polyfills
3 years ago
cache-cues-a3fc9c41.js
2 years ago
fittext-97aa564e.js
3 years ago
hls-9be558b0.js
2 years ago
index-2bbac65f.js
3 years ago
index.js
3 years ago
learndash-65802ac5.js
2 years ago
lifter-4c7e5d43.js
3 years ago
loader.js
2 years ago
presto-action-bar-ui_2.entry.js
2 years ago
presto-action-bar_17.entry.js
2 years ago
presto-cta-overlay-ui.entry.js
2 years ago
presto-email-overlay-ui_2.entry.js
2 years ago
presto-player-button.entry.js
3 years ago
presto-player-skeleton.entry.js
3 years ago
presto-player.presto-playlist-item.presto-playlist-overlay.presto-playlist-ui-7427cab6.js
2 years ago
presto-player_4.entry.js
2 years ago
presto-playlist.entry.js
2 years ago
presto-search-bar-ui.entry.js
3 years ago
presto-timestamp.entry.js
3 years ago
presto-video-curtain-ui.entry.js
3 years ago
presto-video.entry.js
3 years ago
resize-observer-d8d6c99c.js
3 years ago
tutor-cfd3bd88.js
3 years ago
web-components.js
2 years ago
hls-9be558b0.js
1 lines
| 1 | import{P as PrestoPlayer}from"./presto-player.presto-playlist-item.presto-playlist-overlay.presto-playlist-ui-7427cab6.js";import"./index-2bbac65f.js";import"./cache-cues-a3fc9c41.js";const loadHLS=({config:e,selector:t,src:o,preload:r})=>new Promise((async(n,a)=>{if(!window.Hls)for(;!window.hasOwnProperty("Hls");)await new Promise((e=>setTimeout(e,50)));if(window.Hls.isSupported()){let a=!["metadata","none"].includes(r);wp?.blocks&&(a=!0);var l=new window.Hls({autoStartLoad:a});return l.loadSource(o),l.on(window.Hls.Events.LEVEL_SWITCHED,((e,o)=>{var r=t.closest(".presto-player__wrapper").querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span");l.autoLevelEnabled?r.innerHTML=`AUTO (${l.levels[o.level].height}p)`:r.innerHTML="AUTO"})),void l.on(window.Hls.Events.MANIFEST_PARSED,(function(o,r){var a=l.levels.map((function(e){return e.height}));a.unshift(0);const s=(a||[]).findIndex((e=>e===parseInt(window?.prestoPlayer?.hls_start_level)));l.startLevel=s?s-1:2,e.quality={default:0,options:a,forced:!0,onChange:function(e){0===e?prestoHLS.currentLevel=-1:prestoHLS.levels.forEach((function(t,o){t.height===e&&(console.log("Found quality match with "+e),prestoHLS.currentLevel=o)}))}},l.attachMedia(t),window.prestoHLS=l;const i=new PrestoPlayer(t,{...e});i.hls=l;const p=()=>{l.startLoad(-1),i.off("waiting",p)};return i.on("waiting",p),i.on("languagechange",(()=>{setTimeout((()=>l.subtitleTrack=i.currentTrack),50)})),n(i)}))}return t.canPlayType("application/vnd.apple.mpegurl"),n(new PrestoPlayer(t,{...e}))}));export default loadHLS; |