Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wuyanan
2024-08-08 15:18:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
509c7c915601d5865006328de4f99a515ee1a172
509c7c91
1 parent
30efdd3b
手动暂停直播后,app进入后台后,在回到前台场景,不自动恢复播放,和 iOS 保持一致
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
509c7c9
...
...
@@ -30,8 +30,9 @@ export struct PlayUIComponent {
// 当前播放资源的状态
@Consume playSourceState: number
manualClickPauseOrPlayBack?:(manualClickPauseOrPlay: boolean) => void
onChangeMenuVisible() {
this.isPlayStatus = !this.isPlayStatus
if (!this.contentDetailData || !this.contentDetailData.liveInfo ||
this.contentDetailData?.liveInfo?.liveState === 'wait') {
return
...
...
@@ -398,12 +399,18 @@ export struct PlayUIComponent {
if (this.isPlayStatus) {
this.isPlayStatus = false
this.playerController?.pause()
if (this.manualClickPauseOrPlayBack) {
this.manualClickPauseOrPlayBack(true)
}
} else {
this.isPlayStatus = true
if (this.contentDetailData.liveInfo?.liveState == 'running') {
this.playerController?.firstPlay(this.liveUrl)
}
this.playerController?.play()
if (this.manualClickPauseOrPlayBack) {
this.manualClickPauseOrPlayBack(false)
}
}
})
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
509c7c9
...
...
@@ -40,7 +40,13 @@ export struct TopPlayComponent {
@Consume @Watch('pageHideChange') pageHide: number
init: boolean = false
@Prop @Watch("liveIMControlMessageChange") lastLiveControl: LiveRoomItemBean = {} as LiveRoomItemBean // IM 控制消息
///是否是手动点击暂停,手动暂停的,页面重新出现时,不自动恢复播放
manualClickPauseOrPlay: boolean = false
pageShowChange() {
if (this.manualClickPauseOrPlay) {
return
}
this.playerController?.play()
}
...
...
@@ -263,7 +269,9 @@ export struct TopPlayComponent {
PictureLoading().visibility(this.isHideLoading ? Visibility.None : Visibility.Visible)
// 视频播放器上的控制面板和信息
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl })
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl,manualClickPauseOrPlayBack:(manualClickPauseOrPlay: boolean) => {
this.manualClickPauseOrPlay = manualClickPauseOrPlay;
}})
// 直播结束
Text('直播已结束')
...
...
Please
register
or
login
to post a comment