王士厅

【验收问题】沉浸式播放,暂停视频后进入作者主页,返回视频详情页时视频继续播放,视频未暂停播放

... ... @@ -43,6 +43,7 @@ export struct DetailPlayShortVideoPage {
@Consume @Watch("showCommentListChanged") showCommentList: boolean
@Consume displayDirection: DisplayDirection
@Consume @Watch('videoStatusChange') switchVideoStatus: boolean
@State isPlay: boolean = true // 视频手动播放暂停
@Consume @Watch('pageShowChange') pageShow: number
@Consume windowWidth: number
@Consume windowHeight: number
... ... @@ -61,7 +62,7 @@ export struct DetailPlayShortVideoPage {
async pageShowChange() {
if (this.currentIndex === this.index) {
this.queryNewsInfoOfUser()
if (this.switchVideoStatus) {
if (this.switchVideoStatus && this.isPlay) {
await this.playerController.play()
this.imageVisible = false
}
... ... @@ -74,7 +75,7 @@ export struct DetailPlayShortVideoPage {
*/
async videoStatusChange() {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus) {
if (this.switchVideoStatus && this.isPlay) {
await this.playerController.play()
this.imageVisible = false
} else {
... ... @@ -183,14 +184,6 @@ export struct DetailPlayShortVideoPage {
}
if (this.contentDetailData.newsType == 1) {
this.PageName = TrackConstants.PageName.VideoDetail // 点播
} else if (this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
} else if (this.contentDetailData.newsType == 5) {
this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
} else if (this.contentDetailData.newsType == 8) {
this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
} else if (this.contentDetailData.newsType == 9) {
this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
} else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
... ... @@ -268,6 +261,13 @@ export struct DetailPlayShortVideoPage {
.layoutWeight(1)
.onClick(() => {
this.playerController?.switchPlayOrPause();
this.playerController.onStatusChange = (status: number) => {
if (status === PlayerConstants.STATUS_PAUSE) {
this.isPlay = false
} else if(status === PlayerConstants.STATUS_START) {
this.isPlay = true
}
}
})
// 显示评论且非全屏模式(视频频道无评论showComment=false)
... ...
... ... @@ -140,8 +140,6 @@ export struct VideoChannelDetail {
// navigationBarColor: '#000000',
// navigationBarContentColor: '#ffffff'
})
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
/**
... ... @@ -156,8 +154,6 @@ export struct VideoChannelDetail {
// navigationBarContentColor: '#0xE5FFFFFF'
})
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
onBackPress(): boolean | void {
... ...