张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -88,11 +88,11 @@ export struct ZhCarouselLayout01 {
.curve(Curve.Linear)
.autoPlay(this.isAutoPlay())
.onAnimationStart((index: number, targetIndex: number) => {
Logger.info(TAG, `Swiper onAnimationStart index : ${index}, targetIndex: ${targetIndex}`);
// Logger.info(TAG, `Swiper onAnimationStart index : ${index}, targetIndex: ${targetIndex}`);
this.swiperIndex = targetIndex
})
.onChange((index: number) => {
Logger.info(TAG, `Swiper onChange index : ${index}`);
// Logger.info(TAG, `Swiper onChange index : ${index}`);
})
.onAnimationEnd((index: number, extraInfo: SwiperAnimationEvent) => {
... ... @@ -100,7 +100,7 @@ export struct ZhCarouselLayout01 {
setTimeout(() => {
this.SecondWd = 12
}, 2000)
console.info("onAnimationEnd, index: " + index)
// console.info("onAnimationEnd, index: " + index)
})
if (this.compDTO?.operDataList.length > 1) {
... ...
... ... @@ -78,7 +78,7 @@ export struct PlayerCommentComponent {
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
.backgroundColor(Color.Transparent)
.backgroundColor(Color.Black)
}.alignItems(HorizontalAlign.Start)
}
... ...
... ... @@ -5,7 +5,7 @@ const TAG = 'PlayerComponent'
@Component
export struct PlayerComponent {
private playerController?: WDPlayerController;
@Prop playerController: WDPlayerController;
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
... ... @@ -26,17 +26,15 @@ export struct PlayerComponent {
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
if (this.playerController) {
this.playerController.onCanplay = () => {
console.log('可以播放了')
this.playerController?.play()
// this.playerController.selfSize
}
}
}
aboutToDisappear(): void {
this.playerController.onCanplay = () => {
}
this.playerController?.pause()
this.playerController?.stop()
this.playerController?.release()
... ... @@ -74,15 +72,14 @@ export struct PlayerComponent {
.blur(100)
.renderFit(RenderFit.RESIZE_COVER)
// TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,liveStreamType=0横屏正常展示
// TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示
if (this.liveStreamType == null) {
WDPlayerRenderVLiveView({
playerController: this.playerController,
onLoad: () => {
this.playerController?.firstPlay(this.playUrl);
}
}).height('100%')
.width('100%')
})
} else if (this.liveStreamType == 0) {
WDPlayerRenderView({
playerController: this.playerController,
... ...
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { LiveFollowComponent } from 'wdComponent/Index'
import { NumberFormatterUtils } from 'wdKit/Index'
@Preview
... ... @@ -35,28 +36,12 @@ export struct PlayerTitleComponent {
@Builder
getLiveStatusView() {
if (this.liveDetailsBean.rmhInfo?.rmhName) {
Row() {
Image(this.liveDetailsBean.rmhInfo?.rmhHeadUrl || '')
.width(24)
.aspectRatio(1)
.borderRadius(12)
.fillColor(Color.Transparent)
Text(this.liveDetailsBean.rmhInfo?.rmhName || '')
.fontSize(12)
.fontWeight(500)
.fontColor(Color.White)
.padding({
top: 2,
right: 8,
left: 4,
bottom: 2
LiveFollowComponent({
rmhInfo: this.liveDetailsBean.rmhInfo
}).margin({
right: 10
})
}
.backgroundColor('#4D000000')
.borderRadius(2)
.borderRadius({ topLeft: 12, bottomLeft: 12 })
.margin({ right: 8 })
}
... ...