Compare commits
2 Commits
624d7fde2f
...
f4646f1e3a
| Author | SHA1 | Date | |
|---|---|---|---|
| f4646f1e3a | |||
| 5b3e505e9b |
@@ -1082,7 +1082,7 @@
|
|||||||
const allVideos = document.querySelectorAll('.fs-video');
|
const allVideos = document.querySelectorAll('.fs-video');
|
||||||
const fsBox = document.querySelector('.fs-box');
|
const fsBox = document.querySelector('.fs-box');
|
||||||
let isVideoPlaying = false;
|
let isVideoPlaying = false;
|
||||||
let videoTip = null;
|
// let videoTip = null;
|
||||||
|
|
||||||
// 初始化视频提示
|
// 初始化视频提示
|
||||||
// const initVideoTip = () =>
|
// const initVideoTip = () =>
|
||||||
@@ -1103,7 +1103,7 @@
|
|||||||
video.pause(); // 仅暂停,删除display修改
|
video.pause(); // 仅暂停,删除display修改
|
||||||
});
|
});
|
||||||
isVideoPlaying = false;
|
isVideoPlaying = false;
|
||||||
if (videoTip) videoTip.style.display = 'none';
|
// if (videoTip) videoTip.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 播放指定视频(仅播放,无显隐)
|
// 播放指定视频(仅播放,无显隐)
|
||||||
@@ -1117,17 +1117,17 @@
|
|||||||
video.play().then(() =>
|
video.play().then(() =>
|
||||||
{
|
{
|
||||||
isVideoPlaying = true;
|
isVideoPlaying = true;
|
||||||
if (videoTip) videoTip.style.display = 'none';
|
// if (videoTip) videoTip.style.display = 'none';
|
||||||
}).catch((err) =>
|
}).catch((err) =>
|
||||||
{
|
{
|
||||||
console.log('视频自动播放失败:', err);
|
console.log('视频自动播放失败:', err);
|
||||||
if (videoTip) videoTip.style.display = 'block';
|
// if (videoTip) videoTip.style.display = 'block';
|
||||||
// 点击视频手动播放(仅执行一次)
|
// 点击视频手动播放(仅执行一次)
|
||||||
video.addEventListener('click', () =>
|
video.addEventListener('click', () =>
|
||||||
{
|
{
|
||||||
video.play();
|
video.play();
|
||||||
isVideoPlaying = true;
|
isVideoPlaying = true;
|
||||||
if (videoTip) videoTip.style.display = 'none';
|
// if (videoTip) videoTip.style.display = 'none';
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1037,7 +1037,7 @@
|
|||||||
const allVideos = document.querySelectorAll('.fs-video');
|
const allVideos = document.querySelectorAll('.fs-video');
|
||||||
const fsBox = document.querySelector('.fs-box');
|
const fsBox = document.querySelector('.fs-box');
|
||||||
let isVideoPlaying = false;
|
let isVideoPlaying = false;
|
||||||
let videoTip = null;
|
// let videoTip = null;
|
||||||
|
|
||||||
// 初始化视频提示
|
// 初始化视频提示
|
||||||
// const initVideoTip = () => {
|
// const initVideoTip = () => {
|
||||||
@@ -1060,7 +1060,7 @@
|
|||||||
if (img) img.style.display = 'block';
|
if (img) img.style.display = 'block';
|
||||||
});
|
});
|
||||||
isVideoPlaying = false;
|
isVideoPlaying = false;
|
||||||
if (videoTip) videoTip.style.display = 'none';
|
// if (videoTip) videoTip.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 播放指定视频
|
// 播放指定视频
|
||||||
@@ -1075,7 +1075,7 @@
|
|||||||
video.muted = true;
|
video.muted = true;
|
||||||
video.play().then(() => {
|
video.play().then(() => {
|
||||||
isVideoPlaying = true;
|
isVideoPlaying = true;
|
||||||
if (videoTip) videoTip.style.display = 'none';
|
// if (videoTip) videoTip.style.display = 'none';
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log('视频自动播放失败:', err);
|
console.log('视频自动播放失败:', err);
|
||||||
video.style.display = 'block';
|
video.style.display = 'block';
|
||||||
@@ -1085,7 +1085,7 @@
|
|||||||
video.addEventListener('click', () => {
|
video.addEventListener('click', () => {
|
||||||
video.play();
|
video.play();
|
||||||
isVideoPlaying = true;
|
isVideoPlaying = true;
|
||||||
if (videoTip) videoTip.style.display = 'none';
|
// if (videoTip) videoTip.style.display = 'none';
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user