王士厅

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

@@ -43,6 +43,7 @@ export struct DetailPlayShortVideoPage { @@ -43,6 +43,7 @@ export struct DetailPlayShortVideoPage {
43 @Consume @Watch("showCommentListChanged") showCommentList: boolean 43 @Consume @Watch("showCommentListChanged") showCommentList: boolean
44 @Consume displayDirection: DisplayDirection 44 @Consume displayDirection: DisplayDirection
45 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean 45 @Consume @Watch('videoStatusChange') switchVideoStatus: boolean
  46 + @State isPlay: boolean = true // 视频手动播放暂停
46 @Consume @Watch('pageShowChange') pageShow: number 47 @Consume @Watch('pageShowChange') pageShow: number
47 @Consume windowWidth: number 48 @Consume windowWidth: number
48 @Consume windowHeight: number 49 @Consume windowHeight: number
@@ -61,7 +62,7 @@ export struct DetailPlayShortVideoPage { @@ -61,7 +62,7 @@ export struct DetailPlayShortVideoPage {
61 async pageShowChange() { 62 async pageShowChange() {
62 if (this.currentIndex === this.index) { 63 if (this.currentIndex === this.index) {
63 this.queryNewsInfoOfUser() 64 this.queryNewsInfoOfUser()
64 - if (this.switchVideoStatus) { 65 + if (this.switchVideoStatus && this.isPlay) {
65 await this.playerController.play() 66 await this.playerController.play()
66 this.imageVisible = false 67 this.imageVisible = false
67 } 68 }
@@ -74,7 +75,7 @@ export struct DetailPlayShortVideoPage { @@ -74,7 +75,7 @@ export struct DetailPlayShortVideoPage {
74 */ 75 */
75 async videoStatusChange() { 76 async videoStatusChange() {
76 if (this.currentIndex === this.index) { 77 if (this.currentIndex === this.index) {
77 - if (this.switchVideoStatus) { 78 + if (this.switchVideoStatus && this.isPlay) {
78 await this.playerController.play() 79 await this.playerController.play()
79 this.imageVisible = false 80 this.imageVisible = false
80 } else { 81 } else {
@@ -183,14 +184,6 @@ export struct DetailPlayShortVideoPage { @@ -183,14 +184,6 @@ export struct DetailPlayShortVideoPage {
183 } 184 }
184 if (this.contentDetailData.newsType == 1) { 185 if (this.contentDetailData.newsType == 1) {
185 this.PageName = TrackConstants.PageName.VideoDetail // 点播 186 this.PageName = TrackConstants.PageName.VideoDetail // 点播
186 - } else if (this.contentDetailData.newsType == 2) {  
187 - this.PageName = TrackConstants.PageName.Live_Detail // 直播  
188 - } else if (this.contentDetailData.newsType == 5) {  
189 - this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页  
190 - } else if (this.contentDetailData.newsType == 8) {  
191 - this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页  
192 - } else if (this.contentDetailData.newsType == 9) {  
193 - this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页  
194 } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { 187 } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
195 this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 188 this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
196 } 189 }
@@ -268,6 +261,13 @@ export struct DetailPlayShortVideoPage { @@ -268,6 +261,13 @@ export struct DetailPlayShortVideoPage {
268 .layoutWeight(1) 261 .layoutWeight(1)
269 .onClick(() => { 262 .onClick(() => {
270 this.playerController?.switchPlayOrPause(); 263 this.playerController?.switchPlayOrPause();
  264 + this.playerController.onStatusChange = (status: number) => {
  265 + if (status === PlayerConstants.STATUS_PAUSE) {
  266 + this.isPlay = false
  267 + } else if(status === PlayerConstants.STATUS_START) {
  268 + this.isPlay = true
  269 + }
  270 + }
271 }) 271 })
272 272
273 // 显示评论且非全屏模式(视频频道无评论showComment=false) 273 // 显示评论且非全屏模式(视频频道无评论showComment=false)
@@ -140,8 +140,6 @@ export struct VideoChannelDetail { @@ -140,8 +140,6 @@ export struct VideoChannelDetail {
140 // navigationBarColor: '#000000', 140 // navigationBarColor: '#000000',
141 // navigationBarContentColor: '#ffffff' 141 // navigationBarContentColor: '#ffffff'
142 }) 142 })
143 - // WindowModel.shared.setWindowLayoutFullScreen(true)  
144 - // WindowModel.shared.setWindowSystemBarEnable([])  
145 } 143 }
146 144
147 /** 145 /**
@@ -156,8 +154,6 @@ export struct VideoChannelDetail { @@ -156,8 +154,6 @@ export struct VideoChannelDetail {
156 // navigationBarContentColor: '#0xE5FFFFFF' 154 // navigationBarContentColor: '#0xE5FFFFFF'
157 155
158 }) 156 })
159 - // WindowModel.shared.setWindowLayoutFullScreen(false)  
160 - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])  
161 } 157 }
162 158
163 onBackPress(): boolean | void { 159 onBackPress(): boolean | void {