王士厅

fix: 修复沉浸式视频在上滑的过程中,视频编目信息存在闪动

... ... @@ -109,6 +109,7 @@ export struct DetailPlayShortVideoPage {
* 监听下标变化手动创建或销毁视频
*/
async currentIndexChange() {
// console.log(TAG, 'currentIndex:', this.currentIndex,'index:', this.index)
if (this.currentIndex != this.index) {
this.playerController.pause()
if (this.index <= this.currentIndex - 2 && this.playerController.getPlayer()) {
... ... @@ -156,7 +157,7 @@ export struct DetailPlayShortVideoPage {
}
// 已登录->查询用户对作品点赞、收藏状态
ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
// console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
if (res.data) {
this.newsStatusOfUser = res.data[0]
}
... ... @@ -167,7 +168,7 @@ export struct DetailPlayShortVideoPage {
}
// 已登录->批量查作品是否被号主关注
ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
// console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
if (res.data) {
this.followStatus = res.data[0]?.status
}
... ... @@ -182,10 +183,11 @@ export struct DetailPlayShortVideoPage {
contentType: this.contentDetailData?.newsType || 0,
}]
}
ContentDetailRequest.postInteractBrowsOperate(params2).then(res => {
console.log('记录浏览历史==', JSON.stringify(res.data))
})
ContentDetailRequest.postInteractBrowsOperate(params2)
// .then(res => {
// // console.log('记录浏览历史==', JSON.stringify(res.data))
//
// })
}
}
... ... @@ -195,7 +197,7 @@ export struct DetailPlayShortVideoPage {
if (!this.onlyWifiLoadVideo) {
this.onlyWifiLoadVideo = await onlyWifiLoadVideo()
this.toastTextVisible = this.onlyWifiLoadVideo ? false : true
console.log(TAG, 'this.onlyWifiLoadVideo', this.onlyWifiLoadVideo)
// console.log(TAG, 'this.onlyWifiLoadVideo', this.onlyWifiLoadVideo)
}
this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape
... ... @@ -241,12 +243,12 @@ export struct DetailPlayShortVideoPage {
} else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
console.log('视频详情页', JSON.stringify(this.pageParam))
console.log('视频详情页2', JSON.stringify(this.PageName))
// console.log('视频详情页', JSON.stringify(this.pageParam))
// console.log('视频详情页2', JSON.stringify(this.PageName))
}
async aboutToDisappear(): Promise<void> {
console.log(TAG, 'aboutToDisappear', this.index)
// console.log(TAG, 'aboutToDisappear', this.index)
await this.playerController?.pause()
// await this.playerController?.stop()
// await this.playerController?.release();
... ... @@ -310,11 +312,11 @@ export struct DetailPlayShortVideoPage {
}
})
this.playerViewBuilder()
if (this.index === this.currentIndex) {
PlayerBottomView({
playerController: this.playerController
playerController: this.playerController,
index: this.index,
currentIndex: this.currentIndex,
})
}
PlayerRightView({
playerController: this.playerController
... ...
... ... @@ -98,7 +98,7 @@ export struct VideoChannelDetail {
this.switchVideoStatus = false
this.closeFullScreen()
console.log(TAG, '一级视频隐藏')
// console.log(TAG, '一级视频隐藏')
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime) / 1000)
... ... @@ -110,7 +110,7 @@ export struct VideoChannelDetail {
* 监听视频频道激活或失活
*/
navIndexChange() {
console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex)
// console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex)
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
// this.barBackgroundColor = Color.Black
this.switchVideoStatus = true
... ... @@ -139,12 +139,12 @@ export struct VideoChannelDetail {
aboutToAppear() {
this.getDetail()
Logger.info(TAG, 'aboutToAppear');
// Logger.info(TAG, 'aboutToAppear');
}
aboutToDisappear(): void {
this.closeFullScreen()
Logger.info(TAG, 'aboutToDisappear');
// Logger.info(TAG, 'aboutToDisappear');
}
/**
... ... @@ -209,7 +209,7 @@ export struct VideoChannelDetail {
await ContentDetailRequest.getRecCompInfo(params).then(async res => {
this.isOffLine = res.data == null ? true : false
console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
// console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
this.totalCount = res.data?.totalCount || 0
const list1: batchContentDetailParams = {
... ... @@ -259,7 +259,7 @@ export struct VideoChannelDetail {
this.data = this.data.concat(res.data)
this.dataContentDetail.addItems(res.data)
}
console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data))
// console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data))
}).finally(() => {
setTimeout(() => {
this.isRequesting = false
... ... @@ -280,7 +280,7 @@ export struct VideoChannelDetail {
if (res.data) {
this.interactDataList = this.interactDataList.concat(res.data)
}
console.log('根据视频信息批量查询点赞、收藏状态', res.data)
// console.log('根据视频信息批量查询点赞、收藏状态', res.data)
})
}
}
... ... @@ -328,7 +328,7 @@ export struct VideoChannelDetail {
.height('100%')
.onChange((index: number) => {
this.currentIndex = index
console.info('onChange==', index.toString())
// console.info('onChange==', index.toString())
if (this.currentIndex === this.data.length - 1) {
this.pageNum++
... ...
... ... @@ -13,15 +13,20 @@ export struct PlayerBottomView {
@Consume isDragging?: boolean
@Consume contentDetailData: ContentDetailDTO
@Consume displayDirection: DisplayDirection
@Prop index: number = 0
@Prop currentIndex: number = 0
aboutToAppear(): void {
}
build() {
Column() {
PlayerTitleView()
PlayerProgressView({ playerController: this.playerController })
PlayerProgressView({
playerController: this.playerController,
index: this.index,
currentIndex: this.currentIndex,
})
}
.width('100%')
.alignItems(HorizontalAlign.Start)
... ...
... ... @@ -16,14 +16,13 @@ export struct PlayerProgressView {
@State loadingWidth: number | string = 1
@State showLoading: boolean = false
@Consume onlyWifiLoadVideo: boolean
@Prop index: number = 0
@Prop @Watch('currentIndexChange') currentIndex: number = 0
timer: number = 0
aboutToAppear() {
if (this.playerController) {
this.playerController.onSeekDone = (status: number) => {
this.playerController?.play()
}
currentIndexChange() {
// console.log('DetailPlayShortVideoPage PlayerProgressView', 'currentIndex:', this.currentIndex,'index:', this.index)
if (this.playerController && this.index == this.currentIndex) {
this.playerController.onLoaded = (loaded: number) => {
if (loaded == 1) {
this.loadingWidth = '95%'
... ... @@ -44,6 +43,14 @@ export struct PlayerProgressView {
}
}
aboutToAppear() {
if (this.playerController) {
this.playerController.onSeekDone = (status: number) => {
this.playerController?.play()
}
}
}
/**
*
* loading 动效
... ... @@ -71,7 +78,7 @@ export struct PlayerProgressView {
.zIndex(2000)
.height(10)
.visibility(this.showLoading ? Visibility.Visible : Visibility.Hidden)
.margin({ bottom: 10 })
.margin({ bottom: 14 })
// .markAnchor({ x: 0, y: '100%' })
}
... ...