wuyanan

ref |> 观看直播全屏时,点击关注退出全屏

@@ -18,7 +18,7 @@ export struct LiveFollowComponent { @@ -18,7 +18,7 @@ export struct LiveFollowComponent {
18 @Prop rmhInfo: RmhInfoDTO 18 @Prop rmhInfo: RmhInfoDTO
19 @Consume contentDetailData: ContentDetailDTO 19 @Consume contentDetailData: ContentDetailDTO
20 @Consume @Watch('getBatchAttentionStatus') pageShow: number 20 @Consume @Watch('getBatchAttentionStatus') pageShow: number
21 - 21 + clickFollowButton?:()=>void
22 aboutToAppear(): void { 22 aboutToAppear(): void {
23 this.getBatchAttentionStatus() 23 this.getBatchAttentionStatus()
24 } 24 }
@@ -90,6 +90,9 @@ export struct LiveFollowComponent { @@ -90,6 +90,9 @@ export struct LiveFollowComponent {
90 .backgroundColor(this.followStatus === '0' ? $r('app.color.color_ED2800') : $r('app.color.color_CCCCCC')) 90 .backgroundColor(this.followStatus === '0' ? $r('app.color.color_ED2800') : $r('app.color.color_CCCCCC'))
91 .visibility(this.followStatus === '0' ? Visibility.Visible : Visibility.None) 91 .visibility(this.followStatus === '0' ? Visibility.Visible : Visibility.None)
92 .onClick(() => { 92 .onClick(() => {
  93 + if (this.clickFollowButton) {
  94 + this.clickFollowButton()
  95 + }
93 this.handleAccention() 96 this.handleAccention()
94 }) 97 })
95 } 98 }
@@ -30,7 +30,7 @@ export class LiveDetailPageLogic { @@ -30,7 +30,7 @@ export class LiveDetailPageLogic {
30 * @returns true:横屏直播;false:竖屏直播 30 * @returns true:横屏直播;false:竖屏直播
31 */ 31 */
32 isLangScapeScreenVideo(): boolean { 32 isLangScapeScreenVideo(): boolean {
33 - 33 + return true
34 return this.liveState === 'wait' || this.liveLandscape === 'news' 34 return this.liveState === 'wait' || this.liveLandscape === 'news'
35 } 35 }
36 36
@@ -40,7 +40,7 @@ export class LiveDetailPageLogic { @@ -40,7 +40,7 @@ export class LiveDetailPageLogic {
40 * @returns 40 * @returns
41 */ 41 */
42 isVerticalScreenVideo(): boolean { 42 isVerticalScreenVideo(): boolean {
43 - 43 + return false
44 return this.liveLandscape === 'general' 44 return this.liveLandscape === 'general'
45 } 45 }
46 46
@@ -121,12 +121,7 @@ export struct PlayUIComponent { @@ -121,12 +121,7 @@ export struct PlayUIComponent {
121 right: 10 121 right: 10
122 }) 122 })
123 .onClick(() => { 123 .onClick(() => {
124 - this.displayDirection = DisplayDirection.VERTICAL  
125 - WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?  
126 - window.Orientation.PORTRAIT :  
127 - window.Orientation.LANDSCAPE)  
128 - WindowModel.shared.setSpecificSystemBarEnabled(true)  
129 - 124 + this.quitFullScreen()
130 }) 125 })
131 if (this.contentDetailData.liveInfo?.liveState != 'wait') { 126 if (this.contentDetailData.liveInfo?.liveState != 'wait') {
132 //标题 127 //标题
@@ -160,7 +155,12 @@ export struct PlayUIComponent { @@ -160,7 +155,12 @@ export struct PlayUIComponent {
160 Row() { 155 Row() {
161 if (this.contentDetailData?.rmhInfo) { 156 if (this.contentDetailData?.rmhInfo) {
162 LiveFollowComponent({ 157 LiveFollowComponent({
163 - rmhInfo: this.contentDetailData.rmhInfo 158 + rmhInfo: this.contentDetailData.rmhInfo,
  159 + clickFollowButton:() => {
  160 + if (this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) {
  161 + this.quitFullScreen()
  162 + }
  163 + }
164 }) 164 })
165 .margin({ 165 .margin({
166 // top:-7, 166 // top:-7,
@@ -450,4 +450,12 @@ export struct PlayUIComponent { @@ -450,4 +450,12 @@ export struct PlayUIComponent {
450 this.playerController?.setSeekTime(value, mode); 450 this.playerController?.setSeekTime(value, mode);
451 }) 451 })
452 } 452 }
  453 +
  454 + quitFullScreen() {
  455 + this.displayDirection = DisplayDirection.VERTICAL
  456 + WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
  457 + window.Orientation.PORTRAIT :
  458 + window.Orientation.LANDSCAPE)
  459 + WindowModel.shared.setSpecificSystemBarEnabled(true)
  460 + }
453 } 461 }
@@ -52,21 +52,7 @@ export struct PlayerTitleComponent { @@ -52,21 +52,7 @@ export struct PlayerTitleComponent {
52 right: 10 52 right: 10
53 }) 53 })
54 .onClick(() => { 54 .onClick(() => {
55 - WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ?  
56 - window.Orientation.PORTRAIT :  
57 - window.Orientation.LANDSCAPE)  
58 - WindowModel.shared.setSpecificSystemBarEnabled(true)  
59 - this.isLarge = false  
60 - this.displayDirection = DisplayDirection.VERTICAL  
61 - if(this.playerController){  
62 - if(this.playerController.onVideoSizePlayerComponentBack){  
63 - this.playerController.onVideoSizePlayerComponentBack(2,1);  
64 - }  
65 - // if(this.playerController.onVideoSizePlayerUIComponentMethod){  
66 - // this.playerController.onVideoSizePlayerUIComponentMethod(2,1);  
67 - // }  
68 - }  
69 - this.isFullScreen = false 55 + this.quitFullScreen()
70 }) 56 })
71 Text(this.contentDetailData.newsTitle || '') 57 Text(this.contentDetailData.newsTitle || '')
72 .maxLines(2) 58 .maxLines(2)
@@ -104,7 +90,12 @@ export struct PlayerTitleComponent { @@ -104,7 +90,12 @@ export struct PlayerTitleComponent {
104 getLiveStatusView() { 90 getLiveStatusView() {
105 if (this.contentDetailData.rmhInfo?.rmhName) { 91 if (this.contentDetailData.rmhInfo?.rmhName) {
106 LiveFollowComponent({ 92 LiveFollowComponent({
107 - rmhInfo: this.contentDetailData.rmhInfo 93 + rmhInfo: this.contentDetailData.rmhInfo,
  94 + clickFollowButton:()=> {
  95 + if (this.isFullScreen) {
  96 + this.quitFullScreen()
  97 + }
  98 + }
108 }).margin({ 99 }).margin({
109 right: 10 100 right: 10
110 }) 101 })
@@ -159,4 +150,24 @@ export struct PlayerTitleComponent { @@ -159,4 +150,24 @@ export struct PlayerTitleComponent {
159 } : 4) 150 } : 4)
160 } 151 }
161 } 152 }
  153 +
  154 + quitFullScreen() {
  155 + WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ?
  156 + window.Orientation.PORTRAIT :
  157 + window.Orientation.LANDSCAPE)
  158 + WindowModel.shared.setSpecificSystemBarEnabled(true)
  159 + this.isLarge = false
  160 + this.displayDirection = DisplayDirection.VERTICAL
  161 + if(this.playerController){
  162 + if(this.playerController.onVideoSizePlayerComponentBack){
  163 + this.playerController.onVideoSizePlayerComponentBack(2,1);
  164 + }
  165 + // if(this.playerController.onVideoSizePlayerUIComponentMethod){
  166 + // this.playerController.onVideoSizePlayerUIComponentMethod(2,1);
  167 + // }
  168 + }
  169 + this.isFullScreen = false
  170 + }
162 } 171 }
  172 +
  173 +