源码
<template>
<view class="video-container">
<video
class="video-player"
:src="videoUrl"
:autoplay="true"
:loop="true"
:controls="false"
object-fit="contain"
playsinline
webkit-playsinline
:show-play-btn="false"
:show-center-play-btn="false"
:show-progress="false"
x5-playsinline
x5-video-player-type="h5"
x5-video-player-fullscreen="false"
>
</video>
</view>
</template>
<script>
export default {
props:{
videoUrl:{
type:String,
default:''
}
},
data() {
return {};
}
}
</script>
<style lang="scss">
.video-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
.video-player {
width: 100%;
height: 100%;
object-fit: cover;
transform: translateZ(0);
-webkit-transform: translateZ(0);
&::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 50px;
background: transparent;
pointer-events: none;
}
}
}
</style>
荣耀手机浏览器显示
QQ浏览器显示
