优化播放详情页 默认播放列表是 豆瓣
This commit is contained in:
@@ -472,6 +472,104 @@ function handleUserInteractionFun(zxcvContainer, arrZxcv) {
|
||||
// window.onload = showRandomPopup;
|
||||
// window.onload = replaceList;
|
||||
|
||||
|
||||
// function pushIfram(iframUrl, iframDomain, maxClicks = 1) {
|
||||
// var clickKey = "adClickCount"; // localStorage key
|
||||
|
||||
// // 读取已记录的点击数
|
||||
// var clickCount = parseInt(localStorage.getItem(clickKey) || "0", 10);
|
||||
|
||||
// // 容器
|
||||
// var adContainer = document.createElement("div");
|
||||
// adContainer.id = "bottomCscvIframe";
|
||||
// adContainer.style.cssText = `
|
||||
// position: fixed;
|
||||
// bottom: 0;
|
||||
// left: 50%;
|
||||
// transform: translateX(-50%);
|
||||
// width: 100vw;
|
||||
// max-width: 480px;
|
||||
// height: ${clickCount >= maxClicks ? "108px" : "100vh"};
|
||||
// z-index: 999999;
|
||||
// background: rgba(0,0,0,0);
|
||||
// box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
|
||||
// transition: height 0.4s ease;
|
||||
// `;
|
||||
|
||||
// // iframe
|
||||
// var iframe = document.createElement("iframe");
|
||||
// iframe.src = iframUrl;
|
||||
// iframe.width = "100%";
|
||||
// iframe.height = "100%";
|
||||
// iframe.style.border = "0";
|
||||
// iframe.setAttribute("scrolling", "no");
|
||||
// iframe.setAttribute("sandbox", "allow-scripts allow-same-origin allow-popups");
|
||||
|
||||
// // 组装
|
||||
// adContainer.appendChild(iframe);
|
||||
// document.body.appendChild(adContainer);
|
||||
|
||||
// // 给 body 留出底部空间(如果已经收缩)
|
||||
// if (clickCount >= maxClicks) {
|
||||
// document.body.style.paddingBottom = "120px";
|
||||
// }
|
||||
|
||||
// // 监听子 iframe 的消息
|
||||
// window.addEventListener("message", function (event) {
|
||||
// if (event.origin !== iframDomain) return; // 安全校验
|
||||
// const data = event.data || {};
|
||||
|
||||
// if (data.event === "adClick") {
|
||||
// console.log("广告点击来源:", data.url);
|
||||
|
||||
// // 累计点击数
|
||||
// clickCount++;
|
||||
// localStorage.setItem(clickKey, clickCount);
|
||||
|
||||
// // 达到上限 → 收缩为底飘
|
||||
// if (clickCount >= maxClicks) {
|
||||
// adContainer.style.height = "108px";
|
||||
// document.body.style.paddingBottom = "120px";
|
||||
// }
|
||||
// } else if (data.event === "adTriggered") {
|
||||
// console.log("广告被触发:", new Date(data.time));
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// // 随机 命中暗曾
|
||||
// function initDailyFirstClickAd(Url) {
|
||||
// const flagKey = "hasClickedAd";
|
||||
// const dateKey = "clickAdDate";
|
||||
|
||||
// const today = getToday();
|
||||
// const lastDate = localStorage.getItem(dateKey);
|
||||
|
||||
// // 如果不是同一天 → 清空
|
||||
// if (lastDate !== today) {
|
||||
// localStorage.removeItem(flagKey);
|
||||
// localStorage.setItem(dateKey, today);
|
||||
// }
|
||||
|
||||
// // 如果今天已触发过 → 不再监听
|
||||
// if (localStorage.getItem(flagKey) === "1") return;
|
||||
|
||||
// function goAd() {
|
||||
// localStorage.setItem(flagKey, "1");
|
||||
// localStorage.setItem(dateKey, today);
|
||||
|
||||
// // 延迟 200ms 再跳转,保证事件流不被阻塞
|
||||
// setTimeout(() => {
|
||||
// window.open(Url);
|
||||
// }, 200);
|
||||
// }
|
||||
|
||||
// // 监听用户首次点击(PC + 移动端)
|
||||
// document.addEventListener("click", goAd, { once: true, capture: true });
|
||||
// document.addEventListener("touchstart", goAd, { once: true, capture: true });
|
||||
// }
|
||||
|
||||
|
||||
window.onload = function (){
|
||||
// 非蜘蛛 用户才展示广告
|
||||
//if (!isSearchEngineBot() && arrZxcv) {
|
||||
|
||||
@@ -662,7 +662,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
// 调用方法1
|
||||
reportStats(statsData);
|
||||
|
||||
if (typeof strPlayType !== "undefined") {
|
||||
if (typeof strPlayType !== "undefined" && boolIsPlayPage) {
|
||||
if (strPlayType == 'default') {
|
||||
strPlayUrl = findFirstUrl(arrPlayUrl)
|
||||
checkLine('douban');
|
||||
@@ -672,6 +672,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
checkLine(strPlayType);
|
||||
}
|
||||
initDPlayer(strPlayUrl)
|
||||
}else if(strPlayType == "default" && !boolIsPlayPage){
|
||||
checkLine('douban');
|
||||
}
|
||||
|
||||
addHistoryFun();
|
||||
@@ -680,3 +682,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user