PageSourceSearch

https://bcparksfoundation.ca/reactPlayerHls-49c65b3ee22192c5dcc9.js

js bcparksfoundation.ca collected 2026-09-26 01:13:11 UTC 7,038 bytes, 3 lines download raw bytes

1/*! For license information please see reactPlayerHls-49c65b3ee22192c5dcc9.js.LICENSE.txt */
2"use strict";(self.webpackChunkbcpf_web=self.webpackChunkbcpf_web||[]).push([[262],{8805:function(e,t,i){i.r(t),i.d(t,{default:function(){return v}});var n=i(6540),s=i(1121),a=i(5185),o=i(4945);const r=(l=(0,a.u6)(s.lB),class extends l{static shadowRootOptions={...l.shadowRootOptions};static getTemplateHTML=(e,t={})=>{const{src:i,...n}=e;return`\n        <script type="application/json" id="config">\n          ${JSON.stringify(t.config||{})}\n        <\/script>\n        ${l.getTemplateHTML(n)}\n      `};#e=null;#t=null;constructor(){super(),this.#i("config")}get config(){return this.#t}set config(e){this.#t=e}attributeChangedCallback(e,t,i){"src"!==e&&super.attributeChangedCallback(e,t,i),"src"===e&&t!=i&&this.load()}#n(){var e,t;null==(e=this.#e)||e.remove(),null==(t=this.nativeEl)||t.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.#s),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null)}async load(){var e,t;const i=!this.api;if(this.#n(),this.src){if(i&&!this.#t&&(this.#t=JSON.parse((null==(e=this.shadowRoot.getElementById("config"))?void 0:e.textContent)||"{}")),o.Ay.isSupported()){switch(await Promise.resolve(),this.api=new o.Ay({liveDurationInfinity:!0,autoStartLoad:!1,...this.config}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{const e=()=>this.api.startLoad();this.nativeEl.addEventListener("play",e,{once:!0}),this.api.on(o.Ay.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",e)});break}case"metadata":{const e=this.api.config.maxBufferLength,t=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;const i=()=>{this.api.config.maxBufferLength=e,this.api.config.maxBufferSize=t};this.nativeEl.addEventListener("play",i,{once:!0}),this.api.on(o.Ay.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",i)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",this.#s),this.#e=document.createElement("source"),this.#e.setAttribute("type","application/x-mpegURL"),this.#e.setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(this.#e);const e=new WeakMap;this.api.on(o.Ay.Events.MANIFEST_PARSED,(t,i)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(e=>{console.warn("Autoplay failed:",e)}),s();let n=this.videoTracks.getTrackById("main");n||(n=this.addVideoTrack("main"),n.id="main",n.selected=!0);for(const[s,a]of i.levels.entries()){const t=n.addRendition(a.url[0],a.width,a.height,a.videoCodec,a.bitrate);e.set(a,`${s}`),t.id=`${s}`}for(let[e,s]of i.audioTracks.entries()){const t=s.default?"main":"alternative",i=this.addAudioTrack(t,s.name,s.lang);i.id=`${e}`,s.default&&(i.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var e;const t=+(null==(e=[...this.audioTracks].find(e=>e.enabled))?void 0:e.id),i=this.api.audioTracks.map(e=>e.id);t!=this.api.audioTrack&&i.includes(t)&&(this.api.audioTrack=t)}),this.api.on(o.Ay.Events.LEVELS_UPDATED,(t,i)=>{const n=this.videoTracks[this.videoTracks.selectedIndex??0];if(!n)return;const s=i.levels.map(t=>e.get(t));for(const e of this.videoRenditions)e.id&&!s.includes(e.id)&&n.removeRendition(e)});let i=null;this.api.on(o.Ay.Events.ERROR,(e,t)=>{t.type===o.Ay.ErrorTypes.NETWORK_ERROR&&t.details===o.Ay.ErrorDetails.FRAG_LOAD_ERROR&&(i=t.frag.level)}),this.api.on(o.Ay.Events.LEVEL_SWITCHED,(e,t)=>{const n=t.level;null!==i&&n<i&&(console.warn(`⚠️ hls.js downgraded quality from level ${i} to ${n} due to fragment load failure.`),this.videoRenditions.selectedIndex=n,i=null)});const n=e=>{const t=e.target.selectedIndex;t!=this.api.nextLevel&&(this.api.nextLevel=t)};null==(t=this.videoRenditions)||t.addEventListener("change",n);const s=()=>{for(const e of this.videoTracks)this.removeVideoTrack(e);for(const e of this.audioTracks)this.removeAudioTrack(e)};return void this.api.once(o.Ay.Events.DESTROYING,s)}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}}#s=()=>{var e,t,i;(null==(e=this.nativeEl)?void 0:e.webkitCurrentPlaybackTargetIsWireless)?null==(t=this.api)||t.stopLoad():null==(i=this.api)||i.startLoad()};#i(e){if(Object.prototype.hasOwnProperty.call(this,e)){const t=this[e];delete this[e],this[e]=t}}});var l;globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",r);var c=r,d=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),u={className:"class",htmlFor:"for"};function h(e){return e.toLowerCase()}function p(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e||"object"==typeof e&&null!==e?void 0:e}function f(e,t,i){var n;e[t]=i,null==i&&t in((null==(n=globalThis.HTMLElement)?void 0:n.prototype)??{})&&e.removeAttribute(t)}var v=function({react:e,tagName:t,elementClass:i,events:n,displayName:s,defaultProps:a,toAttributeName:o=h,toAttributeValue:r=p}){const l=Number.parseInt(e.version)>=19,c=e.forwardRef((s,c)=>{var h,v;const g=e.useRef(null),y=e.useRef(new Map),E={},m={},b={},T={};for(const[e,t]of Object.entries(s)){if(d.has(e)){b[e]=t;continue}const n=o(u[e]??e);if(i.prototype&&e in i.prototype&&!(e in((null==(h=globalThis.HTMLElement)?void 0:h.prototype)??{}))&&!(null==(v=i.observedAttributes)?void 0:v.some(e=>e===n))){T[e]=t;continue}if(e.startsWith("on")){E[e]=t;continue}const s=r(t);if(n&&null!=s&&(m[n]=String(s),l||(b[n]=s)),n&&l){const e=p(t);b[n]=s!==e?s:t}}if("undefined"!=typeof window){for(const t in E){const i=E[t],s=t.endsWith("Capture"),a=((null==n?void 0:n[t])??t.slice(2).toLowerCase()).slice(0,s?-7:void 0);e.useLayoutEffect(()=>{const e=null==g?void 0:g.current;if(e&&"function"==typeof i)return e.addEventListener(a,i,s),()=>{e.removeEventListener(a,i,s)}},[null==g?void 0:g.current,i])}e.useLayoutEffect(()=>{if(null===g.current)return;const e=new Map;for(const t in T)f(g.current,t,T[t]),y.current.delete(t),e.set(t,T[t]);for(const[t,i]of y.current)f(g.current,t,void 0);y.current=e})}if("undefined"==typeof window&&(null==i?void 0:i.getTemplateHTML)&&(null==i?void 0:i.shadowRootOptions)){const{mode:t,delegatesFocus:n}=i.shadowRootOptions,a=e.createElement("template",{shadowrootmode:t,shadowrootdelegatesfocus:n,dangerouslySetInnerHTML:{__html:i.getTemplateHTML(m,s)},key:"ce-la-react-ssr-template-shadow-root"});b.children=[a,b.children]}return e.createElement(t,{...a,...b,ref:e.useCallback(e=>{g.current=e,"function"==typeof c?c(e):null!==c&&(c.current=e)},[c])},b.children)});return c.displayName=s??i.name,c}({react:n,tagName:"hls-video",elementClass:c,toAttributeName(e){return"muted"===e?"":"defaultMuted"===e?"muted":h(e)}})}}]);
3//# sourceMappingURL=reactPlayerHls-49c65b3ee22192c5dcc9.js.map

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.