1.坑点:引本地视频,必须把视频放在static文件夹里面

2.注意:要先npm i vue-video --save-dev

实例:

<template>
    <div>
        <div class="container">
            <my-video:sources="video.sources":options="video.options"></my-video>

        </div>
    </div>
</template>

<script>
    importmyVideo from'vue-video'
    export default{
        data() {
            return{
                video:{
                    sources:[{
// 网络视频链接 src: 'http://pgccdn.v.baidu.com/3707969107_4165551666_20171001212614.mp4?authorization=bce-auth-v1%2Fc308a72e7b874edd9115e4614e1d62f6%2F2017-10-01T13%3A26%3A40Z%2F-1%2F%2Fab78ab102c9be89ccef9246eb06a63f0da2283c600954d1c9ec72469f4bdfd85&responseCacheControl=max-age%3D8640000&responseExpires=Tue%2C+09+Jan+2018+21%3A26%3A40+GMT&xcode=8d2276fa1447459a98139b247bde767147228947aaa94d58&time=1509612553&_=1509528778129',

// 本地视频链接 src:'../../../static/video/v.mp4',
                        type:'video/mp4'
                    }],
                    options:{
                        autoplay:true,
                        volume:0.6,
                        poster:'http://covteam.u.qiniudn.com/poster.png'
                    }
                }
            }
        },
        components:{
            myVideo
        }
    }
</script>



Logo

前往低代码交流专区

更多推荐