wangyujian_wd

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

@@ -32,15 +32,15 @@ export struct DetailPlayLivePage { @@ -32,15 +32,15 @@ export struct DetailPlayLivePage {
32 32
33 aboutToAppear(): void { 33 aboutToAppear(): void {
34 Logger.info(TAG, `wyj-aboutToAppear`) 34 Logger.info(TAG, `wyj-aboutToAppear`)
35 - // this.listener?.on("change", (mediaQueryResult) => {  
36 - // Logger.info(TAG, `change;${mediaQueryResult.matches}`)  
37 - // if (mediaQueryResult?.matches) {  
38 - // this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL  
39 - // } else {  
40 - // this.displayDirection = DisplayDirection.VERTICAL  
41 - // }  
42 - // WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)  
43 - // }) 35 + this.listener?.on("change", (mediaQueryResult) => {
  36 + Logger.info(TAG, `change;${mediaQueryResult.matches}`)
  37 + if (mediaQueryResult?.matches) {
  38 + this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
  39 + } else {
  40 + this.displayDirection = DisplayDirection.VERTICAL
  41 + }
  42 + WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
  43 + })
44 this.getLiveDetails() 44 this.getLiveDetails()
45 this.getLiveRoomData() 45 this.getLiveRoomData()
46 } 46 }
@@ -72,9 +72,8 @@ export struct DetailPlayLivePage { @@ -72,9 +72,8 @@ export struct DetailPlayLivePage {
72 72
73 onPageHideCus(): void { 73 onPageHideCus(): void {
74 Logger.info(TAG, `wyj-onPageHideCus`) 74 Logger.info(TAG, `wyj-onPageHideCus`)
75 - devicePLSensorManager.devicePLSensorOff();  
76 - // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);  
77 - this.playerController?.pause() 75 + this.listener.off('change');
  76 + // devicePLSensorManager.devicePLSensorOff();
78 } 77 }
79 78
80 onBackPressCus(): boolean | void { 79 onBackPressCus(): boolean | void {
@@ -86,9 +85,9 @@ export struct DetailPlayLivePage { @@ -86,9 +85,9 @@ export struct DetailPlayLivePage {
86 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? 85 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
87 window.Orientation.PORTRAIT : 86 window.Orientation.PORTRAIT :
88 window.Orientation.LANDSCAPE) 87 window.Orientation.LANDSCAPE)
89 - devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?  
90 - window.Orientation.PORTRAIT :  
91 - window.Orientation.LANDSCAPE); 88 + // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
  89 + // window.Orientation.PORTRAIT :
  90 + // window.Orientation.LANDSCAPE);
92 return true 91 return true
93 } 92 }
94 93
@@ -83,9 +83,9 @@ export struct TabLiveItemComponent { @@ -83,9 +83,9 @@ export struct TabLiveItemComponent {
83 //图文 83 //图文
84 if (this.item.dataType === 'ZH_TEXT_AND_IMAGE_MSG') { 84 if (this.item.dataType === 'ZH_TEXT_AND_IMAGE_MSG') {
85 List({ space: this.item.pictureUrls.length == 1 ? 0 : 5 }) { 85 List({ space: this.item.pictureUrls.length == 1 ? 0 : 5 }) {
86 - ForEach(this.item.pictureUrls, (item: string, index: number) => { 86 + ForEach(this.item.pictureUrls, (itemSub: string, index: number) => {
87 ListItem() { 87 ListItem() {
88 - Image(item) 88 + Image(itemSub)
89 .width(`${100 / this.item.pictureUrls.length}%`) 89 .width(`${100 / this.item.pictureUrls.length}%`)
90 .height(this.item.pictureUrls.length > 1 ? 70 : 174) 90 .height(this.item.pictureUrls.length > 1 ? 70 : 174)
91 .objectFit(ImageFit.Auto) 91 .objectFit(ImageFit.Auto)
1 import { window } from '@kit.ArkUI' 1 import { window } from '@kit.ArkUI'
2 import { NumberFormatterUtils, WindowModel } from 'wdKit/Index' 2 import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
3 -import { devicePLSensorManager } from 'wdDetailPlayApi/Index'  
4 import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index' 3 import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'
5 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' 4 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
6 import { DisplayDirection } from 'wdConstant/Index' 5 import { DisplayDirection } from 'wdConstant/Index'
@@ -69,9 +68,9 @@ export struct PlayUIComponent { @@ -69,9 +68,9 @@ export struct PlayUIComponent {
69 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? 68 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
70 window.Orientation.PORTRAIT : 69 window.Orientation.PORTRAIT :
71 window.Orientation.LANDSCAPE) 70 window.Orientation.LANDSCAPE)
72 - devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?  
73 - window.Orientation.PORTRAIT :  
74 - window.Orientation.LANDSCAPE); 71 + // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
  72 + // window.Orientation.PORTRAIT :
  73 + // window.Orientation.LANDSCAPE);
75 }) 74 })
76 if (this.liveDetailsBean.liveInfo?.liveState != 'wait') { 75 if (this.liveDetailsBean.liveInfo?.liveState != 'wait') {
77 Text(this.liveDetailsBean.newsTitle) 76 Text(this.liveDetailsBean.newsTitle)
@@ -191,10 +190,7 @@ export struct PlayUIComponent { @@ -191,10 +190,7 @@ export struct PlayUIComponent {
191 190
192 @Builder 191 @Builder
193 getMiddleUIComponent() { 192 getMiddleUIComponent() {
194 - Stack() {  
195 - Text('播放功能暂时关闭')  
196 - .fontColor(Color.White)  
197 - }.alignContent(Alignment.Center) 193 + Stack()
198 .layoutWeight(1) 194 .layoutWeight(1)
199 .width('100%') 195 .width('100%')
200 .onClick(() => { 196 .onClick(() => {
@@ -238,9 +234,9 @@ export struct PlayUIComponent { @@ -238,9 +234,9 @@ export struct PlayUIComponent {
238 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? 234 WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
239 window.Orientation.PORTRAIT : 235 window.Orientation.PORTRAIT :
240 window.Orientation.LANDSCAPE) 236 window.Orientation.LANDSCAPE)
241 - devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?  
242 - window.Orientation.PORTRAIT :  
243 - window.Orientation.LANDSCAPE); 237 + // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
  238 + // window.Orientation.PORTRAIT :
  239 + // window.Orientation.LANDSCAPE);
244 }) 240 })
245 } 241 }
246 } 242 }
@@ -13,7 +13,7 @@ export struct TopPlayComponent { @@ -13,7 +13,7 @@ export struct TopPlayComponent {
13 aboutToAppear(): void { 13 aboutToAppear(): void {
14 if (this.playerController) { 14 if (this.playerController) {
15 this.playerController.onCanplay = () => { 15 this.playerController.onCanplay = () => {
16 - // this.playerController?.play() 16 + this.playerController?.play()
17 } 17 }
18 } 18 }
19 } 19 }
@@ -31,7 +31,7 @@ export struct TopPlayComponent { @@ -31,7 +31,7 @@ export struct TopPlayComponent {
31 } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { 31 } else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
32 playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri 32 playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
33 } 33 }
34 - // this.playerController?.firstPlay(playUrl); 34 + this.playerController?.firstPlay(playUrl);
35 } 35 }
36 } 36 }
37 37