<video
height="150px"
width="100%"
controls
:src="src"
v-on:fullscreenchange="onFullscreenChange"
v-on:webkitfullscreenchange="onFullscreenChange"
></video>
method里
methods: {
onFullscreenChange() {
if (document.fullscreenElement || document.webkitFullscreenElement) {
// 全屏状态
console.log('Video is in fullscreen mode');
} else {
console.log('Video is not in fullscreen mode');
}
},
}
效果如下,在浏览器和webview里都有效