wangyujian_wd

fix:1)直播详情页面-横竖屏播放优化

... ... @@ -32,15 +32,15 @@ export struct DetailPlayLivePage {
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
// this.listener?.on("change", (mediaQueryResult) => {
// Logger.info(TAG, `change;${mediaQueryResult.matches}`)
// if (mediaQueryResult?.matches) {
// this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
// } else {
// this.displayDirection = DisplayDirection.VERTICAL
// }
// WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
// })
this.listener?.on("change", (mediaQueryResult) => {
Logger.info(TAG, `change;${mediaQueryResult.matches}`)
if (mediaQueryResult?.matches) {
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
} else {
this.displayDirection = DisplayDirection.VERTICAL
}
WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
})
this.getLiveDetails()
this.getLiveRoomData()
}
... ... @@ -72,9 +72,8 @@ export struct DetailPlayLivePage {
onPageHideCus(): void {
Logger.info(TAG, `wyj-onPageHideCus`)
devicePLSensorManager.devicePLSensorOff();
// WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
this.playerController?.pause()
this.listener.off('change');
// devicePLSensorManager.devicePLSensorOff();
}
onBackPressCus(): boolean | void {
... ... @@ -86,9 +85,9 @@ export struct DetailPlayLivePage {
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE)
devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE);
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
return true
}
... ...
... ... @@ -83,9 +83,9 @@ export struct TabLiveItemComponent {
//图文
if (this.item.dataType === 'ZH_TEXT_AND_IMAGE_MSG') {
List({ space: this.item.pictureUrls.length == 1 ? 0 : 5 }) {
ForEach(this.item.pictureUrls, (item: string, index: number) => {
ForEach(this.item.pictureUrls, (itemSub: string, index: number) => {
ListItem() {
Image(item)
Image(itemSub)
.width(`${100 / this.item.pictureUrls.length}%`)
.height(this.item.pictureUrls.length > 1 ? 70 : 174)
.objectFit(ImageFit.Auto)
... ...
import { window } from '@kit.ArkUI'
import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { devicePLSensorManager } from 'wdDetailPlayApi/Index'
import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DisplayDirection } from 'wdConstant/Index'
... ... @@ -69,9 +68,9 @@ export struct PlayUIComponent {
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE)
devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE);
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
if (this.liveDetailsBean.liveInfo?.liveState != 'wait') {
Text(this.liveDetailsBean.newsTitle)
... ... @@ -191,15 +190,12 @@ export struct PlayUIComponent {
@Builder
getMiddleUIComponent() {
Stack() {
Text('播放功能暂时关闭')
.fontColor(Color.White)
}.alignContent(Alignment.Center)
.layoutWeight(1)
.width('100%')
.onClick(() => {
this.isMenuVisible = !this.isMenuVisible
})
Stack()
.layoutWeight(1)
.width('100%')
.onClick(() => {
this.isMenuVisible = !this.isMenuVisible
})
}
@Builder
... ... @@ -238,9 +234,9 @@ export struct PlayUIComponent {
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE)
devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE);
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
}
}
... ...
... ... @@ -13,7 +13,7 @@ export struct TopPlayComponent {
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
// this.playerController?.play()
this.playerController?.play()
}
}
}
... ... @@ -31,7 +31,7 @@ export struct TopPlayComponent {
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
}
// this.playerController?.firstPlay(playUrl);
this.playerController?.firstPlay(playUrl);
}
}
... ...