首先在rawfile文件夹里面放一个mp4文件
自定义Video组件
在videoSrc里面加上播放源的位置
// xxx.ets
@Component
export struct VideoCreateComponent {
@State videoSrc: Resource = $rawfile('1.mp4')
@State previewUri: Resource = $r('app.media.background')
@State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X
@State isAutoPlay: boolean = false
@State showControls: boolean = true
controller: VideoController = new VideoController()
build() {
Column() {
Video({
src: this.videoSrc,
previewUri: this.previewUri,
currentProgressRate: this.curRate,
controller: this.controller
})
.w