@flowplayer/player 3.17.0 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/events.d.ts +49 -0
- package/core/events.js +22 -2
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/index.d.ts +53 -1
- package/package.json +1 -1
- package/plugins/ads.d.ts +53 -1
- package/plugins/ads.js +1 -1
- package/plugins/airplay.d.ts +53 -1
- package/plugins/analytics.d.ts +53 -1
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +53 -1
- package/plugins/audio.d.ts +53 -1
- package/plugins/chapters.d.ts +53 -1
- package/plugins/chromecast.d.ts +53 -1
- package/plugins/comscore.d.ts +53 -1
- package/plugins/consent.d.ts +53 -1
- package/plugins/context-menu.d.ts +53 -1
- package/plugins/cuepoints.d.ts +59 -7
- package/plugins/dash.d.ts +53 -1
- package/plugins/drm.d.ts +53 -1
- package/plugins/endscreen.d.ts +53 -1
- package/plugins/fas.d.ts +53 -1
- package/plugins/float-on-scroll.d.ts +53 -1
- package/plugins/ga4.d.ts +53 -1
- package/plugins/gemius.d.ts +53 -1
- package/plugins/google-analytics.d.ts +53 -1
- package/plugins/health.d.ts +53 -1
- package/plugins/health.js +1 -1
- package/plugins/hls.d.ts +53 -1
- package/plugins/id3.d.ts +53 -1
- package/plugins/iframe.d.ts +53 -1
- package/plugins/keyboard.d.ts +53 -1
- package/plugins/media-session.d.ts +53 -1
- package/plugins/message.d.ts +53 -1
- package/plugins/ovp.d.ts +53 -1
- package/plugins/playlist.d.ts +53 -1
- package/plugins/preview.d.ts +53 -1
- package/plugins/qsel.d.ts +53 -1
- package/plugins/qul.d.ts +53 -1
- package/plugins/rts.d.ts +53 -1
- package/plugins/share.d.ts +53 -1
- package/plugins/speed.d.ts +53 -1
- package/plugins/ssai.d.ts +53 -1
- package/plugins/ssai.js +1 -1
- package/plugins/subtitles.d.ts +53 -1
- package/plugins/thumbnails.d.ts +53 -1
- package/plugins/tizen.d.ts +53 -1
- package/plugins/vtsel.d.ts +53 -1
- package/plugins/webos.d.ts +53 -1
- package/util/loader.d.ts +53 -1
package/plugins/speed.d.ts
CHANGED
|
@@ -157,6 +157,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
157
157
|
*/
|
|
158
158
|
declare type ContextMenuEventDetail = null;
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @public
|
|
162
|
+
* @deprecated
|
|
163
|
+
* when a cuepoint becomes inactive
|
|
164
|
+
*/
|
|
165
|
+
declare const /**
|
|
166
|
+
@public
|
|
167
|
+
* when a new player is inserted into the HTML
|
|
168
|
+
*/ /**
|
|
169
|
+
* @public
|
|
170
|
+
* @deprecated
|
|
171
|
+
* when a cuepoint becomes inactive
|
|
172
|
+
*/
|
|
173
|
+
CUEPOINT_END = "cuepointend";
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @public
|
|
177
|
+
* @deprecated
|
|
178
|
+
* when a cuepoint is active
|
|
179
|
+
*/
|
|
180
|
+
declare const /**
|
|
181
|
+
@public
|
|
182
|
+
* when a new player is inserted into the HTML
|
|
183
|
+
*/ /**
|
|
184
|
+
* @public
|
|
185
|
+
* @deprecated
|
|
186
|
+
* when a cuepoint is active
|
|
187
|
+
*/
|
|
188
|
+
CUEPOINT_START = "cuepointstart";
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
* @deprecated
|
|
193
|
+
* cuepoints parsing is asynchronous
|
|
194
|
+
* you cannot rely on them existing until
|
|
195
|
+
* this event is emitted
|
|
196
|
+
*/
|
|
197
|
+
declare const /**
|
|
198
|
+
@public
|
|
199
|
+
* when a new player is inserted into the HTML
|
|
200
|
+
*/ /**
|
|
201
|
+
* @public
|
|
202
|
+
* @deprecated
|
|
203
|
+
* cuepoints parsing is asynchronous
|
|
204
|
+
* you cannot rely on them existing until
|
|
205
|
+
* this event is emitted
|
|
206
|
+
*/
|
|
207
|
+
CUEPOINTS = "cuepoints";
|
|
208
|
+
|
|
160
209
|
/**
|
|
161
210
|
* @public
|
|
162
211
|
*/
|
|
@@ -341,7 +390,10 @@ declare namespace events {
|
|
|
341
390
|
PORTRAIT,
|
|
342
391
|
DVR,
|
|
343
392
|
LIVE,
|
|
344
|
-
RECOVER
|
|
393
|
+
RECOVER,
|
|
394
|
+
CUEPOINTS,
|
|
395
|
+
CUEPOINT_START,
|
|
396
|
+
CUEPOINT_END
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
399
|
|
package/plugins/ssai.d.ts
CHANGED
|
@@ -175,6 +175,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
175
175
|
*/
|
|
176
176
|
declare type ContextMenuEventDetail = null;
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* @public
|
|
180
|
+
* @deprecated
|
|
181
|
+
* when a cuepoint becomes inactive
|
|
182
|
+
*/
|
|
183
|
+
declare const /**
|
|
184
|
+
@public
|
|
185
|
+
* when a new player is inserted into the HTML
|
|
186
|
+
*/ /**
|
|
187
|
+
* @public
|
|
188
|
+
* @deprecated
|
|
189
|
+
* when a cuepoint becomes inactive
|
|
190
|
+
*/
|
|
191
|
+
CUEPOINT_END = "cuepointend";
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @public
|
|
195
|
+
* @deprecated
|
|
196
|
+
* when a cuepoint is active
|
|
197
|
+
*/
|
|
198
|
+
declare const /**
|
|
199
|
+
@public
|
|
200
|
+
* when a new player is inserted into the HTML
|
|
201
|
+
*/ /**
|
|
202
|
+
* @public
|
|
203
|
+
* @deprecated
|
|
204
|
+
* when a cuepoint is active
|
|
205
|
+
*/
|
|
206
|
+
CUEPOINT_START = "cuepointstart";
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @public
|
|
210
|
+
* @deprecated
|
|
211
|
+
* cuepoints parsing is asynchronous
|
|
212
|
+
* you cannot rely on them existing until
|
|
213
|
+
* this event is emitted
|
|
214
|
+
*/
|
|
215
|
+
declare const /**
|
|
216
|
+
@public
|
|
217
|
+
* when a new player is inserted into the HTML
|
|
218
|
+
*/ /**
|
|
219
|
+
* @public
|
|
220
|
+
* @deprecated
|
|
221
|
+
* cuepoints parsing is asynchronous
|
|
222
|
+
* you cannot rely on them existing until
|
|
223
|
+
* this event is emitted
|
|
224
|
+
*/
|
|
225
|
+
CUEPOINTS = "cuepoints";
|
|
226
|
+
|
|
178
227
|
/**
|
|
179
228
|
* @public
|
|
180
229
|
*/
|
|
@@ -359,7 +408,10 @@ declare namespace events {
|
|
|
359
408
|
PORTRAIT,
|
|
360
409
|
DVR,
|
|
361
410
|
LIVE,
|
|
362
|
-
RECOVER
|
|
411
|
+
RECOVER,
|
|
412
|
+
CUEPOINTS,
|
|
413
|
+
CUEPOINT_START,
|
|
414
|
+
CUEPOINT_END
|
|
363
415
|
}
|
|
364
416
|
}
|
|
365
417
|
|
package/plugins/ssai.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* https://github.com/lancedikson/bowser
|
|
5
5
|
* MIT License | (c) Dustin Diaz 2012-2015
|
|
6
6
|
* MIT License | (c) Denis Demchenko 2015-2019
|
|
7
|
-
*/const S=class Bowser{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Parser(e,t)}static parse(e){return new Parser(e).getResult()}static get BROWSER_MAP(){return u}static get ENGINE_MAP(){return g}static get OS_MAP(){return m}static get PLATFORMS_MAP(){return p}}.parse(window.navigator.userAgent),{platform:w,os:_,browser:M}=S,A=e=>e&&e.toLowerCase();var E={rnd:Math.random().toString(36).substr(2,32),os:A(_.name+(_.versionName?" "+_.versionName:"")),device:A(w.type),browser:A(M.name),browser_version:(M&&M.version?M.version:"unknown").split(".").shift(),plugin_version:"3.17.0"};const U="https://fp-eu-w1-aai.flowplayer.com/in",k="POST",T=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],R=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],P=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],O=d("ads/analytics"),F=RequestQueue.of(),q=(...e)=>Object.assign({},...e);class Analytics{constructor(e,t={}){this.emitter=e,this.metadata=q(E,t.metadata||{}),this.emitter=e,this.events=t.events||[],this.required_keys=t.required_keys||[],this.optional_keys=t.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),O(this),this.wireup()}static of(e,t){return new Analytics(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(e,t){return((e,...t)=>Object.keys(e).filter(e=>~t.indexOf(e)).reduce((t,s)=>Object.assign(t,{[s]:e[s]}),{}))(t,...e.valid_keys)}static mergeMetadata(e,t={}){return e.metadata=Analytics.pluck_valid_keys(e,q(e.metadata,t,{player_version:"3.17.0"})),e}wireup(){this.events.forEach(e=>{this.emitter.on(e,t=>{const s=t.detail,r=q(this.metadata,{event_type:e},s),i=Analytics.pluck_valid_keys(this,r),n=Analytics.ensure_required_keys(this,i);if(O(`Event[${e}]`,{payload:i,observation:s}),n.length)return O(`Analytics.validate_metadata() failed for\n Event[${e}]\n missing keys: ${n}`,i);RequestQueue.rpush(F,[U,k,i])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}var B;function C(e,t){var s;switch(t){case B.Preroll:return 0;case B.Postroll:return-1;default:return null===(s=e.ssai)||void 0===s?void 0:s.provider.getContentCurrentTime(e)}}function D(e,t,s){var r,i,n,a;const o=null===(r=t.ssai)||void 0===r?void 0:r.provider.getAdType(),d=null===(a=null===(n=null===(i=t.ssai)||void 0===i?void 0:i.provider)||void 0===n?void 0:n.src)||void 0===a?void 0:a.analyticsId,c={ad_break_time:C(t,o),ad_muted:t.muted,event_type:e};o&&Object.assign(c,{ad_type:o}),d&&Object.assign(c,{ad_tag_id:d}),s&&"duration"in s&&Object.assign(c,{ad_remaining_seconds:s.duration-s.currentTime,ad_duration_seconds:s.duration}),s&&"getAdId"in s&&Object.assign(c,{vast_ad_id:s.getAdId()}),t.emit("health:record",{event:"ads/"+e,detail:c}),t.emit(e,Object.assign(c,{data:s}))}function N(e,t){var s;e.setState("ssai-ad-active",!0);const r=null===(s=e.ssai)||void 0===s?void 0:s.state;r&&(r.adProgress={currentTime:0,duration:t},L(e,r))}function I(e,t){var s;const r=null===(s=e.ssai)||void 0===s?void 0:s.state;r&&(r.adProgress=t,L(e,r))}function x(e){if(!e.ssai)return;const t=e.ssai.state;e.setState("ssai-ad-active",!1),delete t.adProgress,void 0!==t.rate&&(e.playbackRate=t.rate,delete t.rate),"number"==typeof t.snapbackTime&&(r(e,t.snapbackTime),delete t.snapbackTime)}function L(e,t){const s=e.playbackRate;1!==s&&(t.rate=s,e.playbackRate=1)}!function(e){e.Preroll="preroll",e.Midroll="midroll",e.Postroll="postroll"}(B||(B={}));const Q=navigator.languages||[navigator.language];function j(e){const t=e.ssai.ui,s=new google.ima.dai.api.UiSettings,r=e.opt("lang")||function(){try{return Q.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().find(e=>!e.includes("-"))||"en";s.setLocale(r);const i=new google.ima.dai.api.StreamManager(e,t,s);return i.addEventListener([google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.STREAM_INITIALIZED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,google.ima.dai.api.StreamEvent.Type.RESUMED,google.ima.dai.api.StreamEvent.Type.PAUSED,google.ima.dai.api.StreamEvent.Type.STARTED,google.ima.dai.api.StreamEvent.Type.COMPLETE,google.ima.dai.api.StreamEvent.Type.SKIPPED,google.ima.dai.api.StreamEvent.Type.CLICK],t=>{!function(e,t,s){switch(s.type){case google.ima.dai.api.StreamEvent.Type.STREAM_INITIALIZED:return async function(e,t){var s,r;const i=t.getStreamData().streamId,n=e.ssai.provider;if(!i||!n.isPod)return;if(!n.isVod){const t=null===(s=n.src)||void 0===s?void 0:s.streamUrl;return t?(n.daiStream=n.buildPodStreamURL(t,i),e.setSrc(n.daiStream)):console.error("streamUrl param is missing : https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/html5?service=pod#create_a_simple_video_player_2")}const a=null===(r=n.src)||void 0===r?void 0:r.requestStreamUrl;if(!a)return console.error("requestStreamUrl param is missing : https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/html5?service=pod#vod-pod-serving_1");try{n.daiStream=await a(e.ssai.streamManager,i),e.ssai.streamManager.loadStreamMetadata(),e.setSrc(n.daiStream)}catch(t){z(e)}}(e,s);case google.ima.dai.api.StreamEvent.Type.RESUMED:return D("ad-resumed",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.PAUSED:return D("ad-paused",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.COMPLETE:return D("ad-completed",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.SKIPPED:return D("ad-skipped",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.LOADED:return function(e,t){const s=t.getStreamData().url,r=e.ssai.provider;if(!s||r.isPod&&!r.isVod)return;r.daiStream=s,e.setSrc(s)}(e,s);case google.ima.dai.api.StreamEvent.Type.STARTED:return e.ssai.provider.currentAd=s.getAd(),D("ad-started",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:return N(e),D("ad-break-started",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:return D(a,e,V(e,s)),x(e),e.ssai.provider.currentAd=void 0;case google.ima.dai.api.StreamEvent.Type.ERROR:return z(e,s);case google.ima.dai.api.StreamEvent.Type.AD_PROGRESS:{const t=V(e,s);return I(e,t.stream_data.adProgressData),D("ad-progress",e,t)}case google.ima.dai.api.StreamEvent.Type.CLICK:(function(e,t){if(!e.paused)e.togglePlay(!1)})(e)}}(e,0,t)},!1),e.on("ID3",({data:e})=>{const t=null==e?void 0:e.cue;if(!t)return;const s={},r=t.value;s[r.key]=r.data,i.onTimedMetadata(s)}),e.on("ssai:hls:metadata",e=>{var t;null===(t=e.detail)||void 0===t||t.samples.forEach(e=>i.processMetadata("ID3",e.data,e.pts))}),e.on("ssai:dash:metadata",e=>{const t=e.detail;if(!t)return;const s=t.event.messageData,r=t.event.calculatedPresentationTime;i.processMetadata("urn:google:dai:2018",s,r)}),i}function V(e,t){return{stream_data:t.getStreamData(),ad:e.ssai.provider.currentAd}}function z(e,t){var s,r;const i=e.ssai.provider;if(null===(s=i.src)||void 0===s?void 0:s.backupStream)return e.setSrc(i.src.backupStream);e.emit("error",{message:(null===(r=null==t?void 0:t.getStreamData())||void 0===r?void 0:r.errorMessage)||"error loading stream"})}const W=d("ads/ima/sdk");var G;async function H(e,t){var s;const r=null===(s=null===window||void 0===window?void 0:window.google)||void 0===s?void 0:s.ima;if(t?null==r?void 0:r.dai:r)return void W(":noop");const i=t?"https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js":e._storage.getItem("ima/debug")?"https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"https://imasdk.googleapis.com/js/sdkloader/ima3.js";try{return await async function(e){return new Promise((t,s)=>{let r=document.querySelector(`script[src='${e}']`);if(r)return K(r,t,s);r=document.createElement("script"),r.setAttribute("state",G.LOADING),K(r,t,s),r.src=e,document.head.appendChild(r)})}(i),void W(":loaded")}catch(e){W(":error "+e.message,e)}}function K(e,t,s){const r=e.getAttribute("state");if(r&&[G.ERROR,G.LOADED].includes(r))return t(void 0);e.addEventListener("load",()=>{e.setAttribute("state",G.LOADED),t(void 0)},{once:!0}),["error","abort"].forEach(t=>{e.addEventListener(t,()=>{e.setAttribute("state",G.ERROR),s("script failed to load")},{once:!0})})}!function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(G||(G={}));const $=window.YospaceAdManagement||{AnalyticEventObserver:null};class EventObserver extends $.AnalyticEventObserver{constructor(e){super(),this.video=e}onAdvertBreakStart(e){const t=e.getDuration();if(!e.isActive()&&t){const e=s(this.video);r(this.video,e+t/1e3)}N(this.video,e.getStart()),D("ad-break-started",this.video)}onAdvertBreakEnd(){x(this.video),D(a,this.video)}onAdvertStart(e){}onAdvertEnd(){}onTrackingEvent(e){}}function Z(e,t){YospaceAdManagement.SessionVOD.create(e,t.ssai.properties,e=>{const r=e.getPayload();if(r.getSessionResult()===YospaceAdManagement.SessionResult.INITIALISED){t.ssai.session=r;const e=new EventObserver(t);r.addAnalyticObserver(e),t.setSrc({src:r.getPlaybackUrl()}),setInterval(()=>{const e=1e3*s(t);r.onPlayheadUpdate(e),function(e,t,s){const r=e.getCurrentAdBreak();if(!r)return;const i={currentTime:s-r.getStart(),duration:r.getDuration()};I(t,i),D("ad-progress",t,{stream_data:i})}(r,t,e)},250)}else console.warn("YoSpace Failed to initialise session. ResultCode = "+r.getResultCode())})}var X=Object.freeze({__proto__:null,exists:function(){return!!window.YospaceAdManagement},init:function(e,t){t.ssai&&(!function(e){Object.defineProperty(e,"currentTime",{get:function(){if(e.ssai){const t=e.ssai.state.adProgress;return t?t.currentTime:e.ssai.provider.getContentCurrentTime(e)}return s(e)},set:function(t){var s;if(e.ssai){if(e.ssai.state.adProgress)return;return null===(s=e.ssai.provider)||void 0===s?void 0:s.setContentCurrentTime(e,t)}}}),Object.defineProperty(e,"duration",{get:function(){if(e.ssai){const t=e.ssai.state.adProgress;return t?t.duration:e.ssai.provider.getContentDuration(e)}return n(e)},set:function(){}})}(t),Object.assign(t.ssai,function(){const e=new YospaceAdManagement.SessionProperties;return e.setUserAgent(navigator.userAgent),{properties:e}}()))},srcIsValid:function(e){return"yospace"==e.type},onload:function(e,t){t&&t.src&&Z(t.src,e)},getContentCurrentTime:function(e){const t=s(e),r=e.ssai.session;return r?r.getContentPositionForPlayhead(1e3*t)/1e3:t},setContentCurrentTime:function(e,t){const s=e.ssai.session;return r(e,s?s.getPlayheadForContentPosition(1e3*t)/1e3:t)},onNewSrc:function(e){},getContentDuration:function(e){const t=e.ssai.session,s=n(e);return t?t.getContentPositionForPlayhead(t.getDuration())/1e3:s},getAdType:function(){},getPreviousActiveAdStart:function(e,t){const s=e.ssai.session;if(!s)return;const r=s.getAdBreaks();let i;const n=1e3*t;return r.forEach(e=>{void 0===i&&e.getStart()<n&&e.isActive()&&(i=e)}),void 0!==i?i.getStart()/1e3:void 0}});const Y=(e,t)=>new(((e,t)=>{const s=e.get(t);if(!s)throw new Error(`no flowplayer component with the name ${t} exists`);const r=window.customElements.get(t);if(!r)throw new Error(`no default flowplayer component with the name ${t} exists`);const i=window.customElements.get(s);return"function"!=typeof i?r:i})(e._customElements,t))(e),J=(e,t,s)=>{window.customElements.get(t)||window.customElements.define(t,s),e.customElements.get(t)||e.customElements.set(t,t)};class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class SSAIAdUi extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-ui",this.append(...this.player.createComponents("flowplayer-ssai-indicator","flowplayer-ssai-timeline","flowplayer-ssai-controls"))}}class SSAITimeline extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-timeline";const t=document.createElement("div");t.className="fp-ssai-progress",this.append(t),this.player.on(a,()=>{t.classList.remove("go"),"--ssai-percent-complete --ssai-percent-previous".split(" ").forEach(e=>this.style.setProperty(e,"0"))}),this.player.on("ad-progress",e=>{var s,r,i;const n=null===(i=null===(r=null===(s=e.detail)||void 0===s?void 0:s.data)||void 0===r?void 0:r.stream_data)||void 0===i?void 0:i.adProgressData;if(!n)return;const a=n.currentTime/n.duration*100,o=t.style.getPropertyValue("--ssai-percent-complete");t.classList.remove("go"),t.style.setProperty("--ssai-percent-previous",o),t.style.setProperty("--ssai-percent-complete",a.toFixed(3)),t.classList.add("go")})}}function ee(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}class SSAIControls extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-controls",this.createLeftZone(),this.createRightZone()}createRightZone(){const e=document.createElement("div");e.className="fp-ssai-right-zone",e.append(...this.player.createComponents("flowplayer-volume-control"),...this.fsIcons()),this.append(e)}createLeftZone(){const e=document.createElement("div");e.className="fp-ssai-left-zone",e.append(...this.player.createComponents("flowplayer-control-buttons"),this.remainingTimeComponent()),this.append(e)}fsIcons(){return this.player.createComponents("flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon").map(e=>(e.onclick=()=>this.player.toggleFullScreen(),e))}remainingTimeComponent(){const e=document.createElement("div");return e.className="fp-ssai-remaining",this.player.on("ad-progress",t=>{var s,r;const i=null===(r=null===(s=t.detail.data)||void 0===s?void 0:s.stream_data)||void 0===r?void 0:r.adProgressData;i&&(e.textContent=function(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const s=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,s>=1?(r-=60*s,t+s+":"+ee(r)+":"+ee(e)):t+ee(r)+":"+ee(e)}(i.duration-i.currentTime))}),e}}class SSAIAdIndicator extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-indicator",this.player.on("ad-started",e=>{var t,s,r;const i=null===(r=null===(s=null===(t=e.detail)||void 0===t?void 0:t.data)||void 0===s?void 0:s.ad)||void 0===r?void 0:r.getAdPodInfo();i&&(this.textContent=`${this.player.i18n("ads.indicator","ADS")} ${i.getAdPosition()} / ${i.getTotalAds()}`)})}}var te;const se=[X,new class Dai{async init(e,t){var s,r;if(t.ssai)return this.make_analytics(t),await H(t,!0),(null===(r=null===(s=window.google)||void 0===s?void 0:s.ima)||void 0===r?void 0:r.dai)?void 0:console.warn("google.ima.dai unavailable")}async onload(e,t){var s,r,i;if(await H(e,!0),null===(r=null===(s=window.google)||void 0===s?void 0:s.ima)||void 0===r?void 0:r.dai){if((null===(i=e.ssai)||void 0===i?void 0:i.streamManager)||(e.ssai.streamManager=j(e)),this.src=t,this.isPod=!!t.customAssetKey||!!t.requestStreamUrl,this.isVod=!!t.contentSourceId||!!t.videoId||!!t.requestStreamUrl,this.isPod)return this.requestPodStream(e.ssai.streamManager,t);this.requestStream(e.ssai.streamManager,t)}else t.backupStream&&e.setSrc(t.backupStream)}onNewSrc(e,t){var s;t.src!==this.daiStream&&(null===(s=e.ssai.streamManager)||void 0===s||s.reset())}make_analytics(e){const t=Analytics.of(e,{required_keys:R,events:T,optional_keys:P});e.on("config",()=>{var s;return Analytics.mergeMetadata(t,null===(s=e.opts)||void 0===s?void 0:s.metadata)})}exists(){return!0}getAdType(){if(this.currentAd)switch(this.currentAd.getAdPodInfo().getPodIndex()){case 0:return B.Preroll;case-1:return B.Postroll;case-2:return;default:return B.Midroll}}getContentCurrentTime(e){const t=e.ssai.streamManager,s=e.currentTime;return t?t.contentTimeForStreamTime(s):s}setContentCurrentTime(e,t){}getContentDuration(e){const t=e.ssai.streamManager,s=e.duration;return t?t.contentTimeForStreamTime(s):s}getPreviousActiveAdStart(e,t){var s,r;const i=null===(r=null===(s=e.ssai)||void 0===s?void 0:s.streamManager)||void 0===r?void 0:r.previousCuePointForStreamTime(t);if(i&&!i.played)return i.start}srcIsValid(e){return"google/dai"==e.type}requestStream(e,t){const s=this.isVod?new google.ima.dai.api.VODStreamRequest:new google.ima.dai.api.LiveStreamRequest;e.requestStream(Object.assign(s,t))}requestPodStream(e,t){const s=this.isVod?new google.ima.dai.api.PodVodStreamRequest:new google.ima.dai.api.PodStreamRequest;e.requestStream(Object.assign(s,t))}buildPodStreamURL(e,t){return e.replace("[[STREAMID]]",t)}}],re=((te=class Ssai{constructor(e){this.umd=e,J(e,"flowplayer-ssai-ui",SSAIAdUi),J(e,"flowplayer-ssai-timeline",SSAITimeline),J(e,"flowplayer-ssai-controls",SSAIControls),J(e,"flowplayer-ssai-indicator",SSAIAdIndicator)}init(e,t,i){se.forEach(e=>{if(i.ssai||!e.exists())return;const n=Y(i,"flowplayer-ssai-ui");t.append(n),i.ssai={provider:e,ui:n,state:{snapback:!1}},e.init(t,i),i.on("seeked",()=>function(e){if(e.opt("live"))return;if(!e.ssai)return;const{provider:t,state:i}=e.ssai;if(i.snapback)return i.snapback=!1;const n=s(e),a=t.getPreviousActiveAdStart(e,n);void 0!==a&&(i.snapback=!0,i.snapbackTime=n,r(e,a))}(i)),i.on("src",t=>{i.setState("ssai-ad-active",!1),i.ssai&&(i.ssai.state={snapback:!1},e.onNewSrc(i,t.detail))})})}onload(e,t,s,r){var i;(null===(i=s.ssai)||void 0===i?void 0:i.provider)&&s.ssai.provider.onload(s,r)}wants(e,t,s){let r=!1;return se.forEach(e=>{if(!r&&e.exists()&&e.srcIsValid(t))return r=!0}),r}}).events=o,te);return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const s=e.flowplayer;return"function"==typeof s?(s(t),t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t),t)}(window,re)}));
|
|
7
|
+
*/const S=class Bowser{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Parser(e,t)}static parse(e){return new Parser(e).getResult()}static get BROWSER_MAP(){return u}static get ENGINE_MAP(){return g}static get OS_MAP(){return m}static get PLATFORMS_MAP(){return p}}.parse(window.navigator.userAgent),{platform:w,os:_,browser:M}=S,A=e=>e&&e.toLowerCase();var E={rnd:Math.random().toString(36).substr(2,32),os:A(_.name+(_.versionName?" "+_.versionName:"")),device:A(w.type),browser:A(M.name),browser_version:(M&&M.version?M.version:"unknown").split(".").shift(),plugin_version:"3.17.1"};const U="https://fp-eu-w1-aai.flowplayer.com/in",k="POST",T=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],R=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],P=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],O=d("ads/analytics"),F=RequestQueue.of(),q=(...e)=>Object.assign({},...e);class Analytics{constructor(e,t={}){this.emitter=e,this.metadata=q(E,t.metadata||{}),this.emitter=e,this.events=t.events||[],this.required_keys=t.required_keys||[],this.optional_keys=t.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),O(this),this.wireup()}static of(e,t){return new Analytics(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(e,t){return((e,...t)=>Object.keys(e).filter(e=>~t.indexOf(e)).reduce((t,s)=>Object.assign(t,{[s]:e[s]}),{}))(t,...e.valid_keys)}static mergeMetadata(e,t={}){return e.metadata=Analytics.pluck_valid_keys(e,q(e.metadata,t,{player_version:"3.17.1"})),e}wireup(){this.events.forEach(e=>{this.emitter.on(e,t=>{const s=t.detail,r=q(this.metadata,{event_type:e},s),i=Analytics.pluck_valid_keys(this,r),n=Analytics.ensure_required_keys(this,i);if(O(`Event[${e}]`,{payload:i,observation:s}),n.length)return O(`Analytics.validate_metadata() failed for\n Event[${e}]\n missing keys: ${n}`,i);RequestQueue.rpush(F,[U,k,i])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}var B;function C(e,t){var s;switch(t){case B.Preroll:return 0;case B.Postroll:return-1;default:return null===(s=e.ssai)||void 0===s?void 0:s.provider.getContentCurrentTime(e)}}function D(e,t,s){var r,i,n,a;const o=null===(r=t.ssai)||void 0===r?void 0:r.provider.getAdType(),d=null===(a=null===(n=null===(i=t.ssai)||void 0===i?void 0:i.provider)||void 0===n?void 0:n.src)||void 0===a?void 0:a.analyticsId,c={ad_break_time:C(t,o),ad_muted:t.muted,event_type:e};o&&Object.assign(c,{ad_type:o}),d&&Object.assign(c,{ad_tag_id:d}),s&&"duration"in s&&Object.assign(c,{ad_remaining_seconds:s.duration-s.currentTime,ad_duration_seconds:s.duration}),s&&"getAdId"in s&&Object.assign(c,{vast_ad_id:s.getAdId()}),t.emit("health:record",{event:"ads/"+e,detail:c}),t.emit(e,Object.assign(c,{data:s}))}function N(e,t){var s;e.setState("ssai-ad-active",!0);const r=null===(s=e.ssai)||void 0===s?void 0:s.state;r&&(r.adProgress={currentTime:0,duration:t},L(e,r))}function I(e,t){var s;const r=null===(s=e.ssai)||void 0===s?void 0:s.state;r&&(r.adProgress=t,L(e,r))}function x(e){if(!e.ssai)return;const t=e.ssai.state;e.setState("ssai-ad-active",!1),delete t.adProgress,void 0!==t.rate&&(e.playbackRate=t.rate,delete t.rate),"number"==typeof t.snapbackTime&&(r(e,t.snapbackTime),delete t.snapbackTime)}function L(e,t){const s=e.playbackRate;1!==s&&(t.rate=s,e.playbackRate=1)}!function(e){e.Preroll="preroll",e.Midroll="midroll",e.Postroll="postroll"}(B||(B={}));const Q=navigator.languages||[navigator.language];function j(e){const t=e.ssai.ui,s=new google.ima.dai.api.UiSettings,r=e.opt("lang")||function(){try{return Q.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().find(e=>!e.includes("-"))||"en";s.setLocale(r);const i=new google.ima.dai.api.StreamManager(e,t,s);return i.addEventListener([google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.STREAM_INITIALIZED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,google.ima.dai.api.StreamEvent.Type.RESUMED,google.ima.dai.api.StreamEvent.Type.PAUSED,google.ima.dai.api.StreamEvent.Type.STARTED,google.ima.dai.api.StreamEvent.Type.COMPLETE,google.ima.dai.api.StreamEvent.Type.SKIPPED,google.ima.dai.api.StreamEvent.Type.CLICK],t=>{!function(e,t,s){switch(s.type){case google.ima.dai.api.StreamEvent.Type.STREAM_INITIALIZED:return async function(e,t){var s,r;const i=t.getStreamData().streamId,n=e.ssai.provider;if(!i||!n.isPod)return;if(!n.isVod){const t=null===(s=n.src)||void 0===s?void 0:s.streamUrl;return t?(n.daiStream=n.buildPodStreamURL(t,i),e.setSrc(n.daiStream)):console.error("streamUrl param is missing : https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/html5?service=pod#create_a_simple_video_player_2")}const a=null===(r=n.src)||void 0===r?void 0:r.requestStreamUrl;if(!a)return console.error("requestStreamUrl param is missing : https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/html5?service=pod#vod-pod-serving_1");try{n.daiStream=await a(e.ssai.streamManager,i),e.ssai.streamManager.loadStreamMetadata(),e.setSrc(n.daiStream)}catch(t){z(e)}}(e,s);case google.ima.dai.api.StreamEvent.Type.RESUMED:return D("ad-resumed",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.PAUSED:return D("ad-paused",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.COMPLETE:return D("ad-completed",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.SKIPPED:return D("ad-skipped",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.LOADED:return function(e,t){const s=t.getStreamData().url,r=e.ssai.provider;if(!s||r.isPod&&!r.isVod)return;r.daiStream=s,e.setSrc(s)}(e,s);case google.ima.dai.api.StreamEvent.Type.STARTED:return e.ssai.provider.currentAd=s.getAd(),D("ad-started",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:return N(e),D("ad-break-started",e,V(e,s));case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:return D(a,e,V(e,s)),x(e),e.ssai.provider.currentAd=void 0;case google.ima.dai.api.StreamEvent.Type.ERROR:return z(e,s);case google.ima.dai.api.StreamEvent.Type.AD_PROGRESS:{const t=V(e,s);return I(e,t.stream_data.adProgressData),D("ad-progress",e,t)}case google.ima.dai.api.StreamEvent.Type.CLICK:(function(e,t){if(!e.paused)e.togglePlay(!1)})(e)}}(e,0,t)},!1),e.on("ID3",({data:e})=>{const t=null==e?void 0:e.cue;if(!t)return;const s={},r=t.value;s[r.key]=r.data,i.onTimedMetadata(s)}),e.on("ssai:hls:metadata",e=>{var t;null===(t=e.detail)||void 0===t||t.samples.forEach(e=>i.processMetadata("ID3",e.data,e.pts))}),e.on("ssai:dash:metadata",e=>{const t=e.detail;if(!t)return;const s=t.event.messageData,r=t.event.calculatedPresentationTime;i.processMetadata("urn:google:dai:2018",s,r)}),i}function V(e,t){return{stream_data:t.getStreamData(),ad:e.ssai.provider.currentAd}}function z(e,t){var s,r;const i=e.ssai.provider;if(null===(s=i.src)||void 0===s?void 0:s.backupStream)return e.setSrc(i.src.backupStream);e.emit("error",{message:(null===(r=null==t?void 0:t.getStreamData())||void 0===r?void 0:r.errorMessage)||"error loading stream"})}const W=d("ads/ima/sdk");var G;async function H(e,t){var s;const r=null===(s=null===window||void 0===window?void 0:window.google)||void 0===s?void 0:s.ima;if(t?null==r?void 0:r.dai:r)return void W(":noop");const i=t?"https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js":e._storage.getItem("ima/debug")?"https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"https://imasdk.googleapis.com/js/sdkloader/ima3.js";try{return await async function(e){return new Promise((t,s)=>{let r=document.querySelector(`script[src='${e}']`);if(r)return K(r,t,s);r=document.createElement("script"),r.setAttribute("state",G.LOADING),K(r,t,s),r.src=e,document.head.appendChild(r)})}(i),void W(":loaded")}catch(e){W(":error "+e.message,e)}}function K(e,t,s){const r=e.getAttribute("state");if(r&&[G.ERROR,G.LOADED].includes(r))return t(void 0);e.addEventListener("load",()=>{e.setAttribute("state",G.LOADED),t(void 0)},{once:!0}),["error","abort"].forEach(t=>{e.addEventListener(t,()=>{e.setAttribute("state",G.ERROR),s("script failed to load")},{once:!0})})}!function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(G||(G={}));const $=window.YospaceAdManagement||{AnalyticEventObserver:null};class EventObserver extends $.AnalyticEventObserver{constructor(e){super(),this.video=e}onAdvertBreakStart(e){const t=e.getDuration();if(!e.isActive()&&t){const e=s(this.video);r(this.video,e+t/1e3)}N(this.video,e.getStart()),D("ad-break-started",this.video)}onAdvertBreakEnd(){x(this.video),D(a,this.video)}onAdvertStart(e){}onAdvertEnd(){}onTrackingEvent(e){}}function Z(e,t){YospaceAdManagement.SessionVOD.create(e,t.ssai.properties,e=>{const r=e.getPayload();if(r.getSessionResult()===YospaceAdManagement.SessionResult.INITIALISED){t.ssai.session=r;const e=new EventObserver(t);r.addAnalyticObserver(e),t.setSrc({src:r.getPlaybackUrl()}),setInterval(()=>{const e=1e3*s(t);r.onPlayheadUpdate(e),function(e,t,s){const r=e.getCurrentAdBreak();if(!r)return;const i={currentTime:s-r.getStart(),duration:r.getDuration()};I(t,i),D("ad-progress",t,{stream_data:i})}(r,t,e)},250)}else console.warn("YoSpace Failed to initialise session. ResultCode = "+r.getResultCode())})}var X=Object.freeze({__proto__:null,exists:function(){return!!window.YospaceAdManagement},init:function(e,t){t.ssai&&(!function(e){Object.defineProperty(e,"currentTime",{get:function(){if(e.ssai){const t=e.ssai.state.adProgress;return t?t.currentTime:e.ssai.provider.getContentCurrentTime(e)}return s(e)},set:function(t){var s;if(e.ssai){if(e.ssai.state.adProgress)return;return null===(s=e.ssai.provider)||void 0===s?void 0:s.setContentCurrentTime(e,t)}}}),Object.defineProperty(e,"duration",{get:function(){if(e.ssai){const t=e.ssai.state.adProgress;return t?t.duration:e.ssai.provider.getContentDuration(e)}return n(e)},set:function(){}})}(t),Object.assign(t.ssai,function(){const e=new YospaceAdManagement.SessionProperties;return e.setUserAgent(navigator.userAgent),{properties:e}}()))},srcIsValid:function(e){return"yospace"==e.type},onload:function(e,t){t&&t.src&&Z(t.src,e)},getContentCurrentTime:function(e){const t=s(e),r=e.ssai.session;return r?r.getContentPositionForPlayhead(1e3*t)/1e3:t},setContentCurrentTime:function(e,t){const s=e.ssai.session;return r(e,s?s.getPlayheadForContentPosition(1e3*t)/1e3:t)},onNewSrc:function(e){},getContentDuration:function(e){const t=e.ssai.session,s=n(e);return t?t.getContentPositionForPlayhead(t.getDuration())/1e3:s},getAdType:function(){},getPreviousActiveAdStart:function(e,t){const s=e.ssai.session;if(!s)return;const r=s.getAdBreaks();let i;const n=1e3*t;return r.forEach(e=>{void 0===i&&e.getStart()<n&&e.isActive()&&(i=e)}),void 0!==i?i.getStart()/1e3:void 0}});const Y=(e,t)=>new(((e,t)=>{const s=e.get(t);if(!s)throw new Error(`no flowplayer component with the name ${t} exists`);const r=window.customElements.get(t);if(!r)throw new Error(`no default flowplayer component with the name ${t} exists`);const i=window.customElements.get(s);return"function"!=typeof i?r:i})(e._customElements,t))(e),J=(e,t,s)=>{window.customElements.get(t)||window.customElements.define(t,s),e.customElements.get(t)||e.customElements.set(t,t)};class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class SSAIAdUi extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-ui",this.append(...this.player.createComponents("flowplayer-ssai-indicator","flowplayer-ssai-timeline","flowplayer-ssai-controls"))}}class SSAITimeline extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-timeline";const t=document.createElement("div");t.className="fp-ssai-progress",this.append(t),this.player.on(a,()=>{t.classList.remove("go"),"--ssai-percent-complete --ssai-percent-previous".split(" ").forEach(e=>this.style.setProperty(e,"0"))}),this.player.on("ad-progress",e=>{var s,r,i;const n=null===(i=null===(r=null===(s=e.detail)||void 0===s?void 0:s.data)||void 0===r?void 0:r.stream_data)||void 0===i?void 0:i.adProgressData;if(!n)return;const a=n.currentTime/n.duration*100,o=t.style.getPropertyValue("--ssai-percent-complete");t.classList.remove("go"),t.style.setProperty("--ssai-percent-previous",o),t.style.setProperty("--ssai-percent-complete",a.toFixed(3)),t.classList.add("go")})}}function ee(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}class SSAIControls extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-controls",this.createLeftZone(),this.createRightZone()}createRightZone(){const e=document.createElement("div");e.className="fp-ssai-right-zone",e.append(...this.player.createComponents("flowplayer-volume-control"),...this.fsIcons()),this.append(e)}createLeftZone(){const e=document.createElement("div");e.className="fp-ssai-left-zone",e.append(...this.player.createComponents("flowplayer-control-buttons"),this.remainingTimeComponent()),this.append(e)}fsIcons(){return this.player.createComponents("flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon").map(e=>(e.onclick=()=>this.player.toggleFullScreen(),e))}remainingTimeComponent(){const e=document.createElement("div");return e.className="fp-ssai-remaining",this.player.on("ad-progress",t=>{var s,r;const i=null===(r=null===(s=t.detail.data)||void 0===s?void 0:s.stream_data)||void 0===r?void 0:r.adProgressData;i&&(e.textContent=function(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const s=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,s>=1?(r-=60*s,t+s+":"+ee(r)+":"+ee(e)):t+ee(r)+":"+ee(e)}(i.duration-i.currentTime))}),e}}class SSAIAdIndicator extends FlowplayerComponent{constructor(e){super(e),this.className="fp-ssai-indicator",this.player.on("ad-started",e=>{var t,s,r;const i=null===(r=null===(s=null===(t=e.detail)||void 0===t?void 0:t.data)||void 0===s?void 0:s.ad)||void 0===r?void 0:r.getAdPodInfo();i&&(this.textContent=`${this.player.i18n("ads.indicator","ADS")} ${i.getAdPosition()} / ${i.getTotalAds()}`)})}}var te;const se=[X,new class Dai{async init(e,t){var s,r;if(t.ssai)return this.make_analytics(t),await H(t,!0),(null===(r=null===(s=window.google)||void 0===s?void 0:s.ima)||void 0===r?void 0:r.dai)?void 0:console.warn("google.ima.dai unavailable")}async onload(e,t){var s,r,i;if(await H(e,!0),null===(r=null===(s=window.google)||void 0===s?void 0:s.ima)||void 0===r?void 0:r.dai){if((null===(i=e.ssai)||void 0===i?void 0:i.streamManager)||(e.ssai.streamManager=j(e)),this.src=t,this.isPod=!!t.customAssetKey||!!t.requestStreamUrl,this.isVod=!!t.contentSourceId||!!t.videoId||!!t.requestStreamUrl,this.isPod)return this.requestPodStream(e.ssai.streamManager,t);this.requestStream(e.ssai.streamManager,t)}else t.backupStream&&e.setSrc(t.backupStream)}onNewSrc(e,t){var s;t.src!==this.daiStream&&(null===(s=e.ssai.streamManager)||void 0===s||s.reset())}make_analytics(e){const t=Analytics.of(e,{required_keys:R,events:T,optional_keys:P});e.on("config",()=>{var s;return Analytics.mergeMetadata(t,null===(s=e.opts)||void 0===s?void 0:s.metadata)})}exists(){return!0}getAdType(){if(this.currentAd)switch(this.currentAd.getAdPodInfo().getPodIndex()){case 0:return B.Preroll;case-1:return B.Postroll;case-2:return;default:return B.Midroll}}getContentCurrentTime(e){const t=e.ssai.streamManager,s=e.currentTime;return t?t.contentTimeForStreamTime(s):s}setContentCurrentTime(e,t){}getContentDuration(e){const t=e.ssai.streamManager,s=e.duration;return t?t.contentTimeForStreamTime(s):s}getPreviousActiveAdStart(e,t){var s,r;const i=null===(r=null===(s=e.ssai)||void 0===s?void 0:s.streamManager)||void 0===r?void 0:r.previousCuePointForStreamTime(t);if(i&&!i.played)return i.start}srcIsValid(e){return"google/dai"==e.type}requestStream(e,t){const s=this.isVod?new google.ima.dai.api.VODStreamRequest:new google.ima.dai.api.LiveStreamRequest;e.requestStream(Object.assign(s,t))}requestPodStream(e,t){const s=this.isVod?new google.ima.dai.api.PodVodStreamRequest:new google.ima.dai.api.PodStreamRequest;e.requestStream(Object.assign(s,t))}buildPodStreamURL(e,t){return e.replace("[[STREAMID]]",t)}}],re=((te=class Ssai{constructor(e){this.umd=e,J(e,"flowplayer-ssai-ui",SSAIAdUi),J(e,"flowplayer-ssai-timeline",SSAITimeline),J(e,"flowplayer-ssai-controls",SSAIControls),J(e,"flowplayer-ssai-indicator",SSAIAdIndicator)}init(e,t,i){se.forEach(e=>{if(i.ssai||!e.exists())return;const n=Y(i,"flowplayer-ssai-ui");t.append(n),i.ssai={provider:e,ui:n,state:{snapback:!1}},e.init(t,i),i.on("seeked",()=>function(e){if(e.opt("live"))return;if(!e.ssai)return;const{provider:t,state:i}=e.ssai;if(i.snapback)return i.snapback=!1;const n=s(e),a=t.getPreviousActiveAdStart(e,n);void 0!==a&&(i.snapback=!0,i.snapbackTime=n,r(e,a))}(i)),i.on("src",t=>{i.setState("ssai-ad-active",!1),i.ssai&&(i.ssai.state={snapback:!1},e.onNewSrc(i,t.detail))})})}onload(e,t,s,r){var i;(null===(i=s.ssai)||void 0===i?void 0:i.provider)&&s.ssai.provider.onload(s,r)}wants(e,t,s){let r=!1;return se.forEach(e=>{if(!r&&e.exists()&&e.srcIsValid(t))return r=!0}),r}}).events=o,te);return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const s=e.flowplayer;return"function"==typeof s?(s(t),t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t),t)}(window,re)}));
|
package/plugins/subtitles.d.ts
CHANGED
|
@@ -158,6 +158,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
158
158
|
*/
|
|
159
159
|
declare type ContextMenuEventDetail = null;
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* @public
|
|
163
|
+
* @deprecated
|
|
164
|
+
* when a cuepoint becomes inactive
|
|
165
|
+
*/
|
|
166
|
+
declare const /**
|
|
167
|
+
@public
|
|
168
|
+
* when a new player is inserted into the HTML
|
|
169
|
+
*/ /**
|
|
170
|
+
* @public
|
|
171
|
+
* @deprecated
|
|
172
|
+
* when a cuepoint becomes inactive
|
|
173
|
+
*/
|
|
174
|
+
CUEPOINT_END = "cuepointend";
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @public
|
|
178
|
+
* @deprecated
|
|
179
|
+
* when a cuepoint is active
|
|
180
|
+
*/
|
|
181
|
+
declare const /**
|
|
182
|
+
@public
|
|
183
|
+
* when a new player is inserted into the HTML
|
|
184
|
+
*/ /**
|
|
185
|
+
* @public
|
|
186
|
+
* @deprecated
|
|
187
|
+
* when a cuepoint is active
|
|
188
|
+
*/
|
|
189
|
+
CUEPOINT_START = "cuepointstart";
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @public
|
|
193
|
+
* @deprecated
|
|
194
|
+
* cuepoints parsing is asynchronous
|
|
195
|
+
* you cannot rely on them existing until
|
|
196
|
+
* this event is emitted
|
|
197
|
+
*/
|
|
198
|
+
declare const /**
|
|
199
|
+
@public
|
|
200
|
+
* when a new player is inserted into the HTML
|
|
201
|
+
*/ /**
|
|
202
|
+
* @public
|
|
203
|
+
* @deprecated
|
|
204
|
+
* cuepoints parsing is asynchronous
|
|
205
|
+
* you cannot rely on them existing until
|
|
206
|
+
* this event is emitted
|
|
207
|
+
*/
|
|
208
|
+
CUEPOINTS = "cuepoints";
|
|
209
|
+
|
|
161
210
|
/* Excluded from this release type: CUES_PARSED */
|
|
162
211
|
|
|
163
212
|
/**
|
|
@@ -344,7 +393,10 @@ declare namespace events {
|
|
|
344
393
|
PORTRAIT,
|
|
345
394
|
DVR,
|
|
346
395
|
LIVE,
|
|
347
|
-
RECOVER
|
|
396
|
+
RECOVER,
|
|
397
|
+
CUEPOINTS,
|
|
398
|
+
CUEPOINT_START,
|
|
399
|
+
CUEPOINT_END
|
|
348
400
|
}
|
|
349
401
|
}
|
|
350
402
|
|
package/plugins/thumbnails.d.ts
CHANGED
|
@@ -157,6 +157,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
157
157
|
*/
|
|
158
158
|
declare type ContextMenuEventDetail = null;
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @public
|
|
162
|
+
* @deprecated
|
|
163
|
+
* when a cuepoint becomes inactive
|
|
164
|
+
*/
|
|
165
|
+
declare const /**
|
|
166
|
+
@public
|
|
167
|
+
* when a new player is inserted into the HTML
|
|
168
|
+
*/ /**
|
|
169
|
+
* @public
|
|
170
|
+
* @deprecated
|
|
171
|
+
* when a cuepoint becomes inactive
|
|
172
|
+
*/
|
|
173
|
+
CUEPOINT_END = "cuepointend";
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @public
|
|
177
|
+
* @deprecated
|
|
178
|
+
* when a cuepoint is active
|
|
179
|
+
*/
|
|
180
|
+
declare const /**
|
|
181
|
+
@public
|
|
182
|
+
* when a new player is inserted into the HTML
|
|
183
|
+
*/ /**
|
|
184
|
+
* @public
|
|
185
|
+
* @deprecated
|
|
186
|
+
* when a cuepoint is active
|
|
187
|
+
*/
|
|
188
|
+
CUEPOINT_START = "cuepointstart";
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
* @deprecated
|
|
193
|
+
* cuepoints parsing is asynchronous
|
|
194
|
+
* you cannot rely on them existing until
|
|
195
|
+
* this event is emitted
|
|
196
|
+
*/
|
|
197
|
+
declare const /**
|
|
198
|
+
@public
|
|
199
|
+
* when a new player is inserted into the HTML
|
|
200
|
+
*/ /**
|
|
201
|
+
* @public
|
|
202
|
+
* @deprecated
|
|
203
|
+
* cuepoints parsing is asynchronous
|
|
204
|
+
* you cannot rely on them existing until
|
|
205
|
+
* this event is emitted
|
|
206
|
+
*/
|
|
207
|
+
CUEPOINTS = "cuepoints";
|
|
208
|
+
|
|
160
209
|
/**
|
|
161
210
|
* @public
|
|
162
211
|
*/
|
|
@@ -341,7 +390,10 @@ declare namespace events {
|
|
|
341
390
|
PORTRAIT,
|
|
342
391
|
DVR,
|
|
343
392
|
LIVE,
|
|
344
|
-
RECOVER
|
|
393
|
+
RECOVER,
|
|
394
|
+
CUEPOINTS,
|
|
395
|
+
CUEPOINT_START,
|
|
396
|
+
CUEPOINT_END
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
399
|
|
package/plugins/tizen.d.ts
CHANGED
|
@@ -157,6 +157,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
157
157
|
*/
|
|
158
158
|
declare type ContextMenuEventDetail = null;
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @public
|
|
162
|
+
* @deprecated
|
|
163
|
+
* when a cuepoint becomes inactive
|
|
164
|
+
*/
|
|
165
|
+
declare const /**
|
|
166
|
+
@public
|
|
167
|
+
* when a new player is inserted into the HTML
|
|
168
|
+
*/ /**
|
|
169
|
+
* @public
|
|
170
|
+
* @deprecated
|
|
171
|
+
* when a cuepoint becomes inactive
|
|
172
|
+
*/
|
|
173
|
+
CUEPOINT_END = "cuepointend";
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @public
|
|
177
|
+
* @deprecated
|
|
178
|
+
* when a cuepoint is active
|
|
179
|
+
*/
|
|
180
|
+
declare const /**
|
|
181
|
+
@public
|
|
182
|
+
* when a new player is inserted into the HTML
|
|
183
|
+
*/ /**
|
|
184
|
+
* @public
|
|
185
|
+
* @deprecated
|
|
186
|
+
* when a cuepoint is active
|
|
187
|
+
*/
|
|
188
|
+
CUEPOINT_START = "cuepointstart";
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
* @deprecated
|
|
193
|
+
* cuepoints parsing is asynchronous
|
|
194
|
+
* you cannot rely on them existing until
|
|
195
|
+
* this event is emitted
|
|
196
|
+
*/
|
|
197
|
+
declare const /**
|
|
198
|
+
@public
|
|
199
|
+
* when a new player is inserted into the HTML
|
|
200
|
+
*/ /**
|
|
201
|
+
* @public
|
|
202
|
+
* @deprecated
|
|
203
|
+
* cuepoints parsing is asynchronous
|
|
204
|
+
* you cannot rely on them existing until
|
|
205
|
+
* this event is emitted
|
|
206
|
+
*/
|
|
207
|
+
CUEPOINTS = "cuepoints";
|
|
208
|
+
|
|
160
209
|
/**
|
|
161
210
|
* @public
|
|
162
211
|
*/
|
|
@@ -341,7 +390,10 @@ declare namespace events {
|
|
|
341
390
|
PORTRAIT,
|
|
342
391
|
DVR,
|
|
343
392
|
LIVE,
|
|
344
|
-
RECOVER
|
|
393
|
+
RECOVER,
|
|
394
|
+
CUEPOINTS,
|
|
395
|
+
CUEPOINT_START,
|
|
396
|
+
CUEPOINT_END
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
399
|
|
package/plugins/vtsel.d.ts
CHANGED
|
@@ -158,6 +158,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
158
158
|
*/
|
|
159
159
|
declare type ContextMenuEventDetail = null;
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* @public
|
|
163
|
+
* @deprecated
|
|
164
|
+
* when a cuepoint becomes inactive
|
|
165
|
+
*/
|
|
166
|
+
declare const /**
|
|
167
|
+
@public
|
|
168
|
+
* when a new player is inserted into the HTML
|
|
169
|
+
*/ /**
|
|
170
|
+
* @public
|
|
171
|
+
* @deprecated
|
|
172
|
+
* when a cuepoint becomes inactive
|
|
173
|
+
*/
|
|
174
|
+
CUEPOINT_END = "cuepointend";
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @public
|
|
178
|
+
* @deprecated
|
|
179
|
+
* when a cuepoint is active
|
|
180
|
+
*/
|
|
181
|
+
declare const /**
|
|
182
|
+
@public
|
|
183
|
+
* when a new player is inserted into the HTML
|
|
184
|
+
*/ /**
|
|
185
|
+
* @public
|
|
186
|
+
* @deprecated
|
|
187
|
+
* when a cuepoint is active
|
|
188
|
+
*/
|
|
189
|
+
CUEPOINT_START = "cuepointstart";
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @public
|
|
193
|
+
* @deprecated
|
|
194
|
+
* cuepoints parsing is asynchronous
|
|
195
|
+
* you cannot rely on them existing until
|
|
196
|
+
* this event is emitted
|
|
197
|
+
*/
|
|
198
|
+
declare const /**
|
|
199
|
+
@public
|
|
200
|
+
* when a new player is inserted into the HTML
|
|
201
|
+
*/ /**
|
|
202
|
+
* @public
|
|
203
|
+
* @deprecated
|
|
204
|
+
* cuepoints parsing is asynchronous
|
|
205
|
+
* you cannot rely on them existing until
|
|
206
|
+
* this event is emitted
|
|
207
|
+
*/
|
|
208
|
+
CUEPOINTS = "cuepoints";
|
|
209
|
+
|
|
161
210
|
/**
|
|
162
211
|
* @public
|
|
163
212
|
*/
|
|
@@ -342,7 +391,10 @@ declare namespace events {
|
|
|
342
391
|
PORTRAIT,
|
|
343
392
|
DVR,
|
|
344
393
|
LIVE,
|
|
345
|
-
RECOVER
|
|
394
|
+
RECOVER,
|
|
395
|
+
CUEPOINTS,
|
|
396
|
+
CUEPOINT_START,
|
|
397
|
+
CUEPOINT_END
|
|
346
398
|
}
|
|
347
399
|
}
|
|
348
400
|
|
package/plugins/webos.d.ts
CHANGED
|
@@ -157,6 +157,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
157
157
|
*/
|
|
158
158
|
declare type ContextMenuEventDetail = null;
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @public
|
|
162
|
+
* @deprecated
|
|
163
|
+
* when a cuepoint becomes inactive
|
|
164
|
+
*/
|
|
165
|
+
declare const /**
|
|
166
|
+
@public
|
|
167
|
+
* when a new player is inserted into the HTML
|
|
168
|
+
*/ /**
|
|
169
|
+
* @public
|
|
170
|
+
* @deprecated
|
|
171
|
+
* when a cuepoint becomes inactive
|
|
172
|
+
*/
|
|
173
|
+
CUEPOINT_END = "cuepointend";
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @public
|
|
177
|
+
* @deprecated
|
|
178
|
+
* when a cuepoint is active
|
|
179
|
+
*/
|
|
180
|
+
declare const /**
|
|
181
|
+
@public
|
|
182
|
+
* when a new player is inserted into the HTML
|
|
183
|
+
*/ /**
|
|
184
|
+
* @public
|
|
185
|
+
* @deprecated
|
|
186
|
+
* when a cuepoint is active
|
|
187
|
+
*/
|
|
188
|
+
CUEPOINT_START = "cuepointstart";
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
* @deprecated
|
|
193
|
+
* cuepoints parsing is asynchronous
|
|
194
|
+
* you cannot rely on them existing until
|
|
195
|
+
* this event is emitted
|
|
196
|
+
*/
|
|
197
|
+
declare const /**
|
|
198
|
+
@public
|
|
199
|
+
* when a new player is inserted into the HTML
|
|
200
|
+
*/ /**
|
|
201
|
+
* @public
|
|
202
|
+
* @deprecated
|
|
203
|
+
* cuepoints parsing is asynchronous
|
|
204
|
+
* you cannot rely on them existing until
|
|
205
|
+
* this event is emitted
|
|
206
|
+
*/
|
|
207
|
+
CUEPOINTS = "cuepoints";
|
|
208
|
+
|
|
160
209
|
/**
|
|
161
210
|
* @public
|
|
162
211
|
*/
|
|
@@ -341,7 +390,10 @@ declare namespace events {
|
|
|
341
390
|
PORTRAIT,
|
|
342
391
|
DVR,
|
|
343
392
|
LIVE,
|
|
344
|
-
RECOVER
|
|
393
|
+
RECOVER,
|
|
394
|
+
CUEPOINTS,
|
|
395
|
+
CUEPOINT_START,
|
|
396
|
+
CUEPOINT_END
|
|
345
397
|
}
|
|
346
398
|
}
|
|
347
399
|
|
package/util/loader.d.ts
CHANGED
|
@@ -157,6 +157,55 @@ CONTEXT_MENU = "contextmenu";
|
|
|
157
157
|
*/
|
|
158
158
|
declare type ContextMenuEventDetail = null;
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* @public
|
|
162
|
+
* @deprecated
|
|
163
|
+
* when a cuepoint becomes inactive
|
|
164
|
+
*/
|
|
165
|
+
declare const /**
|
|
166
|
+
@public
|
|
167
|
+
* when a new player is inserted into the HTML
|
|
168
|
+
*/ /**
|
|
169
|
+
* @public
|
|
170
|
+
* @deprecated
|
|
171
|
+
* when a cuepoint becomes inactive
|
|
172
|
+
*/
|
|
173
|
+
CUEPOINT_END = "cuepointend";
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @public
|
|
177
|
+
* @deprecated
|
|
178
|
+
* when a cuepoint is active
|
|
179
|
+
*/
|
|
180
|
+
declare const /**
|
|
181
|
+
@public
|
|
182
|
+
* when a new player is inserted into the HTML
|
|
183
|
+
*/ /**
|
|
184
|
+
* @public
|
|
185
|
+
* @deprecated
|
|
186
|
+
* when a cuepoint is active
|
|
187
|
+
*/
|
|
188
|
+
CUEPOINT_START = "cuepointstart";
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
* @deprecated
|
|
193
|
+
* cuepoints parsing is asynchronous
|
|
194
|
+
* you cannot rely on them existing until
|
|
195
|
+
* this event is emitted
|
|
196
|
+
*/
|
|
197
|
+
declare const /**
|
|
198
|
+
@public
|
|
199
|
+
* when a new player is inserted into the HTML
|
|
200
|
+
*/ /**
|
|
201
|
+
* @public
|
|
202
|
+
* @deprecated
|
|
203
|
+
* cuepoints parsing is asynchronous
|
|
204
|
+
* you cannot rely on them existing until
|
|
205
|
+
* this event is emitted
|
|
206
|
+
*/
|
|
207
|
+
CUEPOINTS = "cuepoints";
|
|
208
|
+
|
|
160
209
|
/**
|
|
161
210
|
* @public
|
|
162
211
|
*/
|
|
@@ -349,7 +398,10 @@ declare namespace events {
|
|
|
349
398
|
PORTRAIT,
|
|
350
399
|
DVR,
|
|
351
400
|
LIVE,
|
|
352
|
-
RECOVER
|
|
401
|
+
RECOVER,
|
|
402
|
+
CUEPOINTS,
|
|
403
|
+
CUEPOINT_START,
|
|
404
|
+
CUEPOINT_END
|
|
353
405
|
}
|
|
354
406
|
}
|
|
355
407
|
|