PageSourceSearch

https://wudang.academy/media-player-fixes-v9.js?v=1

js wudang.academy collected 2026-10-08 12:13:29 UTC 1,540 bytes, 33 lines download raw bytes

1/* AIO shared player fixes v9: derive a safe bound from available renditions when source height is absent. Load after v8. */
2;(function(){
3  function renditionHeight(value){
4    var direct=Number(value&&value.height);
5    if(Number.isFinite(direct)&&direct>0)return direct;
6    var label=String(value&&value.label||"").toLowerCase();
7    return {"360p":360,"480p":480,"720p":720,"1080p":1080,"1440p":1440,"2160p":2160,"4k":2160}[label]||0;
8  }
9  function explicitSourceHeight(opts){
10    return [opts&&opts.sourceHeight,opts&&opts.maxSourceHeight,opts&&opts.source_height]
11      .map(Number).find(function(value){return Number.isFinite(value)&&value>0})||0;
12  }
13  function completeSourceBound(opts){
14    var next=Object.assign({},opts||{});
15    if(explicitSourceHeight(next)||!Array.isArray(next.variants)||!next.variants.length)return next;
16    var highest=next.variants.reduce(function(bound,variant){
17      return Math.max(bound,renditionHeight(variant));
18    },0);
19    if(highest)next.sourceHeight=highest;
20    return next;
21  }
22  function install(){
23    var previous=window.initMediaPlayer;
24    if(typeof previous!=="function"||previous.__aioHighestRenditionWrapped)return;
25    function wrappedInitMediaPlayer(container,opts){
26      return previous(container,completeSourceBound(opts||{}));
27    }
28    wrappedInitMediaPlayer.__aioHighestRenditionWrapped=true;
29    window.initMediaPlayer=wrappedInitMediaPlayer;
30  }
31  if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",install,{once:true});
32  install();
33})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.