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