yuzhilin

fix:解决频道订阅列表无法滑动问题、h5详情页播放器样式

... ... @@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index';
import { performJSCallNative } from './JsBridgeBiz';
import { H5CallNativeType } from './H5CallNativeType';
import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
import { DateTimeUtils } from 'wdKit'
const TAG = 'WdWebLocalComponent';
... ... @@ -22,6 +23,13 @@ export struct WdWebLocalComponent {
@State positionLeft: number = 0
@State positionTop: number = 0
@State videoLandscape: string = '1'
@State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X
@State sliderStartTime: string = '';
@State currentTime: number = 0;
@State durationTime: number = 0;
@State durationStringTime: string = '';
@State isPause: boolean = true;
controller: VideoController = new VideoController()
build() {
Column() {
... ... @@ -77,12 +85,78 @@ export struct WdWebLocalComponent {
})
if (this.videoUrl) {
Video({ src: this.videoUrl })
Stack({ alignContent: Alignment.Bottom }) {
Video({
src: this.videoUrl,
currentProgressRate: this.curRate,
controller: this.controller
})
.borderRadius(5)
.controls(false)
.autoPlay(true)
.objectFit(ImageFit.Contain)
.onStart(() => {
this.isPause = false
})
.onPause(() => {
this.isPause = true
})
.onPrepared((event) => {
if (event) {
this.durationTime = event.duration
}
})
.onUpdate((event) => {
if (event) {
this.currentTime = event.time
}
})
Row() {
Image($r(this.isPause ? 'app.media.icon_play' : 'app.media.icon_pause'))
.width(24)
.height(24)
.onClick(()=>{
if(this.isPause){
this.controller.start()
}else{
this.controller.pause()
}
})
Row() {
Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000)).fontSize(12).fontColor(Color.White).fontWeight(600)
Slider({
value: this.currentTime,
min: 0,
max: this.durationTime
})
.width("50%")
.selectedColor('#ED2800')
.margin({ left: 4, right: 4 })
// .blockStyle({
// type: SliderBlockType.IMAGE,
// image: $r('app.media.slider_block')
// })
// .blockSize({ width: 18, height: 12 })
.onChange((value: number, mode: SliderChangeMode) => {
this.controller.setCurrentTime(value);
})
Text(DateTimeUtils.getFormattedDuration(this.durationTime * 1000)).fontSize(12).fontColor(Color.White).fontWeight(600)
}
.justifyContent(FlexAlign.Center)
Image($r('app.media.icon_full_screen'))
.width(24)
.height(24)
.onClick(()=>{
this.controller.requestFullscreen(true)
})
}
.opacity(0.8)
.width("100%")
.justifyContent(FlexAlign.SpaceAround)
}
.width(this.positionWidth)
.height(this.positionHeight)
.borderRadius(5)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
})
... ... @@ -92,7 +166,6 @@ export struct WdWebLocalComponent {
})
.id("video")
}
}
}.width('100%')
.height(this.webHeight)
... ...
... ... @@ -169,16 +169,13 @@ export struct ImageAndTextPageComponent {
detailedSkeleton()
}
}
//底部交互区
if (this.contentDetailData?.length) {
OperRowListView({
contentDetailData: this.contentDetailData[0],
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
})
}
}
}
.width(CommonConstants.FULL_WIDTH)
... ...
... ... @@ -319,7 +319,7 @@ struct ChannelDialog {
}
}
}),
PanGesture({ fingers: 1, direction: null, distance: 0 })
PanGesture({ fingers: 1, direction: this.isEditIng ? PanDirection.All:PanDirection.None, distance: 0 })
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
this.dragRefOffsetX = 0
... ...