Showing
4 changed files
with
44 additions
and
30 deletions
| @@ -109,6 +109,7 @@ export struct DetailPlayShortVideoPage { | @@ -109,6 +109,7 @@ export struct DetailPlayShortVideoPage { | ||
| 109 | * 监听下标变化手动创建或销毁视频 | 109 | * 监听下标变化手动创建或销毁视频 |
| 110 | */ | 110 | */ |
| 111 | async currentIndexChange() { | 111 | async currentIndexChange() { |
| 112 | + // console.log(TAG, 'currentIndex:', this.currentIndex,'index:', this.index) | ||
| 112 | if (this.currentIndex != this.index) { | 113 | if (this.currentIndex != this.index) { |
| 113 | this.playerController.pause() | 114 | this.playerController.pause() |
| 114 | if (this.index <= this.currentIndex - 2 && this.playerController.getPlayer()) { | 115 | if (this.index <= this.currentIndex - 2 && this.playerController.getPlayer()) { |
| @@ -156,7 +157,7 @@ export struct DetailPlayShortVideoPage { | @@ -156,7 +157,7 @@ export struct DetailPlayShortVideoPage { | ||
| 156 | } | 157 | } |
| 157 | // 已登录->查询用户对作品点赞、收藏状态 | 158 | // 已登录->查询用户对作品点赞、收藏状态 |
| 158 | ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { | 159 | ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { |
| 159 | - console.log('查询点赞、收藏状态==', JSON.stringify(res.data)) | 160 | + // console.log('查询点赞、收藏状态==', JSON.stringify(res.data)) |
| 160 | if (res.data) { | 161 | if (res.data) { |
| 161 | this.newsStatusOfUser = res.data[0] | 162 | this.newsStatusOfUser = res.data[0] |
| 162 | } | 163 | } |
| @@ -167,7 +168,7 @@ export struct DetailPlayShortVideoPage { | @@ -167,7 +168,7 @@ export struct DetailPlayShortVideoPage { | ||
| 167 | } | 168 | } |
| 168 | // 已登录->批量查作品是否被号主关注 | 169 | // 已登录->批量查作品是否被号主关注 |
| 169 | ContentDetailRequest.postBatchAttentionStatus(params1).then(res => { | 170 | ContentDetailRequest.postBatchAttentionStatus(params1).then(res => { |
| 170 | - console.log('批量查号主是否为用户关注==', JSON.stringify(res.data)) | 171 | + // console.log('批量查号主是否为用户关注==', JSON.stringify(res.data)) |
| 171 | if (res.data) { | 172 | if (res.data) { |
| 172 | this.followStatus = res.data[0]?.status | 173 | this.followStatus = res.data[0]?.status |
| 173 | } | 174 | } |
| @@ -182,10 +183,11 @@ export struct DetailPlayShortVideoPage { | @@ -182,10 +183,11 @@ export struct DetailPlayShortVideoPage { | ||
| 182 | contentType: this.contentDetailData?.newsType || 0, | 183 | contentType: this.contentDetailData?.newsType || 0, |
| 183 | }] | 184 | }] |
| 184 | } | 185 | } |
| 185 | - ContentDetailRequest.postInteractBrowsOperate(params2).then(res => { | ||
| 186 | - console.log('记录浏览历史==', JSON.stringify(res.data)) | ||
| 187 | - | ||
| 188 | - }) | 186 | + ContentDetailRequest.postInteractBrowsOperate(params2) |
| 187 | + // .then(res => { | ||
| 188 | + // // console.log('记录浏览历史==', JSON.stringify(res.data)) | ||
| 189 | + // | ||
| 190 | + // }) | ||
| 189 | } | 191 | } |
| 190 | 192 | ||
| 191 | } | 193 | } |
| @@ -195,7 +197,7 @@ export struct DetailPlayShortVideoPage { | @@ -195,7 +197,7 @@ export struct DetailPlayShortVideoPage { | ||
| 195 | if (!this.onlyWifiLoadVideo) { | 197 | if (!this.onlyWifiLoadVideo) { |
| 196 | this.onlyWifiLoadVideo = await onlyWifiLoadVideo() | 198 | this.onlyWifiLoadVideo = await onlyWifiLoadVideo() |
| 197 | this.toastTextVisible = this.onlyWifiLoadVideo ? false : true | 199 | this.toastTextVisible = this.onlyWifiLoadVideo ? false : true |
| 198 | - console.log(TAG, 'this.onlyWifiLoadVideo', this.onlyWifiLoadVideo) | 200 | + // console.log(TAG, 'this.onlyWifiLoadVideo', this.onlyWifiLoadVideo) |
| 199 | } | 201 | } |
| 200 | 202 | ||
| 201 | this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape | 203 | this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape |
| @@ -241,12 +243,12 @@ export struct DetailPlayShortVideoPage { | @@ -241,12 +243,12 @@ export struct DetailPlayShortVideoPage { | ||
| 241 | } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { | 243 | } else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { |
| 242 | this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 | 244 | this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 |
| 243 | } | 245 | } |
| 244 | - console.log('视频详情页', JSON.stringify(this.pageParam)) | ||
| 245 | - console.log('视频详情页2', JSON.stringify(this.PageName)) | 246 | + // console.log('视频详情页', JSON.stringify(this.pageParam)) |
| 247 | + // console.log('视频详情页2', JSON.stringify(this.PageName)) | ||
| 246 | } | 248 | } |
| 247 | 249 | ||
| 248 | async aboutToDisappear(): Promise<void> { | 250 | async aboutToDisappear(): Promise<void> { |
| 249 | - console.log(TAG, 'aboutToDisappear', this.index) | 251 | + // console.log(TAG, 'aboutToDisappear', this.index) |
| 250 | await this.playerController?.pause() | 252 | await this.playerController?.pause() |
| 251 | // await this.playerController?.stop() | 253 | // await this.playerController?.stop() |
| 252 | // await this.playerController?.release(); | 254 | // await this.playerController?.release(); |
| @@ -310,11 +312,11 @@ export struct DetailPlayShortVideoPage { | @@ -310,11 +312,11 @@ export struct DetailPlayShortVideoPage { | ||
| 310 | } | 312 | } |
| 311 | }) | 313 | }) |
| 312 | this.playerViewBuilder() | 314 | this.playerViewBuilder() |
| 313 | - if (this.index === this.currentIndex) { | ||
| 314 | PlayerBottomView({ | 315 | PlayerBottomView({ |
| 315 | - playerController: this.playerController | 316 | + playerController: this.playerController, |
| 317 | + index: this.index, | ||
| 318 | + currentIndex: this.currentIndex, | ||
| 316 | }) | 319 | }) |
| 317 | - } | ||
| 318 | 320 | ||
| 319 | PlayerRightView({ | 321 | PlayerRightView({ |
| 320 | playerController: this.playerController | 322 | playerController: this.playerController |
| @@ -98,7 +98,7 @@ export struct VideoChannelDetail { | @@ -98,7 +98,7 @@ export struct VideoChannelDetail { | ||
| 98 | this.switchVideoStatus = false | 98 | this.switchVideoStatus = false |
| 99 | this.closeFullScreen() | 99 | this.closeFullScreen() |
| 100 | 100 | ||
| 101 | - console.log(TAG, '一级视频隐藏') | 101 | + // console.log(TAG, '一级视频隐藏') |
| 102 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 102 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| 103 | let duration = 0 | 103 | let duration = 0 |
| 104 | duration = Math.floor((this.pageHideTime - this.pageShowTime) / 1000) | 104 | duration = Math.floor((this.pageHideTime - this.pageShowTime) / 1000) |
| @@ -110,7 +110,7 @@ export struct VideoChannelDetail { | @@ -110,7 +110,7 @@ export struct VideoChannelDetail { | ||
| 110 | * 监听视频频道激活或失活 | 110 | * 监听视频频道激活或失活 |
| 111 | */ | 111 | */ |
| 112 | navIndexChange() { | 112 | navIndexChange() { |
| 113 | - console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex) | 113 | + // console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex) |
| 114 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { | 114 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { |
| 115 | // this.barBackgroundColor = Color.Black | 115 | // this.barBackgroundColor = Color.Black |
| 116 | this.switchVideoStatus = true | 116 | this.switchVideoStatus = true |
| @@ -139,12 +139,12 @@ export struct VideoChannelDetail { | @@ -139,12 +139,12 @@ export struct VideoChannelDetail { | ||
| 139 | 139 | ||
| 140 | aboutToAppear() { | 140 | aboutToAppear() { |
| 141 | this.getDetail() | 141 | this.getDetail() |
| 142 | - Logger.info(TAG, 'aboutToAppear'); | 142 | + // Logger.info(TAG, 'aboutToAppear'); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | aboutToDisappear(): void { | 145 | aboutToDisappear(): void { |
| 146 | this.closeFullScreen() | 146 | this.closeFullScreen() |
| 147 | - Logger.info(TAG, 'aboutToDisappear'); | 147 | + // Logger.info(TAG, 'aboutToDisappear'); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /** | 150 | /** |
| @@ -209,7 +209,7 @@ export struct VideoChannelDetail { | @@ -209,7 +209,7 @@ export struct VideoChannelDetail { | ||
| 209 | 209 | ||
| 210 | await ContentDetailRequest.getRecCompInfo(params).then(async res => { | 210 | await ContentDetailRequest.getRecCompInfo(params).then(async res => { |
| 211 | this.isOffLine = res.data == null ? true : false | 211 | this.isOffLine = res.data == null ? true : false |
| 212 | - console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') | 212 | + // console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') |
| 213 | 213 | ||
| 214 | this.totalCount = res.data?.totalCount || 0 | 214 | this.totalCount = res.data?.totalCount || 0 |
| 215 | const list1: batchContentDetailParams = { | 215 | const list1: batchContentDetailParams = { |
| @@ -259,7 +259,7 @@ export struct VideoChannelDetail { | @@ -259,7 +259,7 @@ export struct VideoChannelDetail { | ||
| 259 | this.data = this.data.concat(res.data) | 259 | this.data = this.data.concat(res.data) |
| 260 | this.dataContentDetail.addItems(res.data) | 260 | this.dataContentDetail.addItems(res.data) |
| 261 | } | 261 | } |
| 262 | - console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) | 262 | + // console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) |
| 263 | }).finally(() => { | 263 | }).finally(() => { |
| 264 | setTimeout(() => { | 264 | setTimeout(() => { |
| 265 | this.isRequesting = false | 265 | this.isRequesting = false |
| @@ -280,7 +280,7 @@ export struct VideoChannelDetail { | @@ -280,7 +280,7 @@ export struct VideoChannelDetail { | ||
| 280 | if (res.data) { | 280 | if (res.data) { |
| 281 | this.interactDataList = this.interactDataList.concat(res.data) | 281 | this.interactDataList = this.interactDataList.concat(res.data) |
| 282 | } | 282 | } |
| 283 | - console.log('根据视频信息批量查询点赞、收藏状态', res.data) | 283 | + // console.log('根据视频信息批量查询点赞、收藏状态', res.data) |
| 284 | }) | 284 | }) |
| 285 | } | 285 | } |
| 286 | } | 286 | } |
| @@ -328,7 +328,7 @@ export struct VideoChannelDetail { | @@ -328,7 +328,7 @@ export struct VideoChannelDetail { | ||
| 328 | .height('100%') | 328 | .height('100%') |
| 329 | .onChange((index: number) => { | 329 | .onChange((index: number) => { |
| 330 | this.currentIndex = index | 330 | this.currentIndex = index |
| 331 | - console.info('onChange==', index.toString()) | 331 | + // console.info('onChange==', index.toString()) |
| 332 | 332 | ||
| 333 | if (this.currentIndex === this.data.length - 1) { | 333 | if (this.currentIndex === this.data.length - 1) { |
| 334 | this.pageNum++ | 334 | this.pageNum++ |
| @@ -13,15 +13,20 @@ export struct PlayerBottomView { | @@ -13,15 +13,20 @@ export struct PlayerBottomView { | ||
| 13 | @Consume isDragging?: boolean | 13 | @Consume isDragging?: boolean |
| 14 | @Consume contentDetailData: ContentDetailDTO | 14 | @Consume contentDetailData: ContentDetailDTO |
| 15 | @Consume displayDirection: DisplayDirection | 15 | @Consume displayDirection: DisplayDirection |
| 16 | + @Prop index: number = 0 | ||
| 17 | + @Prop currentIndex: number = 0 | ||
| 16 | 18 | ||
| 17 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| 18 | - | ||
| 19 | } | 20 | } |
| 20 | 21 | ||
| 21 | build() { | 22 | build() { |
| 22 | Column() { | 23 | Column() { |
| 23 | PlayerTitleView() | 24 | PlayerTitleView() |
| 24 | - PlayerProgressView({ playerController: this.playerController }) | 25 | + PlayerProgressView({ |
| 26 | + playerController: this.playerController, | ||
| 27 | + index: this.index, | ||
| 28 | + currentIndex: this.currentIndex, | ||
| 29 | + }) | ||
| 25 | } | 30 | } |
| 26 | .width('100%') | 31 | .width('100%') |
| 27 | .alignItems(HorizontalAlign.Start) | 32 | .alignItems(HorizontalAlign.Start) |
| @@ -16,14 +16,13 @@ export struct PlayerProgressView { | @@ -16,14 +16,13 @@ export struct PlayerProgressView { | ||
| 16 | @State loadingWidth: number | string = 1 | 16 | @State loadingWidth: number | string = 1 |
| 17 | @State showLoading: boolean = false | 17 | @State showLoading: boolean = false |
| 18 | @Consume onlyWifiLoadVideo: boolean | 18 | @Consume onlyWifiLoadVideo: boolean |
| 19 | + @Prop index: number = 0 | ||
| 20 | + @Prop @Watch('currentIndexChange') currentIndex: number = 0 | ||
| 19 | timer: number = 0 | 21 | timer: number = 0 |
| 20 | 22 | ||
| 21 | - aboutToAppear() { | ||
| 22 | - if (this.playerController) { | ||
| 23 | - this.playerController.onSeekDone = (status: number) => { | ||
| 24 | - this.playerController?.play() | ||
| 25 | - } | ||
| 26 | - | 23 | + currentIndexChange() { |
| 24 | + // console.log('DetailPlayShortVideoPage PlayerProgressView', 'currentIndex:', this.currentIndex,'index:', this.index) | ||
| 25 | + if (this.playerController && this.index == this.currentIndex) { | ||
| 27 | this.playerController.onLoaded = (loaded: number) => { | 26 | this.playerController.onLoaded = (loaded: number) => { |
| 28 | if (loaded == 1) { | 27 | if (loaded == 1) { |
| 29 | this.loadingWidth = '95%' | 28 | this.loadingWidth = '95%' |
| @@ -44,6 +43,14 @@ export struct PlayerProgressView { | @@ -44,6 +43,14 @@ export struct PlayerProgressView { | ||
| 44 | } | 43 | } |
| 45 | } | 44 | } |
| 46 | 45 | ||
| 46 | + aboutToAppear() { | ||
| 47 | + if (this.playerController) { | ||
| 48 | + this.playerController.onSeekDone = (status: number) => { | ||
| 49 | + this.playerController?.play() | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + | ||
| 47 | /** | 54 | /** |
| 48 | * | 55 | * |
| 49 | * loading 动效 | 56 | * loading 动效 |
| @@ -71,7 +78,7 @@ export struct PlayerProgressView { | @@ -71,7 +78,7 @@ export struct PlayerProgressView { | ||
| 71 | .zIndex(2000) | 78 | .zIndex(2000) |
| 72 | .height(10) | 79 | .height(10) |
| 73 | .visibility(this.showLoading ? Visibility.Visible : Visibility.Hidden) | 80 | .visibility(this.showLoading ? Visibility.Visible : Visibility.Hidden) |
| 74 | - .margin({ bottom: 10 }) | 81 | + .margin({ bottom: 14 }) |
| 75 | 82 | ||
| 76 | // .markAnchor({ x: 0, y: '100%' }) | 83 | // .markAnchor({ x: 0, y: '100%' }) |
| 77 | } | 84 | } |
-
Please register or login to post a comment