展开菜单
北京奥运开幕盛况:高清全景,带您领略恢弘气魄!

北京奥运开幕盛况:高清全景,带您领略恢弘气魄!

【发布时间】:2024-08-12 06:01:26

带您领略恢弘气魄!

2008 年 8 月 8 日,北京奥运会开幕式在国家体育场隆重举行。这场开幕式耗时 4 个小时,是奥运会历史上最壮观、最令人难忘的开幕式之一。通过高清全景影像,带您回味这场盛事的恢弘气魄!

高清全景 <script> // 定义元素const fullScreen = document.getElementById('full-screen');const fullScreenBtn = document.getElementById('full-screen-btn');const playPauseBtn = document.getElementById('play-pause-btn');const playPauseBtnIcon = document.getElementById('play-pause-btn-icon');const timeStamp = document.getElementById('timestamp');const currentTime = document.getElementById('current-time');const totalTime = document.getElementById('total-time');const videoPlayer = document.getElementById('video-player');// 创建播放器对象const player = new YT.Player(videoPlayer);// 全屏按钮事件监听器fullScreenBtn.addEventListener('click', () => {if (!document.fullscreenElement) {fullScreen.requestFullscreen();fullScreenBtn.textContent = '退出全屏';} else {document.exitFullscreen();fullScreenBtn.textContent = '全屏';}});// 播放/暂停按钮事件监听器playPauseBtn.addEventListener('click', () => {if (player.getPlayerState() === 1) {player.pauseVideo();playPauseBtnIcon.textContent = '播放';} else {player.playVideo();playPauseBtnIcon.textContent = '暂停';}});// 更新时间戳const updateTimestamp = () => {currentTime.textContent = formatTime(player.getCurrentTime());totalTime.textContent = formatTime(player.getDuration());};// 格式化时间const formatTime = (time) => {const hours = Math.floor(time / 3600);const minutes = Math.floor(time % 3600 / 60);const seconds = Math.floor(time % 60);return `${hours}:${minutes}:${seconds.toString().padStart(2, '0')}`;};// 事件监听器player.addEventListener('timeupdate', updateTimestamp);player.addEventListener('play', () => {playPauseBtnIcon.textContent = '暂停';fullScreen.style.display = 'block';playPauseBtn.style.display = 'block';timeStamp.style.display = 'block';});player.addEventListener('pause', () => {playPauseBtnIcon.textContent = '播放';});player.addEventListener('fullscreenchange', () => {if (document.fullscreenElement) {fullScreenBtn.textContent = '退出全屏';fullScreen.style.display = 'block';playPauseBtn.style.display = 'block';timeStamp.style.display = 'block';} else {fullScreenBtn.textContent = '全屏';fullScreen.style.display = 'none';playPauseBtn.style.display = 'none';timeStamp.style.display = 'none';}}); </script>