bitmovin-player 8.280.0 → 8.281.0
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/bitmovinplayer-serviceworker.js +2 -2
- package/bitmovinplayer-serviceworker.prod.js +2 -2
- package/bitmovinplayer-ui.js +1 -1
- package/bitmovinplayer.js +2 -2
- package/bitmovinplayer.prod.js +2 -2
- package/modules/bitmovinplayer-abr.js +2 -2
- package/modules/bitmovinplayer-abr.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-core.js +2 -2
- package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
- package/modules/bitmovinplayer-analytics.js +2 -2
- package/modules/bitmovinplayer-analytics.prod.js +2 -2
- package/modules/bitmovinplayer-container-mp4.js +2 -2
- package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
- package/modules/bitmovinplayer-container-ts.js +2 -2
- package/modules/bitmovinplayer-container-ts.prod.js +2 -2
- package/modules/bitmovinplayer-container-webm.js +2 -2
- package/modules/bitmovinplayer-container-webm.prod.js +2 -2
- package/modules/bitmovinplayer-core.js +2 -2
- package/modules/bitmovinplayer-core.prod.js +2 -2
- package/modules/bitmovinplayer-crypto.js +2 -2
- package/modules/bitmovinplayer-crypto.prod.js +2 -2
- package/modules/bitmovinplayer-dash.js +2 -2
- package/modules/bitmovinplayer-dash.prod.js +2 -2
- package/modules/bitmovinplayer-drm.js +2 -2
- package/modules/bitmovinplayer-drm.prod.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-engine-native.js +2 -2
- package/modules/bitmovinplayer-engine-native.prod.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
- package/modules/bitmovinplayer-envivio.js +1 -1
- package/modules/bitmovinplayer-envivio.prod.js +1 -1
- package/modules/bitmovinplayer-hls.js +2 -2
- package/modules/bitmovinplayer-hls.prod.js +2 -2
- package/modules/bitmovinplayer-lowlatency.js +2 -2
- package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
- package/modules/bitmovinplayer-mserenderer.js +2 -2
- package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
- package/modules/bitmovinplayer-patch.js +1 -1
- package/modules/bitmovinplayer-patch.prod.js +1 -1
- package/modules/bitmovinplayer-playstation4.js +2 -2
- package/modules/bitmovinplayer-playstation4.prod.js +2 -2
- package/modules/bitmovinplayer-playstation5.js +2 -2
- package/modules/bitmovinplayer-playstation5.prod.js +2 -2
- package/modules/bitmovinplayer-polyfill.js +1 -1
- package/modules/bitmovinplayer-polyfill.prod.js +1 -1
- package/modules/bitmovinplayer-reactnative.js +1 -1
- package/modules/bitmovinplayer-reactnative.prod.js +1 -1
- package/modules/bitmovinplayer-remotecontrol.js +2 -2
- package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker.js +2 -2
- package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
- package/modules/bitmovinplayer-sgai.js +2 -2
- package/modules/bitmovinplayer-sgai.prod.js +2 -2
- package/modules/bitmovinplayer-smooth.js +2 -2
- package/modules/bitmovinplayer-smooth.prod.js +2 -2
- package/modules/bitmovinplayer-style.js +2 -2
- package/modules/bitmovinplayer-style.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles.js +2 -2
- package/modules/bitmovinplayer-subtitles.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail.js +2 -2
- package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
- package/modules/bitmovinplayer-tizen.js +2 -2
- package/modules/bitmovinplayer-tizen.prod.js +2 -2
- package/modules/bitmovinplayer-ui.js +2 -2
- package/modules/bitmovinplayer-ui.prod.js +2 -2
- package/modules/bitmovinplayer-vidaa.js +2 -2
- package/modules/bitmovinplayer-vidaa.prod.js +2 -2
- package/modules/bitmovinplayer-vr.js +2 -2
- package/modules/bitmovinplayer-vr.prod.js +2 -2
- package/modules/bitmovinplayer-webos.js +2 -2
- package/modules/bitmovinplayer-webos.prod.js +2 -2
- package/modules/bitmovinplayer-wpe.js +2 -2
- package/modules/bitmovinplayer-wpe.prod.js +2 -2
- package/modules/bitmovinplayer-xml.js +1 -1
- package/modules/bitmovinplayer-xml.prod.js +1 -1
- package/package.json +1 -1
- package/types/advertising/API.d.ts +9 -0
- package/types/advertising/ConfigAPI.d.ts +6 -5
- package/types/core/BufferSettings.d.ts +58 -0
- package/types/core/LogLevels.d.ts +54 -0
- package/types/core/Logger.d.ts +51 -0
- package/types/core/Settings.d.ts +856 -0
- package/types/core/network/ManifestMimeType.d.ts +5 -0
- package/types/core/util/MimeTypeHelper.d.ts +52 -0
- package/types/sgai/SgaiConfigAPI.d.ts +1 -1
- package/types/sgai/SgaiErrorCode.d.ts +6 -1
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.remotecontrol=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.remotecontrol=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[140],{71223:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameSource=r;var n=o(58313);function r(e,t){return!e&&!t||!(!e||!t)&&(e.dash?i(e.dash,t.dash,t):e.hls?i(e.hls,t.hls,t):!!e.progressive&&!Array.isArray(t.progressive)&&i(e.progressive,t.progressive,t))}function i(e,t,o){try{return r(JSON.parse(e),o)}catch(e){}return!!t&&n.URLHelper.toFullUrl(t)===n.URLHelper.toFullUrl(e)}},68657:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastReceiverVersion=void 0,function(e){e.v2="v2",e.v3="v3"}(o||(t.GoogleCastReceiverVersion=o={}))},32645:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlBase=void 0,t.mediaInfoToSourceConfig=c;var r=o(3714),i=o(20213),a=o(85625),s=o(94685),l=o(60768),u=function(e){function t(t,o){var n=e.call(this,t)||this;n.rN=function(e,t){n.context.logger.debug("addReceiverActionListener",e),n.isConnected()||n.onConnect(e.friendlyName)},n.sN=function(e){switch(n.context.logger.debug("CAST_STATE_CHANGED",e),e.castState){case cast.framework.CastState.NO_DEVICES_AVAILABLE:n.onReady(!1);break;case cast.framework.CastState.NOT_CONNECTED:n.onReady(!0);case cast.framework.CastState.CONNECTING:case cast.framework.CastState.CONNECTED:}},n.tN=function(e){switch(n.context.logger.debug("SESSION_STATE_CHANGED",e),e.sessionState){case cast.framework.SessionState.NO_SESSION:case cast.framework.SessionState.SESSION_STARTING:break;case cast.framework.SessionState.SESSION_STARTED:n.onConnected(e.session.getCastDevice().friendlyName,!1);break;case cast.framework.SessionState.SESSION_START_FAILED:n.context.logger.debug("SESSION_START_FAILED",e.errorCode),e.errorCode!==chrome.cast.ErrorCode.CANCEL&&n.onError();break;case cast.framework.SessionState.SESSION_ENDING:break;case cast.framework.SessionState.SESSION_ENDED:n.onDisconnected();break;case cast.framework.SessionState.SESSION_RESUMED:n.onConnected(e.session.getCastDevice().friendlyName,!0),n.remotePlayer.isPaused||(n.qN(),n.onRemotePlayerEvent({event:r.PlayerEvent.Play}))}},n.uN=function(e){n.mediaInfoChangedEventHandler(e)},n.vN=function(e){switch(n.context.logger.debug("PLAYER_STATE_CHANGED",e),e.value){case chrome.cast.media.PlayerState.PAUSED:n.onRemotePlayerEvent({event:r.PlayerEvent.Paused});break;case chrome.cast.media.PlayerState.PLAYING:n.onRemotePlayerEvent({event:r.PlayerEvent.Playing})}},n.wN=function(){n.context.logger.debug("IS_PAUSED_CHANGED",n.remotePlayer.isPaused),n.remotePlayer.isPaused||n.onRemotePlayerEvent({event:r.PlayerEvent.Play})},n.xN=function(){n.context.logger.debug("CURRENT_TIME_CHANGED",n.remotePlayer.currentTime),n.onRemotePlayerEvent({event:r.PlayerEvent.TimeChanged})},n.yN=function(){n.context.logger.debug("VOLUME_LEVEL_CHANGED",n.remotePlayer.volumeLevel),n.onRemotePlayerEvent({event:r.PlayerEvent.VolumeChanged})},n.zN=function(){n.context.logger.debug("IS_MUTED_CHANGED",n.remotePlayer.isMuted),n.onRemotePlayerEvent({event:n.remotePlayer.isMuted?r.PlayerEvent.Muted:r.PlayerEvent.Unmuted})},n.KO=function(e){n.context.logger.debug("IS_CONNECTED_CHANGED",e),n.remotePlayer.isConnected?n.context.logger.debug("remotePlayer connected"):n.context.logger.debug("remotePlayer not connected")},n.LO=function(){n.remotePlayer.isPaused||(n.context.logger.debug('Switching receiver state to "paused"'),n.remotePlayerController.playOrPause())},n.config=o,n.pN=void 0;var i=function(e){if(t.logger.debug("__onGCastApiAvailable "+e),e)try{n.initializeCast()}catch(e){t.logger.debug("Cast initialization failed",e)}n.pN&&n.pN(e)};return window.chrome&&window.chrome.cast&&window.cast&&window.cast.framework?setTimeout(function(){return i(!0)},1e3):(n.pN=window.__onGCastApiAvailable,window.__onGCastApiAvailable=i),n}return n(t,e),t.prototype.qN=function(){var e,t,o=this;null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t||t.getStatus(void 0,function(){(0,s.isContextAvailable)(o.context)&&o.context.logger.debug("State updated from Receiver")},function(e){(0,s.isContextAvailable)(o.context)&&o.context.logger.debug("State update from receiver failed:",e)})},t.prototype.initializeCast=function(){var e;cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:this.config.receiverApplicationId,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,resumeSavedSession:null!==(e=this.config.rejoinActiveSession)&&void 0!==e&&e}),this.remotePlayer=new cast.framework.RemotePlayer,this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.KO),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.vN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.wN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.xN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.yN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.zN),cast.framework.CastContext.getInstance().getCastState()!==cast.framework.CastState.NO_DEVICES_AVAILABLE?this.onReady(!0):cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.sN),cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.tN),chrome.cast.addReceiverActionListener(this.rN);var t=cast.framework.CastContext.getInstance().getCurrentSession();t&&this.onConnected(t.getCastDevice().friendlyName,!0)},t.prototype.mediaInfoChangedEventHandler=function(e){var t=this.remotePlayer.mediaInfo;this.mediaInfo=e.value,this.context.logger.debug("MEDIA_INFO_CHANGED",t)},t.prototype.getConfig=function(){return this.config},t.prototype.connect=function(){var e=this;cast.framework.CastContext.getInstance().requestSession().then(function(){return e.context.logger.debug("Session request successful")}).catch(function(t){t===chrome.cast.ErrorCode.CANCEL||(e.context.logger.debug("Session request failed",t),e.onError())})},t.prototype.onConnected=function(t,o){var n=this;this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.castSession.addMessageListener(this.config.messageNamespace,function(e,t){n.context.logger.insane(e,t);try{var o=JSON.parse(t);n.handleRemoteControlReceiverMessage(o)}catch(e){n.context.logger.error("message parsing failed",t)}}),this.context.eventHandler.on(r.PlayerEvent.PlaybackFinished,this.LO),e.prototype.onConnected.call(this,t,o)},t.prototype.sendMessage=function(e,t){void 0===e&&(e=l.RemoteControlMessageType.PlayerApiMethodCall),this.castSession.sendMessage(this.config.messageNamespace,{type:e,data:t})},t.prototype.disconnect=function(){cast.framework.CastContext.getInstance().endCurrentSession(!0),this.onDisconnect()},t.prototype.onDisconnected=function(){e.prototype.onDisconnected.call(this),this.context.eventHandler.off(r.PlayerEvent.PlaybackFinished,this.LO),this.playerState=null},t.prototype.release=function(){window.__onGCastApiAvailable=this.pN||void 0,this.remotePlayerController&&(this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,this.uN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.vN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.zN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.yN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.xN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.wN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.KO),chrome.cast.removeReceiverActionListener(this.rN),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.sN),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.tN))},t.prototype.setSource=function(e,t,o){var n=this;return this.lastSource=e,this.getMediaInfo(e).then(function(e){var r=new chrome.cast.media.LoadRequest(e);return r.autoplay=t||!1,null!=o&&(r.currentTime=o),n.loadMediaRequest(r)})},t.prototype.loadMediaRequest=function(e){var t=this,o=cast.framework.CastContext.getInstance().getCurrentSession().getSessionObj();return new Promise(function(n,r){o.loadMedia(e,function(e){t.context.logger.debug("Load successful",e),t.media=e,t.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,t.uN),n()},function(e){t.context.logger.debug("Load failed with error",e),r(e)})})},t.prototype.getSource=function(){return this.remotePlayer.mediaInfo?c(this.remotePlayer.mediaInfo):null},t.prototype.play=function(){this.remotePlayer.isPaused&&this.remotePlayerController.playOrPause()},t.prototype.isPlaying=function(){return!this.remotePlayer.isPaused},t.prototype.pause=function(){this.remotePlayer.isPaused||this.remotePlayerController.playOrPause()},t.prototype.isPaused=function(){return this.remotePlayer.isPaused},t.prototype.getCurrentTime=function(t){return void 0===t&&(t=i.TimeMode.AbsoluteTime),t===i.TimeMode.RelativeTime?e.prototype.getCurrentTime.call(this,t):this.remotePlayer.currentTime},t.prototype.seek=function(e){this.remotePlayer.currentTime=e,this.remotePlayerController.seek(),this.onRemotePlayerEvent({event:r.PlayerEvent.Seeked})},t.prototype.setVolume=function(e){this.remotePlayer.volumeLevel=e,this.remotePlayerController.setVolumeLevel()},t.prototype.getVolume=function(){return this.remotePlayer.volumeLevel},t.prototype.setMuted=function(e){e!==this.remotePlayer.isMuted&&this.remotePlayerController.muteOrUnmute()},t.prototype.isMuted=function(){return this.remotePlayer.isMuted},t}(o(35317).RemoteControlBase);function c(e){var t=e.contentUrl||e.contentId;switch(e.contentType.toLowerCase()){case a.ManifestMimeType.Dash:return{dash:t};case a.ManifestMimeType.Hls:return{hls:t};case a.ManifestMimeType.Smooth:return{smooth:t};default:return{progressive:t}}}t.GoogleCastRemoteControlBase=u},61348:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV2=void 0;var r=o(58313),i=o(32645),a=o(61567),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.getMediaInfo=function(e){var t=new chrome.cast.media.MediaInfo(a.RemoteJSON.stringify(e),"application/json");if(t.streamType=chrome.cast.media.StreamType.BUFFERED,t.metadata=new chrome.cast.media.GenericMediaMetadata,t.metadata.title=e.title||null,t.metadata.subtitle=e.description||null,e.poster){var o=r.URLHelper.toFullUrl(e.poster);t.metadata.images=[new chrome.cast.Image(o)]}return Promise.resolve(t)},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t}(i.GoogleCastRemoteControlBase);t.GoogleCastRemoteControlV2=s},23747:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),r=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV3=void 0,t.getDrmConfig=function(e){if(e.widevine)return S(e.widevine,i.WIDEVINE);if(e.playready)return S(e.playready,i.PLAYREADY);if(e.clearkey)return S(e.clearkey,i.CLEARKEY);throw new Error("Not supported drm config.")},t.getUrlFromKeys=C,t.sortProgressiveSources=O;var i,a=o(80813),s=o(20213),l=o(85625),u=o(74853),c=o(70233),d=o(58313),p=o(32645),f=o(7209),h=o(2025),m=o(58367),y=o(13748),g=o(15529);!function(e){e.CLEARKEY="clearkey",e.PLAYREADY="playready",e.WIDEVINE="widevine"}(i||(i={}));var v=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n.OO=0,n.RO=!1,n.XO=function(e){var t,o;(null===(t=n.mediaInfo)||void 0===t?void 0:t.duration)>0&&(null===(o=n.mediaInfo)||void 0===o?void 0:o.duration)-n.NO<2&&0===e.value&&(n.MO=!0,n.onRemotePlayerEvent({event:s.PlayerEvent.PlaybackFinished})),n.NO=e.value},n.PO=new y.MediaInfoTrackMapper(t),n.QO=new m.EditTrackInfoProcessor(n.mediaInfo,n.media,n.context.logger),n.SO=new g.MediaInfoWrapper(n.mediaInfo,n.context.logger),n}return n(t,e),t.prototype.initializeCast=function(){e.prototype.initializeCast.call(this),this.WO()},t.prototype.getCurrentTime=function(e){if(void 0===e&&(e=s.TimeMode.AbsoluteTime),!this.remotePlayer)return 0;var t=this.remotePlayer.currentTime;return e===s.TimeMode.RelativeTime?t:this.TO(t)},t.prototype.TO=function(e){return e+this.VO()},t.prototype.UO=function(e){return e-this.VO()},t.prototype.VO=function(){var e,t,o,n=null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t?void 0:t.customData;return null!==(o=null==n?void 0:n.startAbsoluteTime)&&void 0!==o?o:0},t.prototype.WO=function(){var e=this;this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.XO),this.context.eventHandler.on(s.PlayerEvent.PeriodSwitch,function(){new h.GoogleCastV3TrackFinder(e.mediaInfo).hasATrackToLoad()&&e.fO()})},t.prototype.sendMessage=function(e,t){this.config.messageNamespace&&this.castSession.sendMessage(this.config.messageNamespace,{type:"METADATA",data:t})},t.prototype.play=function(){var t=this;this.MO&&this.lastSource?this.setSource(this.lastSource).then(function(){return e.prototype.play.call(t)}):e.prototype.play.call(this),this.MO=!1},t.prototype.YO=function(e){var t=this.bO(e),o=t.url,n=t.mimeType,r=new chrome.cast.media.MediaInfo(o,n);return r.customData=(0,f.getCustomData)(e,n),r},t.prototype.getMediaInfo=function(e){var t,o=this.YO(e),n=this.context.sourceContext.sourceIdentifier,r=this.context.serviceManager.get(a.ServiceName.ManifestService,n);return(null==r?void 0:r.isLive())&&(o.streamType=chrome.cast.media.StreamType.LIVE,this.OO=0),this.ZO(null!==(t=e.subtitleTracks)&&void 0!==t?t:[],o),this.config.prepareMediaInfo?this.config.prepareMediaInfo(o):Promise.resolve(o)},t.prototype.ZO=function(e,t){var o=new g.MediaInfoWrapper(t,this.context.logger);r(r([],null!=e?e:[],!0),this.aO(),!0).forEach(function(e){return o.maybeAddInternalTrack(e)})},t.prototype.aO=function(){var e=this.context.internalPlayer.listSubtitles().filter(function(e){return e.isSideloaded}),t=this.context.internalPlayer.getAvailableAudio();return r(r([],e,!0),t,!0)},t.prototype.bO=function(e){var t,o;if(e.dash)t=e.dash,o=l.ManifestMimeType.Dash;else if(e.hls)t=e.hls,o=l.ManifestMimeType.Hls;else if(e.smooth)t=e.smooth,o=l.ManifestMimeType.Smooth;else{if(!e.progressive)throw new Error("Source not supported.");var n=this.dO(e.progressive);t=n.url,o=n.mimeType}return{url:t=d.URLHelper.toFullUrl(t),mimeType:o}},t.prototype.timeShift=function(e){var t;this.OO=e,this.seek(((null===(t=this.cO())||void 0===t?void 0:t.end)||0)+e)},t.prototype.seek=function(t){e.prototype.seek.call(this,this.UO(t))},t.prototype.cO=function(){var e,t=null===(e=this.remotePlayer)||void 0===e?void 0:e.liveSeekableRange;return void 0===(null==t?void 0:t.start)||void 0===(null==t?void 0:t.end)?{start:-1,end:-1}:{start:this.TO(t.start),end:this.TO(t.end)}},t.prototype.getTimeShift=function(){var e=this.cO();if(e.end<0)return this.OO;var t=this.getCurrentTime()-e.end;return t>0?0:t},t.prototype.getMaxTimeShift=function(){var e,t,o=this.cO();return(null!==(e=null==o?void 0:o.start)&&void 0!==e?e:0)-(null!==(t=null==o?void 0:o.end)&&void 0!==t?t:0)},t.prototype.dO=function(e){var t,o;if(Array.isArray(e)){var n=O(e)[0];t=n.url,o=n.type}else t=e;return{url:t,mimeType:o}},t.prototype.release=function(){e.prototype.release.call(this),this.remotePlayerController&&this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.XO)},t.prototype.eO=function(e){var t,o,n=this;e&&(null!==(o=null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay)&&void 0!==o&&o?this.fO().then(function(){n.QO.enableTrack(e)}):this.QO.enableTrack(e))},t.prototype.enableSubtitle=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.TEXT);t&&this.eO(t)},t.prototype.disableSubtitle=function(e){this.QO.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.setAudio=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.AUDIO);t&&this.eO(t)},t.prototype.mediaInfoChangedEventHandler=function(t){var o,n;e.prototype.mediaInfoChangedEventHandler.call(this,t),this.QO.setMediaInfo(this.mediaInfo),this.SO=new g.MediaInfoWrapper(this.mediaInfo,this.context.logger),this.PO.maybeReMapTracksForMediaInfo(this.mediaInfo);var r=new g.MediaInfoWrapper(this.mediaInfo,this.context.logger);this.aO().forEach(function(e){return r.maybeAddInternalTrack(e)}),this.RO&&(null===(n=null===(o=this.mediaInfo)||void 0===o?void 0:o.tracks)||void 0===n?void 0:n.length)>0&&this.gO()},t.prototype.addSubtitle=function(e){this.SO.maybeAddInternalTrack(e)},t.prototype.removeSubtitle=function(e){var t,o,n=new g.MediaInfoWrapper(this.mediaInfo,this.context.logger),r=Boolean(null===(o=null===(t=this.media)||void 0===t?void 0:t.activeTrackIds)||void 0===o?void 0:o.find(function(t){return t===n.findTrackIdForTrack(e)}));n.maybeRemoveInternalTrack(e)&&r&&this.QO.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.fO=function(){var e=new chrome.cast.media.LoadRequest(this.mediaInfo);return e.currentTime=this.context.internalPlayer.getCurrentTime(),e.autoplay=this.context.internalPlayer.isPlaying(),this.loadMediaRequest(e)},t.prototype.loadMediaRequest=function(t){var o=this;return this.PO.markAllTracksAsReadyToPlay(t.media.tracks),e.prototype.loadMediaRequest.call(this,t).then(function(){o.RO=!0,o.QO.setMedia(o.media),o.QO.setMediaInfo(o.mediaInfo),o.gO()})},t.prototype.gO=function(){var e,t=this;if(this.mediaInfo){this.RO=!1;var o=this.context.internalPlayer.listSubtitles().filter(function(e){return!!e.enabled}).map(function(e){return e.id});o.push(null===(e=this.context.internalPlayer.getAudio())||void 0===e?void 0:e.id),o=o.filter(Boolean);var n=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTracksForIds(o),r=n.some(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}),i=n.map(function(e){return e.trackId});if(!r)return this.QO.changeActiveTracksBasedOnCastIds(i);this.fO().then(function(){t.QO.changeActiveTracksBasedOnCastIds(i)})}},t}(p.GoogleCastRemoteControlBase);function C(e){var t={keys:e.map(function(e){var t=c.FormatHelper.hexToBytes(e.key),o=c.FormatHelper.hexToBytes(e.kid||"");return{kty:"oct",kid:u.ArrayHelper.arrayBufferToBase64(o.buffer).replace(/[=]*$/,""),k:u.ArrayHelper.arrayBufferToBase64(t.buffer).replace(/[=]*$/,"")}})},o=JSON.stringify(t);return"data:application/json;base64,"+btoa(o)}function O(e){return e.sort(function(e,t){return e.preferred===t.preferred?(e.bitrate||0)>(t.bitrate||0)?-1:1:(e.preferred||0)>(t.preferred||0)?-1:1})}function S(e,t){return function(e){return Array.isArray(e)}(e)?{protectionSystem:i.CLEARKEY,licenseUrl:C(e)}:{protectionSystem:t,licenseUrl:e.LA_URL||"",headers:e.headers,withCredentials:e.withCredentials||!1}}t.GoogleCastRemoteControlV3=v},7209:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomData=function(e,t){var o={};return i(e.drm)&&(o.drm=(0,r.getDrmConfig)(e.drm)),i(e.metadata)&&(o.metadata=e.metadata),i(e.options)&&(o.options=function(e,t){var o,r,i=e.options;return t===n.ManifestMimeType.Dash?(o=a(i,["dashWithCredentials","withCredentials"]),r=a(i,["dashManifestWithCredentials","manifestWithCredentials"])):t===n.ManifestMimeType.Hls&&(o=a(i,["hlsWithCredentials","withCredentials"]),r=a(i,["hlsManifestWithCredentials","manifestWithCredentials"])),{withCredentials:o||!1,manifestWithCredentials:r||!1}}(e,t)),o};var n=o(85625),r=o(23747);function i(e){return Object.keys(null!=e?e:{}).length>0}function a(e,t){for(var o,n=0,r=t;n<r.length;n++){var i=r[n];if(i in e){o=e[i];break}}return o}},2025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastV3TrackFinder=void 0;var o=function(){function e(e){this.b9=e}return e.prototype.findTrackIdByInternalId=function(e,t){var o,n;return null!==(n=null===(o=this.findTrackByInternalId(e,t))||void 0===o?void 0:o.trackId)&&void 0!==n?n:null},e.prototype.findTrackByInternalId=function(e,t){var o,n,r;return null!==(r=(null!==(n=null===(o=this.b9)||void 0===o?void 0:o.tracks)&&void 0!==n?n:[]).find(function(o){var n;return(null===(n=o.customData)||void 0===n?void 0:n.internalId)===e&&o.type===t}))&&void 0!==r?r:null},e.prototype.findTracksForIds=function(e){var t,o;return(null!==(o=null===(t=this.b9)||void 0===t?void 0:t.tracks)&&void 0!==o?o:[]).filter(function(t){var o;return e.includes(null===(o=t.customData)||void 0===o?void 0:o.internalId)})},e.prototype.hasATrackToLoad=function(){var e,t;return Boolean(null===(t=null===(e=this.b9)||void 0===e?void 0:e.tracks)||void 0===t?void 0:t.find(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}))},e.prototype.setMediaInfo=function(e){this.b9=e},e}();t.GoogleCastV3TrackFinder=o},94952:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCustomElementRegistry=function(){var e=function(){var e=window.customElements;return function(e){return"object"==typeof e&&["get","define","whenDefined","upgrade"].every(function(t){return"function"==typeof e[t]})}(e)?e:void 0}();void 0===o&&void 0!==e&&(o=new r(e),Object.defineProperty(window,"customElements",{get:function(){return o}}))};var o,n=["google-cast-button","google-cast-launcher"],r=function(){function e(e){this.registry=e}return e.prototype.define=function(e,t,o){var r=n.includes(e),i=Boolean(this.registry.get(e));r&&i||this.registry.define(e,t,o)},e.prototype.whenDefined=function(e){return this.registry.whenDefined(e)},e.prototype.get=function(e){return this.registry.get(e)},e.prototype.upgrade=function(e){this.registry.upgrade(e)},e}()},92682:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlModuleDefinition=void 0;var n=o(62756),r=o(42489);t.RemoteControlModuleDefinition={name:n.ModuleName.RemoteControl,module:{RemoteControlManager:r.RemoteControlManager}},t.default=t.RemoteControlModuleDefinition},60768:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlMessageType=void 0,function(e){e[e.SourceSetup=0]="SourceSetup",e[e.PlayerApiMethodCall=1]="PlayerApiMethodCall",e[e.CustomData=2]="CustomData"}(o||(t.RemoteControlMessageType=o={}))},35317:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlBase=void 0;var n,r=o(20213),i=o(60768),a=o(30165);!function(e){e[e.Idle=0]="Idle",e[e.Ready=1]="Ready",e[e.Connected=2]="Connected"}(n||(n={}));var s=function(){function e(e){this.context=e,this.Z9=n.Idle}return Object.defineProperty(e.prototype,"Z9",{get:function(){return this.X9},set:function(e){this.context.logger.debug("Remote control session state change: ".concat(n[this.X9]," -> ").concat(n[e])),this.X9=e},enumerable:!1,configurable:!0}),e.prototype.getConfig=function(){throw new Error("Not implemented - overwrite in subclasses!")},e.prototype.setOnErrorCallback=function(e){this.Q9=e},e.prototype.setOnReadyCallback=function(e){this.R9=e},e.prototype.setOnConnectCallback=function(e){this.S9=e},e.prototype.setOnConnectedCallback=function(e){this.T9=e},e.prototype.setOnDisconnectCallback=function(e){this.U9=e},e.prototype.setOnDisconnectedCallback=function(e){this.V9=e},e.prototype.setOnRemotePlayerEventCallback=function(e){this.W9=e},e.prototype.isReady=function(){return this.Z9===n.Ready},e.prototype.isConnected=function(){return this.Z9===n.Connected},e.prototype.onError=function(){this.Z9=n.Ready,this.Q9&&this.Q9()},e.prototype.onReady=function(e){void 0===e&&(e=!0);var t=e?n.Ready:n.Idle;this.Z9!==t&&(this.Z9=t,this.R9&&this.R9({receiverAvailable:e}))},e.prototype.a9=function(){this.playerState={isPlaying:!1,isPaused:!1,hasEnded:!1,isMuted:!1,isStalled:!1,isLive:!1,getVolume:1,getCurrentTime:0,getRelativeCurrentTime:0,getDuration:0,getVersion:"",getDroppedVideoFrames:0,getForwardBufferLevelForVideo:0,getBackwardBufferLevelForVideo:0,getForwardBufferLevelForAudio:0,getBackwardBufferLevelForAudio:0,getTotalStalledTime:0,getDownloadedVideoData:null,getDownloadedAudioData:null,getPlaybackVideoData:null,getPlaybackAudioData:null,getMaxTimeShift:0,getTimeShift:0,getSubtitle:null,getAudio:null}},e.prototype.onConnect=function(e){this.S9&&this.S9({deviceName:e}),this.a9()},e.prototype.onConnected=function(e,t){this.Z9=n.Connected,this.a9(),this.T9&&this.T9({deviceName:e,resumed:t})},e.prototype.onDisconnect=function(){this.U9&&this.U9()},e.prototype.onDisconnected=function(){this.Z9=n.Ready,this.V9&&this.V9()},e.prototype.onRemotePlayerEvent=function(e){this.W9&&this.W9(e)},e.prototype.sendMethodCallMessage=function(e,t){var o=[];t&&(o=Array.isArray(t)?t:1===t.length?[t[0]]:Array.apply(null,t)),this.sendMessage(i.RemoteControlMessageType.PlayerApiMethodCall,{methodName:e,arguments:o})},e.prototype.handleRemoteControlReceiverMessage=function(e){switch(e.type){case a.RemoteControlReceiverMessageType.PlayerState:return this.playerState=e.data,!0;case a.RemoteControlReceiverMessageType.PlayerEvent:var t=e.data;return this.onRemotePlayerEvent(t),!0;case a.RemoteControlReceiverMessageType.PlayerGetterCallReturnValue:return!0}return!1},e.prototype.play=function(){this.sendMethodCallMessage("play")},e.prototype.pause=function(){this.sendMethodCallMessage("pause")},e.prototype.seek=function(e){this.sendMethodCallMessage("seek",[e])},e.prototype.setTargetBufferLevel=function(e,t,o){this.sendMethodCallMessage("setTargetBufferLevel",[e,t,o])},e.prototype.setVolume=function(e){this.sendMethodCallMessage("setVolume",[e])},e.prototype.setMuted=function(e){e?this.sendMethodCallMessage("mute"):this.sendMethodCallMessage("unmute")},e.prototype.isPlaying=function(){return this.playerState.isPlaying},e.prototype.isPaused=function(){return this.playerState.isPaused},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=r.TimeMode.AbsoluteTime),e===r.TimeMode.AbsoluteTime?this.playerState.getCurrentTime:this.playerState.getRelativeCurrentTime},e.prototype.getVolume=function(){return this.playerState.getVolume},e.prototype.isMuted=function(){return this.playerState.isMuted},e.prototype.hasEnded=function(){return this.playerState.hasEnded},e.prototype.isStalled=function(){return this.playerState.isStalled},e.prototype.isLive=function(){return this.playerState.isStalled},e.prototype.getDuration=function(){return this.playerState.getDuration},e.prototype.getDroppedVideoFrames=function(){return this.playerState.getDroppedVideoFrames},e.prototype.getBufferLevel=function(e,t){var o={level:0,targetLevel:this.context.bufferSettings.getTargetLevel(e,t),type:e,media:t};return r.BufferType.ForwardDuration?t===r.MediaType.Video?o.level=this.playerState.getForwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getForwardBufferLevelForAudio):r.BufferType.BackwardDuration&&(t===r.MediaType.Video?o.level=this.playerState.getBackwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getBackwardBufferLevelForAudio)),o},e.prototype.getTotalStalledTime=function(){return this.playerState.getTotalStalledTime},e.prototype.getDownloadedVideoData=function(){return this.playerState.getDownloadedVideoData},e.prototype.getDownloadedAudioData=function(){return this.playerState.getDownloadedAudioData},e.prototype.getPlaybackVideoData=function(){return this.playerState.getPlaybackVideoData},e.prototype.getPlaybackAudioData=function(){return this.playerState.getPlaybackAudioData},e.prototype.getTimeShift=function(){return this.playerState.getTimeShift},e.prototype.getMaxTimeShift=function(){return this.playerState.getMaxTimeShift},e.prototype.preload=function(){this.sendMethodCallMessage("preload",[])},e.prototype.setAudioQuality=function(e){this.sendMethodCallMessage("setAudioQuality",[e])},e.prototype.setVideoQuality=function(e){this.sendMethodCallMessage("setVideoQuality",[e])},e.prototype.setQueryParameters=function(e){this.sendMethodCallMessage("setQueryParameters",[e])},e.prototype.clearQueryParameters=function(){this.sendMethodCallMessage("clearQueryParameters",[])},e.prototype.timeShift=function(e){this.sendMethodCallMessage("timeShift",[e])},e.prototype.enableSubtitle=function(e){this.sendMethodCallMessage("subtitles.enable",[e])},e.prototype.disableSubtitle=function(e){this.sendMethodCallMessage("subtitles.disable",[e])},e.prototype.setAudio=function(e){this.sendMethodCallMessage("setAudio",[e])},e.prototype.getSnapshot=function(e,t){this.sendMethodCallMessage("getSnapshot",[e,t])},e.prototype.setPlaybackSpeed=function(e){this.sendMethodCallMessage("setPlaybackSpeed",[e])},e.prototype.unload=function(){return this.sendMethodCallMessage("unload"),Promise.resolve()},e}();t.RemoteControlBase=s},42489:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlManager=void 0;var n=o(23690),r=o(85648),i=o(68657),a=o(32645),s=o(61348),l=o(23747),u=o(94952),c=o(77118),d=o(91297),p=function(){function e(t,o){this.Hj=e.setupRemoteControl(t),this.Hj instanceof a.GoogleCastRemoteControlBase&&function(e,t){(0,u.wrapCustomElementRegistry)(),e.removeScript(t,"cast_sender.js"),e.removeScript(t,"cast_framework.js"),setTimeout(function(){return e.loadScript(t)},0)}(o,t.config.location.cast)}return e.prototype.getPlayerWrapper=function(e,t){return new c.RemoteControlPlayerWrapper(e,t,this.Hj)},e.setupRemoteControl=function(e){if(null==e.config||null==e.settings)return null;var t=e.config,o=e.settings;if((t.cast&&t.cast.enable||(!t.cast||t.cast&&!t.cast.hasOwnProperty("enable"))&&t.remotecontrol&&"googlecast"===t.remotecontrol.type)&&(t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.receiverApplicationId?(o.CAST_APPLICATION_ID=t.remotecontrol.receiverApplicationId,e.logger.debug("ChromeCast setting application ID to ".concat(o.CAST_APPLICATION_ID))):t.cast&&t.cast.application_id?(o.CAST_APPLICATION_ID=t.cast.application_id,e.logger.debug("ChromeCast setting application ID to ".concat(o.CAST_APPLICATION_ID))):e.logger.debug("ChromeCast using default application ID ".concat(o.CAST_APPLICATION_ID)),t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.messageNamespace?0===t.remotecontrol.messageNamespace.indexOf("urn:x-cast:")?o.CAST_MESSAGE_NAMESPACE=t.remotecontrol.messageNamespace:(e.logger.debug("ChromeCast setting message namespace failed! Namespace must start with urn:x-cast:"),e.logger.debug("ChromeCast using default message namespace ".concat(o.CAST_MESSAGE_NAMESPACE))):t.cast&&t.cast.message_namespace?0===t.cast.message_namespace.indexOf("urn:x-cast:")?(o.CAST_MESSAGE_NAMESPACE=t.cast.message_namespace,e.logger.debug("ChromeCast setting message namespace to ".concat(o.CAST_MESSAGE_NAMESPACE))):(e.logger.debug("ChromeCast setting message namespace failed! Namespace must start with urn:x-cast:"),e.logger.debug("ChromeCast using default message namespace ".concat(o.CAST_MESSAGE_NAMESPACE))):e.logger.debug("ChromeCast using default message namespace ".concat(o.CAST_MESSAGE_NAMESPACE)),t.hasOwnProperty("remotecontrol")||(t.remotecontrol={type:"googlecast",receiverApplicationId:o.CAST_APPLICATION_ID,messageNamespace:o.CAST_MESSAGE_NAMESPACE,customReceiverConfig:{receiverStylesheetUrl:t.cast.receiverStylesheetUrl||null}})),t.remotecontrol&&t.remotecontrol.type)switch(t.remotecontrol.type){case"googlecast":return t.remotecontrol.receiverApplicationId=t.remotecontrol.receiverApplicationId||o.CAST_APPLICATION_ID,t.remotecontrol.messageNamespace=t.remotecontrol.messageNamespace||o.CAST_MESSAGE_NAMESPACE,t.remotecontrol.receiverVersion===i.GoogleCastReceiverVersion.v3?(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV3)),new l.GoogleCastRemoteControlV3(e,t.remotecontrol)):(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV2)),new s.GoogleCastRemoteControlV2(e,t.remotecontrol));case"websocket":return e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.Websocket)),new d.WebSocketRemoteControl(e,t.remotecontrol);default:e.logger.debug("unknown remote control type: "+t.remotecontrol.type)}return null},e}();t.RemoteControlManager=p},77118:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlPlayerWrapper=t.addStartOffset=t.clamp=t.getForwardBufferDiff=void 0;var n=o(9768),r=o(3714),i=o(44468),a=o(23690),s=o(87827),l=o(85648),u=o(71223),c=o(32645),d=o(60768);t.getForwardBufferDiff=function(e){return e.getBufferLevel(i.BufferType.ForwardDuration,i.MediaType.Video).targetLevel-20},t.clamp=function(e,t,o){return Math.max(t,Math.min(o,e))},t.addStartOffset=function(e,o,n){var r=Boolean(e.options&&e.options.startOffset);return(o||!r)&&(e.options=e.options||{},e.options.startOffset=n.isLive()?n.getTimeShift()-(0,t.getForwardBufferDiff)(n):n.getCurrentTime()),e};var p=function(){function e(e,o,n){var i=this;if(this.oO=!1,this.pO=!1,this.lO=e,this.mO=o,this.nO=n,n){var s=!1,c=!1,d=function(){i.pO=i.mO.isPlaying(),i.mO.pause()};n.setOnErrorCallback(function(){e.logger.debug("Remote error"),e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s&&(s=!1,i.rO(),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)))}),n.setOnReadyCallback(function(t){e.logger.debug("Remote ready"),e.eventHandler.dispatchEvent(r.PlayerEvent.CastAvailable,{receiverAvailable:t.receiverAvailable})}),n.setOnConnectCallback(function(t){e.logger.debug("Remote connect",t),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connecting)),d(),e.eventHandler.dispatchEvent(r.PlayerEvent.CastWaitingForDevice,{castPayload:{deviceName:t.deviceName,currentTime:void 0,timestamp:void 0,type:void 0}})}),n.setOnConnectedCallback(function(o){e.logger.debug("Remote connected",o),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connected));var p=(0,u.isSameSource)(n.getSource(),e.sourceContext.source);if(o.resumed&&d(),!o.resumed||!p){e.settings.QUERY_PARAMETERS&&n.setQueryParameters(e.settings.QUERY_PARAMETERS),null!=n.getConfig()&&n.getConfig().customReceiverConfig&&i.addMetadata("CAST",{type:"customReceiverConfig",data:n.getConfig().customReceiverConfig});var f=(0,t.addStartOffset)(e.sourceContext.source,i.oO,i.mO);n.setSource(f,i.qO(),i.mO.getCurrentTime()),c=!0}e.eventHandler.dispatchEvent(r.PlayerEvent.CastStarted,{deviceName:o.deviceName,resuming:o.resumed}),s=!0,e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnDisconnectCallback(function(){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnecting)),e.logger.debug("Remote disconnect")}),n.setOnDisconnectedCallback(function(){e.logger.debug("Remote disconnected"),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)),e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s=!1,i.rO(),e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnRemotePlayerEventCallback(function(t){if(e.logger.debug("Remote player state changed",t),c)switch(t.event){case r.PlayerEvent.Play:case r.PlayerEvent.Paused:c=!1;for(var i=0,a=o.listSubtitles();i<a.length;i++){var s=a[i];n.addSubtitle(s),s.enabled&&n.enableSubtitle(s.id)}}var l=t.data||{};l.remote=!0,e.eventHandler.dispatchEvent(t.event,l)})}else e.logger.debug("No remote control passed into wrapper")}return e.prototype.qO=function(){return this.lO.config&&this.lO.config.playback&&this.lO.config.playback.autoplay||this.pO},e.prototype.rO=function(){var e=this.lO.settings.ENABLE_SEEK_FOR_LIVE;if(this.mO.isLive()&&!e){var o=this.nO.getTimeShift()+(0,t.getForwardBufferDiff)(this.mO),n=this.mO.getMaxTimeShift();this.mO.timeShift((0,t.clamp)(o,n,0))}else{var r=this.mO.getSeekableRange(),i=this.nO.getCurrentTime();this.mO.seek((0,t.clamp)(i,r.start,r.end))}this.nO.isPlaying()?this.mO.play():this.mO.pause()},e.prototype.sO=function(){return null!=this.nO&&this.nO.isReady()},e.prototype.tO=function(){return null!=this.nO&&this.nO.isConnected()},e.prototype.uO=function(e){var t=(0,s.getRemoteControlState)(this.lO.store.getState().player).remoteControlType===l.RemoteControlType.GoogleCastV3;e===n.UI_SEEK_ISSUER_NAME&&t||this.nO.pause()},e.prototype.vO=function(e){this.mO.pause(e)},e.prototype.getAvailableSegments=function(){return this.mO.getAvailableSegments()},e.prototype.play=function(e){return this.oO=!0,this.tO()?(this.nO.play(),Promise.resolve()):this.mO.play(e)},e.prototype.preload=function(){this.tO()?this.nO.preload():this.mO.preload()},e.prototype.pause=function(e){this.tO()?this.uO(e):this.vO(e)},e.prototype.mute=function(e){this.tO()&&this.nO.setMuted(!0),this.mO.mute(e)},e.prototype.unmute=function(e){this.tO()&&this.nO.setMuted(!1),this.mO.unmute(e)},e.prototype.setVolume=function(e,t){this.tO()?this.nO.setVolume(e/100):this.mO.setVolume(e,t)},e.prototype.seek=function(e,t){return this.tO()?(this.nO.seek(e),!0):this.mO.seek(e,t)},e.prototype.setAudioQuality=function(e){this.tO()&&this.nO.setAudioQuality(e),this.mO.setAudioQuality(e)},e.prototype.setVideoQuality=function(e){this.tO()&&this.nO.setVideoQuality(e),this.mO.setVideoQuality(e)},e.prototype.prepareLoad=function(){return this.mO.prepareLoad()},e.prototype.prepareSource=function(e,t){return this.mO.prepareSource(e,t)},e.prototype.load=function(e,t,o){return this.tO()&&this.nO.setSource(this.lO.sourceContext.source,this.qO()),this.mO.load(e,t,o)},e.prototype.unload=function(e){return this.tO()&&this.nO.unload(),this.mO?this.mO.unload(e):Promise.resolve()},e.prototype.isPlaying=function(){return this.tO()?this.nO.isPlaying():this.mO.isPlaying()},e.prototype.isPaused=function(){return this.tO()?this.nO.isPaused():this.mO.isPaused()},e.prototype.hasEnded=function(){return this.tO()?this.nO.hasEnded():this.mO.hasEnded()},e.prototype.isMuted=function(){return this.tO()?this.nO.isMuted():this.mO.isMuted()},e.prototype.isStalled=function(){return this.tO()?this.nO.isStalled():this.mO.isStalled()},e.prototype.isLive=function(){return this.mO.isLive()},e.prototype.getVolume=function(){return this.tO()?100*this.nO.getVolume():this.mO.getVolume()},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=i.TimeMode.AbsoluteTime),this.tO()?this.nO.getCurrentTime(e):this.mO.getCurrentTime(e)},e.prototype.getDuration=function(){return this.mO.getDuration()},e.prototype.getAvailableVideoQualities=function(){return this.mO.getAvailableVideoQualities()},e.prototype.getAvailableAudioQualities=function(){return this.mO.getAvailableAudioQualities()},e.prototype.getDroppedVideoFrames=function(){return this.tO()?this.nO.getDroppedVideoFrames():this.mO.getDroppedVideoFrames()},e.prototype.setTargetBufferLevel=function(e,t,o){return this.tO()?this.nO.setTargetBufferLevel(e,t,o):this.mO.setTargetBufferLevel(e,t,o)},e.prototype.getBufferLevel=function(e,t){return this.tO()?this.nO.getBufferLevel(e,t):this.mO.getBufferLevel(e,t)},e.prototype.getTotalStalledTime=function(){return this.tO()?this.nO.getTotalStalledTime():this.mO.getTotalStalledTime()},e.prototype.getDownloadedVideoData=function(){return this.tO()?this.nO.getDownloadedVideoData():this.mO.getDownloadedVideoData()},e.prototype.getDownloadedAudioData=function(){return this.tO()?this.nO.getDownloadedAudioData():this.mO.getDownloadedAudioData()},e.prototype.getPlaybackVideoData=function(){return this.tO()?this.nO.getPlaybackVideoData():this.mO.getPlaybackVideoData()},e.prototype.getPlaybackAudioData=function(){return this.tO()?this.nO.getPlaybackAudioData():this.mO.getPlaybackAudioData()},e.prototype.getBufferedRanges=function(){return this.mO.getBufferedRanges()},e.prototype.getManifest=function(){return this.mO.getManifest()},e.prototype.isCasting=function(){return this.tO()},e.prototype.isCastAvailable=function(){return this.sO()||this.tO()},e.prototype.castVideo=function(){this.sO()&&(this.nO.connect(),this.lO.eventHandler.dispatchEvent(r.PlayerEvent.CastStart))},e.prototype.castStop=function(){if(this.tO()){if(this.nO instanceof c.GoogleCastRemoteControlBase)return this.nO.connect();this.nO.disconnect()}},e.prototype.updateCallback=function(e){this.mO.updateCallback(e)},e.prototype.setQueryParameters=function(e){this.tO()&&this.nO.setQueryParameters(e),this.mO.setQueryParameters(e)},e.prototype.clearQueryParameters=function(){this.tO()&&this.nO.clearQueryParameters(),this.mO.clearQueryParameters()},e.prototype.getMaxTimeShift=function(){return this.tO()?this.nO.getMaxTimeShift():this.mO.getMaxTimeShift()},e.prototype.timeShift=function(e,t){this.tO()?this.nO.timeShift(e):this.mO.timeShift(e,t)},e.prototype.getTimeShift=function(){return this.tO()?this.nO.getTimeShift():this.mO.getTimeShift()},e.prototype.addSubtitle=function(e){return this.tO()&&this.nO.addSubtitle(e),this.mO.addSubtitle(e)},e.prototype.removeSubtitle=function(e){this.tO()&&this.nO.removeSubtitle(e),this.mO.removeSubtitle(e)},e.prototype.enableSubtitle=function(e){return this.tO()&&this.nO.enableSubtitle(e),this.mO.enableSubtitle(e)},e.prototype.disableSubtitle=function(e){return this.tO()&&this.nO.disableSubtitle(e),this.mO.disableSubtitle(e)},e.prototype.listSubtitles=function(){return this.mO.listSubtitles()},e.prototype.getAudioQuality=function(){return this.mO.getAudioQuality()},e.prototype.getVideoQuality=function(){return this.mO.getVideoQuality()},e.prototype.setAudio=function(e){this.tO()&&this.nO.setAudio(e),this.mO.setAudio(e)},e.prototype.getAvailableAudio=function(){return this.mO.getAvailableAudio()},e.prototype.getAudio=function(){return this.mO.getAudio()},e.prototype.getSnapshot=function(e,t){if(!this.tO())return this.mO.getSnapshot(e,t)},e.prototype.setPlaybackSpeed=function(e){this.tO()&&this.nO.setPlaybackSpeed(e),this.mO.setPlaybackSpeed(e)},e.prototype.getPlaybackSpeed=function(){return this.mO.getPlaybackSpeed()},e.prototype.permitControl=function(e){this.mO.permitControl(e)},e.prototype.addMetadata=function(e,t){return!("CAST"!==e.toUpperCase()||!this.tO()||(this.nO.sendMessage(d.RemoteControlMessageType.CustomData,t),0))},e.prototype.onFullscreenEnter=function(e){this.mO.onFullscreenEnter(e)},e.prototype.onFullscreenExit=function(){this.mO.onFullscreenExit()},e.prototype.isAirplayAvailable=function(){return this.mO.isAirplayAvailable()},e.prototype.isAirplayActive=function(){return this.mO.isAirplayActive()},e.prototype.showAirplayTargetPicker=function(){this.mO.showAirplayTargetPicker()},e.prototype.getSeekableRange=function(){return this.mO.getSeekableRange()},e.prototype.getLatency=function(){return this.mO.getLatency()},e.prototype.setTargetLatency=function(e){this.mO.setTargetLatency(e)},e.prototype.getTargetLatency=function(){return this.mO.getTargetLatency()},e.prototype.setCatchupConfig=function(e){this.mO.setCatchupConfig(e)},e.prototype.getCatchupConfig=function(){return this.mO.getCatchupConfig()},e.prototype.setFallbackConfig=function(e){this.mO.setFallbackConfig(e)},e.prototype.getFallbackConfig=function(){return this.mO.getFallbackConfig()},e.prototype.createManifestApi=function(){return this.mO.createManifestApi()},e.prototype.release=function(e){var t=this;return null!=this.nO&&(this.nO.setOnErrorCallback(null),this.nO.setOnReadyCallback(null),this.nO.setOnConnectCallback(null),this.nO.setOnConnectedCallback(null),this.nO.setOnDisconnectCallback(null),this.nO.setOnDisconnectedCallback(null),this.nO.setOnRemotePlayerEventCallback(null),this.nO.release()),this.mO.release(e).then(function(){t.mO=null,t.nO=null})},e}();t.RemoteControlPlayerWrapper=p},30165:function(e,t){var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedPlayerApiMethods=t.RemoteControlReceiverMessageType=void 0,function(e){e[e.PlayerState=0]="PlayerState",e[e.PlayerEvent=1]="PlayerEvent",e[e.PlayerGetterCallReturnValue=2]="PlayerGetterCallReturnValue"}(o||(t.RemoteControlReceiverMessageType=o={})),function(e){e.GET_CONTAINER="getContainer",e.GET_SNAPSHOT="getSnapShot",e.GET_VIDEO_ELEMENT="getVideoElement"}(n||(t.UnsupportedPlayerApiMethods=n={}))},61567:function(__unused_webpack_module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.RemoteJSON=void 0;var RemoteJSON=function(){function RemoteJSON(){}return RemoteJSON.stringifyFunction=function(e){if("function"==typeof e)return RemoteJSON.FUNCTION_PREFIX+e.toString()},RemoteJSON.parseFunction=function(fs){if(fs&&"string"==typeof fs&&0===fs.indexOf(RemoteJSON.FUNCTION_PREFIX)){var f="f = "+fs.substring(RemoteJSON.FUNCTION_PREFIX.length);if(eval(f),"function"==typeof f)return f}},RemoteJSON.stringify=function(e,t,o){return JSON.stringify(e,function(e,o){return"function"==typeof o?RemoteJSON.stringifyFunction(o):t?t(e,o):o},o)},RemoteJSON.parse=function(e,t){return JSON.parse(e,function(e,o){return RemoteJSON.parseFunction(o)||(t?t(e,o):o)})},RemoteJSON.FUNCTION_PREFIX="function::",RemoteJSON}();exports.RemoteJSON=RemoteJSON},91297:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketRemoteControl=void 0;var r=o(60768),i=o(35317),a=o(61567),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.hO=o,window.WebSocket&&n.onReady(),n}return n(t,e),t.prototype.getConfig=function(){return this.hO},t.prototype.connect=function(){var e=this;if(!this.isReady())throw new Error("Remote is not ready");this.onConnect("WebSocket Receiver"),this.iO=new WebSocket(this.hO.url+"?role=remote"),this.iO.addEventListener("open",function(t){e.onConnected("WebSocket Receiver",!1)}),this.iO.addEventListener("error",function(t){e.context.logger.debug("Error",t),e.onError()}),this.iO.addEventListener("close",function(t){e.context.logger.debug("Close",t),e.onDisconnected()}),this.iO.addEventListener("message",function(t){return e.kO(t)})},t.prototype.kO=function(e){if(e.data)try{var t=JSON.parse(e.data);this.handleRemoteControlReceiverMessage(t)}catch(t){this.context.logger.error("message parsing failed",e.data)}else this.context.logger.log("unknown message received",e.data)},t.prototype.sendMessage=function(e,t){this.iO.send(a.RemoteJSON.stringify({type:e,data:t}))},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.disconnect=function(){this.onDisconnect(),this.iO.close()},t.prototype.release=function(){},t.prototype.setSource=function(e,t,o){this.jO=e,this.sendMessage(r.RemoteControlMessageType.SourceSetup,{source:e,autoplay:t,time:o})},t.prototype.getSource=function(){return this.jO},t}(i.RemoteControlBase);t.WebSocketRemoteControl=s},58367:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoProcessor=void 0;var n=o(2025),r=o(26662),i=function(){function e(e,t,o){this.d9=Promise.resolve(),this.c9=new n.GoogleCastV3TrackFinder(e),this.media=t,this.logger=o}return e.prototype.setMedia=function(e){this.media=e},e.prototype.setMediaInfo=function(e){this.c9.setMediaInfo(e)},e.prototype.enableTrack=function(e){var t,o=this,n=e.trackId;this.f9(null===(t=e.customData)||void 0===t?void 0:t.internalId,e.type,n)&&n&&this.d9.then(function(){var t=o.e9(e.type);return t.push(n),new r.EditTrackInfoRequest(o.media,t,o.logger).execute()})},e.prototype.e9=function(e){var t;if(!this.media||!this.media.activeTrackIds)return[];var o=this.media.activeTrackIds,n=null===(t=this.media.media)||void 0===t?void 0:t.tracks;if(!n)return o;var r=n.filter(function(t){return t.type!==e});return o.filter(function(e){return r.find(function(t){return t.trackId===e})})},e.prototype.disableTrack=function(e,t){var o,n=this.c9.findTrackIdByInternalId(e,t);if(this.f9(e,t,n)&&n){var i=((null===(o=this.media)||void 0===o?void 0:o.activeTrackIds)||[]).filter(function(e){return e!==n});this.d9=new r.EditTrackInfoRequest(this.media,i,this.logger).execute()}},e.prototype.changeActiveTracksBasedOnCastIds=function(e){this.media&&(this.d9=new r.EditTrackInfoRequest(this.media,e,this.logger).execute())},e.prototype.f9=function(e,t,o){return this.media?null!==o||(this.logger.debug("EditTrackInfoProcessor: Could not make track request. No trackId found for combination:",{requestId:e,type:t}),!1):(this.logger.debug("EditTrackInfoProcessor: Media info is not initialized."),!1)},e}();t.EditTrackInfoProcessor=i},26662:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoRequest=void 0;var o=function(){function e(e,t,o){this.Agb=e,this.Bgb=t,this.Cgb=o}return e.prototype.execute=function(){var e=this;return new Promise(function(t,o){if(e.Agb){var n=new chrome.cast.media.EditTracksInfoRequest(e.Bgb);e.Agb.editTracksInfo(n,t,o)}else o("Media is not initialized properly.")}).catch(function(t){e.Cgb.debug("Problem executing EditTrackInfoRequest",t)})},e}();t.EditTrackInfoRequest=o},13748:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoTrackMapper=void 0;var r=o(80186),i=o(57230),a=function(){function e(e){this.context=e}return e.prototype.maybeReMapTracksForMediaInfo=function(e){(null==e?void 0:e.tracks)&&this.mapTracksWithNoInternalId(e.tracks)},e.prototype.mapTracksWithNoInternalId=function(e){var t=this,o=e.filter(function(e){var t;return!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}),n={};o.forEach(function(o){var r=o.type,i=n[r];i||(i=t.i9(o),n[r]=i),t.g9(o,e,i)})},e.prototype.g9=function(e,t,o){var r;if(!(null===(r=null==e?void 0:e.customData)||void 0===r?void 0:r.internalId)&&(null==t?void 0:t.length)){var i=this.h9(e,t,o);i?e.customData=n(n({},e.customData),{internalId:i}):this.context.logger.debug("Could not map track for language:",e.language,"No relevant internal track was found.",e)}},e.prototype.h9=function(e,t,o){var n,i,a,s=o.filter(function(t){return(0,r.bothTracksHaveSameLanguage)(t,e)}),l=null===(n=s[0])||void 0===n?void 0:n.id;if(s.length>0){var u=t.filter(function(e){var t;return!!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}).map(function(e){return e.customData.internalId});return null!==(a=null===(i=s.find(function(e){return!u.includes(e.id)}))||void 0===i?void 0:i.id)&&void 0!==a?a:null}return l},e.prototype.i9=function(e){return(0,i.isSubtitle)(e)?this.context.internalPlayer.listSubtitles():(0,i.isAudio)(e)?this.context.internalPlayer.getAvailableAudio():[]},e.prototype.markAllTracksAsReadyToPlay=function(e){null==e||e.forEach(function(e){e.customData&&(e.customData.needsReloadBeforePlay=!1)})},e}();t.MediaInfoTrackMapper=a},15529:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoWrapper=void 0;var n=o(57230),r=function(){function e(e,t){e&&!Array.isArray(e.tracks)&&(e.tracks=[]),this.j9=e,this.k9=t}return e.prototype.l9=function(){var e,t,o,n=null===(e=this.j9)||void 0===e?void 0:e.tracks;return(null==n?void 0:n.length)&&null!==(o=null===(t=n[n.length-1])||void 0===t?void 0:t.trackId)&&void 0!==o?o:0},e.prototype.maybeAddInternalTrack=function(e){if(this.j9&&!(this.m9(e.id)>=0)){var t=(0,n.fromInternalTrackToGoogleTrack)(e,this.l9()+1);(0,n.isValidTrack)(t)?this.j9.tracks.push(t):this.k9.debug("Trying to add an invalid track",t)}},e.prototype.maybeRemoveInternalTrack=function(e){var t,o,n=this.m9(e);return n>-1&&(null===(o=null===(t=this.j9)||void 0===t?void 0:t.tracks)||void 0===o||o.splice(n,1)),n>-1},e.prototype.m9=function(e){var t;return e&&(null===(t=this.j9)||void 0===t?void 0:t.tracks)?this.j9.tracks.findIndex(function(t){var o;return e===(null===(o=t.customData)||void 0===o?void 0:o.internalId)}):-1},e.prototype.findTrackIdForTrack=function(e){var t,o,n;return null!==(n=null===(o=null===(t=this.j9)||void 0===t?void 0:t.tracks[this.m9(e)])||void 0===o?void 0:o.trackId)&&void 0!==n?n:-1},e}();t.MediaInfoWrapper=r},80186:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.bothTracksHaveSameLanguage=function(e,t){var o;return!!t.language&&((null===(o=e.lang)||void 0===o?void 0:o.toLowerCase())===t.language.toLowerCase()||function(e,t){var o=n.SHAKA_ISO_MAP[e];return o?t===o:function(e){var t=Object.keys(n.SHAKA_ISO_MAP).find(function(t){var o=n.SHAKA_ISO_MAP[t];return e===o||e===t});return null!=t?n.SHAKA_ISO_MAP[t]:null}(t)===e}(t.language,e.lang))};var n=o(90435)},57230:function(e,t){function o(e){return e.type===chrome.cast.media.TrackType.AUDIO}Object.defineProperty(t,"__esModule",{value:!0}),t.fromInternalTrackToGoogleTrack=function(e,t){var n,r=e.getQualities?chrome.cast.media.TrackType.AUDIO:chrome.cast.media.TrackType.TEXT,i=new chrome.cast.media.Track(t,r);return function(e,t){o(t)?function(e,t){var o,n;t.trackContentType=null!==(n=null===(o=e.getQualities().find(function(e){return e.codec}))||void 0===o?void 0:o.codec)&&void 0!==n?n:""}(e,t):function(e,t){t.trackContentType=e.id?e.id.split("-")[0]:"",t.trackContentId=e.url,t.subtype=function(e){var t,o;return e.kind===chrome.cast.media.TextTrackType.METADATA.toLowerCase()?chrome.cast.media.TextTrackType.METADATA:(null===(t=e.kind)||void 0===t?void 0:t.includes("caption"))||function(e){return Boolean(e.find(function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.includes("caption")}))}(null!==(o=e.role)&&void 0!==o?o:[])?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES}(e)}(e,t)}(e,i),i.language=e.lang,i.name=e.label,i.roles=(null===(n=e.role)||void 0===n?void 0:n.filter(function(e){return!!e.value}).map(function(e){return e.value||""}))||[],i.customData={internalId:e.id,needsReloadBeforePlay:!0},i},t.isValidTrack=function(e){return!(!(e.trackContentType&&e.trackId&&e.language&&e.name)||o(e))&&(!!e.subtype&&!!e.trackContentId)},t.isSubtitle=function(e){return e.type===chrome.cast.media.TrackType.TEXT},t.isAudio=o},90435:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SHAKA_ISO_MAP=void 0,t.SHAKA_ISO_MAP={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"}}},function(e){return function(){return e(92682)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.remotecontrol=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.remotecontrol=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[140],{71223:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameSource=r;var n=o(58313);function r(e,t){return!e&&!t||!(!e||!t)&&(e.dash?i(e.dash,t.dash,t):e.hls?i(e.hls,t.hls,t):!!e.progressive&&!Array.isArray(t.progressive)&&i(e.progressive,t.progressive,t))}function i(e,t,o){try{return r(JSON.parse(e),o)}catch(e){}return!!t&&n.URLHelper.toFullUrl(t)===n.URLHelper.toFullUrl(e)}},68657:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastReceiverVersion=void 0,function(e){e.v2="v2",e.v3="v3"}(o||(t.GoogleCastReceiverVersion=o={}))},32645:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlBase=void 0,t.mediaInfoToSourceConfig=c;var r=o(3714),i=o(20213),a=o(85625),s=o(94685),l=o(60768),u=function(e){function t(t,o){var n=e.call(this,t)||this;n.UL=function(e,t){n.context.logger.debug("addReceiverActionListener",e),n.isConnected()||n.onConnect(e.friendlyName)},n.VL=function(e){switch(n.context.logger.debug("CAST_STATE_CHANGED",e),e.castState){case cast.framework.CastState.NO_DEVICES_AVAILABLE:n.onReady(!1);break;case cast.framework.CastState.NOT_CONNECTED:n.onReady(!0);case cast.framework.CastState.CONNECTING:case cast.framework.CastState.CONNECTED:}},n.WL=function(e){switch(n.context.logger.debug("SESSION_STATE_CHANGED",e),e.sessionState){case cast.framework.SessionState.NO_SESSION:case cast.framework.SessionState.SESSION_STARTING:break;case cast.framework.SessionState.SESSION_STARTED:n.onConnected(e.session.getCastDevice().friendlyName,!1);break;case cast.framework.SessionState.SESSION_START_FAILED:n.context.logger.debug("SESSION_START_FAILED",e.errorCode),e.errorCode!==chrome.cast.ErrorCode.CANCEL&&n.onError();break;case cast.framework.SessionState.SESSION_ENDING:break;case cast.framework.SessionState.SESSION_ENDED:n.onDisconnected();break;case cast.framework.SessionState.SESSION_RESUMED:n.onConnected(e.session.getCastDevice().friendlyName,!0),n.remotePlayer.isPaused||(n.TL(),n.onRemotePlayerEvent({event:r.PlayerEvent.Play}))}},n.XL=function(e){n.mediaInfoChangedEventHandler(e)},n.YL=function(e){switch(n.context.logger.debug("PLAYER_STATE_CHANGED",e),e.value){case chrome.cast.media.PlayerState.PAUSED:n.onRemotePlayerEvent({event:r.PlayerEvent.Paused});break;case chrome.cast.media.PlayerState.PLAYING:n.onRemotePlayerEvent({event:r.PlayerEvent.Playing})}},n.ZL=function(){n.context.logger.debug("IS_PAUSED_CHANGED",n.remotePlayer.isPaused),n.remotePlayer.isPaused||n.onRemotePlayerEvent({event:r.PlayerEvent.Play})},n.aL=function(){n.context.logger.debug("CURRENT_TIME_CHANGED",n.remotePlayer.currentTime),n.onRemotePlayerEvent({event:r.PlayerEvent.TimeChanged})},n.bL=function(){n.context.logger.debug("VOLUME_LEVEL_CHANGED",n.remotePlayer.volumeLevel),n.onRemotePlayerEvent({event:r.PlayerEvent.VolumeChanged})},n.cL=function(){n.context.logger.debug("IS_MUTED_CHANGED",n.remotePlayer.isMuted),n.onRemotePlayerEvent({event:n.remotePlayer.isMuted?r.PlayerEvent.Muted:r.PlayerEvent.Unmuted})},n.dL=function(e){n.context.logger.debug("IS_CONNECTED_CHANGED",e),n.remotePlayer.isConnected?n.context.logger.debug("remotePlayer connected"):n.context.logger.debug("remotePlayer not connected")},n.eL=function(){n.remotePlayer.isPaused||(n.context.logger.debug('Switching receiver state to "paused"'),n.remotePlayerController.playOrPause())},n.config=o,n.SL=void 0;var i=function(e){if(t.logger.debug("__onGCastApiAvailable "+e),e)try{n.initializeCast()}catch(e){t.logger.debug("Cast initialization failed",e)}n.SL&&n.SL(e)};return window.chrome&&window.chrome.cast&&window.cast&&window.cast.framework?setTimeout(function(){return i(!0)},1e3):(n.SL=window.__onGCastApiAvailable,window.__onGCastApiAvailable=i),n}return n(t,e),t.prototype.TL=function(){var e,t,o=this;null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t||t.getStatus(void 0,function(){(0,s.isContextAvailable)(o.context)&&o.context.logger.debug("State updated from Receiver")},function(e){(0,s.isContextAvailable)(o.context)&&o.context.logger.debug("State update from receiver failed:",e)})},t.prototype.initializeCast=function(){var e;cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:this.config.receiverApplicationId,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,resumeSavedSession:null!==(e=this.config.rejoinActiveSession)&&void 0!==e&&e}),this.remotePlayer=new cast.framework.RemotePlayer,this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.dL),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.YL),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.ZL),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.aL),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.bL),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.cL),cast.framework.CastContext.getInstance().getCastState()!==cast.framework.CastState.NO_DEVICES_AVAILABLE?this.onReady(!0):cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.VL),cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.WL),chrome.cast.addReceiverActionListener(this.UL);var t=cast.framework.CastContext.getInstance().getCurrentSession();t&&this.onConnected(t.getCastDevice().friendlyName,!0)},t.prototype.mediaInfoChangedEventHandler=function(e){var t=this.remotePlayer.mediaInfo;this.mediaInfo=e.value,this.context.logger.debug("MEDIA_INFO_CHANGED",t)},t.prototype.getConfig=function(){return this.config},t.prototype.connect=function(){var e=this;cast.framework.CastContext.getInstance().requestSession().then(function(){return e.context.logger.debug("Session request successful")}).catch(function(t){t===chrome.cast.ErrorCode.CANCEL||(e.context.logger.debug("Session request failed",t),e.onError())})},t.prototype.onConnected=function(t,o){var n=this;this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.castSession.addMessageListener(this.config.messageNamespace,function(e,t){n.context.logger.insane(e,t);try{var o=JSON.parse(t);n.handleRemoteControlReceiverMessage(o)}catch(e){n.context.logger.error("message parsing failed",t)}}),this.context.eventHandler.on(r.PlayerEvent.PlaybackFinished,this.eL),e.prototype.onConnected.call(this,t,o)},t.prototype.sendMessage=function(e,t){void 0===e&&(e=l.RemoteControlMessageType.PlayerApiMethodCall),this.castSession.sendMessage(this.config.messageNamespace,{type:e,data:t})},t.prototype.disconnect=function(){cast.framework.CastContext.getInstance().endCurrentSession(!0),this.onDisconnect()},t.prototype.onDisconnected=function(){e.prototype.onDisconnected.call(this),this.context.eventHandler.off(r.PlayerEvent.PlaybackFinished,this.eL),this.playerState=null},t.prototype.release=function(){window.__onGCastApiAvailable=this.SL||void 0,this.remotePlayerController&&(this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,this.XL),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.YL),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.cL),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.bL),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.aL),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.ZL),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.dL),chrome.cast.removeReceiverActionListener(this.UL),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.VL),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.WL))},t.prototype.setSource=function(e,t,o){var n=this;return this.lastSource=e,this.getMediaInfo(e).then(function(e){var r=new chrome.cast.media.LoadRequest(e);return r.autoplay=t||!1,null!=o&&(r.currentTime=o),n.loadMediaRequest(r)})},t.prototype.loadMediaRequest=function(e){var t=this,o=cast.framework.CastContext.getInstance().getCurrentSession().getSessionObj();return new Promise(function(n,r){o.loadMedia(e,function(e){t.context.logger.debug("Load successful",e),t.media=e,t.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,t.XL),n()},function(e){t.context.logger.debug("Load failed with error",e),r(e)})})},t.prototype.getSource=function(){return this.remotePlayer.mediaInfo?c(this.remotePlayer.mediaInfo):null},t.prototype.play=function(){this.remotePlayer.isPaused&&this.remotePlayerController.playOrPause()},t.prototype.isPlaying=function(){return!this.remotePlayer.isPaused},t.prototype.pause=function(){this.remotePlayer.isPaused||this.remotePlayerController.playOrPause()},t.prototype.isPaused=function(){return this.remotePlayer.isPaused},t.prototype.getCurrentTime=function(t){return void 0===t&&(t=i.TimeMode.AbsoluteTime),t===i.TimeMode.RelativeTime?e.prototype.getCurrentTime.call(this,t):this.remotePlayer.currentTime},t.prototype.seek=function(e){this.remotePlayer.currentTime=e,this.remotePlayerController.seek(),this.onRemotePlayerEvent({event:r.PlayerEvent.Seeked})},t.prototype.setVolume=function(e){this.remotePlayer.volumeLevel=e,this.remotePlayerController.setVolumeLevel()},t.prototype.getVolume=function(){return this.remotePlayer.volumeLevel},t.prototype.setMuted=function(e){e!==this.remotePlayer.isMuted&&this.remotePlayerController.muteOrUnmute()},t.prototype.isMuted=function(){return this.remotePlayer.isMuted},t}(o(35317).RemoteControlBase);function c(e){var t=e.contentUrl||e.contentId;switch(e.contentType.toLowerCase()){case a.ManifestMimeType.Dash:return{dash:t};case a.ManifestMimeType.Hls:return{hls:t};case a.ManifestMimeType.Smooth:return{smooth:t};default:return{progressive:t}}}t.GoogleCastRemoteControlBase=u},61348:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV2=void 0;var r=o(58313),i=o(32645),a=o(61567),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.getMediaInfo=function(e){var t=new chrome.cast.media.MediaInfo(a.RemoteJSON.stringify(e),"application/json");if(t.streamType=chrome.cast.media.StreamType.BUFFERED,t.metadata=new chrome.cast.media.GenericMediaMetadata,t.metadata.title=e.title||null,t.metadata.subtitle=e.description||null,e.poster){var o=r.URLHelper.toFullUrl(e.poster);t.metadata.images=[new chrome.cast.Image(o)]}return Promise.resolve(t)},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t}(i.GoogleCastRemoteControlBase);t.GoogleCastRemoteControlV2=s},23747:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),r=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV3=void 0,t.getDrmConfig=function(e){if(e.widevine)return P(e.widevine,i.WIDEVINE);if(e.playready)return P(e.playready,i.PLAYREADY);if(e.clearkey)return P(e.clearkey,i.CLEARKEY);throw new Error("Not supported drm config.")},t.getUrlFromKeys=M,t.sortProgressiveSources=C;var i,a=o(80813),s=o(20213),l=o(85625),u=o(74853),c=o(70233),d=o(58313),p=o(32645),f=o(7209),h=o(2025),y=o(58367),m=o(13748),g=o(15529);!function(e){e.CLEARKEY="clearkey",e.PLAYREADY="playready",e.WIDEVINE="widevine"}(i||(i={}));var v=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n.rM=0,n.uM=!1,n.AM=function(e){var t,o;(null===(t=n.mediaInfo)||void 0===t?void 0:t.duration)>0&&(null===(o=n.mediaInfo)||void 0===o?void 0:o.duration)-n.qM<2&&0===e.value&&(n.fL=!0,n.onRemotePlayerEvent({event:s.PlayerEvent.PlaybackFinished})),n.qM=e.value},n.sM=new m.MediaInfoTrackMapper(t),n.tM=new y.EditTrackInfoProcessor(n.mediaInfo,n.media,n.context.logger),n.vM=new g.MediaInfoWrapper(n.mediaInfo,n.context.logger),n}return n(t,e),t.prototype.initializeCast=function(){e.prototype.initializeCast.call(this),this.zM()},t.prototype.getCurrentTime=function(e){if(void 0===e&&(e=s.TimeMode.AbsoluteTime),!this.remotePlayer)return 0;var t=this.remotePlayer.currentTime;return e===s.TimeMode.RelativeTime?t:this.wM(t)},t.prototype.wM=function(e){return e+this.yM()},t.prototype.xM=function(e){return e-this.yM()},t.prototype.yM=function(){var e,t,o,n=null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t?void 0:t.customData;return null!==(o=null==n?void 0:n.startAbsoluteTime)&&void 0!==o?o:0},t.prototype.zM=function(){var e=this;this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.AM),this.context.eventHandler.on(s.PlayerEvent.PeriodSwitch,function(){new h.GoogleCastV3TrackFinder(e.mediaInfo).hasATrackToLoad()&&e.IM()})},t.prototype.sendMessage=function(e,t){this.config.messageNamespace&&this.castSession.sendMessage(this.config.messageNamespace,{type:"METADATA",data:t})},t.prototype.play=function(){var t=this;this.fL&&this.lastSource?this.setSource(this.lastSource).then(function(){return e.prototype.play.call(t)}):e.prototype.play.call(this),this.fL=!1},t.prototype.BM=function(e){var t=this.EM(e),o=t.url,n=t.mimeType,r=new chrome.cast.media.MediaInfo(o,n);return r.customData=(0,f.getCustomData)(e,n),r},t.prototype.getMediaInfo=function(e){var t,o=this.BM(e),n=this.context.sourceContext.sourceIdentifier,r=this.context.serviceManager.get(a.ServiceName.ManifestService,n);return(null==r?void 0:r.isLive())&&(o.streamType=chrome.cast.media.StreamType.LIVE,this.rM=0),this.CM(null!==(t=e.subtitleTracks)&&void 0!==t?t:[],o),this.config.prepareMediaInfo?this.config.prepareMediaInfo(o):Promise.resolve(o)},t.prototype.CM=function(e,t){var o=new g.MediaInfoWrapper(t,this.context.logger);r(r([],null!=e?e:[],!0),this.DM(),!0).forEach(function(e){return o.maybeAddInternalTrack(e)})},t.prototype.DM=function(){var e=this.context.internalPlayer.listSubtitles().filter(function(e){return e.isSideloaded}),t=this.context.internalPlayer.getAvailableAudio();return r(r([],e,!0),t,!0)},t.prototype.EM=function(e){var t,o;if(e.dash)t=e.dash,o=l.ManifestMimeType.Dash;else if(e.hls)t=e.hls,o=l.ManifestMimeType.Hls;else if(e.smooth)t=e.smooth,o=l.ManifestMimeType.Smooth;else{if(!e.progressive)throw new Error("Source not supported.");var n=this.GM(e.progressive);t=n.url,o=n.mimeType}return{url:t=d.URLHelper.toFullUrl(t),mimeType:o}},t.prototype.timeShift=function(e){var t;this.rM=e,this.seek(((null===(t=this.FM())||void 0===t?void 0:t.end)||0)+e)},t.prototype.seek=function(t){e.prototype.seek.call(this,this.xM(t))},t.prototype.FM=function(){var e,t=null===(e=this.remotePlayer)||void 0===e?void 0:e.liveSeekableRange;return void 0===(null==t?void 0:t.start)||void 0===(null==t?void 0:t.end)?{start:-1,end:-1}:{start:this.wM(t.start),end:this.wM(t.end)}},t.prototype.getTimeShift=function(){var e=this.FM();if(e.end<0)return this.rM;var t=this.getCurrentTime()-e.end;return t>0?0:t},t.prototype.getMaxTimeShift=function(){var e,t,o=this.FM();return(null!==(e=null==o?void 0:o.start)&&void 0!==e?e:0)-(null!==(t=null==o?void 0:o.end)&&void 0!==t?t:0)},t.prototype.GM=function(e){var t,o;if(Array.isArray(e)){var n=C(e)[0];t=n.url,o=n.type}else t=e;return{url:t,mimeType:o}},t.prototype.release=function(){e.prototype.release.call(this),this.remotePlayerController&&this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.AM)},t.prototype.HM=function(e){var t,o,n=this;e&&(null!==(o=null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay)&&void 0!==o&&o?this.IM().then(function(){n.tM.enableTrack(e)}):this.tM.enableTrack(e))},t.prototype.enableSubtitle=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.TEXT);t&&this.HM(t)},t.prototype.disableSubtitle=function(e){this.tM.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.setAudio=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.AUDIO);t&&this.HM(t)},t.prototype.mediaInfoChangedEventHandler=function(t){var o,n;e.prototype.mediaInfoChangedEventHandler.call(this,t),this.tM.setMediaInfo(this.mediaInfo),this.vM=new g.MediaInfoWrapper(this.mediaInfo,this.context.logger),this.sM.maybeReMapTracksForMediaInfo(this.mediaInfo);var r=new g.MediaInfoWrapper(this.mediaInfo,this.context.logger);this.DM().forEach(function(e){return r.maybeAddInternalTrack(e)}),this.uM&&(null===(n=null===(o=this.mediaInfo)||void 0===o?void 0:o.tracks)||void 0===n?void 0:n.length)>0&&this.JM()},t.prototype.addSubtitle=function(e){this.vM.maybeAddInternalTrack(e)},t.prototype.removeSubtitle=function(e){var t,o,n=new g.MediaInfoWrapper(this.mediaInfo,this.context.logger),r=Boolean(null===(o=null===(t=this.media)||void 0===t?void 0:t.activeTrackIds)||void 0===o?void 0:o.find(function(t){return t===n.findTrackIdForTrack(e)}));n.maybeRemoveInternalTrack(e)&&r&&this.tM.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.IM=function(){var e=new chrome.cast.media.LoadRequest(this.mediaInfo);return e.currentTime=this.context.internalPlayer.getCurrentTime(),e.autoplay=this.context.internalPlayer.isPlaying(),this.loadMediaRequest(e)},t.prototype.loadMediaRequest=function(t){var o=this;return this.sM.markAllTracksAsReadyToPlay(t.media.tracks),e.prototype.loadMediaRequest.call(this,t).then(function(){o.uM=!0,o.tM.setMedia(o.media),o.tM.setMediaInfo(o.mediaInfo),o.JM()})},t.prototype.JM=function(){var e,t=this;if(this.mediaInfo){this.uM=!1;var o=this.context.internalPlayer.listSubtitles().filter(function(e){return!!e.enabled}).map(function(e){return e.id});o.push(null===(e=this.context.internalPlayer.getAudio())||void 0===e?void 0:e.id),o=o.filter(Boolean);var n=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTracksForIds(o),r=n.some(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}),i=n.map(function(e){return e.trackId});if(!r)return this.tM.changeActiveTracksBasedOnCastIds(i);this.IM().then(function(){t.tM.changeActiveTracksBasedOnCastIds(i)})}},t}(p.GoogleCastRemoteControlBase);function M(e){var t={keys:e.map(function(e){var t=c.FormatHelper.hexToBytes(e.key),o=c.FormatHelper.hexToBytes(e.kid||"");return{kty:"oct",kid:u.ArrayHelper.arrayBufferToBase64(o.buffer).replace(/[=]*$/,""),k:u.ArrayHelper.arrayBufferToBase64(t.buffer).replace(/[=]*$/,"")}})},o=JSON.stringify(t);return"data:application/json;base64,"+btoa(o)}function C(e){return e.sort(function(e,t){return e.preferred===t.preferred?(e.bitrate||0)>(t.bitrate||0)?-1:1:(e.preferred||0)>(t.preferred||0)?-1:1})}function P(e,t){return function(e){return Array.isArray(e)}(e)?{protectionSystem:i.CLEARKEY,licenseUrl:M(e)}:{protectionSystem:t,licenseUrl:e.LA_URL||"",headers:e.headers,withCredentials:e.withCredentials||!1}}t.GoogleCastRemoteControlV3=v},7209:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomData=function(e,t){var o={};return i(e.drm)&&(o.drm=(0,r.getDrmConfig)(e.drm)),i(e.metadata)&&(o.metadata=e.metadata),i(e.options)&&(o.options=function(e,t){var o,r,i=e.options;return t===n.ManifestMimeType.Dash?(o=a(i,["dashWithCredentials","withCredentials"]),r=a(i,["dashManifestWithCredentials","manifestWithCredentials"])):t===n.ManifestMimeType.Hls&&(o=a(i,["hlsWithCredentials","withCredentials"]),r=a(i,["hlsManifestWithCredentials","manifestWithCredentials"])),{withCredentials:o||!1,manifestWithCredentials:r||!1}}(e,t)),o};var n=o(85625),r=o(23747);function i(e){return Object.keys(null!=e?e:{}).length>0}function a(e,t){for(var o,n=0,r=t;n<r.length;n++){var i=r[n];if(i in e){o=e[i];break}}return o}},2025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastV3TrackFinder=void 0;var o=function(){function e(e){this.x8=e}return e.prototype.findTrackIdByInternalId=function(e,t){var o,n;return null!==(n=null===(o=this.findTrackByInternalId(e,t))||void 0===o?void 0:o.trackId)&&void 0!==n?n:null},e.prototype.findTrackByInternalId=function(e,t){var o,n,r;return null!==(r=(null!==(n=null===(o=this.x8)||void 0===o?void 0:o.tracks)&&void 0!==n?n:[]).find(function(o){var n;return(null===(n=o.customData)||void 0===n?void 0:n.internalId)===e&&o.type===t}))&&void 0!==r?r:null},e.prototype.findTracksForIds=function(e){var t,o;return(null!==(o=null===(t=this.x8)||void 0===t?void 0:t.tracks)&&void 0!==o?o:[]).filter(function(t){var o;return e.includes(null===(o=t.customData)||void 0===o?void 0:o.internalId)})},e.prototype.hasATrackToLoad=function(){var e,t;return Boolean(null===(t=null===(e=this.x8)||void 0===e?void 0:e.tracks)||void 0===t?void 0:t.find(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}))},e.prototype.setMediaInfo=function(e){this.x8=e},e}();t.GoogleCastV3TrackFinder=o},94952:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCustomElementRegistry=function(){var e=function(){var e=window.customElements;return function(e){return"object"==typeof e&&["get","define","whenDefined","upgrade"].every(function(t){return"function"==typeof e[t]})}(e)?e:void 0}();void 0===o&&void 0!==e&&(o=new r(e),Object.defineProperty(window,"customElements",{get:function(){return o}}))};var o,n=["google-cast-button","google-cast-launcher"],r=function(){function e(e){this.registry=e}return e.prototype.define=function(e,t,o){var r=n.includes(e),i=Boolean(this.registry.get(e));r&&i||this.registry.define(e,t,o)},e.prototype.whenDefined=function(e){return this.registry.whenDefined(e)},e.prototype.get=function(e){return this.registry.get(e)},e.prototype.upgrade=function(e){this.registry.upgrade(e)},e}()},92682:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlModuleDefinition=void 0;var n=o(62756),r=o(42489);t.RemoteControlModuleDefinition={name:n.ModuleName.RemoteControl,module:{RemoteControlManager:r.RemoteControlManager}},t.default=t.RemoteControlModuleDefinition},60768:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlMessageType=void 0,function(e){e[e.SourceSetup=0]="SourceSetup",e[e.PlayerApiMethodCall=1]="PlayerApiMethodCall",e[e.CustomData=2]="CustomData"}(o||(t.RemoteControlMessageType=o={}))},35317:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlBase=void 0;var n,r=o(20213),i=o(60768),a=o(30165);!function(e){e[e.Idle=0]="Idle",e[e.Ready=1]="Ready",e[e.Connected=2]="Connected"}(n||(n={}));var s=function(){function e(e){this.context=e,this.P8=n.Idle}return Object.defineProperty(e.prototype,"P8",{get:function(){return this.N8},set:function(e){this.context.logger.debug("Remote control session state change: ".concat(n[this.N8]," -> ").concat(n[e])),this.N8=e},enumerable:!1,configurable:!0}),e.prototype.getConfig=function(){throw new Error("Not implemented - overwrite in subclasses!")},e.prototype.setOnErrorCallback=function(e){this.G8=e},e.prototype.setOnReadyCallback=function(e){this.H8=e},e.prototype.setOnConnectCallback=function(e){this.I8=e},e.prototype.setOnConnectedCallback=function(e){this.J8=e},e.prototype.setOnDisconnectCallback=function(e){this.K8=e},e.prototype.setOnDisconnectedCallback=function(e){this.L8=e},e.prototype.setOnRemotePlayerEventCallback=function(e){this.M8=e},e.prototype.isReady=function(){return this.P8===n.Ready},e.prototype.isConnected=function(){return this.P8===n.Connected},e.prototype.onError=function(){this.P8=n.Ready,this.G8&&this.G8()},e.prototype.onReady=function(e){void 0===e&&(e=!0);var t=e?n.Ready:n.Idle;this.P8!==t&&(this.P8=t,this.H8&&this.H8({receiverAvailable:e}))},e.prototype.Q8=function(){this.playerState={isPlaying:!1,isPaused:!1,hasEnded:!1,isMuted:!1,isStalled:!1,isLive:!1,getVolume:1,getCurrentTime:0,getRelativeCurrentTime:0,getDuration:0,getVersion:"",getDroppedVideoFrames:0,getForwardBufferLevelForVideo:0,getBackwardBufferLevelForVideo:0,getForwardBufferLevelForAudio:0,getBackwardBufferLevelForAudio:0,getTotalStalledTime:0,getDownloadedVideoData:null,getDownloadedAudioData:null,getPlaybackVideoData:null,getPlaybackAudioData:null,getMaxTimeShift:0,getTimeShift:0,getSubtitle:null,getAudio:null}},e.prototype.onConnect=function(e){this.I8&&this.I8({deviceName:e}),this.Q8()},e.prototype.onConnected=function(e,t){this.P8=n.Connected,this.Q8(),this.J8&&this.J8({deviceName:e,resumed:t})},e.prototype.onDisconnect=function(){this.K8&&this.K8()},e.prototype.onDisconnected=function(){this.P8=n.Ready,this.L8&&this.L8()},e.prototype.onRemotePlayerEvent=function(e){this.M8&&this.M8(e)},e.prototype.sendMethodCallMessage=function(e,t){var o=[];t&&(o=Array.isArray(t)?t:1===t.length?[t[0]]:Array.apply(null,t)),this.sendMessage(i.RemoteControlMessageType.PlayerApiMethodCall,{methodName:e,arguments:o})},e.prototype.handleRemoteControlReceiverMessage=function(e){switch(e.type){case a.RemoteControlReceiverMessageType.PlayerState:return this.playerState=e.data,!0;case a.RemoteControlReceiverMessageType.PlayerEvent:var t=e.data;return this.onRemotePlayerEvent(t),!0;case a.RemoteControlReceiverMessageType.PlayerGetterCallReturnValue:return!0}return!1},e.prototype.play=function(){this.sendMethodCallMessage("play")},e.prototype.pause=function(){this.sendMethodCallMessage("pause")},e.prototype.seek=function(e){this.sendMethodCallMessage("seek",[e])},e.prototype.setTargetBufferLevel=function(e,t,o){this.sendMethodCallMessage("setTargetBufferLevel",[e,t,o])},e.prototype.setVolume=function(e){this.sendMethodCallMessage("setVolume",[e])},e.prototype.setMuted=function(e){e?this.sendMethodCallMessage("mute"):this.sendMethodCallMessage("unmute")},e.prototype.isPlaying=function(){return this.playerState.isPlaying},e.prototype.isPaused=function(){return this.playerState.isPaused},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=r.TimeMode.AbsoluteTime),e===r.TimeMode.AbsoluteTime?this.playerState.getCurrentTime:this.playerState.getRelativeCurrentTime},e.prototype.getVolume=function(){return this.playerState.getVolume},e.prototype.isMuted=function(){return this.playerState.isMuted},e.prototype.hasEnded=function(){return this.playerState.hasEnded},e.prototype.isStalled=function(){return this.playerState.isStalled},e.prototype.isLive=function(){return this.playerState.isStalled},e.prototype.getDuration=function(){return this.playerState.getDuration},e.prototype.getDroppedVideoFrames=function(){return this.playerState.getDroppedVideoFrames},e.prototype.getBufferLevel=function(e,t){var o={level:0,targetLevel:this.context.bufferSettings.getTargetLevel(e,t),type:e,media:t};return r.BufferType.ForwardDuration?t===r.MediaType.Video?o.level=this.playerState.getForwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getForwardBufferLevelForAudio):r.BufferType.BackwardDuration&&(t===r.MediaType.Video?o.level=this.playerState.getBackwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getBackwardBufferLevelForAudio)),o},e.prototype.getTotalStalledTime=function(){return this.playerState.getTotalStalledTime},e.prototype.getDownloadedVideoData=function(){return this.playerState.getDownloadedVideoData},e.prototype.getDownloadedAudioData=function(){return this.playerState.getDownloadedAudioData},e.prototype.getPlaybackVideoData=function(){return this.playerState.getPlaybackVideoData},e.prototype.getPlaybackAudioData=function(){return this.playerState.getPlaybackAudioData},e.prototype.getTimeShift=function(){return this.playerState.getTimeShift},e.prototype.getMaxTimeShift=function(){return this.playerState.getMaxTimeShift},e.prototype.preload=function(){this.sendMethodCallMessage("preload",[])},e.prototype.setAudioQuality=function(e){this.sendMethodCallMessage("setAudioQuality",[e])},e.prototype.setVideoQuality=function(e){this.sendMethodCallMessage("setVideoQuality",[e])},e.prototype.setQueryParameters=function(e){this.sendMethodCallMessage("setQueryParameters",[e])},e.prototype.clearQueryParameters=function(){this.sendMethodCallMessage("clearQueryParameters",[])},e.prototype.timeShift=function(e){this.sendMethodCallMessage("timeShift",[e])},e.prototype.enableSubtitle=function(e){this.sendMethodCallMessage("subtitles.enable",[e])},e.prototype.disableSubtitle=function(e){this.sendMethodCallMessage("subtitles.disable",[e])},e.prototype.setAudio=function(e){this.sendMethodCallMessage("setAudio",[e])},e.prototype.getSnapshot=function(e,t){this.sendMethodCallMessage("getSnapshot",[e,t])},e.prototype.setPlaybackSpeed=function(e){this.sendMethodCallMessage("setPlaybackSpeed",[e])},e.prototype.unload=function(){return this.sendMethodCallMessage("unload"),Promise.resolve()},e}();t.RemoteControlBase=s},42489:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlManager=void 0;var n=o(23690),r=o(85648),i=o(68657),a=o(32645),s=o(61348),l=o(23747),u=o(94952),c=o(77118),d=o(91297),p=function(){function e(t,o){this.Bi=e.setupRemoteControl(t),this.Bi instanceof a.GoogleCastRemoteControlBase&&function(e,t){(0,u.wrapCustomElementRegistry)(),e.removeScript(t,"cast_sender.js"),e.removeScript(t,"cast_framework.js"),setTimeout(function(){return e.loadScript(t)},0)}(o,t.config.location.cast)}return e.prototype.getPlayerWrapper=function(e,t){return new c.RemoteControlPlayerWrapper(e,t,this.Bi)},e.setupRemoteControl=function(e){if(null==e.config||null==e.settings)return null;var t=e.config,o=e.settings;if((t.cast&&t.cast.enable||(!t.cast||t.cast&&!t.cast.hasOwnProperty("enable"))&&t.remotecontrol&&"googlecast"===t.remotecontrol.type)&&(t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.receiverApplicationId?(o.CAST_APPLICATION_ID=t.remotecontrol.receiverApplicationId,e.logger.debug("ChromeCast setting application ID to ".concat(o.CAST_APPLICATION_ID))):t.cast&&t.cast.application_id?(o.CAST_APPLICATION_ID=t.cast.application_id,e.logger.debug("ChromeCast setting application ID to ".concat(o.CAST_APPLICATION_ID))):e.logger.debug("ChromeCast using default application ID ".concat(o.CAST_APPLICATION_ID)),t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.messageNamespace?0===t.remotecontrol.messageNamespace.indexOf("urn:x-cast:")?o.CAST_MESSAGE_NAMESPACE=t.remotecontrol.messageNamespace:(e.logger.debug("ChromeCast setting message namespace failed! Namespace must start with urn:x-cast:"),e.logger.debug("ChromeCast using default message namespace ".concat(o.CAST_MESSAGE_NAMESPACE))):t.cast&&t.cast.message_namespace?0===t.cast.message_namespace.indexOf("urn:x-cast:")?(o.CAST_MESSAGE_NAMESPACE=t.cast.message_namespace,e.logger.debug("ChromeCast setting message namespace to ".concat(o.CAST_MESSAGE_NAMESPACE))):(e.logger.debug("ChromeCast setting message namespace failed! Namespace must start with urn:x-cast:"),e.logger.debug("ChromeCast using default message namespace ".concat(o.CAST_MESSAGE_NAMESPACE))):e.logger.debug("ChromeCast using default message namespace ".concat(o.CAST_MESSAGE_NAMESPACE)),t.hasOwnProperty("remotecontrol")||(t.remotecontrol={type:"googlecast",receiverApplicationId:o.CAST_APPLICATION_ID,messageNamespace:o.CAST_MESSAGE_NAMESPACE,customReceiverConfig:{receiverStylesheetUrl:t.cast.receiverStylesheetUrl||null}})),t.remotecontrol&&t.remotecontrol.type)switch(t.remotecontrol.type){case"googlecast":return t.remotecontrol.receiverApplicationId=t.remotecontrol.receiverApplicationId||o.CAST_APPLICATION_ID,t.remotecontrol.messageNamespace=t.remotecontrol.messageNamespace||o.CAST_MESSAGE_NAMESPACE,t.remotecontrol.receiverVersion===i.GoogleCastReceiverVersion.v3?(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV3)),new l.GoogleCastRemoteControlV3(e,t.remotecontrol)):(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV2)),new s.GoogleCastRemoteControlV2(e,t.remotecontrol));case"websocket":return e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.Websocket)),new d.WebSocketRemoteControl(e,t.remotecontrol);default:e.logger.debug("unknown remote control type: "+t.remotecontrol.type)}return null},e}();t.RemoteControlManager=p},77118:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlPlayerWrapper=t.addStartOffset=t.clamp=t.getForwardBufferDiff=void 0;var n=o(9768),r=o(3714),i=o(44468),a=o(23690),s=o(87827),l=o(85648),u=o(71223),c=o(32645),d=o(60768);t.getForwardBufferDiff=function(e){return e.getBufferLevel(i.BufferType.ForwardDuration,i.MediaType.Video).targetLevel-20},t.clamp=function(e,t,o){return Math.max(t,Math.min(o,e))},t.addStartOffset=function(e,o,n){var r=Boolean(e.options&&e.options.startOffset);return(o||!r)&&(e.options=e.options||{},e.options.startOffset=n.isLive()?n.getTimeShift()-(0,t.getForwardBufferDiff)(n):n.getCurrentTime()),e};var p=function(){function e(e,o,n){var i=this;if(this.RM=!1,this.SM=!1,this.OM=e,this.PM=o,this.QM=n,n){var s=!1,c=!1,d=function(){i.SM=i.PM.isPlaying(),i.PM.pause()};n.setOnErrorCallback(function(){e.logger.debug("Remote error"),e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s&&(s=!1,i.UM(),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)))}),n.setOnReadyCallback(function(t){e.logger.debug("Remote ready"),e.eventHandler.dispatchEvent(r.PlayerEvent.CastAvailable,{receiverAvailable:t.receiverAvailable})}),n.setOnConnectCallback(function(t){e.logger.debug("Remote connect",t),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connecting)),d(),e.eventHandler.dispatchEvent(r.PlayerEvent.CastWaitingForDevice,{castPayload:{deviceName:t.deviceName,currentTime:void 0,timestamp:void 0,type:void 0}})}),n.setOnConnectedCallback(function(o){e.logger.debug("Remote connected",o),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connected));var p=(0,u.isSameSource)(n.getSource(),e.sourceContext.source);if(o.resumed&&d(),!o.resumed||!p){e.settings.QUERY_PARAMETERS&&n.setQueryParameters(e.settings.QUERY_PARAMETERS),null!=n.getConfig()&&n.getConfig().customReceiverConfig&&i.addMetadata("CAST",{type:"customReceiverConfig",data:n.getConfig().customReceiverConfig});var f=(0,t.addStartOffset)(e.sourceContext.source,i.RM,i.PM);n.setSource(f,i.TM(),i.PM.getCurrentTime()),c=!0}e.eventHandler.dispatchEvent(r.PlayerEvent.CastStarted,{deviceName:o.deviceName,resuming:o.resumed}),s=!0,e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnDisconnectCallback(function(){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnecting)),e.logger.debug("Remote disconnect")}),n.setOnDisconnectedCallback(function(){e.logger.debug("Remote disconnected"),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)),e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s=!1,i.UM(),e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnRemotePlayerEventCallback(function(t){if(e.logger.debug("Remote player state changed",t),c)switch(t.event){case r.PlayerEvent.Play:case r.PlayerEvent.Paused:c=!1;for(var i=0,a=o.listSubtitles();i<a.length;i++){var s=a[i];n.addSubtitle(s),s.enabled&&n.enableSubtitle(s.id)}}var l=t.data||{};l.remote=!0,e.eventHandler.dispatchEvent(t.event,l)})}else e.logger.debug("No remote control passed into wrapper")}return e.prototype.TM=function(){return this.OM.config&&this.OM.config.playback&&this.OM.config.playback.autoplay||this.SM},e.prototype.UM=function(){var e=this.OM.settings.ENABLE_SEEK_FOR_LIVE;if(this.PM.isLive()&&!e){var o=this.QM.getTimeShift()+(0,t.getForwardBufferDiff)(this.PM),n=this.PM.getMaxTimeShift();this.PM.timeShift((0,t.clamp)(o,n,0))}else{var r=this.PM.getSeekableRange(),i=this.QM.getCurrentTime();this.PM.seek((0,t.clamp)(i,r.start,r.end))}this.QM.isPlaying()?this.PM.play():this.PM.pause()},e.prototype.VM=function(){return null!=this.QM&&this.QM.isReady()},e.prototype.WM=function(){return null!=this.QM&&this.QM.isConnected()},e.prototype.XM=function(e){var t=(0,s.getRemoteControlState)(this.OM.store.getState().player).remoteControlType===l.RemoteControlType.GoogleCastV3;e===n.UI_SEEK_ISSUER_NAME&&t||this.QM.pause()},e.prototype.YM=function(e){this.PM.pause(e)},e.prototype.getAvailableSegments=function(){return this.PM.getAvailableSegments()},e.prototype.play=function(e){return this.RM=!0,this.WM()?(this.QM.play(),Promise.resolve()):this.PM.play(e)},e.prototype.preload=function(){this.WM()?this.QM.preload():this.PM.preload()},e.prototype.pause=function(e){this.WM()?this.XM(e):this.YM(e)},e.prototype.mute=function(e){this.WM()&&this.QM.setMuted(!0),this.PM.mute(e)},e.prototype.unmute=function(e){this.WM()&&this.QM.setMuted(!1),this.PM.unmute(e)},e.prototype.setVolume=function(e,t){this.WM()?this.QM.setVolume(e/100):this.PM.setVolume(e,t)},e.prototype.seek=function(e,t){return this.WM()?(this.QM.seek(e),!0):this.PM.seek(e,t)},e.prototype.setAudioQuality=function(e){this.WM()&&this.QM.setAudioQuality(e),this.PM.setAudioQuality(e)},e.prototype.setVideoQuality=function(e){this.WM()&&this.QM.setVideoQuality(e),this.PM.setVideoQuality(e)},e.prototype.prepareLoad=function(){return this.PM.prepareLoad()},e.prototype.prepareSource=function(e,t){return this.PM.prepareSource(e,t)},e.prototype.load=function(e,t,o){return this.WM()&&this.QM.setSource(this.OM.sourceContext.source,this.TM()),this.PM.load(e,t,o)},e.prototype.unload=function(e){return this.WM()&&this.QM.unload(),this.PM?this.PM.unload(e):Promise.resolve()},e.prototype.isPlaying=function(){return this.WM()?this.QM.isPlaying():this.PM.isPlaying()},e.prototype.isPaused=function(){return this.WM()?this.QM.isPaused():this.PM.isPaused()},e.prototype.hasEnded=function(){return this.WM()?this.QM.hasEnded():this.PM.hasEnded()},e.prototype.isMuted=function(){return this.WM()?this.QM.isMuted():this.PM.isMuted()},e.prototype.isStalled=function(){return this.WM()?this.QM.isStalled():this.PM.isStalled()},e.prototype.isLive=function(){return this.PM.isLive()},e.prototype.getVolume=function(){return this.WM()?100*this.QM.getVolume():this.PM.getVolume()},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=i.TimeMode.AbsoluteTime),this.WM()?this.QM.getCurrentTime(e):this.PM.getCurrentTime(e)},e.prototype.getDuration=function(){return this.PM.getDuration()},e.prototype.getAvailableVideoQualities=function(){return this.PM.getAvailableVideoQualities()},e.prototype.getAvailableAudioQualities=function(){return this.PM.getAvailableAudioQualities()},e.prototype.getDroppedVideoFrames=function(){return this.WM()?this.QM.getDroppedVideoFrames():this.PM.getDroppedVideoFrames()},e.prototype.setTargetBufferLevel=function(e,t,o){return this.WM()?this.QM.setTargetBufferLevel(e,t,o):this.PM.setTargetBufferLevel(e,t,o)},e.prototype.getBufferLevel=function(e,t){return this.WM()?this.QM.getBufferLevel(e,t):this.PM.getBufferLevel(e,t)},e.prototype.getTotalStalledTime=function(){return this.WM()?this.QM.getTotalStalledTime():this.PM.getTotalStalledTime()},e.prototype.getDownloadedVideoData=function(){return this.WM()?this.QM.getDownloadedVideoData():this.PM.getDownloadedVideoData()},e.prototype.getDownloadedAudioData=function(){return this.WM()?this.QM.getDownloadedAudioData():this.PM.getDownloadedAudioData()},e.prototype.getPlaybackVideoData=function(){return this.WM()?this.QM.getPlaybackVideoData():this.PM.getPlaybackVideoData()},e.prototype.getPlaybackAudioData=function(){return this.WM()?this.QM.getPlaybackAudioData():this.PM.getPlaybackAudioData()},e.prototype.getBufferedRanges=function(){return this.PM.getBufferedRanges()},e.prototype.getManifest=function(){return this.PM.getManifest()},e.prototype.isCasting=function(){return this.WM()},e.prototype.isCastAvailable=function(){return this.VM()||this.WM()},e.prototype.castVideo=function(){this.VM()&&(this.QM.connect(),this.OM.eventHandler.dispatchEvent(r.PlayerEvent.CastStart))},e.prototype.castStop=function(){if(this.WM()){if(this.QM instanceof c.GoogleCastRemoteControlBase)return this.QM.connect();this.QM.disconnect()}},e.prototype.updateCallback=function(e){this.PM.updateCallback(e)},e.prototype.setQueryParameters=function(e){this.WM()&&this.QM.setQueryParameters(e),this.PM.setQueryParameters(e)},e.prototype.clearQueryParameters=function(){this.WM()&&this.QM.clearQueryParameters(),this.PM.clearQueryParameters()},e.prototype.getMaxTimeShift=function(){return this.WM()?this.QM.getMaxTimeShift():this.PM.getMaxTimeShift()},e.prototype.timeShift=function(e,t){this.WM()?this.QM.timeShift(e):this.PM.timeShift(e,t)},e.prototype.getTimeShift=function(){return this.WM()?this.QM.getTimeShift():this.PM.getTimeShift()},e.prototype.addSubtitle=function(e){return this.WM()&&this.QM.addSubtitle(e),this.PM.addSubtitle(e)},e.prototype.removeSubtitle=function(e){this.WM()&&this.QM.removeSubtitle(e),this.PM.removeSubtitle(e)},e.prototype.enableSubtitle=function(e){return this.WM()&&this.QM.enableSubtitle(e),this.PM.enableSubtitle(e)},e.prototype.disableSubtitle=function(e){return this.WM()&&this.QM.disableSubtitle(e),this.PM.disableSubtitle(e)},e.prototype.listSubtitles=function(){return this.PM.listSubtitles()},e.prototype.getAudioQuality=function(){return this.PM.getAudioQuality()},e.prototype.getVideoQuality=function(){return this.PM.getVideoQuality()},e.prototype.setAudio=function(e){this.WM()&&this.QM.setAudio(e),this.PM.setAudio(e)},e.prototype.getAvailableAudio=function(){return this.PM.getAvailableAudio()},e.prototype.getAudio=function(){return this.PM.getAudio()},e.prototype.getSnapshot=function(e,t){if(!this.WM())return this.PM.getSnapshot(e,t)},e.prototype.setPlaybackSpeed=function(e){this.WM()&&this.QM.setPlaybackSpeed(e),this.PM.setPlaybackSpeed(e)},e.prototype.getPlaybackSpeed=function(){return this.PM.getPlaybackSpeed()},e.prototype.permitControl=function(e){this.PM.permitControl(e)},e.prototype.addMetadata=function(e,t){return!("CAST"!==e.toUpperCase()||!this.WM()||(this.QM.sendMessage(d.RemoteControlMessageType.CustomData,t),0))},e.prototype.onFullscreenEnter=function(e){this.PM.onFullscreenEnter(e)},e.prototype.onFullscreenExit=function(){this.PM.onFullscreenExit()},e.prototype.isAirplayAvailable=function(){return this.PM.isAirplayAvailable()},e.prototype.isAirplayActive=function(){return this.PM.isAirplayActive()},e.prototype.showAirplayTargetPicker=function(){this.PM.showAirplayTargetPicker()},e.prototype.getSeekableRange=function(){return this.PM.getSeekableRange()},e.prototype.getLatency=function(){return this.PM.getLatency()},e.prototype.setTargetLatency=function(e){this.PM.setTargetLatency(e)},e.prototype.getTargetLatency=function(){return this.PM.getTargetLatency()},e.prototype.setCatchupConfig=function(e){this.PM.setCatchupConfig(e)},e.prototype.getCatchupConfig=function(){return this.PM.getCatchupConfig()},e.prototype.setFallbackConfig=function(e){this.PM.setFallbackConfig(e)},e.prototype.getFallbackConfig=function(){return this.PM.getFallbackConfig()},e.prototype.createManifestApi=function(){return this.PM.createManifestApi()},e.prototype.release=function(e){var t=this;return null!=this.QM&&(this.QM.setOnErrorCallback(null),this.QM.setOnReadyCallback(null),this.QM.setOnConnectCallback(null),this.QM.setOnConnectedCallback(null),this.QM.setOnDisconnectCallback(null),this.QM.setOnDisconnectedCallback(null),this.QM.setOnRemotePlayerEventCallback(null),this.QM.release()),this.PM.release(e).then(function(){t.PM=null,t.QM=null})},e}();t.RemoteControlPlayerWrapper=p},30165:function(e,t){var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedPlayerApiMethods=t.RemoteControlReceiverMessageType=void 0,function(e){e[e.PlayerState=0]="PlayerState",e[e.PlayerEvent=1]="PlayerEvent",e[e.PlayerGetterCallReturnValue=2]="PlayerGetterCallReturnValue"}(o||(t.RemoteControlReceiverMessageType=o={})),function(e){e.GET_CONTAINER="getContainer",e.GET_SNAPSHOT="getSnapShot",e.GET_VIDEO_ELEMENT="getVideoElement"}(n||(t.UnsupportedPlayerApiMethods=n={}))},61567:function(__unused_webpack_module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.RemoteJSON=void 0;var RemoteJSON=function(){function RemoteJSON(){}return RemoteJSON.stringifyFunction=function(e){if("function"==typeof e)return RemoteJSON.FUNCTION_PREFIX+e.toString()},RemoteJSON.parseFunction=function(fs){if(fs&&"string"==typeof fs&&0===fs.indexOf(RemoteJSON.FUNCTION_PREFIX)){var f="f = "+fs.substring(RemoteJSON.FUNCTION_PREFIX.length);if(eval(f),"function"==typeof f)return f}},RemoteJSON.stringify=function(e,t,o){return JSON.stringify(e,function(e,o){return"function"==typeof o?RemoteJSON.stringifyFunction(o):t?t(e,o):o},o)},RemoteJSON.parse=function(e,t){return JSON.parse(e,function(e,o){return RemoteJSON.parseFunction(o)||(t?t(e,o):o)})},RemoteJSON.FUNCTION_PREFIX="function::",RemoteJSON}();exports.RemoteJSON=RemoteJSON},91297:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketRemoteControl=void 0;var r=o(60768),i=o(35317),a=o(61567),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.KM=o,window.WebSocket&&n.onReady(),n}return n(t,e),t.prototype.getConfig=function(){return this.KM},t.prototype.connect=function(){var e=this;if(!this.isReady())throw new Error("Remote is not ready");this.onConnect("WebSocket Receiver"),this.LM=new WebSocket(this.KM.url+"?role=remote"),this.LM.addEventListener("open",function(t){e.onConnected("WebSocket Receiver",!1)}),this.LM.addEventListener("error",function(t){e.context.logger.debug("Error",t),e.onError()}),this.LM.addEventListener("close",function(t){e.context.logger.debug("Close",t),e.onDisconnected()}),this.LM.addEventListener("message",function(t){return e.NM(t)})},t.prototype.NM=function(e){if(e.data)try{var t=JSON.parse(e.data);this.handleRemoteControlReceiverMessage(t)}catch(t){this.context.logger.error("message parsing failed",e.data)}else this.context.logger.log("unknown message received",e.data)},t.prototype.sendMessage=function(e,t){this.LM.send(a.RemoteJSON.stringify({type:e,data:t}))},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.disconnect=function(){this.onDisconnect(),this.LM.close()},t.prototype.release=function(){},t.prototype.setSource=function(e,t,o){this.MM=e,this.sendMessage(r.RemoteControlMessageType.SourceSetup,{source:e,autoplay:t,time:o})},t.prototype.getSource=function(){return this.MM},t}(i.RemoteControlBase);t.WebSocketRemoteControl=s},58367:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoProcessor=void 0;var n=o(2025),r=o(26662),i=function(){function e(e,t,o){this.M9=Promise.resolve(),this.B8=new n.GoogleCastV3TrackFinder(e),this.media=t,this.logger=o}return e.prototype.setMedia=function(e){this.media=e},e.prototype.setMediaInfo=function(e){this.B8.setMediaInfo(e)},e.prototype.enableTrack=function(e){var t,o=this,n=e.trackId;this.O9(null===(t=e.customData)||void 0===t?void 0:t.internalId,e.type,n)&&n&&this.M9.then(function(){var t=o.N9(e.type);return t.push(n),new r.EditTrackInfoRequest(o.media,t,o.logger).execute()})},e.prototype.N9=function(e){var t;if(!this.media||!this.media.activeTrackIds)return[];var o=this.media.activeTrackIds,n=null===(t=this.media.media)||void 0===t?void 0:t.tracks;if(!n)return o;var r=n.filter(function(t){return t.type!==e});return o.filter(function(e){return r.find(function(t){return t.trackId===e})})},e.prototype.disableTrack=function(e,t){var o,n=this.B8.findTrackIdByInternalId(e,t);if(this.O9(e,t,n)&&n){var i=((null===(o=this.media)||void 0===o?void 0:o.activeTrackIds)||[]).filter(function(e){return e!==n});this.M9=new r.EditTrackInfoRequest(this.media,i,this.logger).execute()}},e.prototype.changeActiveTracksBasedOnCastIds=function(e){this.media&&(this.M9=new r.EditTrackInfoRequest(this.media,e,this.logger).execute())},e.prototype.O9=function(e,t,o){return this.media?null!==o||(this.logger.debug("EditTrackInfoProcessor: Could not make track request. No trackId found for combination:",{requestId:e,type:t}),!1):(this.logger.debug("EditTrackInfoProcessor: Media info is not initialized."),!1)},e}();t.EditTrackInfoProcessor=i},26662:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoRequest=void 0;var o=function(){function e(e,t,o){this.Efb=e,this.Ffb=t,this.Gfb=o}return e.prototype.execute=function(){var e=this;return new Promise(function(t,o){if(e.Efb){var n=new chrome.cast.media.EditTracksInfoRequest(e.Ffb);e.Efb.editTracksInfo(n,t,o)}else o("Media is not initialized properly.")}).catch(function(t){e.Gfb.debug("Problem executing EditTrackInfoRequest",t)})},e}();t.EditTrackInfoRequest=o},13748:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoTrackMapper=void 0;var r=o(80186),i=o(57230),a=function(){function e(e){this.context=e}return e.prototype.maybeReMapTracksForMediaInfo=function(e){(null==e?void 0:e.tracks)&&this.mapTracksWithNoInternalId(e.tracks)},e.prototype.mapTracksWithNoInternalId=function(e){var t=this,o=e.filter(function(e){var t;return!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}),n={};o.forEach(function(o){var r=o.type,i=n[r];i||(i=t.A8(o),n[r]=i),t.y8(o,e,i)})},e.prototype.y8=function(e,t,o){var r;if(!(null===(r=null==e?void 0:e.customData)||void 0===r?void 0:r.internalId)&&(null==t?void 0:t.length)){var i=this.z8(e,t,o);i?e.customData=n(n({},e.customData),{internalId:i}):this.context.logger.debug("Could not map track for language:",e.language,"No relevant internal track was found.",e)}},e.prototype.z8=function(e,t,o){var n,i,a,s=o.filter(function(t){return(0,r.bothTracksHaveSameLanguage)(t,e)}),l=null===(n=s[0])||void 0===n?void 0:n.id;if(s.length>0){var u=t.filter(function(e){var t;return!!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}).map(function(e){return e.customData.internalId});return null!==(a=null===(i=s.find(function(e){return!u.includes(e.id)}))||void 0===i?void 0:i.id)&&void 0!==a?a:null}return l},e.prototype.A8=function(e){return(0,i.isSubtitle)(e)?this.context.internalPlayer.listSubtitles():(0,i.isAudio)(e)?this.context.internalPlayer.getAvailableAudio():[]},e.prototype.markAllTracksAsReadyToPlay=function(e){null==e||e.forEach(function(e){e.customData&&(e.customData.needsReloadBeforePlay=!1)})},e}();t.MediaInfoTrackMapper=a},15529:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoWrapper=void 0;var n=o(57230),r=function(){function e(e,t){e&&!Array.isArray(e.tracks)&&(e.tracks=[]),this.P9=e,this.Q9=t}return e.prototype.R9=function(){var e,t,o,n=null===(e=this.P9)||void 0===e?void 0:e.tracks;return(null==n?void 0:n.length)&&null!==(o=null===(t=n[n.length-1])||void 0===t?void 0:t.trackId)&&void 0!==o?o:0},e.prototype.maybeAddInternalTrack=function(e){if(this.P9&&!(this.S9(e.id)>=0)){var t=(0,n.fromInternalTrackToGoogleTrack)(e,this.R9()+1);(0,n.isValidTrack)(t)?this.P9.tracks.push(t):this.Q9.debug("Trying to add an invalid track",t)}},e.prototype.maybeRemoveInternalTrack=function(e){var t,o,n=this.S9(e);return n>-1&&(null===(o=null===(t=this.P9)||void 0===t?void 0:t.tracks)||void 0===o||o.splice(n,1)),n>-1},e.prototype.S9=function(e){var t;return e&&(null===(t=this.P9)||void 0===t?void 0:t.tracks)?this.P9.tracks.findIndex(function(t){var o;return e===(null===(o=t.customData)||void 0===o?void 0:o.internalId)}):-1},e.prototype.findTrackIdForTrack=function(e){var t,o,n;return null!==(n=null===(o=null===(t=this.P9)||void 0===t?void 0:t.tracks[this.S9(e)])||void 0===o?void 0:o.trackId)&&void 0!==n?n:-1},e}();t.MediaInfoWrapper=r},80186:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.bothTracksHaveSameLanguage=function(e,t){var o;return!!t.language&&((null===(o=e.lang)||void 0===o?void 0:o.toLowerCase())===t.language.toLowerCase()||function(e,t){var o=n.SHAKA_ISO_MAP[e];return o?t===o:function(e){var t=Object.keys(n.SHAKA_ISO_MAP).find(function(t){var o=n.SHAKA_ISO_MAP[t];return e===o||e===t});return null!=t?n.SHAKA_ISO_MAP[t]:null}(t)===e}(t.language,e.lang))};var n=o(90435)},57230:function(e,t){function o(e){return e.type===chrome.cast.media.TrackType.AUDIO}Object.defineProperty(t,"__esModule",{value:!0}),t.fromInternalTrackToGoogleTrack=function(e,t){var n,r=e.getQualities?chrome.cast.media.TrackType.AUDIO:chrome.cast.media.TrackType.TEXT,i=new chrome.cast.media.Track(t,r);return function(e,t){o(t)?function(e,t){var o,n;t.trackContentType=null!==(n=null===(o=e.getQualities().find(function(e){return e.codec}))||void 0===o?void 0:o.codec)&&void 0!==n?n:""}(e,t):function(e,t){t.trackContentType=e.id?e.id.split("-")[0]:"",t.trackContentId=e.url,t.subtype=function(e){var t,o;return e.kind===chrome.cast.media.TextTrackType.METADATA.toLowerCase()?chrome.cast.media.TextTrackType.METADATA:(null===(t=e.kind)||void 0===t?void 0:t.includes("caption"))||function(e){return Boolean(e.find(function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.includes("caption")}))}(null!==(o=e.role)&&void 0!==o?o:[])?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES}(e)}(e,t)}(e,i),i.language=e.lang,i.name=e.label,i.roles=(null===(n=e.role)||void 0===n?void 0:n.filter(function(e){return!!e.value}).map(function(e){return e.value||""}))||[],i.customData={internalId:e.id,needsReloadBeforePlay:!0},i},t.isValidTrack=function(e){return!(!(e.trackContentType&&e.trackId&&e.language&&e.name)||o(e))&&(!!e.subtype&&!!e.trackContentId)},t.isSubtitle=function(e){return e.type===chrome.cast.media.TrackType.TEXT},t.isAudio=o},90435:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SHAKA_ISO_MAP=void 0,t.SHAKA_ISO_MAP={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"}}},function(e){return function(){return e(92682)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.remotecontrol=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.remotecontrol=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[140],{71223:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameSource=r;var n=o(58313);function r(e,t){return!e&&!t||!(!e||!t)&&(e.dash?i(e.dash,t.dash,t):e.hls?i(e.hls,t.hls,t):!!e.progressive&&!Array.isArray(t.progressive)&&i(e.progressive,t.progressive,t))}function i(e,t,o){try{return r(JSON.parse(e),o)}catch(e){}return!!t&&n.URLHelper.toFullUrl(t)===n.URLHelper.toFullUrl(e)}},68657:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastReceiverVersion=void 0,function(e){e.v2="v2",e.v3="v3"}(o||(t.GoogleCastReceiverVersion=o={}))},32645:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlBase=void 0,t.mediaInfoToSourceConfig=c;var r=o(3714),i=o(20213),a=o(85625),s=o(94685),l=o(60768),u=function(e){function t(t,o){var n=e.call(this,t)||this;n.EN=function(e,t){n.isConnected()||n.onConnect(e.friendlyName)},n.FN=function(e){switch(e.castState){case cast.framework.CastState.NO_DEVICES_AVAILABLE:n.onReady(!1);break;case cast.framework.CastState.NOT_CONNECTED:n.onReady(!0);case cast.framework.CastState.CONNECTING:case cast.framework.CastState.CONNECTED:}},n.GN=function(e){switch(e.sessionState){case cast.framework.SessionState.NO_SESSION:case cast.framework.SessionState.SESSION_STARTING:break;case cast.framework.SessionState.SESSION_STARTED:n.onConnected(e.session.getCastDevice().friendlyName,!1);break;case cast.framework.SessionState.SESSION_START_FAILED:e.errorCode!==chrome.cast.ErrorCode.CANCEL&&n.onError();break;case cast.framework.SessionState.SESSION_ENDING:break;case cast.framework.SessionState.SESSION_ENDED:n.onDisconnected();break;case cast.framework.SessionState.SESSION_RESUMED:n.onConnected(e.session.getCastDevice().friendlyName,!0),n.remotePlayer.isPaused||(n.DN(),n.onRemotePlayerEvent({event:r.PlayerEvent.Play}))}},n.HN=function(e){n.mediaInfoChangedEventHandler(e)},n.IN=function(e){switch(e.value){case chrome.cast.media.PlayerState.PAUSED:n.onRemotePlayerEvent({event:r.PlayerEvent.Paused});break;case chrome.cast.media.PlayerState.PLAYING:n.onRemotePlayerEvent({event:r.PlayerEvent.Playing})}},n.JN=function(){n.remotePlayer.isPaused||n.onRemotePlayerEvent({event:r.PlayerEvent.Play})},n.KN=function(){n.onRemotePlayerEvent({event:r.PlayerEvent.TimeChanged})},n.LN=function(){n.onRemotePlayerEvent({event:r.PlayerEvent.VolumeChanged})},n.MN=function(){n.onRemotePlayerEvent({event:n.remotePlayer.isMuted?r.PlayerEvent.Muted:r.PlayerEvent.Unmuted})},n.NN=function(e){n.remotePlayer.isConnected},n.ON=function(){n.remotePlayer.isPaused||n.remotePlayerController.playOrPause()},n.config=o,n.CN=void 0;var i=function(e){if(e)try{n.initializeCast()}catch(e){}n.CN&&n.CN(e)};return window.chrome&&window.chrome.cast&&window.cast&&window.cast.framework?setTimeout(function(){return i(!0)},1e3):(n.CN=window.__onGCastApiAvailable,window.__onGCastApiAvailable=i),n}return n(t,e),t.prototype.DN=function(){var e,t,o=this;null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t||t.getStatus(void 0,function(){(0,s.isContextAvailable)(o.context)},function(e){(0,s.isContextAvailable)(o.context)})},t.prototype.initializeCast=function(){var e;cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:this.config.receiverApplicationId,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,resumeSavedSession:null!==(e=this.config.rejoinActiveSession)&&void 0!==e&&e}),this.remotePlayer=new cast.framework.RemotePlayer,this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.NN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.IN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.JN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.KN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.LN),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.MN),cast.framework.CastContext.getInstance().getCastState()!==cast.framework.CastState.NO_DEVICES_AVAILABLE?this.onReady(!0):cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.FN),cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.GN),chrome.cast.addReceiverActionListener(this.EN);var t=cast.framework.CastContext.getInstance().getCurrentSession();t&&this.onConnected(t.getCastDevice().friendlyName,!0)},t.prototype.mediaInfoChangedEventHandler=function(e){this.remotePlayer.mediaInfo,this.mediaInfo=e.value},t.prototype.getConfig=function(){return this.config},t.prototype.connect=function(){var e=this;cast.framework.CastContext.getInstance().requestSession().then(function(){}).catch(function(t){t===chrome.cast.ErrorCode.CANCEL||e.onError()})},t.prototype.onConnected=function(t,o){var n=this;this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.castSession.addMessageListener(this.config.messageNamespace,function(e,t){try{var o=JSON.parse(t);n.handleRemoteControlReceiverMessage(o)}catch(e){}}),this.context.eventHandler.on(r.PlayerEvent.PlaybackFinished,this.ON),e.prototype.onConnected.call(this,t,o)},t.prototype.sendMessage=function(e,t){void 0===e&&(e=l.RemoteControlMessageType.PlayerApiMethodCall),this.castSession.sendMessage(this.config.messageNamespace,{type:e,data:t})},t.prototype.disconnect=function(){cast.framework.CastContext.getInstance().endCurrentSession(!0),this.onDisconnect()},t.prototype.onDisconnected=function(){e.prototype.onDisconnected.call(this),this.context.eventHandler.off(r.PlayerEvent.PlaybackFinished,this.ON),this.playerState=null},t.prototype.release=function(){window.__onGCastApiAvailable=this.CN||void 0,this.remotePlayerController&&(this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,this.HN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.IN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.MN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.LN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.KN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.JN),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.NN),chrome.cast.removeReceiverActionListener(this.EN),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.FN),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.GN))},t.prototype.setSource=function(e,t,o){var n=this;return this.lastSource=e,this.getMediaInfo(e).then(function(e){var r=new chrome.cast.media.LoadRequest(e);return r.autoplay=t||!1,null!=o&&(r.currentTime=o),n.loadMediaRequest(r)})},t.prototype.loadMediaRequest=function(e){var t=this,o=cast.framework.CastContext.getInstance().getCurrentSession().getSessionObj();return new Promise(function(n,r){o.loadMedia(e,function(e){t.media=e,t.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,t.HN),n()},function(e){r(e)})})},t.prototype.getSource=function(){return this.remotePlayer.mediaInfo?c(this.remotePlayer.mediaInfo):null},t.prototype.play=function(){this.remotePlayer.isPaused&&this.remotePlayerController.playOrPause()},t.prototype.isPlaying=function(){return!this.remotePlayer.isPaused},t.prototype.pause=function(){this.remotePlayer.isPaused||this.remotePlayerController.playOrPause()},t.prototype.isPaused=function(){return this.remotePlayer.isPaused},t.prototype.getCurrentTime=function(t){return void 0===t&&(t=i.TimeMode.AbsoluteTime),t===i.TimeMode.RelativeTime?e.prototype.getCurrentTime.call(this,t):this.remotePlayer.currentTime},t.prototype.seek=function(e){this.remotePlayer.currentTime=e,this.remotePlayerController.seek(),this.onRemotePlayerEvent({event:r.PlayerEvent.Seeked})},t.prototype.setVolume=function(e){this.remotePlayer.volumeLevel=e,this.remotePlayerController.setVolumeLevel()},t.prototype.getVolume=function(){return this.remotePlayer.volumeLevel},t.prototype.setMuted=function(e){e!==this.remotePlayer.isMuted&&this.remotePlayerController.muteOrUnmute()},t.prototype.isMuted=function(){return this.remotePlayer.isMuted},t}(o(35317).RemoteControlBase);function c(e){var t=e.contentUrl||e.contentId;switch(e.contentType.toLowerCase()){case a.ManifestMimeType.Dash:return{dash:t};case a.ManifestMimeType.Hls:return{hls:t};case a.ManifestMimeType.Smooth:return{smooth:t};default:return{progressive:t}}}t.GoogleCastRemoteControlBase=u},61348:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV2=void 0;var r=o(58313),i=o(32645),a=o(61567),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.getMediaInfo=function(e){var t=new chrome.cast.media.MediaInfo(a.RemoteJSON.stringify(e),"application/json");if(t.streamType=chrome.cast.media.StreamType.BUFFERED,t.metadata=new chrome.cast.media.GenericMediaMetadata,t.metadata.title=e.title||null,t.metadata.subtitle=e.description||null,e.poster){var o=r.URLHelper.toFullUrl(e.poster);t.metadata.images=[new chrome.cast.Image(o)]}return Promise.resolve(t)},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t}(i.GoogleCastRemoteControlBase);t.GoogleCastRemoteControlV2=s},23747:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),r=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV3=void 0,t.getDrmConfig=function(e){if(e.widevine)return S(e.widevine,i.WIDEVINE);if(e.playready)return S(e.playready,i.PLAYREADY);if(e.clearkey)return S(e.clearkey,i.CLEARKEY);throw new Error("Not supported drm config.")},t.getUrlFromKeys=N,t.sortProgressiveSources=C;var i,a=o(80813),s=o(20213),l=o(85625),u=o(74853),c=o(70233),d=o(58313),p=o(32645),f=o(7209),h=o(2025),y=o(58367),m=o(13748),v=o(15529);!function(e){e.CLEARKEY="clearkey",e.PLAYREADY="playready",e.WIDEVINE="widevine"}(i||(i={}));var g=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n.RN=0,n.UN=!1,n.aN=function(e){var t,o;(null===(t=n.mediaInfo)||void 0===t?void 0:t.duration)>0&&(null===(o=n.mediaInfo)||void 0===o?void 0:o.duration)-n.QN<2&&0===e.value&&(n.PN=!0,n.onRemotePlayerEvent({event:s.PlayerEvent.PlaybackFinished})),n.QN=e.value},n.SN=new m.MediaInfoTrackMapper(t),n.TN=new y.EditTrackInfoProcessor(n.mediaInfo,n.media,n.context.logger),n.VN=new v.MediaInfoWrapper(n.mediaInfo,n.context.logger),n}return n(t,e),t.prototype.initializeCast=function(){e.prototype.initializeCast.call(this),this.ZN()},t.prototype.getCurrentTime=function(e){if(void 0===e&&(e=s.TimeMode.AbsoluteTime),!this.remotePlayer)return 0;var t=this.remotePlayer.currentTime;return e===s.TimeMode.RelativeTime?t:this.WN(t)},t.prototype.WN=function(e){return e+this.YN()},t.prototype.XN=function(e){return e-this.YN()},t.prototype.YN=function(){var e,t,o,n=null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t?void 0:t.customData;return null!==(o=null==n?void 0:n.startAbsoluteTime)&&void 0!==o?o:0},t.prototype.ZN=function(){var e=this;this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.aN),this.context.eventHandler.on(s.PlayerEvent.PeriodSwitch,function(){new h.GoogleCastV3TrackFinder(e.mediaInfo).hasATrackToLoad()&&e.iN()})},t.prototype.sendMessage=function(e,t){this.config.messageNamespace&&this.castSession.sendMessage(this.config.messageNamespace,{type:"METADATA",data:t})},t.prototype.play=function(){var t=this;this.PN&&this.lastSource?this.setSource(this.lastSource).then(function(){return e.prototype.play.call(t)}):e.prototype.play.call(this),this.PN=!1},t.prototype.bN=function(e){var t=this.eN(e),o=t.url,n=t.mimeType,r=new chrome.cast.media.MediaInfo(o,n);return r.customData=(0,f.getCustomData)(e,n),r},t.prototype.getMediaInfo=function(e){var t,o=this.bN(e),n=this.context.sourceContext.sourceIdentifier,r=this.context.serviceManager.get(a.ServiceName.ManifestService,n);return(null==r?void 0:r.isLive())&&(o.streamType=chrome.cast.media.StreamType.LIVE,this.RN=0),this.cN(null!==(t=e.subtitleTracks)&&void 0!==t?t:[],o),this.config.prepareMediaInfo?this.config.prepareMediaInfo(o):Promise.resolve(o)},t.prototype.cN=function(e,t){var o=new v.MediaInfoWrapper(t,this.context.logger);r(r([],null!=e?e:[],!0),this.dN(),!0).forEach(function(e){return o.maybeAddInternalTrack(e)})},t.prototype.dN=function(){var e=this.context.internalPlayer.listSubtitles().filter(function(e){return e.isSideloaded}),t=this.context.internalPlayer.getAvailableAudio();return r(r([],e,!0),t,!0)},t.prototype.eN=function(e){var t,o;if(e.dash)t=e.dash,o=l.ManifestMimeType.Dash;else if(e.hls)t=e.hls,o=l.ManifestMimeType.Hls;else if(e.smooth)t=e.smooth,o=l.ManifestMimeType.Smooth;else{if(!e.progressive)throw new Error("Source not supported.");var n=this.gN(e.progressive);t=n.url,o=n.mimeType}return{url:t=d.URLHelper.toFullUrl(t),mimeType:o}},t.prototype.timeShift=function(e){var t;this.RN=e,this.seek(((null===(t=this.fN())||void 0===t?void 0:t.end)||0)+e)},t.prototype.seek=function(t){e.prototype.seek.call(this,this.XN(t))},t.prototype.fN=function(){var e,t=null===(e=this.remotePlayer)||void 0===e?void 0:e.liveSeekableRange;return void 0===(null==t?void 0:t.start)||void 0===(null==t?void 0:t.end)?{start:-1,end:-1}:{start:this.WN(t.start),end:this.WN(t.end)}},t.prototype.getTimeShift=function(){var e=this.fN();if(e.end<0)return this.RN;var t=this.getCurrentTime()-e.end;return t>0?0:t},t.prototype.getMaxTimeShift=function(){var e,t,o=this.fN();return(null!==(e=null==o?void 0:o.start)&&void 0!==e?e:0)-(null!==(t=null==o?void 0:o.end)&&void 0!==t?t:0)},t.prototype.gN=function(e){var t,o;if(Array.isArray(e)){var n=C(e)[0];t=n.url,o=n.type}else t=e;return{url:t,mimeType:o}},t.prototype.release=function(){e.prototype.release.call(this),this.remotePlayerController&&this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.aN)},t.prototype.hN=function(e){var t,o,n=this;e&&(null!==(o=null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay)&&void 0!==o&&o?this.iN().then(function(){n.TN.enableTrack(e)}):this.TN.enableTrack(e))},t.prototype.enableSubtitle=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.TEXT);t&&this.hN(t)},t.prototype.disableSubtitle=function(e){this.TN.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.setAudio=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.AUDIO);t&&this.hN(t)},t.prototype.mediaInfoChangedEventHandler=function(t){var o,n;e.prototype.mediaInfoChangedEventHandler.call(this,t),this.TN.setMediaInfo(this.mediaInfo),this.VN=new v.MediaInfoWrapper(this.mediaInfo,this.context.logger),this.SN.maybeReMapTracksForMediaInfo(this.mediaInfo);var r=new v.MediaInfoWrapper(this.mediaInfo,this.context.logger);this.dN().forEach(function(e){return r.maybeAddInternalTrack(e)}),this.UN&&(null===(n=null===(o=this.mediaInfo)||void 0===o?void 0:o.tracks)||void 0===n?void 0:n.length)>0&&this.jN()},t.prototype.addSubtitle=function(e){this.VN.maybeAddInternalTrack(e)},t.prototype.removeSubtitle=function(e){var t,o,n=new v.MediaInfoWrapper(this.mediaInfo,this.context.logger),r=Boolean(null===(o=null===(t=this.media)||void 0===t?void 0:t.activeTrackIds)||void 0===o?void 0:o.find(function(t){return t===n.findTrackIdForTrack(e)}));n.maybeRemoveInternalTrack(e)&&r&&this.TN.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.iN=function(){var e=new chrome.cast.media.LoadRequest(this.mediaInfo);return e.currentTime=this.context.internalPlayer.getCurrentTime(),e.autoplay=this.context.internalPlayer.isPlaying(),this.loadMediaRequest(e)},t.prototype.loadMediaRequest=function(t){var o=this;return this.SN.markAllTracksAsReadyToPlay(t.media.tracks),e.prototype.loadMediaRequest.call(this,t).then(function(){o.UN=!0,o.TN.setMedia(o.media),o.TN.setMediaInfo(o.mediaInfo),o.jN()})},t.prototype.jN=function(){var e,t=this;if(this.mediaInfo){this.UN=!1;var o=this.context.internalPlayer.listSubtitles().filter(function(e){return!!e.enabled}).map(function(e){return e.id});o.push(null===(e=this.context.internalPlayer.getAudio())||void 0===e?void 0:e.id),o=o.filter(Boolean);var n=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTracksForIds(o),r=n.some(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}),i=n.map(function(e){return e.trackId});if(!r)return this.TN.changeActiveTracksBasedOnCastIds(i);this.iN().then(function(){t.TN.changeActiveTracksBasedOnCastIds(i)})}},t}(p.GoogleCastRemoteControlBase);function N(e){var t={keys:e.map(function(e){var t=c.FormatHelper.hexToBytes(e.key),o=c.FormatHelper.hexToBytes(e.kid||"");return{kty:"oct",kid:u.ArrayHelper.arrayBufferToBase64(o.buffer).replace(/[=]*$/,""),k:u.ArrayHelper.arrayBufferToBase64(t.buffer).replace(/[=]*$/,"")}})},o=JSON.stringify(t);return"data:application/json;base64,"+btoa(o)}function C(e){return e.sort(function(e,t){return e.preferred===t.preferred?(e.bitrate||0)>(t.bitrate||0)?-1:1:(e.preferred||0)>(t.preferred||0)?-1:1})}function S(e,t){return function(e){return Array.isArray(e)}(e)?{protectionSystem:i.CLEARKEY,licenseUrl:N(e)}:{protectionSystem:t,licenseUrl:e.LA_URL||"",headers:e.headers,withCredentials:e.withCredentials||!1}}t.GoogleCastRemoteControlV3=g},7209:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomData=function(e,t){var o={};return i(e.drm)&&(o.drm=(0,r.getDrmConfig)(e.drm)),i(e.metadata)&&(o.metadata=e.metadata),i(e.options)&&(o.options=function(e,t){var o,r,i=e.options;return t===n.ManifestMimeType.Dash?(o=a(i,["dashWithCredentials","withCredentials"]),r=a(i,["dashManifestWithCredentials","manifestWithCredentials"])):t===n.ManifestMimeType.Hls&&(o=a(i,["hlsWithCredentials","withCredentials"]),r=a(i,["hlsManifestWithCredentials","manifestWithCredentials"])),{withCredentials:o||!1,manifestWithCredentials:r||!1}}(e,t)),o};var n=o(85625),r=o(23747);function i(e){return Object.keys(null!=e?e:{}).length>0}function a(e,t){for(var o,n=0,r=t;n<r.length;n++){var i=r[n];if(i in e){o=e[i];break}}return o}},2025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastV3TrackFinder=void 0;var o=function(){function e(e){this.h7=e}return e.prototype.findTrackIdByInternalId=function(e,t){var o,n;return null!==(n=null===(o=this.findTrackByInternalId(e,t))||void 0===o?void 0:o.trackId)&&void 0!==n?n:null},e.prototype.findTrackByInternalId=function(e,t){var o,n,r;return null!==(r=(null!==(n=null===(o=this.h7)||void 0===o?void 0:o.tracks)&&void 0!==n?n:[]).find(function(o){var n;return(null===(n=o.customData)||void 0===n?void 0:n.internalId)===e&&o.type===t}))&&void 0!==r?r:null},e.prototype.findTracksForIds=function(e){var t,o;return(null!==(o=null===(t=this.h7)||void 0===t?void 0:t.tracks)&&void 0!==o?o:[]).filter(function(t){var o;return e.includes(null===(o=t.customData)||void 0===o?void 0:o.internalId)})},e.prototype.hasATrackToLoad=function(){var e,t;return Boolean(null===(t=null===(e=this.h7)||void 0===e?void 0:e.tracks)||void 0===t?void 0:t.find(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}))},e.prototype.setMediaInfo=function(e){this.h7=e},e}();t.GoogleCastV3TrackFinder=o},94952:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCustomElementRegistry=function(){var e=function(){var e=window.customElements;return function(e){return"object"==typeof e&&["get","define","whenDefined","upgrade"].every(function(t){return"function"==typeof e[t]})}(e)?e:void 0}();void 0===o&&void 0!==e&&(o=new r(e),Object.defineProperty(window,"customElements",{get:function(){return o}}))};var o,n=["google-cast-button","google-cast-launcher"],r=function(){function e(e){this.registry=e}return e.prototype.define=function(e,t,o){var r=n.includes(e),i=Boolean(this.registry.get(e));r&&i||this.registry.define(e,t,o)},e.prototype.whenDefined=function(e){return this.registry.whenDefined(e)},e.prototype.get=function(e){return this.registry.get(e)},e.prototype.upgrade=function(e){this.registry.upgrade(e)},e}()},92682:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlModuleDefinition=void 0;var n=o(62756),r=o(42489);t.RemoteControlModuleDefinition={name:n.ModuleName.RemoteControl,module:{RemoteControlManager:r.RemoteControlManager}},t.default=t.RemoteControlModuleDefinition},60768:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlMessageType=void 0,function(e){e[e.SourceSetup=0]="SourceSetup",e[e.PlayerApiMethodCall=1]="PlayerApiMethodCall",e[e.CustomData=2]="CustomData"}(o||(t.RemoteControlMessageType=o={}))},35317:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlBase=void 0;var n,r=o(20213),i=o(60768),a=o(30165);!function(e){e[e.Idle=0]="Idle",e[e.Ready=1]="Ready",e[e.Connected=2]="Connected"}(n||(n={}));var s=function(){function e(e){this.context=e,this.f7=n.Idle}return Object.defineProperty(e.prototype,"f7",{get:function(){return this.d7},set:function(e){this.d7=e},enumerable:!1,configurable:!0}),e.prototype.getConfig=function(){throw new Error("Not implemented - overwrite in subclasses!")},e.prototype.setOnErrorCallback=function(e){this.W7=e},e.prototype.setOnReadyCallback=function(e){this.X7=e},e.prototype.setOnConnectCallback=function(e){this.Y7=e},e.prototype.setOnConnectedCallback=function(e){this.Z7=e},e.prototype.setOnDisconnectCallback=function(e){this.a7=e},e.prototype.setOnDisconnectedCallback=function(e){this.b7=e},e.prototype.setOnRemotePlayerEventCallback=function(e){this.c7=e},e.prototype.isReady=function(){return this.f7===n.Ready},e.prototype.isConnected=function(){return this.f7===n.Connected},e.prototype.onError=function(){this.f7=n.Ready,this.W7&&this.W7()},e.prototype.onReady=function(e){void 0===e&&(e=!0);var t=e?n.Ready:n.Idle;this.f7!==t&&(this.f7=t,this.X7&&this.X7({receiverAvailable:e}))},e.prototype.g7=function(){this.playerState={isPlaying:!1,isPaused:!1,hasEnded:!1,isMuted:!1,isStalled:!1,isLive:!1,getVolume:1,getCurrentTime:0,getRelativeCurrentTime:0,getDuration:0,getVersion:"",getDroppedVideoFrames:0,getForwardBufferLevelForVideo:0,getBackwardBufferLevelForVideo:0,getForwardBufferLevelForAudio:0,getBackwardBufferLevelForAudio:0,getTotalStalledTime:0,getDownloadedVideoData:null,getDownloadedAudioData:null,getPlaybackVideoData:null,getPlaybackAudioData:null,getMaxTimeShift:0,getTimeShift:0,getSubtitle:null,getAudio:null}},e.prototype.onConnect=function(e){this.Y7&&this.Y7({deviceName:e}),this.g7()},e.prototype.onConnected=function(e,t){this.f7=n.Connected,this.g7(),this.Z7&&this.Z7({deviceName:e,resumed:t})},e.prototype.onDisconnect=function(){this.a7&&this.a7()},e.prototype.onDisconnected=function(){this.f7=n.Ready,this.b7&&this.b7()},e.prototype.onRemotePlayerEvent=function(e){this.c7&&this.c7(e)},e.prototype.sendMethodCallMessage=function(e,t){var o=[];t&&(o=Array.isArray(t)?t:1===t.length?[t[0]]:Array.apply(null,t)),this.sendMessage(i.RemoteControlMessageType.PlayerApiMethodCall,{methodName:e,arguments:o})},e.prototype.handleRemoteControlReceiverMessage=function(e){switch(e.type){case a.RemoteControlReceiverMessageType.PlayerState:return this.playerState=e.data,!0;case a.RemoteControlReceiverMessageType.PlayerEvent:var t=e.data;return this.onRemotePlayerEvent(t),!0;case a.RemoteControlReceiverMessageType.PlayerGetterCallReturnValue:return!0}return!1},e.prototype.play=function(){this.sendMethodCallMessage("play")},e.prototype.pause=function(){this.sendMethodCallMessage("pause")},e.prototype.seek=function(e){this.sendMethodCallMessage("seek",[e])},e.prototype.setTargetBufferLevel=function(e,t,o){this.sendMethodCallMessage("setTargetBufferLevel",[e,t,o])},e.prototype.setVolume=function(e){this.sendMethodCallMessage("setVolume",[e])},e.prototype.setMuted=function(e){e?this.sendMethodCallMessage("mute"):this.sendMethodCallMessage("unmute")},e.prototype.isPlaying=function(){return this.playerState.isPlaying},e.prototype.isPaused=function(){return this.playerState.isPaused},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=r.TimeMode.AbsoluteTime),e===r.TimeMode.AbsoluteTime?this.playerState.getCurrentTime:this.playerState.getRelativeCurrentTime},e.prototype.getVolume=function(){return this.playerState.getVolume},e.prototype.isMuted=function(){return this.playerState.isMuted},e.prototype.hasEnded=function(){return this.playerState.hasEnded},e.prototype.isStalled=function(){return this.playerState.isStalled},e.prototype.isLive=function(){return this.playerState.isStalled},e.prototype.getDuration=function(){return this.playerState.getDuration},e.prototype.getDroppedVideoFrames=function(){return this.playerState.getDroppedVideoFrames},e.prototype.getBufferLevel=function(e,t){var o={level:0,targetLevel:this.context.bufferSettings.getTargetLevel(e,t),type:e,media:t};return r.BufferType.ForwardDuration?t===r.MediaType.Video?o.level=this.playerState.getForwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getForwardBufferLevelForAudio):r.BufferType.BackwardDuration&&(t===r.MediaType.Video?o.level=this.playerState.getBackwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getBackwardBufferLevelForAudio)),o},e.prototype.getTotalStalledTime=function(){return this.playerState.getTotalStalledTime},e.prototype.getDownloadedVideoData=function(){return this.playerState.getDownloadedVideoData},e.prototype.getDownloadedAudioData=function(){return this.playerState.getDownloadedAudioData},e.prototype.getPlaybackVideoData=function(){return this.playerState.getPlaybackVideoData},e.prototype.getPlaybackAudioData=function(){return this.playerState.getPlaybackAudioData},e.prototype.getTimeShift=function(){return this.playerState.getTimeShift},e.prototype.getMaxTimeShift=function(){return this.playerState.getMaxTimeShift},e.prototype.preload=function(){this.sendMethodCallMessage("preload",[])},e.prototype.setAudioQuality=function(e){this.sendMethodCallMessage("setAudioQuality",[e])},e.prototype.setVideoQuality=function(e){this.sendMethodCallMessage("setVideoQuality",[e])},e.prototype.setQueryParameters=function(e){this.sendMethodCallMessage("setQueryParameters",[e])},e.prototype.clearQueryParameters=function(){this.sendMethodCallMessage("clearQueryParameters",[])},e.prototype.timeShift=function(e){this.sendMethodCallMessage("timeShift",[e])},e.prototype.enableSubtitle=function(e){this.sendMethodCallMessage("subtitles.enable",[e])},e.prototype.disableSubtitle=function(e){this.sendMethodCallMessage("subtitles.disable",[e])},e.prototype.setAudio=function(e){this.sendMethodCallMessage("setAudio",[e])},e.prototype.getSnapshot=function(e,t){this.sendMethodCallMessage("getSnapshot",[e,t])},e.prototype.setPlaybackSpeed=function(e){this.sendMethodCallMessage("setPlaybackSpeed",[e])},e.prototype.unload=function(){return this.sendMethodCallMessage("unload"),Promise.resolve()},e}();t.RemoteControlBase=s},42489:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlManager=void 0;var n=o(23690),r=o(85648),i=o(68657),a=o(32645),s=o(61348),l=o(23747),u=o(94952),c=o(77118),d=o(91297),p=function(){function e(t,o){this.wi=e.setupRemoteControl(t),this.wi instanceof a.GoogleCastRemoteControlBase&&function(e,t){(0,u.wrapCustomElementRegistry)(),e.removeScript(t,"cast_sender.js"),e.removeScript(t,"cast_framework.js"),setTimeout(function(){return e.loadScript(t)},0)}(o,t.config.location.cast)}return e.prototype.getPlayerWrapper=function(e,t){return new c.RemoteControlPlayerWrapper(e,t,this.wi)},e.setupRemoteControl=function(e){if(null==e.config||null==e.settings)return null;var t=e.config,o=e.settings;if((t.cast&&t.cast.enable||(!t.cast||t.cast&&!t.cast.hasOwnProperty("enable"))&&t.remotecontrol&&"googlecast"===t.remotecontrol.type)&&(t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.receiverApplicationId?o.CAST_APPLICATION_ID=t.remotecontrol.receiverApplicationId:t.cast&&t.cast.application_id&&(o.CAST_APPLICATION_ID=t.cast.application_id),t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.messageNamespace?0===t.remotecontrol.messageNamespace.indexOf("urn:x-cast:")&&(o.CAST_MESSAGE_NAMESPACE=t.remotecontrol.messageNamespace):t.cast&&t.cast.message_namespace&&0===t.cast.message_namespace.indexOf("urn:x-cast:")&&(o.CAST_MESSAGE_NAMESPACE=t.cast.message_namespace),t.hasOwnProperty("remotecontrol")||(t.remotecontrol={type:"googlecast",receiverApplicationId:o.CAST_APPLICATION_ID,messageNamespace:o.CAST_MESSAGE_NAMESPACE,customReceiverConfig:{receiverStylesheetUrl:t.cast.receiverStylesheetUrl||null}})),t.remotecontrol&&t.remotecontrol.type)switch(t.remotecontrol.type){case"googlecast":return t.remotecontrol.receiverApplicationId=t.remotecontrol.receiverApplicationId||o.CAST_APPLICATION_ID,t.remotecontrol.messageNamespace=t.remotecontrol.messageNamespace||o.CAST_MESSAGE_NAMESPACE,t.remotecontrol.receiverVersion===i.GoogleCastReceiverVersion.v3?(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV3)),new l.GoogleCastRemoteControlV3(e,t.remotecontrol)):(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV2)),new s.GoogleCastRemoteControlV2(e,t.remotecontrol));case"websocket":return e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.Websocket)),new d.WebSocketRemoteControl(e,t.remotecontrol)}return null},e}();t.RemoteControlManager=p},77118:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlPlayerWrapper=t.addStartOffset=t.clamp=t.getForwardBufferDiff=void 0;var n=o(9768),r=o(3714),i=o(44468),a=o(23690),s=o(87827),l=o(85648),u=o(71223),c=o(32645),d=o(60768);t.getForwardBufferDiff=function(e){return e.getBufferLevel(i.BufferType.ForwardDuration,i.MediaType.Video).targetLevel-20},t.clamp=function(e,t,o){return Math.max(t,Math.min(o,e))},t.addStartOffset=function(e,o,n){var r=Boolean(e.options&&e.options.startOffset);return(o||!r)&&(e.options=e.options||{},e.options.startOffset=n.isLive()?n.getTimeShift()-(0,t.getForwardBufferDiff)(n):n.getCurrentTime()),e};var p=function(){function e(e,o,n){var i=this;if(this.nN=!1,this.oN=!1,this.kN=e,this.lN=o,this.mN=n,n){var s=!1,c=!1,d=function(){i.oN=i.lN.isPlaying(),i.lN.pause()};n.setOnErrorCallback(function(){e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s&&(s=!1,i.qN(),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)))}),n.setOnReadyCallback(function(t){e.eventHandler.dispatchEvent(r.PlayerEvent.CastAvailable,{receiverAvailable:t.receiverAvailable})}),n.setOnConnectCallback(function(t){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connecting)),d(),e.eventHandler.dispatchEvent(r.PlayerEvent.CastWaitingForDevice,{castPayload:{deviceName:t.deviceName,currentTime:void 0,timestamp:void 0,type:void 0}})}),n.setOnConnectedCallback(function(o){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connected));var p=(0,u.isSameSource)(n.getSource(),e.sourceContext.source);if(o.resumed&&d(),!o.resumed||!p){e.settings.QUERY_PARAMETERS&&n.setQueryParameters(e.settings.QUERY_PARAMETERS),null!=n.getConfig()&&n.getConfig().customReceiverConfig&&i.addMetadata("CAST",{type:"customReceiverConfig",data:n.getConfig().customReceiverConfig});var f=(0,t.addStartOffset)(e.sourceContext.source,i.nN,i.lN);n.setSource(f,i.pN(),i.lN.getCurrentTime()),c=!0}e.eventHandler.dispatchEvent(r.PlayerEvent.CastStarted,{deviceName:o.deviceName,resuming:o.resumed}),s=!0,e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnDisconnectCallback(function(){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnecting))}),n.setOnDisconnectedCallback(function(){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)),e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s=!1,i.qN(),e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnRemotePlayerEventCallback(function(t){if(c)switch(t.event){case r.PlayerEvent.Play:case r.PlayerEvent.Paused:c=!1;for(var i=0,a=o.listSubtitles();i<a.length;i++){var s=a[i];n.addSubtitle(s),s.enabled&&n.enableSubtitle(s.id)}}var l=t.data||{};l.remote=!0,e.eventHandler.dispatchEvent(t.event,l)})}}return e.prototype.pN=function(){return this.kN.config&&this.kN.config.playback&&this.kN.config.playback.autoplay||this.oN},e.prototype.qN=function(){var e=this.kN.settings.ENABLE_SEEK_FOR_LIVE;if(this.lN.isLive()&&!e){var o=this.mN.getTimeShift()+(0,t.getForwardBufferDiff)(this.lN),n=this.lN.getMaxTimeShift();this.lN.timeShift((0,t.clamp)(o,n,0))}else{var r=this.lN.getSeekableRange(),i=this.mN.getCurrentTime();this.lN.seek((0,t.clamp)(i,r.start,r.end))}this.mN.isPlaying()?this.lN.play():this.lN.pause()},e.prototype.rN=function(){return null!=this.mN&&this.mN.isReady()},e.prototype.sN=function(){return null!=this.mN&&this.mN.isConnected()},e.prototype.tN=function(e){var t=(0,s.getRemoteControlState)(this.kN.store.getState().player).remoteControlType===l.RemoteControlType.GoogleCastV3;e===n.UI_SEEK_ISSUER_NAME&&t||this.mN.pause()},e.prototype.uN=function(e){this.lN.pause(e)},e.prototype.getAvailableSegments=function(){return this.lN.getAvailableSegments()},e.prototype.play=function(e){return this.nN=!0,this.sN()?(this.mN.play(),Promise.resolve()):this.lN.play(e)},e.prototype.preload=function(){this.sN()?this.mN.preload():this.lN.preload()},e.prototype.pause=function(e){this.sN()?this.tN(e):this.uN(e)},e.prototype.mute=function(e){this.sN()&&this.mN.setMuted(!0),this.lN.mute(e)},e.prototype.unmute=function(e){this.sN()&&this.mN.setMuted(!1),this.lN.unmute(e)},e.prototype.setVolume=function(e,t){this.sN()?this.mN.setVolume(e/100):this.lN.setVolume(e,t)},e.prototype.seek=function(e,t){return this.sN()?(this.mN.seek(e),!0):this.lN.seek(e,t)},e.prototype.setAudioQuality=function(e){this.sN()&&this.mN.setAudioQuality(e),this.lN.setAudioQuality(e)},e.prototype.setVideoQuality=function(e){this.sN()&&this.mN.setVideoQuality(e),this.lN.setVideoQuality(e)},e.prototype.prepareLoad=function(){return this.lN.prepareLoad()},e.prototype.prepareSource=function(e,t){return this.lN.prepareSource(e,t)},e.prototype.load=function(e,t,o){return this.sN()&&this.mN.setSource(this.kN.sourceContext.source,this.pN()),this.lN.load(e,t,o)},e.prototype.unload=function(e){return this.sN()&&this.mN.unload(),this.lN?this.lN.unload(e):Promise.resolve()},e.prototype.isPlaying=function(){return this.sN()?this.mN.isPlaying():this.lN.isPlaying()},e.prototype.isPaused=function(){return this.sN()?this.mN.isPaused():this.lN.isPaused()},e.prototype.hasEnded=function(){return this.sN()?this.mN.hasEnded():this.lN.hasEnded()},e.prototype.isMuted=function(){return this.sN()?this.mN.isMuted():this.lN.isMuted()},e.prototype.isStalled=function(){return this.sN()?this.mN.isStalled():this.lN.isStalled()},e.prototype.isLive=function(){return this.lN.isLive()},e.prototype.getVolume=function(){return this.sN()?100*this.mN.getVolume():this.lN.getVolume()},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=i.TimeMode.AbsoluteTime),this.sN()?this.mN.getCurrentTime(e):this.lN.getCurrentTime(e)},e.prototype.getDuration=function(){return this.lN.getDuration()},e.prototype.getAvailableVideoQualities=function(){return this.lN.getAvailableVideoQualities()},e.prototype.getAvailableAudioQualities=function(){return this.lN.getAvailableAudioQualities()},e.prototype.getDroppedVideoFrames=function(){return this.sN()?this.mN.getDroppedVideoFrames():this.lN.getDroppedVideoFrames()},e.prototype.setTargetBufferLevel=function(e,t,o){return this.sN()?this.mN.setTargetBufferLevel(e,t,o):this.lN.setTargetBufferLevel(e,t,o)},e.prototype.getBufferLevel=function(e,t){return this.sN()?this.mN.getBufferLevel(e,t):this.lN.getBufferLevel(e,t)},e.prototype.getTotalStalledTime=function(){return this.sN()?this.mN.getTotalStalledTime():this.lN.getTotalStalledTime()},e.prototype.getDownloadedVideoData=function(){return this.sN()?this.mN.getDownloadedVideoData():this.lN.getDownloadedVideoData()},e.prototype.getDownloadedAudioData=function(){return this.sN()?this.mN.getDownloadedAudioData():this.lN.getDownloadedAudioData()},e.prototype.getPlaybackVideoData=function(){return this.sN()?this.mN.getPlaybackVideoData():this.lN.getPlaybackVideoData()},e.prototype.getPlaybackAudioData=function(){return this.sN()?this.mN.getPlaybackAudioData():this.lN.getPlaybackAudioData()},e.prototype.getBufferedRanges=function(){return this.lN.getBufferedRanges()},e.prototype.getManifest=function(){return this.lN.getManifest()},e.prototype.isCasting=function(){return this.sN()},e.prototype.isCastAvailable=function(){return this.rN()||this.sN()},e.prototype.castVideo=function(){this.rN()&&(this.mN.connect(),this.kN.eventHandler.dispatchEvent(r.PlayerEvent.CastStart))},e.prototype.castStop=function(){if(this.sN()){if(this.mN instanceof c.GoogleCastRemoteControlBase)return this.mN.connect();this.mN.disconnect()}},e.prototype.updateCallback=function(e){this.lN.updateCallback(e)},e.prototype.setQueryParameters=function(e){this.sN()&&this.mN.setQueryParameters(e),this.lN.setQueryParameters(e)},e.prototype.clearQueryParameters=function(){this.sN()&&this.mN.clearQueryParameters(),this.lN.clearQueryParameters()},e.prototype.getMaxTimeShift=function(){return this.sN()?this.mN.getMaxTimeShift():this.lN.getMaxTimeShift()},e.prototype.timeShift=function(e,t){this.sN()?this.mN.timeShift(e):this.lN.timeShift(e,t)},e.prototype.getTimeShift=function(){return this.sN()?this.mN.getTimeShift():this.lN.getTimeShift()},e.prototype.addSubtitle=function(e){return this.sN()&&this.mN.addSubtitle(e),this.lN.addSubtitle(e)},e.prototype.removeSubtitle=function(e){this.sN()&&this.mN.removeSubtitle(e),this.lN.removeSubtitle(e)},e.prototype.enableSubtitle=function(e){return this.sN()&&this.mN.enableSubtitle(e),this.lN.enableSubtitle(e)},e.prototype.disableSubtitle=function(e){return this.sN()&&this.mN.disableSubtitle(e),this.lN.disableSubtitle(e)},e.prototype.listSubtitles=function(){return this.lN.listSubtitles()},e.prototype.getAudioQuality=function(){return this.lN.getAudioQuality()},e.prototype.getVideoQuality=function(){return this.lN.getVideoQuality()},e.prototype.setAudio=function(e){this.sN()&&this.mN.setAudio(e),this.lN.setAudio(e)},e.prototype.getAvailableAudio=function(){return this.lN.getAvailableAudio()},e.prototype.getAudio=function(){return this.lN.getAudio()},e.prototype.getSnapshot=function(e,t){if(!this.sN())return this.lN.getSnapshot(e,t)},e.prototype.setPlaybackSpeed=function(e){this.sN()&&this.mN.setPlaybackSpeed(e),this.lN.setPlaybackSpeed(e)},e.prototype.getPlaybackSpeed=function(){return this.lN.getPlaybackSpeed()},e.prototype.permitControl=function(e){this.lN.permitControl(e)},e.prototype.addMetadata=function(e,t){return!("CAST"!==e.toUpperCase()||!this.sN()||(this.mN.sendMessage(d.RemoteControlMessageType.CustomData,t),0))},e.prototype.onFullscreenEnter=function(e){this.lN.onFullscreenEnter(e)},e.prototype.onFullscreenExit=function(){this.lN.onFullscreenExit()},e.prototype.isAirplayAvailable=function(){return this.lN.isAirplayAvailable()},e.prototype.isAirplayActive=function(){return this.lN.isAirplayActive()},e.prototype.showAirplayTargetPicker=function(){this.lN.showAirplayTargetPicker()},e.prototype.getSeekableRange=function(){return this.lN.getSeekableRange()},e.prototype.getLatency=function(){return this.lN.getLatency()},e.prototype.setTargetLatency=function(e){this.lN.setTargetLatency(e)},e.prototype.getTargetLatency=function(){return this.lN.getTargetLatency()},e.prototype.setCatchupConfig=function(e){this.lN.setCatchupConfig(e)},e.prototype.getCatchupConfig=function(){return this.lN.getCatchupConfig()},e.prototype.setFallbackConfig=function(e){this.lN.setFallbackConfig(e)},e.prototype.getFallbackConfig=function(){return this.lN.getFallbackConfig()},e.prototype.createManifestApi=function(){return this.lN.createManifestApi()},e.prototype.release=function(e){var t=this;return null!=this.mN&&(this.mN.setOnErrorCallback(null),this.mN.setOnReadyCallback(null),this.mN.setOnConnectCallback(null),this.mN.setOnConnectedCallback(null),this.mN.setOnDisconnectCallback(null),this.mN.setOnDisconnectedCallback(null),this.mN.setOnRemotePlayerEventCallback(null),this.mN.release()),this.lN.release(e).then(function(){t.lN=null,t.mN=null})},e}();t.RemoteControlPlayerWrapper=p},30165:function(e,t){var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedPlayerApiMethods=t.RemoteControlReceiverMessageType=void 0,function(e){e[e.PlayerState=0]="PlayerState",e[e.PlayerEvent=1]="PlayerEvent",e[e.PlayerGetterCallReturnValue=2]="PlayerGetterCallReturnValue"}(o||(t.RemoteControlReceiverMessageType=o={})),function(e){e.GET_CONTAINER="getContainer",e.GET_SNAPSHOT="getSnapShot",e.GET_VIDEO_ELEMENT="getVideoElement"}(n||(t.UnsupportedPlayerApiMethods=n={}))},61567:function(__unused_webpack_module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.RemoteJSON=void 0;var RemoteJSON=function(){function RemoteJSON(){}return RemoteJSON.stringifyFunction=function(e){if("function"==typeof e)return RemoteJSON.FUNCTION_PREFIX+e.toString()},RemoteJSON.parseFunction=function(fs){if(fs&&"string"==typeof fs&&0===fs.indexOf(RemoteJSON.FUNCTION_PREFIX)){var f="f = "+fs.substring(RemoteJSON.FUNCTION_PREFIX.length);if(eval(f),"function"==typeof f)return f}},RemoteJSON.stringify=function(e,t,o){return JSON.stringify(e,function(e,o){return"function"==typeof o?RemoteJSON.stringifyFunction(o):t?t(e,o):o},o)},RemoteJSON.parse=function(e,t){return JSON.parse(e,function(e,o){return RemoteJSON.parseFunction(o)||(t?t(e,o):o)})},RemoteJSON.FUNCTION_PREFIX="function::",RemoteJSON}();exports.RemoteJSON=RemoteJSON},91297:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketRemoteControl=void 0;var r=o(60768),i=o(35317),a=o(61567),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.vN=o,window.WebSocket&&n.onReady(),n}return n(t,e),t.prototype.getConfig=function(){return this.vN},t.prototype.connect=function(){var e=this;if(!this.isReady())throw new Error("Remote is not ready");this.onConnect("WebSocket Receiver"),this.wN=new WebSocket(this.vN.url+"?role=remote"),this.wN.addEventListener("open",function(t){e.onConnected("WebSocket Receiver",!1)}),this.wN.addEventListener("error",function(t){e.onError()}),this.wN.addEventListener("close",function(t){e.onDisconnected()}),this.wN.addEventListener("message",function(t){return e.yN(t)})},t.prototype.yN=function(e){if(e.data)try{var t=JSON.parse(e.data);this.handleRemoteControlReceiverMessage(t)}catch(e){}},t.prototype.sendMessage=function(e,t){this.wN.send(a.RemoteJSON.stringify({type:e,data:t}))},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.disconnect=function(){this.onDisconnect(),this.wN.close()},t.prototype.release=function(){},t.prototype.setSource=function(e,t,o){this.xN=e,this.sendMessage(r.RemoteControlMessageType.SourceSetup,{source:e,autoplay:t,time:o})},t.prototype.getSource=function(){return this.xN},t}(i.RemoteControlBase);t.WebSocketRemoteControl=s},58367:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoProcessor=void 0;var n=o(2025),r=o(26662),i=function(){function e(e,t,o){this.j7=Promise.resolve(),this.i7=new n.GoogleCastV3TrackFinder(e),this.media=t,this.logger=o}return e.prototype.setMedia=function(e){this.media=e},e.prototype.setMediaInfo=function(e){this.i7.setMediaInfo(e)},e.prototype.enableTrack=function(e){var t,o=this,n=e.trackId;this.l7(null===(t=e.customData)||void 0===t?void 0:t.internalId,e.type,n)&&n&&this.j7.then(function(){var t=o.k7(e.type);return t.push(n),new r.EditTrackInfoRequest(o.media,t,o.logger).execute()})},e.prototype.k7=function(e){var t;if(!this.media||!this.media.activeTrackIds)return[];var o=this.media.activeTrackIds,n=null===(t=this.media.media)||void 0===t?void 0:t.tracks;if(!n)return o;var r=n.filter(function(t){return t.type!==e});return o.filter(function(e){return r.find(function(t){return t.trackId===e})})},e.prototype.disableTrack=function(e,t){var o,n=this.i7.findTrackIdByInternalId(e,t);if(this.l7(e,t,n)&&n){var i=((null===(o=this.media)||void 0===o?void 0:o.activeTrackIds)||[]).filter(function(e){return e!==n});this.j7=new r.EditTrackInfoRequest(this.media,i,this.logger).execute()}},e.prototype.changeActiveTracksBasedOnCastIds=function(e){this.media&&(this.j7=new r.EditTrackInfoRequest(this.media,e,this.logger).execute())},e.prototype.l7=function(e,t,o){return!!this.media&&null!==o},e}();t.EditTrackInfoProcessor=i},26662:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoRequest=void 0;var o=function(){function e(e,t,o){this.xgb=e,this.ygb=t,this.zgb=o}return e.prototype.execute=function(){var e=this;return new Promise(function(t,o){if(e.xgb){var n=new chrome.cast.media.EditTracksInfoRequest(e.ygb);e.xgb.editTracksInfo(n,t,o)}else o("Media is not initialized properly.")}).catch(function(e){})},e}();t.EditTrackInfoRequest=o},13748:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoTrackMapper=void 0;var r=o(80186),i=o(57230),a=function(){function e(e){this.context=e}return e.prototype.maybeReMapTracksForMediaInfo=function(e){(null==e?void 0:e.tracks)&&this.mapTracksWithNoInternalId(e.tracks)},e.prototype.mapTracksWithNoInternalId=function(e){var t=this,o=e.filter(function(e){var t;return!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}),n={};o.forEach(function(o){var r=o.type,i=n[r];i||(i=t.o7(o),n[r]=i),t.m7(o,e,i)})},e.prototype.m7=function(e,t,o){var r;if(!(null===(r=null==e?void 0:e.customData)||void 0===r?void 0:r.internalId)&&(null==t?void 0:t.length)){var i=this.n7(e,t,o);i&&(e.customData=n(n({},e.customData),{internalId:i}))}},e.prototype.n7=function(e,t,o){var n,i,a,s=o.filter(function(t){return(0,r.bothTracksHaveSameLanguage)(t,e)}),l=null===(n=s[0])||void 0===n?void 0:n.id;if(s.length>0){var u=t.filter(function(e){var t;return!!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}).map(function(e){return e.customData.internalId});return null!==(a=null===(i=s.find(function(e){return!u.includes(e.id)}))||void 0===i?void 0:i.id)&&void 0!==a?a:null}return l},e.prototype.o7=function(e){return(0,i.isSubtitle)(e)?this.context.internalPlayer.listSubtitles():(0,i.isAudio)(e)?this.context.internalPlayer.getAvailableAudio():[]},e.prototype.markAllTracksAsReadyToPlay=function(e){null==e||e.forEach(function(e){e.customData&&(e.customData.needsReloadBeforePlay=!1)})},e}();t.MediaInfoTrackMapper=a},15529:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoWrapper=void 0;var n=o(57230),r=function(){function e(e,t){e&&!Array.isArray(e.tracks)&&(e.tracks=[]),this.p7=e,this.q7=t}return e.prototype.r7=function(){var e,t,o,n=null===(e=this.p7)||void 0===e?void 0:e.tracks;return(null==n?void 0:n.length)&&null!==(o=null===(t=n[n.length-1])||void 0===t?void 0:t.trackId)&&void 0!==o?o:0},e.prototype.maybeAddInternalTrack=function(e){if(this.p7&&!(this.C8(e.id)>=0)){var t=(0,n.fromInternalTrackToGoogleTrack)(e,this.r7()+1);(0,n.isValidTrack)(t)&&this.p7.tracks.push(t)}},e.prototype.maybeRemoveInternalTrack=function(e){var t,o,n=this.C8(e);return n>-1&&(null===(o=null===(t=this.p7)||void 0===t?void 0:t.tracks)||void 0===o||o.splice(n,1)),n>-1},e.prototype.C8=function(e){var t;return e&&(null===(t=this.p7)||void 0===t?void 0:t.tracks)?this.p7.tracks.findIndex(function(t){var o;return e===(null===(o=t.customData)||void 0===o?void 0:o.internalId)}):-1},e.prototype.findTrackIdForTrack=function(e){var t,o,n;return null!==(n=null===(o=null===(t=this.p7)||void 0===t?void 0:t.tracks[this.C8(e)])||void 0===o?void 0:o.trackId)&&void 0!==n?n:-1},e}();t.MediaInfoWrapper=r},80186:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.bothTracksHaveSameLanguage=function(e,t){var o;return!!t.language&&((null===(o=e.lang)||void 0===o?void 0:o.toLowerCase())===t.language.toLowerCase()||function(e,t){var o=n.SHAKA_ISO_MAP[e];return o?t===o:function(e){var t=Object.keys(n.SHAKA_ISO_MAP).find(function(t){var o=n.SHAKA_ISO_MAP[t];return e===o||e===t});return null!=t?n.SHAKA_ISO_MAP[t]:null}(t)===e}(t.language,e.lang))};var n=o(90435)},57230:function(e,t){function o(e){return e.type===chrome.cast.media.TrackType.AUDIO}Object.defineProperty(t,"__esModule",{value:!0}),t.fromInternalTrackToGoogleTrack=function(e,t){var n,r=e.getQualities?chrome.cast.media.TrackType.AUDIO:chrome.cast.media.TrackType.TEXT,i=new chrome.cast.media.Track(t,r);return function(e,t){o(t)?function(e,t){var o,n;t.trackContentType=null!==(n=null===(o=e.getQualities().find(function(e){return e.codec}))||void 0===o?void 0:o.codec)&&void 0!==n?n:""}(e,t):function(e,t){t.trackContentType=e.id?e.id.split("-")[0]:"",t.trackContentId=e.url,t.subtype=function(e){var t,o;return e.kind===chrome.cast.media.TextTrackType.METADATA.toLowerCase()?chrome.cast.media.TextTrackType.METADATA:(null===(t=e.kind)||void 0===t?void 0:t.includes("caption"))||function(e){return Boolean(e.find(function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.includes("caption")}))}(null!==(o=e.role)&&void 0!==o?o:[])?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES}(e)}(e,t)}(e,i),i.language=e.lang,i.name=e.label,i.roles=(null===(n=e.role)||void 0===n?void 0:n.filter(function(e){return!!e.value}).map(function(e){return e.value||""}))||[],i.customData={internalId:e.id,needsReloadBeforePlay:!0},i},t.isValidTrack=function(e){return!(!(e.trackContentType&&e.trackId&&e.language&&e.name)||o(e))&&(!!e.subtype&&!!e.trackContentId)},t.isSubtitle=function(e){return e.type===chrome.cast.media.TrackType.TEXT},t.isAudio=o},90435:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SHAKA_ISO_MAP=void 0,t.SHAKA_ISO_MAP={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"}}},function(e){return function(){return e(92682)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.remotecontrol=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player.remotecontrol=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[140],{71223:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameSource=r;var n=o(58313);function r(e,t){return!e&&!t||!(!e||!t)&&(e.dash?i(e.dash,t.dash,t):e.hls?i(e.hls,t.hls,t):!!e.progressive&&!Array.isArray(t.progressive)&&i(e.progressive,t.progressive,t))}function i(e,t,o){try{return r(JSON.parse(e),o)}catch(e){}return!!t&&n.URLHelper.toFullUrl(t)===n.URLHelper.toFullUrl(e)}},68657:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastReceiverVersion=void 0,function(e){e.v2="v2",e.v3="v3"}(o||(t.GoogleCastReceiverVersion=o={}))},32645:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlBase=void 0,t.mediaInfoToSourceConfig=c;var r=o(3714),i=o(20213),a=o(85625),s=o(94685),l=o(60768),u=function(e){function t(t,o){var n=e.call(this,t)||this;n.yN=function(e,t){n.isConnected()||n.onConnect(e.friendlyName)},n.zN=function(e){switch(e.castState){case cast.framework.CastState.NO_DEVICES_AVAILABLE:n.onReady(!1);break;case cast.framework.CastState.NOT_CONNECTED:n.onReady(!0);case cast.framework.CastState.CONNECTING:case cast.framework.CastState.CONNECTED:}},n.KO=function(e){switch(e.sessionState){case cast.framework.SessionState.NO_SESSION:case cast.framework.SessionState.SESSION_STARTING:break;case cast.framework.SessionState.SESSION_STARTED:n.onConnected(e.session.getCastDevice().friendlyName,!1);break;case cast.framework.SessionState.SESSION_START_FAILED:e.errorCode!==chrome.cast.ErrorCode.CANCEL&&n.onError();break;case cast.framework.SessionState.SESSION_ENDING:break;case cast.framework.SessionState.SESSION_ENDED:n.onDisconnected();break;case cast.framework.SessionState.SESSION_RESUMED:n.onConnected(e.session.getCastDevice().friendlyName,!0),n.remotePlayer.isPaused||(n.xN(),n.onRemotePlayerEvent({event:r.PlayerEvent.Play}))}},n.LO=function(e){n.mediaInfoChangedEventHandler(e)},n.MO=function(e){switch(e.value){case chrome.cast.media.PlayerState.PAUSED:n.onRemotePlayerEvent({event:r.PlayerEvent.Paused});break;case chrome.cast.media.PlayerState.PLAYING:n.onRemotePlayerEvent({event:r.PlayerEvent.Playing})}},n.NO=function(){n.remotePlayer.isPaused||n.onRemotePlayerEvent({event:r.PlayerEvent.Play})},n.OO=function(){n.onRemotePlayerEvent({event:r.PlayerEvent.TimeChanged})},n.PO=function(){n.onRemotePlayerEvent({event:r.PlayerEvent.VolumeChanged})},n.QO=function(){n.onRemotePlayerEvent({event:n.remotePlayer.isMuted?r.PlayerEvent.Muted:r.PlayerEvent.Unmuted})},n.RO=function(e){n.remotePlayer.isConnected},n.SO=function(){n.remotePlayer.isPaused||n.remotePlayerController.playOrPause()},n.config=o,n.wN=void 0;var i=function(e){if(e)try{n.initializeCast()}catch(e){}n.wN&&n.wN(e)};return window.chrome&&window.chrome.cast&&window.cast&&window.cast.framework?setTimeout(function(){return i(!0)},1e3):(n.wN=window.__onGCastApiAvailable,window.__onGCastApiAvailable=i),n}return n(t,e),t.prototype.xN=function(){var e,t,o=this;null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t||t.getStatus(void 0,function(){(0,s.isContextAvailable)(o.context)},function(e){(0,s.isContextAvailable)(o.context)})},t.prototype.initializeCast=function(){var e;cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:this.config.receiverApplicationId,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,resumeSavedSession:null!==(e=this.config.rejoinActiveSession)&&void 0!==e&&e}),this.remotePlayer=new cast.framework.RemotePlayer,this.remotePlayerController=new cast.framework.RemotePlayerController(this.remotePlayer),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.RO),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.MO),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.NO),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.OO),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.PO),this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.QO),cast.framework.CastContext.getInstance().getCastState()!==cast.framework.CastState.NO_DEVICES_AVAILABLE?this.onReady(!0):cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.zN),cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.KO),chrome.cast.addReceiverActionListener(this.yN);var t=cast.framework.CastContext.getInstance().getCurrentSession();t&&this.onConnected(t.getCastDevice().friendlyName,!0)},t.prototype.mediaInfoChangedEventHandler=function(e){this.remotePlayer.mediaInfo,this.mediaInfo=e.value},t.prototype.getConfig=function(){return this.config},t.prototype.connect=function(){var e=this;cast.framework.CastContext.getInstance().requestSession().then(function(){}).catch(function(t){t===chrome.cast.ErrorCode.CANCEL||e.onError()})},t.prototype.onConnected=function(t,o){var n=this;this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.castSession.addMessageListener(this.config.messageNamespace,function(e,t){try{var o=JSON.parse(t);n.handleRemoteControlReceiverMessage(o)}catch(e){}}),this.context.eventHandler.on(r.PlayerEvent.PlaybackFinished,this.SO),e.prototype.onConnected.call(this,t,o)},t.prototype.sendMessage=function(e,t){void 0===e&&(e=l.RemoteControlMessageType.PlayerApiMethodCall),this.castSession.sendMessage(this.config.messageNamespace,{type:e,data:t})},t.prototype.disconnect=function(){cast.framework.CastContext.getInstance().endCurrentSession(!0),this.onDisconnect()},t.prototype.onDisconnected=function(){e.prototype.onDisconnected.call(this),this.context.eventHandler.off(r.PlayerEvent.PlaybackFinished,this.SO),this.playerState=null},t.prototype.release=function(){window.__onGCastApiAvailable=this.wN||void 0,this.remotePlayerController&&(this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,this.LO),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED,this.MO),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,this.QO),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED,this.PO),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.OO),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,this.NO),this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED,this.RO),chrome.cast.removeReceiverActionListener(this.yN),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.zN),cast.framework.CastContext.getInstance().removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.KO))},t.prototype.setSource=function(e,t,o){var n=this;return this.lastSource=e,this.getMediaInfo(e).then(function(e){var r=new chrome.cast.media.LoadRequest(e);return r.autoplay=t||!1,null!=o&&(r.currentTime=o),n.loadMediaRequest(r)})},t.prototype.loadMediaRequest=function(e){var t=this,o=cast.framework.CastContext.getInstance().getCurrentSession().getSessionObj();return new Promise(function(n,r){o.loadMedia(e,function(e){t.media=e,t.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,t.LO),n()},function(e){r(e)})})},t.prototype.getSource=function(){return this.remotePlayer.mediaInfo?c(this.remotePlayer.mediaInfo):null},t.prototype.play=function(){this.remotePlayer.isPaused&&this.remotePlayerController.playOrPause()},t.prototype.isPlaying=function(){return!this.remotePlayer.isPaused},t.prototype.pause=function(){this.remotePlayer.isPaused||this.remotePlayerController.playOrPause()},t.prototype.isPaused=function(){return this.remotePlayer.isPaused},t.prototype.getCurrentTime=function(t){return void 0===t&&(t=i.TimeMode.AbsoluteTime),t===i.TimeMode.RelativeTime?e.prototype.getCurrentTime.call(this,t):this.remotePlayer.currentTime},t.prototype.seek=function(e){this.remotePlayer.currentTime=e,this.remotePlayerController.seek(),this.onRemotePlayerEvent({event:r.PlayerEvent.Seeked})},t.prototype.setVolume=function(e){this.remotePlayer.volumeLevel=e,this.remotePlayerController.setVolumeLevel()},t.prototype.getVolume=function(){return this.remotePlayer.volumeLevel},t.prototype.setMuted=function(e){e!==this.remotePlayer.isMuted&&this.remotePlayerController.muteOrUnmute()},t.prototype.isMuted=function(){return this.remotePlayer.isMuted},t}(o(35317).RemoteControlBase);function c(e){var t=e.contentUrl||e.contentId;switch(e.contentType.toLowerCase()){case a.ManifestMimeType.Dash:return{dash:t};case a.ManifestMimeType.Hls:return{hls:t};case a.ManifestMimeType.Smooth:return{smooth:t};default:return{progressive:t}}}t.GoogleCastRemoteControlBase=u},61348:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV2=void 0;var r=o(58313),i=o(32645),a=o(61567),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.getMediaInfo=function(e){var t=new chrome.cast.media.MediaInfo(a.RemoteJSON.stringify(e),"application/json");if(t.streamType=chrome.cast.media.StreamType.BUFFERED,t.metadata=new chrome.cast.media.GenericMediaMetadata,t.metadata.title=e.title||null,t.metadata.subtitle=e.description||null,e.poster){var o=r.URLHelper.toFullUrl(e.poster);t.metadata.images=[new chrome.cast.Image(o)]}return Promise.resolve(t)},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t}(i.GoogleCastRemoteControlBase);t.GoogleCastRemoteControlV2=s},23747:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),r=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastRemoteControlV3=void 0,t.getDrmConfig=function(e){if(e.widevine)return S(e.widevine,i.WIDEVINE);if(e.playready)return S(e.playready,i.PLAYREADY);if(e.clearkey)return S(e.clearkey,i.CLEARKEY);throw new Error("Not supported drm config.")},t.getUrlFromKeys=O,t.sortProgressiveSources=C;var i,a=o(80813),s=o(20213),l=o(85625),u=o(74853),c=o(70233),p=o(58313),d=o(32645),f=o(7209),h=o(2025),y=o(58367),m=o(13748),v=o(15529);!function(e){e.CLEARKEY="clearkey",e.PLAYREADY="playready",e.WIDEVINE="widevine"}(i||(i={}));var g=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n.VO=0,n.YO=!1,n.eO=function(e){var t,o;(null===(t=n.mediaInfo)||void 0===t?void 0:t.duration)>0&&(null===(o=n.mediaInfo)||void 0===o?void 0:o.duration)-n.UO<2&&0===e.value&&(n.TO=!0,n.onRemotePlayerEvent({event:s.PlayerEvent.PlaybackFinished})),n.UO=e.value},n.WO=new m.MediaInfoTrackMapper(t),n.XO=new y.EditTrackInfoProcessor(n.mediaInfo,n.media,n.context.logger),n.ZO=new v.MediaInfoWrapper(n.mediaInfo,n.context.logger),n}return n(t,e),t.prototype.initializeCast=function(){e.prototype.initializeCast.call(this),this.dO()},t.prototype.getCurrentTime=function(e){if(void 0===e&&(e=s.TimeMode.AbsoluteTime),!this.remotePlayer)return 0;var t=this.remotePlayer.currentTime;return e===s.TimeMode.RelativeTime?t:this.aO(t)},t.prototype.aO=function(e){return e+this.cO()},t.prototype.bO=function(e){return e-this.cO()},t.prototype.cO=function(){var e,t,o,n=null===(t=null===(e=this.castSession)||void 0===e?void 0:e.getMediaSession())||void 0===t?void 0:t.customData;return null!==(o=null==n?void 0:n.startAbsoluteTime)&&void 0!==o?o:0},t.prototype.dO=function(){var e=this;this.remotePlayerController.addEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.eO),this.context.eventHandler.on(s.PlayerEvent.PeriodSwitch,function(){new h.GoogleCastV3TrackFinder(e.mediaInfo).hasATrackToLoad()&&e.mO()})},t.prototype.sendMessage=function(e,t){this.config.messageNamespace&&this.castSession.sendMessage(this.config.messageNamespace,{type:"METADATA",data:t})},t.prototype.play=function(){var t=this;this.TO&&this.lastSource?this.setSource(this.lastSource).then(function(){return e.prototype.play.call(t)}):e.prototype.play.call(this),this.TO=!1},t.prototype.fO=function(e){var t=this.iO(e),o=t.url,n=t.mimeType,r=new chrome.cast.media.MediaInfo(o,n);return r.customData=(0,f.getCustomData)(e,n),r},t.prototype.getMediaInfo=function(e){var t,o=this.fO(e),n=this.context.sourceContext.sourceIdentifier,r=this.context.serviceManager.get(a.ServiceName.ManifestService,n);return(null==r?void 0:r.isLive())&&(o.streamType=chrome.cast.media.StreamType.LIVE,this.VO=0),this.gO(null!==(t=e.subtitleTracks)&&void 0!==t?t:[],o),this.config.prepareMediaInfo?this.config.prepareMediaInfo(o):Promise.resolve(o)},t.prototype.gO=function(e,t){var o=new v.MediaInfoWrapper(t,this.context.logger);r(r([],null!=e?e:[],!0),this.hO(),!0).forEach(function(e){return o.maybeAddInternalTrack(e)})},t.prototype.hO=function(){var e=this.context.internalPlayer.listSubtitles().filter(function(e){return e.isSideloaded}),t=this.context.internalPlayer.getAvailableAudio();return r(r([],e,!0),t,!0)},t.prototype.iO=function(e){var t,o;if(e.dash)t=e.dash,o=l.ManifestMimeType.Dash;else if(e.hls)t=e.hls,o=l.ManifestMimeType.Hls;else if(e.smooth)t=e.smooth,o=l.ManifestMimeType.Smooth;else{if(!e.progressive)throw new Error("Source not supported.");var n=this.kO(e.progressive);t=n.url,o=n.mimeType}return{url:t=p.URLHelper.toFullUrl(t),mimeType:o}},t.prototype.timeShift=function(e){var t;this.VO=e,this.seek(((null===(t=this.jO())||void 0===t?void 0:t.end)||0)+e)},t.prototype.seek=function(t){e.prototype.seek.call(this,this.bO(t))},t.prototype.jO=function(){var e,t=null===(e=this.remotePlayer)||void 0===e?void 0:e.liveSeekableRange;return void 0===(null==t?void 0:t.start)||void 0===(null==t?void 0:t.end)?{start:-1,end:-1}:{start:this.aO(t.start),end:this.aO(t.end)}},t.prototype.getTimeShift=function(){var e=this.jO();if(e.end<0)return this.VO;var t=this.getCurrentTime()-e.end;return t>0?0:t},t.prototype.getMaxTimeShift=function(){var e,t,o=this.jO();return(null!==(e=null==o?void 0:o.start)&&void 0!==e?e:0)-(null!==(t=null==o?void 0:o.end)&&void 0!==t?t:0)},t.prototype.kO=function(e){var t,o;if(Array.isArray(e)){var n=C(e)[0];t=n.url,o=n.type}else t=e;return{url:t,mimeType:o}},t.prototype.release=function(){e.prototype.release.call(this),this.remotePlayerController&&this.remotePlayerController.removeEventListener(cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,this.eO)},t.prototype.lO=function(e){var t,o,n=this;e&&(null!==(o=null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay)&&void 0!==o&&o?this.mO().then(function(){n.XO.enableTrack(e)}):this.XO.enableTrack(e))},t.prototype.enableSubtitle=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.TEXT);t&&this.lO(t)},t.prototype.disableSubtitle=function(e){this.XO.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.setAudio=function(e){var t=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTrackByInternalId(e,chrome.cast.media.TrackType.AUDIO);t&&this.lO(t)},t.prototype.mediaInfoChangedEventHandler=function(t){var o,n;e.prototype.mediaInfoChangedEventHandler.call(this,t),this.XO.setMediaInfo(this.mediaInfo),this.ZO=new v.MediaInfoWrapper(this.mediaInfo,this.context.logger),this.WO.maybeReMapTracksForMediaInfo(this.mediaInfo);var r=new v.MediaInfoWrapper(this.mediaInfo,this.context.logger);this.hO().forEach(function(e){return r.maybeAddInternalTrack(e)}),this.YO&&(null===(n=null===(o=this.mediaInfo)||void 0===o?void 0:o.tracks)||void 0===n?void 0:n.length)>0&&this.nO()},t.prototype.addSubtitle=function(e){this.ZO.maybeAddInternalTrack(e)},t.prototype.removeSubtitle=function(e){var t,o,n=new v.MediaInfoWrapper(this.mediaInfo,this.context.logger),r=Boolean(null===(o=null===(t=this.media)||void 0===t?void 0:t.activeTrackIds)||void 0===o?void 0:o.find(function(t){return t===n.findTrackIdForTrack(e)}));n.maybeRemoveInternalTrack(e)&&r&&this.XO.disableTrack(e,chrome.cast.media.TrackType.TEXT)},t.prototype.mO=function(){var e=new chrome.cast.media.LoadRequest(this.mediaInfo);return e.currentTime=this.context.internalPlayer.getCurrentTime(),e.autoplay=this.context.internalPlayer.isPlaying(),this.loadMediaRequest(e)},t.prototype.loadMediaRequest=function(t){var o=this;return this.WO.markAllTracksAsReadyToPlay(t.media.tracks),e.prototype.loadMediaRequest.call(this,t).then(function(){o.YO=!0,o.XO.setMedia(o.media),o.XO.setMediaInfo(o.mediaInfo),o.nO()})},t.prototype.nO=function(){var e,t=this;if(this.mediaInfo){this.YO=!1;var o=this.context.internalPlayer.listSubtitles().filter(function(e){return!!e.enabled}).map(function(e){return e.id});o.push(null===(e=this.context.internalPlayer.getAudio())||void 0===e?void 0:e.id),o=o.filter(Boolean);var n=new h.GoogleCastV3TrackFinder(this.mediaInfo).findTracksForIds(o),r=n.some(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}),i=n.map(function(e){return e.trackId});if(!r)return this.XO.changeActiveTracksBasedOnCastIds(i);this.mO().then(function(){t.XO.changeActiveTracksBasedOnCastIds(i)})}},t}(d.GoogleCastRemoteControlBase);function O(e){var t={keys:e.map(function(e){var t=c.FormatHelper.hexToBytes(e.key),o=c.FormatHelper.hexToBytes(e.kid||"");return{kty:"oct",kid:u.ArrayHelper.arrayBufferToBase64(o.buffer).replace(/[=]*$/,""),k:u.ArrayHelper.arrayBufferToBase64(t.buffer).replace(/[=]*$/,"")}})},o=JSON.stringify(t);return"data:application/json;base64,"+btoa(o)}function C(e){return e.sort(function(e,t){return e.preferred===t.preferred?(e.bitrate||0)>(t.bitrate||0)?-1:1:(e.preferred||0)>(t.preferred||0)?-1:1})}function S(e,t){return function(e){return Array.isArray(e)}(e)?{protectionSystem:i.CLEARKEY,licenseUrl:O(e)}:{protectionSystem:t,licenseUrl:e.LA_URL||"",headers:e.headers,withCredentials:e.withCredentials||!1}}t.GoogleCastRemoteControlV3=g},7209:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomData=function(e,t){var o={};return i(e.drm)&&(o.drm=(0,r.getDrmConfig)(e.drm)),i(e.metadata)&&(o.metadata=e.metadata),i(e.options)&&(o.options=function(e,t){var o,r,i=e.options;return t===n.ManifestMimeType.Dash?(o=a(i,["dashWithCredentials","withCredentials"]),r=a(i,["dashManifestWithCredentials","manifestWithCredentials"])):t===n.ManifestMimeType.Hls&&(o=a(i,["hlsWithCredentials","withCredentials"]),r=a(i,["hlsManifestWithCredentials","manifestWithCredentials"])),{withCredentials:o||!1,manifestWithCredentials:r||!1}}(e,t)),o};var n=o(85625),r=o(23747);function i(e){return Object.keys(null!=e?e:{}).length>0}function a(e,t){for(var o,n=0,r=t;n<r.length;n++){var i=r[n];if(i in e){o=e[i];break}}return o}},2025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleCastV3TrackFinder=void 0;var o=function(){function e(e){this.i9=e}return e.prototype.findTrackIdByInternalId=function(e,t){var o,n;return null!==(n=null===(o=this.findTrackByInternalId(e,t))||void 0===o?void 0:o.trackId)&&void 0!==n?n:null},e.prototype.findTrackByInternalId=function(e,t){var o,n,r;return null!==(r=(null!==(n=null===(o=this.i9)||void 0===o?void 0:o.tracks)&&void 0!==n?n:[]).find(function(o){var n;return(null===(n=o.customData)||void 0===n?void 0:n.internalId)===e&&o.type===t}))&&void 0!==r?r:null},e.prototype.findTracksForIds=function(e){var t,o;return(null!==(o=null===(t=this.i9)||void 0===t?void 0:t.tracks)&&void 0!==o?o:[]).filter(function(t){var o;return e.includes(null===(o=t.customData)||void 0===o?void 0:o.internalId)})},e.prototype.hasATrackToLoad=function(){var e,t;return Boolean(null===(t=null===(e=this.i9)||void 0===e?void 0:e.tracks)||void 0===t?void 0:t.find(function(e){var t;return null===(t=e.customData)||void 0===t?void 0:t.needsReloadBeforePlay}))},e.prototype.setMediaInfo=function(e){this.i9=e},e}();t.GoogleCastV3TrackFinder=o},94952:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCustomElementRegistry=function(){var e=function(){var e=window.customElements;return function(e){return"object"==typeof e&&["get","define","whenDefined","upgrade"].every(function(t){return"function"==typeof e[t]})}(e)?e:void 0}();void 0===o&&void 0!==e&&(o=new r(e),Object.defineProperty(window,"customElements",{get:function(){return o}}))};var o,n=["google-cast-button","google-cast-launcher"],r=function(){function e(e){this.registry=e}return e.prototype.define=function(e,t,o){var r=n.includes(e),i=Boolean(this.registry.get(e));r&&i||this.registry.define(e,t,o)},e.prototype.whenDefined=function(e){return this.registry.whenDefined(e)},e.prototype.get=function(e){return this.registry.get(e)},e.prototype.upgrade=function(e){this.registry.upgrade(e)},e}()},92682:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlModuleDefinition=void 0;var n=o(62756),r=o(42489);t.RemoteControlModuleDefinition={name:n.ModuleName.RemoteControl,module:{RemoteControlManager:r.RemoteControlManager}},t.default=t.RemoteControlModuleDefinition},60768:function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlMessageType=void 0,function(e){e[e.SourceSetup=0]="SourceSetup",e[e.PlayerApiMethodCall=1]="PlayerApiMethodCall",e[e.CustomData=2]="CustomData"}(o||(t.RemoteControlMessageType=o={}))},35317:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlBase=void 0;var n,r=o(20213),i=o(60768),a=o(30165);!function(e){e[e.Idle=0]="Idle",e[e.Ready=1]="Ready",e[e.Connected=2]="Connected"}(n||(n={}));var s=function(){function e(e){this.context=e,this.g9=n.Idle}return Object.defineProperty(e.prototype,"g9",{get:function(){return this.e9},set:function(e){this.e9=e},enumerable:!1,configurable:!0}),e.prototype.getConfig=function(){throw new Error("Not implemented - overwrite in subclasses!")},e.prototype.setOnErrorCallback=function(e){this.X9=e},e.prototype.setOnReadyCallback=function(e){this.Y9=e},e.prototype.setOnConnectCallback=function(e){this.Z9=e},e.prototype.setOnConnectedCallback=function(e){this.a9=e},e.prototype.setOnDisconnectCallback=function(e){this.b9=e},e.prototype.setOnDisconnectedCallback=function(e){this.c9=e},e.prototype.setOnRemotePlayerEventCallback=function(e){this.d9=e},e.prototype.isReady=function(){return this.g9===n.Ready},e.prototype.isConnected=function(){return this.g9===n.Connected},e.prototype.onError=function(){this.g9=n.Ready,this.X9&&this.X9()},e.prototype.onReady=function(e){void 0===e&&(e=!0);var t=e?n.Ready:n.Idle;this.g9!==t&&(this.g9=t,this.Y9&&this.Y9({receiverAvailable:e}))},e.prototype.h9=function(){this.playerState={isPlaying:!1,isPaused:!1,hasEnded:!1,isMuted:!1,isStalled:!1,isLive:!1,getVolume:1,getCurrentTime:0,getRelativeCurrentTime:0,getDuration:0,getVersion:"",getDroppedVideoFrames:0,getForwardBufferLevelForVideo:0,getBackwardBufferLevelForVideo:0,getForwardBufferLevelForAudio:0,getBackwardBufferLevelForAudio:0,getTotalStalledTime:0,getDownloadedVideoData:null,getDownloadedAudioData:null,getPlaybackVideoData:null,getPlaybackAudioData:null,getMaxTimeShift:0,getTimeShift:0,getSubtitle:null,getAudio:null}},e.prototype.onConnect=function(e){this.Z9&&this.Z9({deviceName:e}),this.h9()},e.prototype.onConnected=function(e,t){this.g9=n.Connected,this.h9(),this.a9&&this.a9({deviceName:e,resumed:t})},e.prototype.onDisconnect=function(){this.b9&&this.b9()},e.prototype.onDisconnected=function(){this.g9=n.Ready,this.c9&&this.c9()},e.prototype.onRemotePlayerEvent=function(e){this.d9&&this.d9(e)},e.prototype.sendMethodCallMessage=function(e,t){var o=[];t&&(o=Array.isArray(t)?t:1===t.length?[t[0]]:Array.apply(null,t)),this.sendMessage(i.RemoteControlMessageType.PlayerApiMethodCall,{methodName:e,arguments:o})},e.prototype.handleRemoteControlReceiverMessage=function(e){switch(e.type){case a.RemoteControlReceiverMessageType.PlayerState:return this.playerState=e.data,!0;case a.RemoteControlReceiverMessageType.PlayerEvent:var t=e.data;return this.onRemotePlayerEvent(t),!0;case a.RemoteControlReceiverMessageType.PlayerGetterCallReturnValue:return!0}return!1},e.prototype.play=function(){this.sendMethodCallMessage("play")},e.prototype.pause=function(){this.sendMethodCallMessage("pause")},e.prototype.seek=function(e){this.sendMethodCallMessage("seek",[e])},e.prototype.setTargetBufferLevel=function(e,t,o){this.sendMethodCallMessage("setTargetBufferLevel",[e,t,o])},e.prototype.setVolume=function(e){this.sendMethodCallMessage("setVolume",[e])},e.prototype.setMuted=function(e){e?this.sendMethodCallMessage("mute"):this.sendMethodCallMessage("unmute")},e.prototype.isPlaying=function(){return this.playerState.isPlaying},e.prototype.isPaused=function(){return this.playerState.isPaused},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=r.TimeMode.AbsoluteTime),e===r.TimeMode.AbsoluteTime?this.playerState.getCurrentTime:this.playerState.getRelativeCurrentTime},e.prototype.getVolume=function(){return this.playerState.getVolume},e.prototype.isMuted=function(){return this.playerState.isMuted},e.prototype.hasEnded=function(){return this.playerState.hasEnded},e.prototype.isStalled=function(){return this.playerState.isStalled},e.prototype.isLive=function(){return this.playerState.isStalled},e.prototype.getDuration=function(){return this.playerState.getDuration},e.prototype.getDroppedVideoFrames=function(){return this.playerState.getDroppedVideoFrames},e.prototype.getBufferLevel=function(e,t){var o={level:0,targetLevel:this.context.bufferSettings.getTargetLevel(e,t),type:e,media:t};return r.BufferType.ForwardDuration?t===r.MediaType.Video?o.level=this.playerState.getForwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getForwardBufferLevelForAudio):r.BufferType.BackwardDuration&&(t===r.MediaType.Video?o.level=this.playerState.getBackwardBufferLevelForVideo:t===r.MediaType.Audio&&(o.level=this.playerState.getBackwardBufferLevelForAudio)),o},e.prototype.getTotalStalledTime=function(){return this.playerState.getTotalStalledTime},e.prototype.getDownloadedVideoData=function(){return this.playerState.getDownloadedVideoData},e.prototype.getDownloadedAudioData=function(){return this.playerState.getDownloadedAudioData},e.prototype.getPlaybackVideoData=function(){return this.playerState.getPlaybackVideoData},e.prototype.getPlaybackAudioData=function(){return this.playerState.getPlaybackAudioData},e.prototype.getTimeShift=function(){return this.playerState.getTimeShift},e.prototype.getMaxTimeShift=function(){return this.playerState.getMaxTimeShift},e.prototype.preload=function(){this.sendMethodCallMessage("preload",[])},e.prototype.setAudioQuality=function(e){this.sendMethodCallMessage("setAudioQuality",[e])},e.prototype.setVideoQuality=function(e){this.sendMethodCallMessage("setVideoQuality",[e])},e.prototype.setQueryParameters=function(e){this.sendMethodCallMessage("setQueryParameters",[e])},e.prototype.clearQueryParameters=function(){this.sendMethodCallMessage("clearQueryParameters",[])},e.prototype.timeShift=function(e){this.sendMethodCallMessage("timeShift",[e])},e.prototype.enableSubtitle=function(e){this.sendMethodCallMessage("subtitles.enable",[e])},e.prototype.disableSubtitle=function(e){this.sendMethodCallMessage("subtitles.disable",[e])},e.prototype.setAudio=function(e){this.sendMethodCallMessage("setAudio",[e])},e.prototype.getSnapshot=function(e,t){this.sendMethodCallMessage("getSnapshot",[e,t])},e.prototype.setPlaybackSpeed=function(e){this.sendMethodCallMessage("setPlaybackSpeed",[e])},e.prototype.unload=function(){return this.sendMethodCallMessage("unload"),Promise.resolve()},e}();t.RemoteControlBase=s},42489:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlManager=void 0;var n=o(23690),r=o(85648),i=o(68657),a=o(32645),s=o(61348),l=o(23747),u=o(94952),c=o(77118),p=o(91297),d=function(){function e(t,o){this.ck=e.setupRemoteControl(t),this.ck instanceof a.GoogleCastRemoteControlBase&&function(e,t){(0,u.wrapCustomElementRegistry)(),e.removeScript(t,"cast_sender.js"),e.removeScript(t,"cast_framework.js"),setTimeout(function(){return e.loadScript(t)},0)}(o,t.config.location.cast)}return e.prototype.getPlayerWrapper=function(e,t){return new c.RemoteControlPlayerWrapper(e,t,this.ck)},e.setupRemoteControl=function(e){if(null==e.config||null==e.settings)return null;var t=e.config,o=e.settings;if((t.cast&&t.cast.enable||(!t.cast||t.cast&&!t.cast.hasOwnProperty("enable"))&&t.remotecontrol&&"googlecast"===t.remotecontrol.type)&&(t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.receiverApplicationId?o.CAST_APPLICATION_ID=t.remotecontrol.receiverApplicationId:t.cast&&t.cast.application_id&&(o.CAST_APPLICATION_ID=t.cast.application_id),t.remotecontrol&&"googlecast"===t.remotecontrol.type&&t.remotecontrol.messageNamespace?0===t.remotecontrol.messageNamespace.indexOf("urn:x-cast:")&&(o.CAST_MESSAGE_NAMESPACE=t.remotecontrol.messageNamespace):t.cast&&t.cast.message_namespace&&0===t.cast.message_namespace.indexOf("urn:x-cast:")&&(o.CAST_MESSAGE_NAMESPACE=t.cast.message_namespace),t.hasOwnProperty("remotecontrol")||(t.remotecontrol={type:"googlecast",receiverApplicationId:o.CAST_APPLICATION_ID,messageNamespace:o.CAST_MESSAGE_NAMESPACE,customReceiverConfig:{receiverStylesheetUrl:t.cast.receiverStylesheetUrl||null}})),t.remotecontrol&&t.remotecontrol.type)switch(t.remotecontrol.type){case"googlecast":return t.remotecontrol.receiverApplicationId=t.remotecontrol.receiverApplicationId||o.CAST_APPLICATION_ID,t.remotecontrol.messageNamespace=t.remotecontrol.messageNamespace||o.CAST_MESSAGE_NAMESPACE,t.remotecontrol.receiverVersion===i.GoogleCastReceiverVersion.v3?(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV3)),new l.GoogleCastRemoteControlV3(e,t.remotecontrol)):(e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.GoogleCastV2)),new s.GoogleCastRemoteControlV2(e,t.remotecontrol));case"websocket":return e.store.dispatch((0,n.setRemoteControlType)(r.RemoteControlType.Websocket)),new p.WebSocketRemoteControl(e,t.remotecontrol)}return null},e}();t.RemoteControlManager=d},77118:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteControlPlayerWrapper=t.addStartOffset=t.clamp=t.getForwardBufferDiff=void 0;var n=o(9768),r=o(3714),i=o(44468),a=o(23690),s=o(87827),l=o(85648),u=o(71223),c=o(32645),p=o(60768);t.getForwardBufferDiff=function(e){return e.getBufferLevel(i.BufferType.ForwardDuration,i.MediaType.Video).targetLevel-20},t.clamp=function(e,t,o){return Math.max(t,Math.min(o,e))},t.addStartOffset=function(e,o,n){var r=Boolean(e.options&&e.options.startOffset);return(o||!r)&&(e.options=e.options||{},e.options.startOffset=n.isLive()?n.getTimeShift()-(0,t.getForwardBufferDiff)(n):n.getCurrentTime()),e};var d=function(){function e(e,o,n){var i=this;if(this.rO=!1,this.sO=!1,this.oO=e,this.pO=o,this.qO=n,n){var s=!1,c=!1,p=function(){i.sO=i.pO.isPlaying(),i.pO.pause()};n.setOnErrorCallback(function(){e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s&&(s=!1,i.uO(),e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)))}),n.setOnReadyCallback(function(t){e.eventHandler.dispatchEvent(r.PlayerEvent.CastAvailable,{receiverAvailable:t.receiverAvailable})}),n.setOnConnectCallback(function(t){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connecting)),p(),e.eventHandler.dispatchEvent(r.PlayerEvent.CastWaitingForDevice,{castPayload:{deviceName:t.deviceName,currentTime:void 0,timestamp:void 0,type:void 0}})}),n.setOnConnectedCallback(function(o){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Connected));var d=(0,u.isSameSource)(n.getSource(),e.sourceContext.source);if(o.resumed&&p(),!o.resumed||!d){e.settings.QUERY_PARAMETERS&&n.setQueryParameters(e.settings.QUERY_PARAMETERS),null!=n.getConfig()&&n.getConfig().customReceiverConfig&&i.addMetadata("CAST",{type:"customReceiverConfig",data:n.getConfig().customReceiverConfig});var f=(0,t.addStartOffset)(e.sourceContext.source,i.rO,i.pO);n.setSource(f,i.tO(),i.pO.getCurrentTime()),c=!0}e.eventHandler.dispatchEvent(r.PlayerEvent.CastStarted,{deviceName:o.deviceName,resuming:o.resumed}),s=!0,e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnDisconnectCallback(function(){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnecting))}),n.setOnDisconnectedCallback(function(){e.store.dispatch((0,a.setConnectionState)(l.ConnectionState.Disconnected)),e.eventHandler.dispatchEvent(r.PlayerEvent.CastStopped),s=!1,i.uO(),e.eventHandler.dispatchEvent(r.PlayerEvent.VolumeChanged)}),n.setOnRemotePlayerEventCallback(function(t){if(c)switch(t.event){case r.PlayerEvent.Play:case r.PlayerEvent.Paused:c=!1;for(var i=0,a=o.listSubtitles();i<a.length;i++){var s=a[i];n.addSubtitle(s),s.enabled&&n.enableSubtitle(s.id)}}var l=t.data||{};l.remote=!0,e.eventHandler.dispatchEvent(t.event,l)})}}return e.prototype.tO=function(){return this.oO.config&&this.oO.config.playback&&this.oO.config.playback.autoplay||this.sO},e.prototype.uO=function(){var e=this.oO.settings.ENABLE_SEEK_FOR_LIVE;if(this.pO.isLive()&&!e){var o=this.qO.getTimeShift()+(0,t.getForwardBufferDiff)(this.pO),n=this.pO.getMaxTimeShift();this.pO.timeShift((0,t.clamp)(o,n,0))}else{var r=this.pO.getSeekableRange(),i=this.qO.getCurrentTime();this.pO.seek((0,t.clamp)(i,r.start,r.end))}this.qO.isPlaying()?this.pO.play():this.pO.pause()},e.prototype.vO=function(){return null!=this.qO&&this.qO.isReady()},e.prototype.wO=function(){return null!=this.qO&&this.qO.isConnected()},e.prototype.xO=function(e){var t=(0,s.getRemoteControlState)(this.oO.store.getState().player).remoteControlType===l.RemoteControlType.GoogleCastV3;e===n.UI_SEEK_ISSUER_NAME&&t||this.qO.pause()},e.prototype.yO=function(e){this.pO.pause(e)},e.prototype.getAvailableSegments=function(){return this.pO.getAvailableSegments()},e.prototype.play=function(e){return this.rO=!0,this.wO()?(this.qO.play(),Promise.resolve()):this.pO.play(e)},e.prototype.preload=function(){this.wO()?this.qO.preload():this.pO.preload()},e.prototype.pause=function(e){this.wO()?this.xO(e):this.yO(e)},e.prototype.mute=function(e){this.wO()&&this.qO.setMuted(!0),this.pO.mute(e)},e.prototype.unmute=function(e){this.wO()&&this.qO.setMuted(!1),this.pO.unmute(e)},e.prototype.setVolume=function(e,t){this.wO()?this.qO.setVolume(e/100):this.pO.setVolume(e,t)},e.prototype.seek=function(e,t){return this.wO()?(this.qO.seek(e),!0):this.pO.seek(e,t)},e.prototype.setAudioQuality=function(e){this.wO()&&this.qO.setAudioQuality(e),this.pO.setAudioQuality(e)},e.prototype.setVideoQuality=function(e){this.wO()&&this.qO.setVideoQuality(e),this.pO.setVideoQuality(e)},e.prototype.prepareLoad=function(){return this.pO.prepareLoad()},e.prototype.prepareSource=function(e,t){return this.pO.prepareSource(e,t)},e.prototype.load=function(e,t,o){return this.wO()&&this.qO.setSource(this.oO.sourceContext.source,this.tO()),this.pO.load(e,t,o)},e.prototype.unload=function(e){return this.wO()&&this.qO.unload(),this.pO?this.pO.unload(e):Promise.resolve()},e.prototype.isPlaying=function(){return this.wO()?this.qO.isPlaying():this.pO.isPlaying()},e.prototype.isPaused=function(){return this.wO()?this.qO.isPaused():this.pO.isPaused()},e.prototype.hasEnded=function(){return this.wO()?this.qO.hasEnded():this.pO.hasEnded()},e.prototype.isMuted=function(){return this.wO()?this.qO.isMuted():this.pO.isMuted()},e.prototype.isStalled=function(){return this.wO()?this.qO.isStalled():this.pO.isStalled()},e.prototype.isLive=function(){return this.pO.isLive()},e.prototype.getVolume=function(){return this.wO()?100*this.qO.getVolume():this.pO.getVolume()},e.prototype.getCurrentTime=function(e){return void 0===e&&(e=i.TimeMode.AbsoluteTime),this.wO()?this.qO.getCurrentTime(e):this.pO.getCurrentTime(e)},e.prototype.getDuration=function(){return this.pO.getDuration()},e.prototype.getAvailableVideoQualities=function(){return this.pO.getAvailableVideoQualities()},e.prototype.getAvailableAudioQualities=function(){return this.pO.getAvailableAudioQualities()},e.prototype.getDroppedVideoFrames=function(){return this.wO()?this.qO.getDroppedVideoFrames():this.pO.getDroppedVideoFrames()},e.prototype.setTargetBufferLevel=function(e,t,o){return this.wO()?this.qO.setTargetBufferLevel(e,t,o):this.pO.setTargetBufferLevel(e,t,o)},e.prototype.getBufferLevel=function(e,t){return this.wO()?this.qO.getBufferLevel(e,t):this.pO.getBufferLevel(e,t)},e.prototype.getTotalStalledTime=function(){return this.wO()?this.qO.getTotalStalledTime():this.pO.getTotalStalledTime()},e.prototype.getDownloadedVideoData=function(){return this.wO()?this.qO.getDownloadedVideoData():this.pO.getDownloadedVideoData()},e.prototype.getDownloadedAudioData=function(){return this.wO()?this.qO.getDownloadedAudioData():this.pO.getDownloadedAudioData()},e.prototype.getPlaybackVideoData=function(){return this.wO()?this.qO.getPlaybackVideoData():this.pO.getPlaybackVideoData()},e.prototype.getPlaybackAudioData=function(){return this.wO()?this.qO.getPlaybackAudioData():this.pO.getPlaybackAudioData()},e.prototype.getBufferedRanges=function(){return this.pO.getBufferedRanges()},e.prototype.getManifest=function(){return this.pO.getManifest()},e.prototype.isCasting=function(){return this.wO()},e.prototype.isCastAvailable=function(){return this.vO()||this.wO()},e.prototype.castVideo=function(){this.vO()&&(this.qO.connect(),this.oO.eventHandler.dispatchEvent(r.PlayerEvent.CastStart))},e.prototype.castStop=function(){if(this.wO()){if(this.qO instanceof c.GoogleCastRemoteControlBase)return this.qO.connect();this.qO.disconnect()}},e.prototype.updateCallback=function(e){this.pO.updateCallback(e)},e.prototype.setQueryParameters=function(e){this.wO()&&this.qO.setQueryParameters(e),this.pO.setQueryParameters(e)},e.prototype.clearQueryParameters=function(){this.wO()&&this.qO.clearQueryParameters(),this.pO.clearQueryParameters()},e.prototype.getMaxTimeShift=function(){return this.wO()?this.qO.getMaxTimeShift():this.pO.getMaxTimeShift()},e.prototype.timeShift=function(e,t){this.wO()?this.qO.timeShift(e):this.pO.timeShift(e,t)},e.prototype.getTimeShift=function(){return this.wO()?this.qO.getTimeShift():this.pO.getTimeShift()},e.prototype.addSubtitle=function(e){return this.wO()&&this.qO.addSubtitle(e),this.pO.addSubtitle(e)},e.prototype.removeSubtitle=function(e){this.wO()&&this.qO.removeSubtitle(e),this.pO.removeSubtitle(e)},e.prototype.enableSubtitle=function(e){return this.wO()&&this.qO.enableSubtitle(e),this.pO.enableSubtitle(e)},e.prototype.disableSubtitle=function(e){return this.wO()&&this.qO.disableSubtitle(e),this.pO.disableSubtitle(e)},e.prototype.listSubtitles=function(){return this.pO.listSubtitles()},e.prototype.getAudioQuality=function(){return this.pO.getAudioQuality()},e.prototype.getVideoQuality=function(){return this.pO.getVideoQuality()},e.prototype.setAudio=function(e){this.wO()&&this.qO.setAudio(e),this.pO.setAudio(e)},e.prototype.getAvailableAudio=function(){return this.pO.getAvailableAudio()},e.prototype.getAudio=function(){return this.pO.getAudio()},e.prototype.getSnapshot=function(e,t){if(!this.wO())return this.pO.getSnapshot(e,t)},e.prototype.setPlaybackSpeed=function(e){this.wO()&&this.qO.setPlaybackSpeed(e),this.pO.setPlaybackSpeed(e)},e.prototype.getPlaybackSpeed=function(){return this.pO.getPlaybackSpeed()},e.prototype.permitControl=function(e){this.pO.permitControl(e)},e.prototype.addMetadata=function(e,t){return!("CAST"!==e.toUpperCase()||!this.wO()||(this.qO.sendMessage(p.RemoteControlMessageType.CustomData,t),0))},e.prototype.onFullscreenEnter=function(e){this.pO.onFullscreenEnter(e)},e.prototype.onFullscreenExit=function(){this.pO.onFullscreenExit()},e.prototype.isAirplayAvailable=function(){return this.pO.isAirplayAvailable()},e.prototype.isAirplayActive=function(){return this.pO.isAirplayActive()},e.prototype.showAirplayTargetPicker=function(){this.pO.showAirplayTargetPicker()},e.prototype.getSeekableRange=function(){return this.pO.getSeekableRange()},e.prototype.getLatency=function(){return this.pO.getLatency()},e.prototype.setTargetLatency=function(e){this.pO.setTargetLatency(e)},e.prototype.getTargetLatency=function(){return this.pO.getTargetLatency()},e.prototype.setCatchupConfig=function(e){this.pO.setCatchupConfig(e)},e.prototype.getCatchupConfig=function(){return this.pO.getCatchupConfig()},e.prototype.setFallbackConfig=function(e){this.pO.setFallbackConfig(e)},e.prototype.getFallbackConfig=function(){return this.pO.getFallbackConfig()},e.prototype.createManifestApi=function(){return this.pO.createManifestApi()},e.prototype.release=function(e){var t=this;return null!=this.qO&&(this.qO.setOnErrorCallback(null),this.qO.setOnReadyCallback(null),this.qO.setOnConnectCallback(null),this.qO.setOnConnectedCallback(null),this.qO.setOnDisconnectCallback(null),this.qO.setOnDisconnectedCallback(null),this.qO.setOnRemotePlayerEventCallback(null),this.qO.release()),this.pO.release(e).then(function(){t.pO=null,t.qO=null})},e}();t.RemoteControlPlayerWrapper=d},30165:function(e,t){var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedPlayerApiMethods=t.RemoteControlReceiverMessageType=void 0,function(e){e[e.PlayerState=0]="PlayerState",e[e.PlayerEvent=1]="PlayerEvent",e[e.PlayerGetterCallReturnValue=2]="PlayerGetterCallReturnValue"}(o||(t.RemoteControlReceiverMessageType=o={})),function(e){e.GET_CONTAINER="getContainer",e.GET_SNAPSHOT="getSnapShot",e.GET_VIDEO_ELEMENT="getVideoElement"}(n||(t.UnsupportedPlayerApiMethods=n={}))},61567:function(__unused_webpack_module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.RemoteJSON=void 0;var RemoteJSON=function(){function RemoteJSON(){}return RemoteJSON.stringifyFunction=function(e){if("function"==typeof e)return RemoteJSON.FUNCTION_PREFIX+e.toString()},RemoteJSON.parseFunction=function(fs){if(fs&&"string"==typeof fs&&0===fs.indexOf(RemoteJSON.FUNCTION_PREFIX)){var f="f = "+fs.substring(RemoteJSON.FUNCTION_PREFIX.length);if(eval(f),"function"==typeof f)return f}},RemoteJSON.stringify=function(e,t,o){return JSON.stringify(e,function(e,o){return"function"==typeof o?RemoteJSON.stringifyFunction(o):t?t(e,o):o},o)},RemoteJSON.parse=function(e,t){return JSON.parse(e,function(e,o){return RemoteJSON.parseFunction(o)||(t?t(e,o):o)})},RemoteJSON.FUNCTION_PREFIX="function::",RemoteJSON}();exports.RemoteJSON=RemoteJSON},91297:function(e,t,o){var n=this&&this.__extends||function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},e(t,o)};return function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketRemoteControl=void 0;var r=o(60768),i=o(35317),a=o(61567),s=function(e){function t(t,o){var n=e.call(this,t)||this;return n.zO=o,window.WebSocket&&n.onReady(),n}return n(t,e),t.prototype.getConfig=function(){return this.zO},t.prototype.connect=function(){var e=this;if(!this.isReady())throw new Error("Remote is not ready");this.onConnect("WebSocket Receiver"),this.AO=new WebSocket(this.zO.url+"?role=remote"),this.AO.addEventListener("open",function(t){e.onConnected("WebSocket Receiver",!1)}),this.AO.addEventListener("error",function(t){e.onError()}),this.AO.addEventListener("close",function(t){e.onDisconnected()}),this.AO.addEventListener("message",function(t){return e.CO(t)})},t.prototype.CO=function(e){if(e.data)try{var t=JSON.parse(e.data);this.handleRemoteControlReceiverMessage(t)}catch(e){}},t.prototype.sendMessage=function(e,t){this.AO.send(a.RemoteJSON.stringify({type:e,data:t}))},t.prototype.addSubtitle=function(e){this.sendMethodCallMessage("subtitles.add",[e])},t.prototype.removeSubtitle=function(e){this.sendMethodCallMessage("subtitles.remove",[e])},t.prototype.disconnect=function(){this.onDisconnect(),this.AO.close()},t.prototype.release=function(){},t.prototype.setSource=function(e,t,o){this.BO=e,this.sendMessage(r.RemoteControlMessageType.SourceSetup,{source:e,autoplay:t,time:o})},t.prototype.getSource=function(){return this.BO},t}(i.RemoteControlBase);t.WebSocketRemoteControl=s},58367:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoProcessor=void 0;var n=o(2025),r=o(26662),i=function(){function e(e,t,o){this.m9=Promise.resolve(),this.l9=new n.GoogleCastV3TrackFinder(e),this.media=t,this.logger=o}return e.prototype.setMedia=function(e){this.media=e},e.prototype.setMediaInfo=function(e){this.l9.setMediaInfo(e)},e.prototype.enableTrack=function(e){var t,o=this,n=e.trackId;this.o9(null===(t=e.customData)||void 0===t?void 0:t.internalId,e.type,n)&&n&&this.m9.then(function(){var t=o.n9(e.type);return t.push(n),new r.EditTrackInfoRequest(o.media,t,o.logger).execute()})},e.prototype.n9=function(e){var t;if(!this.media||!this.media.activeTrackIds)return[];var o=this.media.activeTrackIds,n=null===(t=this.media.media)||void 0===t?void 0:t.tracks;if(!n)return o;var r=n.filter(function(t){return t.type!==e});return o.filter(function(e){return r.find(function(t){return t.trackId===e})})},e.prototype.disableTrack=function(e,t){var o,n=this.l9.findTrackIdByInternalId(e,t);if(this.o9(e,t,n)&&n){var i=((null===(o=this.media)||void 0===o?void 0:o.activeTrackIds)||[]).filter(function(e){return e!==n});this.m9=new r.EditTrackInfoRequest(this.media,i,this.logger).execute()}},e.prototype.changeActiveTracksBasedOnCastIds=function(e){this.media&&(this.m9=new r.EditTrackInfoRequest(this.media,e,this.logger).execute())},e.prototype.o9=function(e,t,o){return!!this.media&&null!==o},e}();t.EditTrackInfoProcessor=i},26662:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.EditTrackInfoRequest=void 0;var o=function(){function e(e,t,o){this.Egb=e,this.Fgb=t,this.Ggb=o}return e.prototype.execute=function(){var e=this;return new Promise(function(t,o){if(e.Egb){var n=new chrome.cast.media.EditTracksInfoRequest(e.Fgb);e.Egb.editTracksInfo(n,t,o)}else o("Media is not initialized properly.")}).catch(function(e){})},e}();t.EditTrackInfoRequest=o},13748:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoTrackMapper=void 0;var r=o(80186),i=o(57230),a=function(){function e(e){this.context=e}return e.prototype.maybeReMapTracksForMediaInfo=function(e){(null==e?void 0:e.tracks)&&this.mapTracksWithNoInternalId(e.tracks)},e.prototype.mapTracksWithNoInternalId=function(e){var t=this,o=e.filter(function(e){var t;return!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}),n={};o.forEach(function(o){var r=o.type,i=n[r];i||(i=t.r9(o),n[r]=i),t.p9(o,e,i)})},e.prototype.p9=function(e,t,o){var r;if(!(null===(r=null==e?void 0:e.customData)||void 0===r?void 0:r.internalId)&&(null==t?void 0:t.length)){var i=this.q9(e,t,o);i&&(e.customData=n(n({},e.customData),{internalId:i}))}},e.prototype.q9=function(e,t,o){var n,i,a,s=o.filter(function(t){return(0,r.bothTracksHaveSameLanguage)(t,e)}),l=null===(n=s[0])||void 0===n?void 0:n.id;if(s.length>0){var u=t.filter(function(e){var t;return!!(null===(t=e.customData)||void 0===t?void 0:t.internalId)}).map(function(e){return e.customData.internalId});return null!==(a=null===(i=s.find(function(e){return!u.includes(e.id)}))||void 0===i?void 0:i.id)&&void 0!==a?a:null}return l},e.prototype.r9=function(e){return(0,i.isSubtitle)(e)?this.context.internalPlayer.listSubtitles():(0,i.isAudio)(e)?this.context.internalPlayer.getAvailableAudio():[]},e.prototype.markAllTracksAsReadyToPlay=function(e){null==e||e.forEach(function(e){e.customData&&(e.customData.needsReloadBeforePlay=!1)})},e}();t.MediaInfoTrackMapper=a},15529:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.MediaInfoWrapper=void 0;var n=o(57230),r=function(){function e(e,t){e&&!Array.isArray(e.tracks)&&(e.tracks=[]),this.s9=e,this.t9=t}return e.prototype.u9=function(){var e,t,o,n=null===(e=this.s9)||void 0===e?void 0:e.tracks;return(null==n?void 0:n.length)&&null!==(o=null===(t=n[n.length-1])||void 0===t?void 0:t.trackId)&&void 0!==o?o:0},e.prototype.maybeAddInternalTrack=function(e){if(this.s9&&!(this.v9(e.id)>=0)){var t=(0,n.fromInternalTrackToGoogleTrack)(e,this.u9()+1);(0,n.isValidTrack)(t)&&this.s9.tracks.push(t)}},e.prototype.maybeRemoveInternalTrack=function(e){var t,o,n=this.v9(e);return n>-1&&(null===(o=null===(t=this.s9)||void 0===t?void 0:t.tracks)||void 0===o||o.splice(n,1)),n>-1},e.prototype.v9=function(e){var t;return e&&(null===(t=this.s9)||void 0===t?void 0:t.tracks)?this.s9.tracks.findIndex(function(t){var o;return e===(null===(o=t.customData)||void 0===o?void 0:o.internalId)}):-1},e.prototype.findTrackIdForTrack=function(e){var t,o,n;return null!==(n=null===(o=null===(t=this.s9)||void 0===t?void 0:t.tracks[this.v9(e)])||void 0===o?void 0:o.trackId)&&void 0!==n?n:-1},e}();t.MediaInfoWrapper=r},80186:function(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.bothTracksHaveSameLanguage=function(e,t){var o;return!!t.language&&((null===(o=e.lang)||void 0===o?void 0:o.toLowerCase())===t.language.toLowerCase()||function(e,t){var o=n.SHAKA_ISO_MAP[e];return o?t===o:function(e){var t=Object.keys(n.SHAKA_ISO_MAP).find(function(t){var o=n.SHAKA_ISO_MAP[t];return e===o||e===t});return null!=t?n.SHAKA_ISO_MAP[t]:null}(t)===e}(t.language,e.lang))};var n=o(90435)},57230:function(e,t){function o(e){return e.type===chrome.cast.media.TrackType.AUDIO}Object.defineProperty(t,"__esModule",{value:!0}),t.fromInternalTrackToGoogleTrack=function(e,t){var n,r=e.getQualities?chrome.cast.media.TrackType.AUDIO:chrome.cast.media.TrackType.TEXT,i=new chrome.cast.media.Track(t,r);return function(e,t){o(t)?function(e,t){var o,n;t.trackContentType=null!==(n=null===(o=e.getQualities().find(function(e){return e.codec}))||void 0===o?void 0:o.codec)&&void 0!==n?n:""}(e,t):function(e,t){t.trackContentType=e.id?e.id.split("-")[0]:"",t.trackContentId=e.url,t.subtype=function(e){var t,o;return e.kind===chrome.cast.media.TextTrackType.METADATA.toLowerCase()?chrome.cast.media.TextTrackType.METADATA:(null===(t=e.kind)||void 0===t?void 0:t.includes("caption"))||function(e){return Boolean(e.find(function(e){var t;return null===(t=e.value)||void 0===t?void 0:t.includes("caption")}))}(null!==(o=e.role)&&void 0!==o?o:[])?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES}(e)}(e,t)}(e,i),i.language=e.lang,i.name=e.label,i.roles=(null===(n=e.role)||void 0===n?void 0:n.filter(function(e){return!!e.value}).map(function(e){return e.value||""}))||[],i.customData={internalId:e.id,needsReloadBeforePlay:!0},i},t.isValidTrack=function(e){return!(!(e.trackContentType&&e.trackId&&e.language&&e.name)||o(e))&&(!!e.subtype&&!!e.trackContentId)},t.isSubtitle=function(e){return e.type===chrome.cast.media.TrackType.TEXT},t.isAudio=o},90435:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SHAKA_ISO_MAP=void 0,t.SHAKA_ISO_MAP={aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bih:"bh",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tib:"bo",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"}}},function(e){return function(){return e(92682)}()}])});
|
|
18
18
|
})();
|