wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 修复直播结束页面,不存在人民号信息时,有人民号头像边框问题
  fix |> 修复从直播详情返回后,列表上上直播中动画消失问题
  fix seek后滑块会回退
  fix: 折叠屏--直播预告稿件详情页面,上方展示的大图被过度拉近,导致直播的文字信息展示不完整
... ... @@ -2,8 +2,8 @@
"app": {
"bundleName": "com.peopledailychina.hosactivity",
"vendor": "$string:app_vendor",
"versionCode": 7393,
"versionName": "7.3.9.3",
"versionCode": 7394,
"versionName": "7.3.9.4",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
... ...
... ... @@ -72,7 +72,7 @@ export struct PlayUIComponent {
aboutToDisappear(): void {
if (this.contentDetailData.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
// lottie.destroy('live_status_wait')
}
}
... ...
import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index';
import { Logger, StringUtils } from 'wdKit/Index';
import { Logger, StringUtils, WindowModel } from 'wdKit/Index';
import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
import { PictureLoading } from '../../vertical/PictureLoading';
... ... @@ -7,6 +7,7 @@ import { TrackConstants } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../../../viewModel/LiveDetailPageLogic';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { LiveMessageOptType } from 'wdBean/src/main/ets/bean/live/LiveRoomBean';
import { window } from '@kit.ArkUI';
const TAG: string = 'TopPlayComponent'
... ... @@ -42,6 +43,11 @@ export struct TopPlayComponent {
@Prop @Watch("liveIMControlMessageChange") lastLiveControl: LiveRoomItemBean = {} as LiveRoomItemBean // IM 控制消息
///是否是手动点击暂停,手动暂停的,页面重新出现时,不自动恢复播放
manualClickPauseOrPlay: boolean = false
private windowClass?: window.Window
private screenWidth: number = 0
@State isZDP: boolean = false // 是否折叠屏 默认false
@State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
pageShowChange() {
if (this.manualClickPauseOrPlay) {
return
... ... @@ -81,6 +87,21 @@ export struct TopPlayComponent {
}
}
this.updateData()
this.windowClass = WindowModel.shared.getWindowClass(); // 获取应用主窗口
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width
console.log('ENewspaperPageComponent this.screenWidth', this.screenWidth)
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.isZDP = this.screenWidth > 2000 ? true : false
this.resizeWindow()
}
resizeWindow() {
this.windowClass?.on('windowSizeChange', () => {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.windowWidth
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
this.isZDP = this.screenWidth > 2000 ? true : false
});
}
/**
... ... @@ -242,13 +263,14 @@ export struct TopPlayComponent {
} else {
// 直播房间图
Image(this.previewUrl)
.objectFit(ImageFit.Cover)
.objectFit(this.isZDP ? ImageFit.Contain : ImageFit.Fill)
.alt($r('app.media.live_room_image_fail'))
.visibility(this.isWait || this.isEnd ? Visibility.Visible :
Visibility.None)// .contrast(this.isEnd ? 0.4 : 1)
.blur(this.isEnd ? 20 : 0)
.width('100%')
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if (this.liveDetailPageLogic.padImageUri.length > 0) {
... ...
... ... @@ -136,16 +136,17 @@ export struct PlayerEndView {
.height(254)
.backgroundColor('#999999')
.borderRadius(4)
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.width(80)
.height(80)
.borderRadius(40)
.borderWidth(1)
.borderColor(Color.White)
.borderStyle(BorderStyle.Solid)
.position({ x: '50%', y: 0 })
.markAnchor({ x: '50%', y: '50%' })
if (this.contentDetailData.rmhInfo != null) {
Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
.width(80)
.height(80)
.borderRadius(40)
.borderWidth(1)
.borderColor(Color.White)
.borderStyle(BorderStyle.Solid)
.position({ x: '50%', y: 0 })
.markAnchor({ x: '50%', y: '50%' })
}
}
.width(307)
.padding({ top: 40 })
... ...
... ... @@ -35,7 +35,8 @@ export struct PlayerTitleComponent {
}
aboutToDisappear(): void {
if (this.contentDetailData.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
///lottieView身上已经有单独不展示时处理销毁,不用单独在销毁了,会影响展现组件列表上相同名称的动画展示
// lottie.destroy('live_status_wait')
}
}
... ...
... ... @@ -19,10 +19,13 @@ export struct PlayerFullScreenView {
private timer: number = -1
@State upProVal: string = ''
@State duration: string = DateTimeUtils.secondToTime(this.videoDuration)
@State startX:number = 0
@State endX:number = 0
@State panDirection:number = 1 //1左滑 2右滑
private panDistance:number = 0
@State startX: number = 0
@State endX: number = 0
@State panDirection: number = 1 //1左滑 2右滑
private panDistance: number = 0
private touchDownX: number = 0
private touchUpX: number = 0
@State isTouched: boolean = false
getTitle() {
return this.contentDetailData?.newsTitle
... ... @@ -156,11 +159,14 @@ export struct PlayerFullScreenView {
PlayerProgressFullScreenView({ playerController: this.playerController }).layoutWeight(1)
.onTouch((event?: TouchEvent) => {
if (event) {
if (event.type === TouchType.Down) {
// console.info(`cj2024 onTouch Down x=${event?.tiltX}`)
clearInterval(this.timer)
}
if (event.type === TouchType.Up) {
// console.info(`cj2024 onTouch Up x=${event?.tiltX}`)
this.restartTimer();
}
}
... ... @@ -202,7 +208,7 @@ export struct PlayerFullScreenView {
.margin({ top: 73, bottom: 73 })
// .backgroundColor('#FF0000')
.onClick(() => {
Logger.warn(`cj2024 onClick showOperator=${this.showOperator}`)
Logger.warn(`cj2024 onClick showOperator=${this.showOperator}`)
if (!this.isDragging) {
if (this.showOperator == false) {
this.restartTimer();
... ... @@ -241,7 +247,8 @@ export struct PlayerFullScreenView {
this.endX = event.offsetX
}
this.panDirection = this.endX - this.startX > 0 ? 2 : 1
Logger.warn(`cj2024 pan end panDirection = ${this.panDirection} this.progressVal = ${this.progressVal} dir=${this.endX - this.startX}`)
Logger.warn(`cj2024 pan end panDirection = ${this.panDirection} this.progressVal = ${this.progressVal} dir=${this.endX -
this.startX}`)
if (Math.abs(this.endX - this.startX) < 100) {
this.panDistance = 1
} else {
... ... @@ -254,7 +261,7 @@ export struct PlayerFullScreenView {
this.progressVal = 0
}
} else {
if (this.progressVal <100) {
if (this.progressVal < 100) {
this.progressVal += this.panDistance
} else {
this.progressVal = 100
... ... @@ -285,7 +292,11 @@ export struct PlayerFullScreenView {
.width('100%')
.height('100%')
.onChange((value: number, mode: SliderChangeMode) => {
// if (this.isTouched) {
// return
// }
this.progressVal = value
// console.log('cj2024 onChange slider value:', value)
if (mode === SliderChangeMode.Moving) {
this.isDragging = true
}
... ... @@ -293,20 +304,33 @@ export struct PlayerFullScreenView {
this.isDragging = false
this.playerController?.setSeekTime(this.progressVal, SliderChangeMode.End);
}
console.log('Transparent slider value:', value)
})
}.margin({ top: 73, bottom: 73 })
.onTouch((event?: TouchEvent) => {
// console.log(`cj2024 onTouch isDragging = ${this.isDragging}`)
if (this.isDragging) {
return
}
if (event) {
if (event.type === TouchType.Down) {
// console.info(`cj2024 onTouch Down x=${event?.touches[0].x}`)
if (event?.touches.length > 0) {
this.touchDownX = event?.touches[0].x
}
clearInterval(this.timer)
}
if (event.type === TouchType.Up) {
// console.info(`cj2024 onTouch Up x=${event?.touches[0].x}`)
if (event?.touches.length > 0) {
this.touchUpX = event?.touches[0].x
this.isTouched = this.touchUpX == this.touchDownX ? true : false
}
if (this.showOperator == false) {
this.restartTimer();
} else {
this.showOperator = false
if (this.isTouched) {
this.showOperator = false
}
}
}
}
... ...
... ... @@ -341,9 +341,12 @@ export class WDPlayerController {
// 100 / 1000));
}
if (mode === SliderChangeMode.End) {
// Logger.warn(`cj2024 seekTime = ${value}`)
// Logger.warn(`cj2024 duration = ${this.duration}`)
this.seekTime = Math.floor(value * this.duration / 100);
// Logger.warn(`cj2024 seekTime = ${this.seekTime}`)
this.currentPlayTime = this.seekTime
this.avPlayer?.seek(this.seekTime);
this.avPlayer?.seek(this.seekTime,media.SeekMode.SEEK_CLOSEST);
}
}
async setSeekMicroSecondsTime(value: number) {
... ...