首页内容只是现实一个全屏的视频播放本地的一个视频文件代码如下
<template>
<view class="content">
<video class="myVideo" :controls="controls" object-fit="fill" autoplay loop show-loading="false" show-fullscreen-btn="false" show-play-btn="false" show-center-play-btn="false" src="@/static/qidong.mp4"
@error="videoErrorCallback"></video>
</view>
</template>
<script>
export default {
data() {
return {
controls: false
};
},
methods: {
videoErrorCallback: function(e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false
})
},
}
}
</script>
<style lang="less">
page {
width: 100%;
height: 100%;
}
.content {
width: 100%;
height: 100%;
.myVideo {
background-color: rgba(0, 0, 0, 0.0);
width: 100%;
height: 100%;
}
}
</style>