uni-app Video组件设置duration参数无效

uni-app Video组件设置duration参数无效

开发环境 版本号 项目创建方式
Windows Windows10 HBuilderX
### 示例代码:


```html
<template>  
    <view>  
        <video id="myVideo" src="http://video.haier.wxcy.tv/dz/msjt/2f8ed4c1b2cf41f78a629e2df4b90b01.mp4"  
            :initial-time="10" autoplay="true" :duration="endTime" @ended="videoEnd" @timeupdate="videoTimeUpdate"></video>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                endTime: 150,  
                videoContext: null  
            }  
        },  
        onLoad() {  

        },  
        onReady() {  
            this.videoContext = uni.createVideoContext('myVideo');  
        },  
        methods: {  
            videoEnd() {  
                console.log("播放结束");  
            },  
            videoTimeUpdate(e) {  
                console.log("当前播放位置:" + e.target.currentTime);  
                if (e.target.currentTime >= this.endTime) {  
                    this.videoContext.stop();  
                }  
            }  
        }  
    }  
</script>  

<style>  

</style>

### 操作步骤:

- 设置duration参数值无效

### 预期结果:

- 视频长度显示duration设置的值

### 实际结果:

- 安卓端无效

### bug描述:

- 安卓端使用Video组件设置duration参数无效!

更多关于uni-app Video组件设置duration参数无效的实战教程也可以访问 https://www.itying.com/category-93-b0.html

1 回复

更多关于uni-app Video组件设置duration参数无效的实战教程也可以访问 https://www.itying.com/category-93-b0.html


小米8测试,未复现您说的问题。你试下其他设备是否正常?

回到顶部