张善主

Merge remote-tracking branch 'origin/main'

@@ -88,11 +88,11 @@ export struct ZhCarouselLayout01 { @@ -88,11 +88,11 @@ export struct ZhCarouselLayout01 {
88 .curve(Curve.Linear) 88 .curve(Curve.Linear)
89 .autoPlay(this.isAutoPlay()) 89 .autoPlay(this.isAutoPlay())
90 .onAnimationStart((index: number, targetIndex: number) => { 90 .onAnimationStart((index: number, targetIndex: number) => {
91 - Logger.info(TAG, `Swiper onAnimationStart index : ${index}, targetIndex: ${targetIndex}`); 91 + // Logger.info(TAG, `Swiper onAnimationStart index : ${index}, targetIndex: ${targetIndex}`);
92 this.swiperIndex = targetIndex 92 this.swiperIndex = targetIndex
93 }) 93 })
94 .onChange((index: number) => { 94 .onChange((index: number) => {
95 - Logger.info(TAG, `Swiper onChange index : ${index}`); 95 + // Logger.info(TAG, `Swiper onChange index : ${index}`);
96 96
97 }) 97 })
98 .onAnimationEnd((index: number, extraInfo: SwiperAnimationEvent) => { 98 .onAnimationEnd((index: number, extraInfo: SwiperAnimationEvent) => {
@@ -100,7 +100,7 @@ export struct ZhCarouselLayout01 { @@ -100,7 +100,7 @@ export struct ZhCarouselLayout01 {
100 setTimeout(() => { 100 setTimeout(() => {
101 this.SecondWd = 12 101 this.SecondWd = 12
102 }, 2000) 102 }, 2000)
103 - console.info("onAnimationEnd, index: " + index) 103 + // console.info("onAnimationEnd, index: " + index)
104 }) 104 })
105 105
106 if (this.compDTO?.operDataList.length > 1) { 106 if (this.compDTO?.operDataList.length > 1) {
@@ -78,7 +78,7 @@ export struct PlayerCommentComponent { @@ -78,7 +78,7 @@ export struct PlayerCommentComponent {
78 78
79 LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) 79 LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
80 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 80 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
81 - .backgroundColor(Color.Transparent) 81 + .backgroundColor(Color.Black)
82 }.alignItems(HorizontalAlign.Start) 82 }.alignItems(HorizontalAlign.Start)
83 83
84 } 84 }
@@ -5,7 +5,7 @@ const TAG = 'PlayerComponent' @@ -5,7 +5,7 @@ const TAG = 'PlayerComponent'
5 5
6 @Component 6 @Component
7 export struct PlayerComponent { 7 export struct PlayerComponent {
8 - private playerController?: WDPlayerController; 8 + @Prop playerController: WDPlayerController;
9 @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean 9 @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
10 @Consume @Watch('pageShowChange') pageShow: number 10 @Consume @Watch('pageShowChange') pageShow: number
11 @Consume @Watch('pageHideChange') pageHide: number 11 @Consume @Watch('pageHideChange') pageHide: number
@@ -26,17 +26,15 @@ export struct PlayerComponent { @@ -26,17 +26,15 @@ export struct PlayerComponent {
26 26
27 aboutToAppear(): void { 27 aboutToAppear(): void {
28 console.log(TAG, 'aboutToAppear') 28 console.log(TAG, 'aboutToAppear')
29 - if (this.playerController) {  
30 this.playerController.onCanplay = () => { 29 this.playerController.onCanplay = () => {
31 console.log('可以播放了') 30 console.log('可以播放了')
32 this.playerController?.play() 31 this.playerController?.play()
33 - // this.playerController.selfSize  
34 } 32 }
35 } 33 }
36 34
37 - }  
38 -  
39 aboutToDisappear(): void { 35 aboutToDisappear(): void {
  36 + this.playerController.onCanplay = () => {
  37 + }
40 this.playerController?.pause() 38 this.playerController?.pause()
41 this.playerController?.stop() 39 this.playerController?.stop()
42 this.playerController?.release() 40 this.playerController?.release()
@@ -74,15 +72,14 @@ export struct PlayerComponent { @@ -74,15 +72,14 @@ export struct PlayerComponent {
74 .blur(100) 72 .blur(100)
75 .renderFit(RenderFit.RESIZE_COVER) 73 .renderFit(RenderFit.RESIZE_COVER)
76 74
77 - // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,liveStreamType=0横屏正常展示 75 + // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示
78 if (this.liveStreamType == null) { 76 if (this.liveStreamType == null) {
79 WDPlayerRenderVLiveView({ 77 WDPlayerRenderVLiveView({
80 playerController: this.playerController, 78 playerController: this.playerController,
81 onLoad: () => { 79 onLoad: () => {
82 this.playerController?.firstPlay(this.playUrl); 80 this.playerController?.firstPlay(this.playUrl);
83 } 81 }
84 - }).height('100%')  
85 - .width('100%') 82 + })
86 } else if (this.liveStreamType == 0) { 83 } else if (this.liveStreamType == 0) {
87 WDPlayerRenderView({ 84 WDPlayerRenderView({
88 playerController: this.playerController, 85 playerController: this.playerController,
1 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' 1 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
  2 +import { LiveFollowComponent } from 'wdComponent/Index'
2 import { NumberFormatterUtils } from 'wdKit/Index' 3 import { NumberFormatterUtils } from 'wdKit/Index'
3 4
4 @Preview 5 @Preview
@@ -35,28 +36,12 @@ export struct PlayerTitleComponent { @@ -35,28 +36,12 @@ export struct PlayerTitleComponent {
35 @Builder 36 @Builder
36 getLiveStatusView() { 37 getLiveStatusView() {
37 if (this.liveDetailsBean.rmhInfo?.rmhName) { 38 if (this.liveDetailsBean.rmhInfo?.rmhName) {
38 - Row() {  
39 - Image(this.liveDetailsBean.rmhInfo?.rmhHeadUrl || '')  
40 - .width(24)  
41 - .aspectRatio(1)  
42 - .borderRadius(12)  
43 - .fillColor(Color.Transparent)  
44 -  
45 - Text(this.liveDetailsBean.rmhInfo?.rmhName || '')  
46 - .fontSize(12)  
47 - .fontWeight(500)  
48 - .fontColor(Color.White)  
49 - .padding({  
50 - top: 2,  
51 - right: 8,  
52 - left: 4,  
53 - bottom: 2 39 + LiveFollowComponent({
  40 + rmhInfo: this.liveDetailsBean.rmhInfo
  41 + }).margin({
  42 + right: 10
54 }) 43 })
55 - }  
56 - .backgroundColor('#4D000000')  
57 - .borderRadius(2)  
58 - .borderRadius({ topLeft: 12, bottomLeft: 12 })  
59 - .margin({ right: 8 }) 44 +
60 } 45 }
61 46
62 47