button.addEventListener('click', function() { let currentUrl = window.location.href; let match = currentUrl.match(/https:\/\/www\.mxdmp\.com\/play\/(\d+)\/1\/(\d+)\//); if (!match) return;
let dramaId = match[1]; let currentEpisode = parseInt(match[2]);
let nextEpisode = currentEpisode + 1; let jumpTime = 3 * 60 + 30; // 第三分半钟的秒数 let nextUrl = `https://www.mxdmp.com/play/${dramaId}/1/${nextEpisode}/?jumpTime=${jumpTime}`;
// 跳转到下一集 window.location.href = nextUrl; });
// 当页面加载完毕时设置播放进度 window.addEventListener('load', function() { let params = newURLSearchParams(window.location.search); let jumpTime = params.get('jumpTime'); if (jumpTime) { let player = document.querySelector('.art-video'); // s根据实际情况获取视频元素 if (player) { player.currentTime = parseInt(jumpTime); player.play(); } } }); })();
functionswitchToNextEpisode() { let currentUrl = window.location.href; let match = currentUrl.match(/https:\/\/www\.mxdmp\.com\/play\/(\d+)\/1\/(\d+)\//); if (!match) return;
let dramaId = match[1]; let currentEpisode = parseInt(match[2]);
let nextEpisode = currentEpisode + 1; let jumpTime = 3 * 60 + 30; // 第三分半钟的秒数 let nextUrl = `https://www.mxdmp.com/play/${dramaId}/1/${nextEpisode}/?jumpTime=${jumpTime}`;
// 跳转到下一集 window.location.href = nextUrl; }
// 自动切换到下一集的逻辑 functionautoSwitchNextEpisode() { let player = document.querySelector('.art-video'); // 根据实际情况获取视频元素 if (!player) return;