css({
width: "100%"
}), $(".o--vip").removeClass("is-sniffing").addClass("is-sniff-done"), sniffUrls.length > 0 && 0 === $(".o--sniff-done").length && $(".o--vip-play .o--sources").length && $(".o--vip-play .o--sources").append('<span class="o--sniff-done">✔</span>');
}
function sniffSuccess(n, o) {
const e = (n = decodeURIComponent(n).replace(/^(http:)?\/\//, "https://")).replace(/\?.+/, "");
if (sniffUrlsKey.includes(e)) return void (isAllowIframeSniff && log("Skip duplicate sniff url:", n));
sniffUrlsKey.push(e), sniffUrls.push(n), log("✔ sniffSuccess:", n);
const i = sniffUrls.length, t = _D ? ' _from="'.concat(o, '"') : "", a = n.match(isVideoUrlRegex)[1];
$(".o--vip-play .o--sources").append('<a _href="'.concat(n, '" class="is-').concat(a, '"').concat(t, ">线路").concat(i, "</a>")),
$(".o--vip-play .o--sources a").off("click").on("click", (function() {
const n = $(this).attr("_href");
log("→ playing:", n), updateQrcode(n);
let o = document.querySelector(".o--player video");
!o && ($(".o--player").prepend('<video class="o--video" poster="'.concat(PlayerCover, '" controls playsinline></video>')),
o = document.querySelector(".o--player video"));
const e = getGlobal("Plyr"), i = getGlobal("Hls");
if (!player && e ? (player = new e(o, {
debug: _D,
invertTime: !1,
autoplay: !0,
volume: .75,
speed: {
selected: 1,
options: [ .5, .75, 1, 1.25, 1.5, 2 ]
},
storage: {
enabled: !0,
key: storePrefix + "plyr"
}
}), player.on("enterfullscreen", (function() {
$("html").addClass("o--fullscreen");
})), player.on("exitfullscree", (function() {
$("html").removeClass("o--fullscreen");
}))) : !e && console.warn("NO Plyr."), $(".o--player-bg").remove(), /\.m3u8/.test(n) && i && i.isSupported()) {
const e = new i;
e.loadSource(n), e.attachMedia(o), e.on(i.Events.MANIFEST_PARSED, (function() {
o.play();
}));
} else o.src = n, o.addEventListener("loadedmetadata", (function() {
o.play();
}));
$(".o--play-url").html('来源:<a _href="'.concat(n, '">').concat(toShortVideoUrl(n), "</a>").concat(canPlayInPage(n) ? '<span class="o--span">如果全部线路都无法播放,可以点击来源链接下载来播放,或使用单个解析播放。</span>' : '<span class="o--span is-warning"><span>该链接无法在当前站点播放,请点击来源下载播放</span></span>')),
$(".o--play-url a").off("click").on("click", (function() {
const n = $(this).attr("_href");
log("click play url:", n), isHiker && window.fy_bridge_app.playVideo ? window.fy_bridge_app.playVideo(n) : isMixia && window.mx_browser_obj.playvideo ? window.mx_browser_obj.playvideo(n, n) : window.open(n, "_blank", "noopener");
})), $(".o--vip-play .o--sources a").removeClass("is-active"), $(this).addClass("is-active");
})), 1 === i ? ($(".o--vip-play a").eq(0).click(), $(".o--vip").addClass("is-sniff-success"),
$(".o--vip-play").removeClass("is-hide")) : setTimeout((function() {
player && player.ready && 0 === player.duration && $(".o--vip-play a").eq(i - 1).click();
}), isMobile ? 3200 : 2800);
}
function sniffFail() {
log("× sniffFail"), sniffDone(), $(".o--player-bg").addClass("is-fail"), $(".o--vip").addClass("is-sniff-fail");
}
function _Sniff() {}
function hikerSniff(sniffTickId) {
if (sniffTickId !== sniffTick) return;
let resource = eval(window.fy_bridge_app.getNetworkRecords());
resource = resource.filter((function(n) {
return n.timestamp > sniffTimestamp && /video/i.test(n.mediaType.name) && isValidVideoUrl(n.url);
})), isSniffing && (resource.forEach((function(n) {
sniffSuccess(n.url);
})), setTimeout((function() {
hikerSniff(sniffTickId);
}), 100));
}
function mixiaSniff(n) {
if (n !== sniffTick) return;
let o = [], e = window.mx_browser_obj.getweblogs("http");
"error" !== e && (o = e.trim().split(/\s*\n[\n\s]*/), o = o.filter((function(n) {
return isValidVideoUrl(n);
}))), isSniffing && (o.forEach((function(n) {
sniffSuccess(n);
})), setTimeout((function() {
mixiaSniff(n);
}), 100));
}
function insertPlayerHtml() {
let n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
const o = '<div class="o--player-bg"><div class="o--sniff-progress"></div><div class="o--loader">'.concat(Icon.loader, '</div><div class="o--sign">(o˘◡˘o)<span class="o--version">v ').concat(VERSION, '</span></div><div class="o--slogan"><strong>觅</strong>即知君不可见,挥毫点染湖山<strong>影</strong></div><div class="o--error-text">解析失败,可以尝试使用单个解析播放,或者到其它正版网站上解析</div></div>'), e = '<div class="o--player">'.concat(o).concat(n, "</div>"), i = getVipPlayer();
i.length > 0 && (i.empty().append(e), $(".o--player").parent().addClass("o--player-box"));
}
function sniff(n) {
if (log("sniff / isAllowSniff ".concat(isAllowSniff ? "✔" : "×")), sniffStart(),
isAllowIframeSniff) log("_Sniff"), _Sniff(); else if (isAllowHikerSniff) log("hikerSniff"),
hikerSniff(n); else {
if (!isAllowMixiaSniff) return void sniffDone();
log("mixiaSniff"), mixiaSniff(n);
}
const o = '<div class="o--vip-play is-hide"><div class="o--sources"></div><div class="o--play-url"></div></div>';
insertPlayerHtml(isMobile ? "" : o), isMobile && ($(".o--vip-play").remove(), $(".o--vip-panel").after(o)),
pausePlay(), sniffUrls = [], sniffTimes = {}, goSniff();
}
function goSniff() {
function n() {
const e = $("oo-iframes > iframe").length;
if (e > p - 1) setTimeout((function() {
n();
}), 100); else {
const n = player && player.ready && player.duration > 0 ? 200 * e : 0, i = e < p - 2 ? isMobile ? Math.min(150 * sniffUrls.length + 150 * e + 800, 1200) : Math.min(150 * sniffUrls.length + 200 * e + 1e3, 1500) : 150;
log("[".concat(o + 1, "] nextSniffTime: ").concat(i)), setTimeout((function() {
goSniff(o + 1);
}), i + n);
}
}
let o = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
if (!isSniffing) return;
Back to home |
File page
Subscribe |
Register |
Login
| N