PageSourceSearch

https://www.dkfz.de/_assets/5bd5aaeffedb0553dcc3d3be99b60d08/Front…/vidstack-google-cast-SSWYNLBP.min.js

js dkfz.de collected 2026-10-01 09:06:30 UTC 8,277 bytes, 1 lines download raw bytes

1import{a as n}from"./chunk-BR7IAQ4L.min.js";import{e as C,f as E,g as l,h as m,j as v,k as S}from"./chunk-XUSEV6OV.min.js";import{a as y,b as p}from"./chunk-7KYGJIQS.min.js";import{X as u,a as c,b as T,f,g,u as k,v as h,x as d}from"./chunk-4JTI5JCN.min.js";import"./chunk-B2HEEVD7.min.js";var L=class{#t;constructor(t){this.#t=new chrome.cast.media.MediaInfo(t.src,t.type)}build(){return this.#t}setStreamType(t){return t.includes("live")?this.#t.streamType=chrome.cast.media.StreamType.LIVE:this.#t.streamType=chrome.cast.media.StreamType.BUFFERED,this}setTracks(t){return this.#t.tracks=t.map(this.#e),this}setMetadata(t,e){return this.#t.metadata=new chrome.cast.media.GenericMediaMetadata,this.#t.metadata.title=t,this.#t.metadata.images=[{url:e}],this}#e(t,e){let s=new chrome.cast.media.Track(e,chrome.cast.media.TrackType.TEXT);return s.name=t.label,s.trackContentId=t.src,s.trackContentType="text/vtt",s.language=t.language,s.subtype=t.kind.toUpperCase(),s}},A=class{#t;#e;#i;constructor(t,e,s){this.#t=t,this.#e=e,this.#i=s}setup(){let t=this.syncRemoteActiveIds.bind(this);d(this.#e.audioTracks,"change",t),d(this.#e.textTracks,"mode-change",t),k(this.#o.bind(this))}getLocalTextTracks(){return this.#e.$state.textTracks().filter(t=>t.src&&t.type==="vtt")}#a(){return this.#e.$state.audioTracks()}#r(t){let e=this.#t.mediaInfo?.tracks??[];return t?e.filter(s=>s.type===t):e}#u(){let t=[],e=this.#a().find(i=>i.selected),s=this.getLocalTextTracks().filter(i=>i.mode==="showing");if(e){let i=this.#r(chrome.cast.media.TrackType.AUDIO),a=this.#d(i,e);a&&t.push(a.trackId)}if(s?.length){let i=this.#r(chrome.cast.media.TrackType.TEXT);if(i.length)for(let a of s){let r=this.#d(i,a);r&&t.push(r.trackId)}}return t}#o(){let t=this.getLocalTextTracks();if(!this.#t.isMediaLoaded)return;let e=this.#r(chrome.cast.media.TrackType.TEXT);for(let s of t)if(!this.#d(e,s)){T(()=>this.#i?.());break}}syncRemoteTracks(t){if(!this.#t.isMediaLoaded)return;let e=this.#a(),s=this.getLocalTextTracks(),i=this.#r(chrome.cast.media.TrackType.AUDIO),a=this.#r(chrome.cast.media.TrackType.TEXT);for(let r of i){if(this.#h(e,r))continue;let o={id:r.trackId.toString(),label:r.name,language:r.language,kind:r.subtype??"main",selected:!1};this.#e.audioTracks[y.add](o,t)}for(let r of a){if(this.#h(s,r))continue;let o={id:r.trackId.toString(),src:r.trackContentId,label:r.name,language:r.language,kind:r.subtype.toLowerCase()};this.#e.textTracks.add(o,t)}}syncRemoteActiveIds(t){if(!this.#t.isMediaLoaded)return;let e=this.#u(),s=new chrome.cast.media.EditTracksInfoRequest(e);this.#c(s).catch(i=>{})}#c(t){let e=l();return new Promise((s,i)=>e?.editTracksInfo(t,s,i))}#h(t,e){return t.find(s=>this.#s(s,e))}#d(t,e){return t.find(s=>this.#s(e,s))}#s(t,e){return e.name===t.label&&e.language===t.language&&e.subtype.toLowerCase()===t.kind.toLowerCase()}},R=class{$$PROVIDER_TYPE="GOOGLE_CAST";scope=g();#t;#e;#i;#a=null;#r="disconnected";#u=0;#o=0;#c=new n(0,0);#h=new p(this.#b.bind(this));#d;#s=null;#l=!1;constructor(t,e){this.#t=t,this.#e=e,this.#i=new A(t,e,this.#G.bind(this))}get type(){return"google-cast"}get currentSrc(){return this.#a}get player(){return this.#t}get cast(){return C()}get session(){return E()}get media(){return l()}get hasActiveSession(){return m(this.#a)}setup(){this.#S(),this.#L(),this.#i.setup(),this.#e.notify("provider-setup",this)}#S(){S(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.#f.bind(this))}#L(){let t=cast.framework.RemotePlayerEventType,e={[t.IS_CONNECTED_CHANGED]:this.#f,[t.IS_MEDIA_LOADED_CHANGED]:this.#g,[t.CAN_CONTROL_VOLUME_CHANGED]:this.#k,[t.CAN_SEEK_CHANGED]:this.#y,[t.DURATION_CHANGED]:this.#D,[t.IS_MUTED_CHANGED]:this.#p,[t.VOLUME_LEVEL_CHANGED]:this.#p,[t.IS_PAUSED_CHANGED]:this.#N,[t.LIVE_SEEKABLE_RANGE_CHANGED]:this.#C,[t.PLAYER_STATE_CHANGED]:this.#P};this.#d=e;let s=this.#w.bind(this);for(let i of u(e))this.#t.controller.addEventListener(i,s);f(()=>{for(let i of u(e))this.#t.controller.removeEventListener(i,s)})}async play(){if(!(!this.#t.isPaused&&!this.#l)){if(this.#l){await this.#v(!1,0);return}this.#t.controller?.playOrPause()}}async pause(){this.#t.isPaused||this.#t.controller?.playOrPause()}getMediaStatus(t){return new Promise((e,s)=>{this.media?.getStatus(t,e,s)})}setMuted(t){(t&&!this.#t.isMuted||!t&&this.#t.isMuted)&&this.#t.controller?.muteOr
1Unmute()}setCurrentTime(t){this.#t.currentTime=t,this.#e.notify("seeking",t),this.#t.controller?.seek()}setVolume(t){this.#t.volumeLevel=t,this.#t.controller?.setVolumeLevel()}async loadSource(t){if(this.#s?.src!==t&&(this.#s=null),m(t)){this.#A(),this.#a=t;return}this.#e.notify("load-start");let e=this.#x(t),s=await this.session.loadMedia(e);if(s){this.#a=null,this.#e.notify("error",Error(v(s)));return}this.#a=t}destroy(){this.#m(),this.#T()}#m(){this.#s||(this.#o=0,this.#c=new n(0,0)),this.#h.stop(),this.#u=0,this.#s=null}#A(){let t=new h("resume-session",{detail:this.session});this.#g(t);let{muted:e,volume:s,savedState:i}=this.#e.$state,a=i();this.setCurrentTime(Math.max(this.#t.currentTime,a?.currentTime??0)),this.setMuted(e()),this.setVolume(s()),a?.paused===!1&&this.play()}#T(){this.cast.endCurrentSession(!0);let{remotePlaybackLoader:t}=this.#e.$state;t.set(null)}#I(){let{savedState:t}=this.#e.$state;t.set({paused:this.#t.isPaused,currentTime:this.#t.currentTime}),this.#T()}#b(){this.#R()}#w(t){this.#d[t.type].call(this,t)}#f(t){let e=this.cast.getCastState(),s=e===cast.framework.CastState.CONNECTED?"connected":e===cast.framework.CastState.CONNECTING?"connecting":"disconnected";if(this.#r===s)return;let i={type:"google-cast",state:s},a=this.#n(t);this.#r=s,this.#e.notify("remote-playback-change",i,a),s==="disconnected"&&this.#I()}#g(t){if(!this.#t.isMediaLoaded)return;let e=c(this.#e.$state.source);Promise.resolve().then(()=>{if(e!==c(this.#e.$state.source)||!this.#t.isMediaLoaded)return;this.#m();let s=this.#t.duration;this.#c=new n(0,s);let i={provider:this,duration:s,buffered:new n(0,0),seekable:this.#E()},a=this.#n(t);this.#e.notify("loaded-metadata",void 0,a),this.#e.notify("loaded-data",void 0,a),this.#e.notify("can-play",i,a),this.#k(),this.#y(t);let{volume:r,muted:o}=this.#e.$state;this.setVolume(r()),this.setMuted(o()),this.#h.start(),this.#i.syncRemoteTracks(a),this.#i.syncRemoteActiveIds(a)})}#k(){this.#e.$state.canSetVolume.set(this.#t.canControlVolume)}#y(t){let e=this.#n(t);this.#e.notify("stream-type-change",this.#M(),e)}#M(){return this.#t.mediaInfo?.streamType===chrome.cast.media.StreamType.LIVE?this.#t.canSeek?"live:dvr":"live":"on-demand"}#R(){if(this.#s)return;let t=this.#t.currentTime;t!==this.#u&&(this.#e.notify("time-change",t),t>this.#o&&(this.#o=t,this.#C()),this.#e.$state.seeking()&&this.#e.notify("seeked",t),this.#u=t)}#D(t){if(!this.#t.isMediaLoaded||this.#s)return;let e=this.#t.duration,s=this.#n(t);this.#c=new n(0,e),this.#e.notify("duration-change",e,s)}#p(t){if(!this.#t.isMediaLoaded)return;let e={muted:this.#t.isMuted,volume:this.#t.volumeLevel},s=this.#n(t);this.#e.notify("volume-change",e,s)}#N(t){let e=this.#n(t);this.#t.isPaused?this.#e.notify("pause",void 0,e):this.#e.notify("play",void 0,e)}#C(t){let e={seekable:this.#E(),buffered:new n(0,this.#o)},s=t?this.#n(t):void 0;this.#e.notify("progress",e,s)}#P(t){let e=this.#t.playerState,s=chrome.cast.media.PlayerState;if(this.#l=e===s.IDLE,e===s.PAUSED)return;let i=this.#n(t);switch(e){case s.PLAYING:this.#e.notify("playing",void 0,i);break;case s.BUFFERING:this.#e.notify("waiting",void 0,i);break;case s.IDLE:this.#h.stop(),this.#e.notify("pause"),this.#e.notify("end");break}}#E(){return this.#t.liveSeekableRange?new n(this.#t.liveSeekableRange.start,this.#t.liveSeekableRange.end):this.#c}#n(t){return t instanceof Event?t:new h(t.type,{detail:t})}#_(t){let{streamType:e,title:s,poster:i}=this.#e.$state;return new L(t).setMetadata(s(),i()).setStreamType(e()).setTracks(this.#i.getLocalTextTracks()).build()}#x(t){let e=this.#_(t),s=new chrome.cast.media.LoadRequest(e),i=this.#e.$state.savedState();return s.autoplay=(this.#s?.paused??i?.paused)===!1,s.currentTime=this.#s?.time??i?.currentTime??0,s}async#v(t,e){let s=c(this.#e.$state.source);this.#s={src:s,paused:t,time:e},await this.loadSource(s)}#G(){this.#v(this.#t.isPaused,this.#t.currentTime).catch(t=>{})}};export{R as GoogleCastProvider};

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.