| | |
| | | class="videoBox" |
| | | ref="videoRefs" |
| | | controls |
| | | |
| | | preload="auto" |
| | | @play="handleVideoPlay" |
| | | @ended="handleVideoEnded(index)" |
| | | :src="currentVideoUrl" |
| | | ></video> |
| | | </div> |
| | |
| | | const currentAreaPosition = ref({ height: 1987280, latitude: 27.636112, longitude: 115.732975 }); |
| | | let handler = null; |
| | | const switchFolders = ref(false) |
| | | // 视频播放事件处理 |
| | | const handleVideoPlay = (event) => { |
| | | if (event.target.playbackRate !== 0.75) { |
| | | event.target.playbackRate = 0.75 |
| | | |
| | | } |
| | | } |
| | | const handleVideoEnded = index => { |
| | | // 获取当前视频 |
| | | const video = videoRefs.value[index] |
| | | |
| | | // 重置视频播放时间为 0 |
| | | video.currentTime = 0 |
| | | |
| | | // 重新加载视频 |
| | | video.load() |
| | | } |
| | | function bytesToMB(bytes, decimalPlaces = 2) { |
| | | if (typeof bytes !== 'number' || bytes < 0) return '0'; |
| | | return (bytes / 1048576).toFixed(decimalPlaces) + ' MB'; |