mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-06 17:36:42 +08:00
退出全屏 ,需要水印3
This commit is contained in:
@@ -388,7 +388,7 @@ export default {
|
||||
window.addEventListener("F", () => {
|
||||
this.isFullscreen = this.isFullScreen();
|
||||
});
|
||||
|
||||
document.addEventListener('fullscreenchange', handleFullscreenChange);
|
||||
// this.videoDom.addEventListener('keydown', function(e){
|
||||
// //console.log('\x1b[31m%s\x1b[0m','*****************加载失败**********')
|
||||
// console.log("video is exit");
|
||||
@@ -613,6 +613,16 @@ export default {
|
||||
const currentTime = this.$refs.video.currentTime;
|
||||
this.$emit('onTimeUpdate', currentTime);
|
||||
},
|
||||
/**
|
||||
* 监听全屏变化
|
||||
*/
|
||||
handleFullscreenChange() {
|
||||
this.isFullscreen = !!document.fullscreenElement;
|
||||
if (!this.isFullscreen) {
|
||||
// 退出全屏后的逻辑(如暂停视频、更新 UI 等)
|
||||
console.log('ESC 已退出全屏');
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentVolume: function () {
|
||||
|
||||
Reference in New Issue
Block a user