From 41d770950479e5aded6126e183bfe241e99bd5ce Mon Sep 17 00:00:00 2001 From: Mike Griffith Date: Fri, 21 May 2021 11:26:36 -0400 Subject: [PATCH] attempt to work around error loading plugin into media control --- lib/clappr-chromecast-plugin.js | 4 ++-- lib/clappr-chromecast-plugin.js.map | 2 +- lib/clappr-chromecast-plugin.min.js | 2 +- lib/clappr-chromecast-plugin.min.js.map | 2 +- package-lock.json | 22 ++++++++++++++++++++++ package.json | 4 ++++ src/chromecast.js | 2 +- webpack.config.js | 8 ++++---- 8 files changed, 36 insertions(+), 10 deletions(-) diff --git a/lib/clappr-chromecast-plugin.js b/lib/clappr-chromecast-plugin.js index bf7e168..007a396 100644 --- a/lib/clappr-chromecast-plugin.js +++ b/lib/clappr-chromecast-plugin.js @@ -1091,7 +1091,7 @@ class chromecast_playback_ChromecastPlayback extends player_root_Clappr_["Playba var style = __webpack_require__(2); var style_default = /*#__PURE__*/__webpack_require__.n(style); -// EXTERNAL MODULE: /Users/mdg/Source/boxcast_js/node_modules/lodash.assign/index.js +// EXTERNAL MODULE: ./node_modules/lodash.assign/index.js var lodash_assign = __webpack_require__(3); var lodash_assign_default = /*#__PURE__*/__webpack_require__.n(lodash_assign); @@ -1602,7 +1602,7 @@ class chromecast_ChromecastPlugin extends player_root_Clappr_["UICorePlugin"] { render() { this.session ? this.renderConnected() : this.renderDisconnected(); - this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').append(this.$el); + this.core.mediaControl.$el.find('.media-control-right-panel').append(this.el); this.$style && this.$style.remove(); this.$style = player_root_Clappr_["Styler"].getStyleFor(style_default.a, { baseUrl: this.core.options.baseUrl diff --git a/lib/clappr-chromecast-plugin.js.map b/lib/clappr-chromecast-plugin.js.map index 3d69399..937cb47 100644 --- a/lib/clappr-chromecast-plugin.js.map +++ b/lib/clappr-chromecast-plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://ChromecastPlugin/webpack/universalModuleDefinition","webpack://ChromecastPlugin/webpack/bootstrap","webpack://ChromecastPlugin/external {\"amd\":\"@clappr/player\",\"commonjs\":\"@clappr/player\",\"commonjs2\":\"@clappr/player\",\"root\":\"Clappr\"}","webpack://ChromecastPlugin/./src/public/chromecast.html","webpack://ChromecastPlugin/./src/public/style.scss","webpack://ChromecastPlugin//Users/mdg/Source/boxcast_js/node_modules/lodash.assign/index.js","webpack://ChromecastPlugin/./src/public/ic_cast_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast0_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast1_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast2_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast_connected_24dp.svg","webpack://ChromecastPlugin/./node_modules/css-loader/dist/runtime/api.js","webpack://ChromecastPlugin/./src/chromecast_playback.js","webpack://ChromecastPlugin/./src/chromecast.js"],"names":["TICK_INTERVAL","ChromecastPlayback","Playback","name","template","chromecastHTML","attributes","class","isReady","constructor","options","src","currentMedia","mediaControl","addUpdateListener","onMediaStatusUpdate","settings","noVolume","default","filter","left","right","_closedCaptionsTracks","ccTracks","_ccTrackId","_updateCCTrackID","updateCCTrackID","closedCaptionsTracks","closedCaptionsTrackId","trackID","render","$el","html","poster","$","css","play","pause","stopTimer","getPlaybackType","LIVE","trigger","Events","PLAYBACK_DVR","stop","seek","time","request","chrome","cast","media","SeekRequest","currentTime","startTimer","Log","warn","getDuration","seekPercentage","percentage","duration","timer","setInterval","updateMediaControl","clearInterval","isPlaying","playerState","liveSeekableRange","VOD","changeTogglePlay","isBuffering","PLAYBACK_BUFFERING","PLAYBACK_BUFFERFULL","prevState","PLAYBACK_PLAY","PLAYBACK_ENDED","PLAYBACK_PAUSE","position","getEstimatedTime","PLAYBACK_TIMEUPDATE","current","total","show","hide","DEVICE_STATE","DEFAULT_CLAPPR_APP_ID","DEFAULT_MESSAGE_NAMESPACE","MIMETYPES","ChromecastPlugin","UICorePlugin","supportedVersion","min","max","Movie","TvShow","Generic","version","VERSION","tagName","events","core","chromecast","container","getCurrentContainer","activeContainer","playback","getCurrentPlayback","activePlayback","bootTryDelay","bootMaxTryCount","bootTryCount","textTracks","messageNamespace","customNamespace","isBootable","appId","deviceState","IDLE","embedScript","disable","bindEvents","listenTo","MEDIACONTROL_RENDERED","CORE_ACTIVE_CONTAINER_CHANGED","containerChanged","MEDIACONTROL_CONTAINERCHANGED","CONTAINER_TIMEUPDATE","containerTimeUpdate","CONTAINER_PLAY","containerPlay","CONTAINER_ENDED","sessionStopped","Browser","isChrome","isSecure","isLocalhost","window","location","hostname","protocol","enable","isAvailable","script","document","createElement","setAttribute","onload","bootstrapCastApi","body","appendChild","initializeCastApi","loaded","errorInfo","setTimeout","t","id","length","console","enabledTextTrackIDs","session","sendMessage","CONTAINER_SUBTITLE_CHANGED","autoJoinPolicy","AutoJoinPolicy","ORIGIN_SCOPED","sessionRequest","SessionRequest","apiConfig","ApiConfig","sessionListener","e","receiverListener","initialize","debug","sessionId","newSession","sessionUpdateListener","status","SessionStatus","STOPPED","onSessionTextTracks","tracks","map","trackId","track","playbackProxy","PLAYBACK_SUBTITLE_AVAILABLE","ReceiverAvailability","AVAILABLE","launchSuccess","renderConnected","connectAnimInterval","resetKeepVisible","launchError","renderDisconnected","loadMediaSuccess","how","mediaSession","originalPlayback","assign","addClass","remove","append","stopListening","settingsUpdate","loadMediaError","ACTIVE","addMessageListener","_","tracksJSON","JSON","parse","undefined","removeClass","load","sources","once","CONTAINER_READY","loadMedia","mediaInfo","createMediaInfo","LoadRequest","autoplay","mimeType","mimeTypeFor","MediaInfo","contentType","customData","metadata","createMediaMetadata","type","createCastMediaMetadata","title","subtitle","releaseDate","episode","originalAirdate","season","seriesTitle","studio","images","url","Image","MovieMediaMetadata","TvShowMediaMetadata","GenericMediaMetadata","click","getCurrentTime","requestSession","connectingIcons","connecting1IconSvg","connecting2IconSvg","connecting3IconSvg","setKeepVisible","timeProgress","connectedIconSvg","castIconSvg","find","$style","Styler","getStyleFor","chromecastStyle","baseUrl","srcUrl","extension","split","match","indexOf"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,gD;;;;;;ACAA,6H;;;;;;ACAA;AACA,kCAAkC,mBAAO,CAAC,CAAmD;AAC7F;AACA;AACA,cAAc,QAAS,wBAAwB,YAAY,WAAW,uGAAuG,kBAAkB,YAAY,WAAW,qDAAqD,wBAAwB,kDAAkD,sBAAsB,YAAY,mBAAmB,uBAAuB,SAAS,WAAW,YAAY,eAAe,iBAAiB,iBAAiB,aAAa,WAAW,YAAY,sBAAsB,gBAAgB,eAAe,mCAAmC,yBAAyB,yBAAyB,aAAa,0CAA0C,yBAAyB,aAAa,uBAAuB,WAAW,YAAY,0FAA0F,UAAU,YAAY,mBAAmB;AAC96B;AACA;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,MAAM;AACjB,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,eAAe;;AAEhE;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,WAAW,OAAO,WAAW;AAC7B,WAAW,SAAS;AACpB,aAAa,OAAO;AACpB;AACA;AACA,wBAAwB;;AAExB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA,6BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC5nBA,we;;;;;;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S,CAACiL,SAAD,CAAb,EAA0B;AACxB,aAAOjL,SAAS,CAACiL,SAAD,CAAhB;AACD,KAFD,MAEO,IAAID,MAAM,CAACI,OAAP,CAAe,MAAf,IAAyB,CAAC,CAA9B,EAAiC;AACtC,aAAO,6BAAP;AACD;AACF;;AAhbwD,C","file":"clappr-chromecast-plugin.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@clappr/player\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@clappr/player\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ChromecastPlugin\"] = factory(require(\"@clappr/player\"));\n\telse\n\t\troot[\"ChromecastPlugin\"] = factory(root[\"Clappr\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = \"
\\n
\\n\";","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".chromecast-playback{height:100%;width:100%}.chromecast-playback .chromecast-playback-background,.chromecast-playback .chromecast-playback-overlay{position:absolute;height:100%;width:100%}.chromecast-playback .chromecast-playback-background{background-size:contain}.chromecast-playback .chromecast-playback-overlay{background-color:#000;opacity:0.4}.chromecast-button{background:transparent;border:0;width:32px;height:32px;font-size:22px;line-height:32px;letter-spacing:0;margin:0 6px;color:#fff;opacity:0.5;vertical-align:middle;text-align:left;cursor:pointer;-webkit-font-smoothing:antialiased;transition:all 0.1s ease}.chromecast-button:hover{opacity:0.75;text-shadow:rgba(255,255,255,0.8) 0 0 5px}.chromecast-button:focus{outline:none}.chromecast-button svg{width:24px;height:24px}.chromecast-button svg #cast,.chromecast-button svg #cast-on,.chromecast-button svg #Path{fill:#fff;stroke:#fff;stroke-width:0.5px}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import {Events, Log, Playback, template} from '@clappr/player'\nimport chromecastHTML from './public/chromecast.html'\n\nconst TICK_INTERVAL = 100\n\nexport default class ChromecastPlayback extends Playback {\n\n get name() { return 'chromecast_playback' }\n get template() { return template(chromecastHTML) }\n get attributes() { return { class: 'chromecast-playback' } }\n\n get isReady() { return true }\n\n constructor(options) {\n super(options)\n this.src = options.src\n this.currentMedia = options.currentMedia\n this.mediaControl = options.mediaControl\n this.currentMedia.addUpdateListener(() => this.onMediaStatusUpdate())\n this.settings = options.settings\n let noVolume = (name) => name != 'volume'\n this.settings.default && (this.settings.default = this.settings.default.filter(noVolume))\n this.settings.left && (this.settings.left = this.settings.left.filter(noVolume))\n this.settings.right && (this.settings.right = this.settings.right.filter(noVolume))\n this._closedCaptionsTracks = options.ccTracks || []\n this._ccTrackId = -1\n this._updateCCTrackID = options.updateCCTrackID\n }\n\n get closedCaptionsTracks() {\n return this._closedCaptionsTracks\n }\n\n get closedCaptionsTrackId() {\n return this._ccTrackId\n }\n\n set closedCaptionsTrackId(trackID) {\n this._ccTrackId = trackID\n this._updateCCTrackID(trackID)\n }\n\n render() {\n let template = this.template()\n this.$el.html(template)\n if (this.options.poster) {\n this.$('.chromecast-playback-background').css('background-image', 'url(' + this.options.poster + ')')\n } else {\n this.$('.chromecast-playback-background').css('background-color', '#666')\n }\n }\n\n play() {\n this.currentMedia.play()\n }\n\n pause() {\n this.stopTimer()\n this.currentMedia.pause()\n if (this.getPlaybackType() === Playback.LIVE) {\n this.trigger(Events.PLAYBACK_DVR, true)\n }\n }\n\n stop() {\n this.stopTimer()\n this.currentMedia.pause() // FIXME: properly handle media stop\n }\n\n seek(time) {\n this.stopTimer()\n let request = new chrome.cast.media.SeekRequest()\n request.currentTime = time\n this.currentMedia.seek(request,\n () => this.startTimer(), () => Log.warn('seek failed'))\n if (this.getPlaybackType() === Playback.LIVE) {\n // assume live if time within 30 seconds of end of live stream\n this.trigger(Events.PLAYBACK_DVR, time < this.getDuration() - 30)\n }\n }\n\n seekPercentage(percentage) {\n if (percentage >= 0 && percentage <= 100) {\n let duration = this.getDuration()\n this.seek(percentage * duration / 100)\n }\n }\n\n startTimer() {\n this.timer = setInterval(() => this.updateMediaControl(), TICK_INTERVAL)\n }\n\n stopTimer() {\n clearInterval(this.timer)\n this.timer = null\n }\n\n getDuration() {\n return this.currentMedia.media.duration\n }\n\n isPlaying() {\n return this.currentMedia.playerState === 'PLAYING' || this.currentMedia.playerState === 'BUFFERING'\n }\n\n getPlaybackType() {\n return this.currentMedia.liveSeekableRange ? Playback.LIVE : Playback.VOD\n }\n\n onMediaStatusUpdate() {\n this.mediaControl.changeTogglePlay()\n if (this.isPlaying() && !this.timer) {\n this.startTimer()\n }\n\n if (this.currentMedia.playerState === 'BUFFERING') {\n this.isBuffering = true\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n } else if (this.currentMedia.playerState === 'PLAYING') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n }\n } else if (this.currentMedia.playerState === 'IDLE') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n } else if (this.currentMedia.playerState === 'PAUSED') {\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PAUSE, this.name)\n }\n }\n\n this.prevState = this.currentMedia.playerState\n }\n\n updateMediaControl() {\n let position = this.currentMedia.getEstimatedTime()\n let duration = this.currentMedia.media.duration\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: position, total: duration}, this.name)\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n}\n","import {Browser, Events, Log, Styler, UICorePlugin} from '@clappr/player'\nimport ChromecastPlayback from './chromecast_playback'\nimport chromecastStyle from './public/style.scss'\nimport assign from 'lodash.assign'\nimport castIconSvg from './public/ic_cast_24dp.svg'\nimport connecting1IconSvg from './public/ic_cast0_24dp.svg'\nimport connecting2IconSvg from './public/ic_cast1_24dp.svg'\nimport connecting3IconSvg from './public/ic_cast2_24dp.svg'\nimport connectedIconSvg from './public/ic_cast_connected_24dp.svg'\n\nconst DEVICE_STATE = {\n 'IDLE' : 0,\n 'ACTIVE' : 1,\n 'WARNING' : 2,\n 'ERROR' : 3\n}\n\nconst DEFAULT_CLAPPR_APP_ID = '9DFB77C0'\n\nconst DEFAULT_MESSAGE_NAMESPACE = 'clappr-chromecast-plugin'\n\nconst MIMETYPES = {\n 'mp4': 'video/mp4',\n 'ogg': 'video/ogg',\n '3gpp': 'video/3gpp',\n 'webm': 'video/webm',\n 'mkv': 'video/x-matroska',\n 'm3u8': 'application/x-mpegurl',\n 'mpd': 'application/dash+xml'\n}\nMIMETYPES['ogv'] = MIMETYPES['ogg']\nMIMETYPES['3gp'] = MIMETYPES['3gpp']\n\nexport default class ChromecastPlugin extends UICorePlugin {\n get supportedVersion() {\n return { min: '0.4.0', max: '0.5.0' }\n }\n\n static get Movie() { return 'movie' }\n static get TvShow() { return 'tv_show' }\n static get Generic() { return 'none' }\n\n static get version() { return VERSION }\n get version() { return VERSION }\n\n get name() { return 'chromecast' }\n get tagName() { return 'button' }\n get attributes() {\n return {\n 'class' : 'chromecast-button',\n 'type' : 'button'\n }\n }\n get events() {\n return {\n 'click': 'click'\n }\n }\n get options() { return this.core.options.chromecast || (this.core.options.chromecast = {}) }\n get container() {\n return this.core.getCurrentContainer\n ? this.core.getCurrentContainer()\n : this.core.activeContainer // Clappr 0.3.0 or greater\n }\n get playback() {\n return this.core.getCurrentPlayback\n ? this.core.getCurrentPlayback()\n : this.core.activePlayback // Clappr 0.3.0 or greater\n }\n\n constructor(core) {\n super(core)\n\n this.bootTryDelay = this.options.bootTryDelay || 500 // Default is 500 milliseconds between each attempt\n this.bootMaxTryCount = this.options.bootMaxTryCount || 6 // Default is 6 attempts (3 seconds)\n this.bootTryCount = 0\n this.textTracks = []\n this.messageNamespace = this.options.customNamespace || DEFAULT_MESSAGE_NAMESPACE\n\n if (this.isBootable()) {\n this.appId = this.options.appId || DEFAULT_CLAPPR_APP_ID\n this.deviceState = DEVICE_STATE.IDLE\n this.embedScript()\n } else {\n this.disable()\n }\n }\n\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)\n\n if (Events.CORE_ACTIVE_CONTAINER_CHANGED) {\n // Clappr 0.3.0 or greater\n this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged)\n } else {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n }\n\n if (this.container) {\n this.listenTo(this.container, Events.CONTAINER_TIMEUPDATE, this.containerTimeUpdate)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.containerPlay)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.sessionStopped)\n }\n }\n\n isBootable() {\n // Browser must be Chrome\n if (!Browser.isChrome) {\n return false\n }\n\n // Chrome lesser than or equals to 71\n // does not require secure page\n if (Browser.version <= 71) {\n return true\n }\n\n // Chrome greater than or equals to 72\n // require secure page or localhost\n return this.isSecure() || this.isLocalhost()\n }\n\n isLocalhost() {\n return window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'\n }\n\n isSecure() {\n return window.location.protocol === 'https:'\n }\n\n enable() {\n super.enable()\n this.render()\n this.embedScript()\n }\n\n embedScript() {\n if (!window.chrome || !window.chrome.cast || !window.chrome.cast.isAvailable) {\n let script = document.createElement('script')\n script.setAttribute('type', 'text/javascript')\n script.setAttribute('async', 'async')\n script.setAttribute('src', 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js')\n script.onload = () => this.bootstrapCastApi()\n document.body.appendChild(script)\n } else {\n this.bootstrapCastApi()\n }\n }\n\n bootstrapCastApi() {\n this.bootTryCount++\n\n if (this.bootTryCount > this.bootMaxTryCount) {\n this.bootTryCount = 0\n Log.warn('GCastApi bootstrap timeout')\n this.disable()\n return\n }\n\n // The \"chrome\" property may not be available immediately on some iOS devices\n if (window.chrome) {\n this.bootTryCount = 0\n\n if (window.chrome.cast && window.chrome.cast.isAvailable) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n window['__onGCastApiAvailable'] = (loaded, errorInfo) => {\n if (loaded) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n Log.warn('GCastApi error', errorInfo)\n this.disable()\n }\n }\n }\n } else {\n setTimeout(() => { this.bootstrapCastApi() }, this.bootTryDelay)\n }\n }\n\n updateCCTrackID(trackID) {\n if (trackID !== -1) {\n if (this.textTracks.filter(t => t.id === trackID).length === 0) {\n console.warn(`Failed to enable text track with ID ${trackID}, as it does not exist.`)\n return\n }\n }\n var enabledTextTrackIDs = []\n if (trackID !== -1) {\n enabledTextTrackIDs = [trackID]\n }\n if (this.session) {\n this.session.sendMessage(\n `urn:x-cast:${this.messageNamespace}:active-text-tracks`,\n enabledTextTrackIDs\n )\n }\n let container = this.core.getCurrentContainer()\n if (container) {\n container.trigger(Events.CONTAINER_SUBTITLE_CHANGED, {id: trackID})\n }\n }\n\n initializeCastApi() {\n let autoJoinPolicy = chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED\n let sessionRequest = new chrome.cast.SessionRequest(this.appId)\n let apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n (session) => this.sessionListener(session), (e) => this.receiverListener(e), autoJoinPolicy)\n chrome.cast.initialize(apiConfig, () => Log.debug(this.name, 'init success'), () => Log.warn(this.name, 'init error'))\n }\n\n sessionListener(session) {\n Log.debug(this.name, 'new session id:' + session.sessionId)\n this.newSession(session)\n }\n\n sessionUpdateListener() {\n if (this.session) {\n Log.debug(this.name, this.session.status)\n if (this.session.status === chrome.cast.SessionStatus.STOPPED) {\n this.sessionStopped()\n this.session = null\n }\n }\n }\n\n onSessionTextTracks(tracks) {\n this.textTracks = tracks.map(t => {return {id: t.trackId, name: t.name, track: t}})\n if (this.textTracks.length > 0) {\n if (this.playbackProxy) {\n this.playbackProxy._closedCaptionsTracks = this.textTracks\n }\n this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)\n this.updateCCTrackID(this.core.getCurrentContainer().closedCaptionsTrackId)\n }\n }\n\n receiverListener(e) {\n if ( e === chrome.cast.ReceiverAvailability.AVAILABLE ) {\n Log.debug(this.name, 'receiver found')\n this.show()\n } else {\n Log.debug(this.name, 'receiver list empty')\n this.hide()\n }\n }\n\n launchSuccess(session) {\n this.renderConnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n Log.debug(this.name, 'launch success - session: ' + session.sessionId)\n this.newSession(session)\n }\n\n launchError(e) {\n Log.debug(this.name, 'error on launch', e)\n this.renderDisconnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n this.container.play()\n }\n\n loadMediaSuccess(how, mediaSession) {\n Log.debug(this.name, 'new media session', mediaSession, '(', how , ')')\n\n this.originalPlayback = this.playback\n\n let options = assign({}, this.originalPlayback.options, {\n currentMedia: mediaSession,\n mediaControl: this.core.mediaControl,\n poster: this.options.poster || this.core.options.poster,\n settings: this.originalPlayback.settings,\n ccTracks: this.textTracks,\n updateCCTrackID: (id) => this.updateCCTrackID(id)\n })\n this.src = this.originalPlayback.src\n this.playbackProxy = new ChromecastPlayback(options)\n this.playbackProxy.render()\n this.core.$el.addClass('chromecast-active')\n\n this.mediaSession = mediaSession\n\n this.originalPlayback.$el.remove()\n\n let container = this.container\n container.$el.append(this.playbackProxy.$el)\n container.stopListening()\n container.playback = this.playbackProxy\n container.bindEvents()\n container.settingsUpdate()\n }\n\n loadMediaError(e) {\n Log.warn(this.name, 'media error', e)\n }\n\n newSession(session) {\n this.session = session\n this.deviceState = DEVICE_STATE.ACTIVE\n this.renderConnected()\n\n session.addUpdateListener(() => this.sessionUpdateListener())\n session.addMessageListener(\n `urn:x-cast:${this.messageNamespace}:text-tracks`,\n (_, tracksJSON) => this.onSessionTextTracks(JSON.parse(tracksJSON))\n )\n\n this.containerPlay()\n }\n\n sessionStopped() {\n this.renderDisconnected()\n\n let time = this.currentTime\n\n let playerState = undefined\n if (this.mediaSession) {\n playerState = this.mediaSession.playerState\n this.mediaSession = null\n }\n\n this.core.$el.removeClass('chromecast-active')\n this.core.load(this.src || this.core.options.sources)\n\n let container = this.container\n\n if (this.playbackProxy) {\n if (this.playbackProxy.isPlaying() || playerState === 'PAUSED') {\n container.once(Events.CONTAINER_READY, () => {\n container.play()\n container.playback.seek(100 * time / container.getDuration())\n })\n }\n this.playbackProxy.stop()\n }\n }\n\n loadMedia() {\n this.container.pause()\n let src = this.container.options.src\n Log.debug(this.name, 'loading... ' + src)\n let mediaInfo = this.createMediaInfo(src)\n let request = new chrome.cast.media.LoadRequest(mediaInfo)\n request.autoplay = true\n if (this.currentTime) {\n request.currentTime = this.currentTime\n }\n this.session.loadMedia(request, (mediaSession) => this.loadMediaSuccess('loadMedia', mediaSession), (e) => this.loadMediaError(e))\n }\n\n createMediaInfo(src) {\n let mimeType = ChromecastPlugin.mimeTypeFor(src)\n let mediaInfo = new chrome.cast.media.MediaInfo(src)\n mediaInfo.contentType = this.options.contentType || mimeType\n mediaInfo.customData = this.options.customData\n let metadata = this.createMediaMetadata()\n mediaInfo.metadata = metadata\n return mediaInfo\n }\n\n createMediaMetadata() {\n this.options.media || (this.options.media = {})\n let type = this.options.media.type\n\n let metadata = this.createCastMediaMetadata(type)\n metadata.title = this.options.media.title\n metadata.subtitle = this.options.media.subtitle\n metadata.releaseDate = this.options.media.releaseDate\n\n if (type === ChromecastPlugin.TvShow) {\n metadata.episode = this.options.media.episode\n metadata.originalAirdate = this.options.media.originalAirdate\n metadata.season = this.options.media.season\n metadata.seriesTitle = this.options.media.seriesTitle\n } else if (type === ChromecastPlugin.Movie) {\n metadata.studio = this.options.media.studio\n }\n\n if (this.options.media.images) {\n metadata.images = this.options.media.images.map((url) => new chrome.cast.Image(url))\n }\n if (!metadata.images && this.options.poster) {\n metadata.images = [new chrome.cast.Image(this.options.poster)]\n }\n if (!metadata.images && this.core.options.poster) {\n metadata.images = [new chrome.cast.Image(this.core.options.poster)]\n }\n return metadata\n }\n\n createCastMediaMetadata(type) {\n switch (type) {\n case ChromecastPlugin.Movie: return new chrome.cast.media.MovieMediaMetadata()\n case ChromecastPlugin.TvShow: return new chrome.cast.media.TvShowMediaMetadata()\n default: return new chrome.cast.media.GenericMediaMetadata()\n }\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n\n click() {\n this.currentTime = this.container.getCurrentTime()\n this.container.pause()\n chrome.cast.requestSession((session) => this.launchSuccess(session), (e) => this.launchError(e))\n if (!this.session) {\n let position = 0\n let connectingIcons = [connecting1IconSvg, connecting2IconSvg, connecting3IconSvg]\n clearInterval(this.connectAnimInterval)\n this.connectAnimInterval = setInterval(() => {\n this.$el.html(connectingIcons[position])\n position = (position + 1) % 3\n }, 600)\n this.core.mediaControl.setKeepVisible()\n }\n }\n\n containerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n containerTimeUpdate(timeProgress) {\n this.currentTime = timeProgress.current\n }\n\n containerPlay() {\n if (this.session && (!this.mediaSession || this.mediaSession.playerState === 'IDLE' || this.mediaSession.playerState === 'PAUSED')) {\n Log.debug(this.name, 'load media')\n this.loadMedia()\n }\n }\n\n renderConnected() {\n this.$el.html(connectedIconSvg)\n }\n\n renderDisconnected() {\n this.$el.html(castIconSvg)\n }\n\n render() {\n this.session ? this.renderConnected() : this.renderDisconnected()\n this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').append(this.$el)\n this.$style && this.$style.remove()\n this.$style = Styler.getStyleFor(chromecastStyle, {baseUrl: this.core.options.baseUrl})\n this.core.$el.append(this.$style)\n return this\n }\n\n static mimeTypeFor(srcUrl) {\n let extension = (srcUrl.split('?')[0].match(/.*\\.(.*)$/) || [])[1]\n if (MIMETYPES[extension]) {\n return MIMETYPES[extension]\n } else if (srcUrl.indexOf('.ism') > -1) {\n return 'application/vnd.ms-sstr+xml'\n }\n }\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://ChromecastPlugin/webpack/universalModuleDefinition","webpack://ChromecastPlugin/webpack/bootstrap","webpack://ChromecastPlugin/external {\"amd\":\"@clappr/player\",\"commonjs\":\"@clappr/player\",\"commonjs2\":\"@clappr/player\",\"root\":\"Clappr\"}","webpack://ChromecastPlugin/./src/public/chromecast.html","webpack://ChromecastPlugin/./src/public/style.scss","webpack://ChromecastPlugin/./node_modules/lodash.assign/index.js","webpack://ChromecastPlugin/./src/public/ic_cast_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast0_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast1_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast2_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast_connected_24dp.svg","webpack://ChromecastPlugin/./node_modules/css-loader/dist/runtime/api.js","webpack://ChromecastPlugin/./src/chromecast_playback.js","webpack://ChromecastPlugin/./src/chromecast.js"],"names":["TICK_INTERVAL","ChromecastPlayback","Playback","name","template","chromecastHTML","attributes","class","isReady","constructor","options","src","currentMedia","mediaControl","addUpdateListener","onMediaStatusUpdate","settings","noVolume","default","filter","left","right","_closedCaptionsTracks","ccTracks","_ccTrackId","_updateCCTrackID","updateCCTrackID","closedCaptionsTracks","closedCaptionsTrackId","trackID","render","$el","html","poster","$","css","play","pause","stopTimer","getPlaybackType","LIVE","trigger","Events","PLAYBACK_DVR","stop","seek","time","request","chrome","cast","media","SeekRequest","currentTime","startTimer","Log","warn","getDuration","seekPercentage","percentage","duration","timer","setInterval","updateMediaControl","clearInterval","isPlaying","playerState","liveSeekableRange","VOD","changeTogglePlay","isBuffering","PLAYBACK_BUFFERING","PLAYBACK_BUFFERFULL","prevState","PLAYBACK_PLAY","PLAYBACK_ENDED","PLAYBACK_PAUSE","position","getEstimatedTime","PLAYBACK_TIMEUPDATE","current","total","show","hide","DEVICE_STATE","DEFAULT_CLAPPR_APP_ID","DEFAULT_MESSAGE_NAMESPACE","MIMETYPES","ChromecastPlugin","UICorePlugin","supportedVersion","min","max","Movie","TvShow","Generic","version","VERSION","tagName","events","core","chromecast","container","getCurrentContainer","activeContainer","playback","getCurrentPlayback","activePlayback","bootTryDelay","bootMaxTryCount","bootTryCount","textTracks","messageNamespace","customNamespace","isBootable","appId","deviceState","IDLE","embedScript","disable","bindEvents","listenTo","MEDIACONTROL_RENDERED","CORE_ACTIVE_CONTAINER_CHANGED","containerChanged","MEDIACONTROL_CONTAINERCHANGED","CONTAINER_TIMEUPDATE","containerTimeUpdate","CONTAINER_PLAY","containerPlay","CONTAINER_ENDED","sessionStopped","Browser","isChrome","isSecure","isLocalhost","window","location","hostname","protocol","enable","isAvailable","script","document","createElement","setAttribute","onload","bootstrapCastApi","body","appendChild","initializeCastApi","loaded","errorInfo","setTimeout","t","id","length","console","enabledTextTrackIDs","session","sendMessage","CONTAINER_SUBTITLE_CHANGED","autoJoinPolicy","AutoJoinPolicy","ORIGIN_SCOPED","sessionRequest","SessionRequest","apiConfig","ApiConfig","sessionListener","e","receiverListener","initialize","debug","sessionId","newSession","sessionUpdateListener","status","SessionStatus","STOPPED","onSessionTextTracks","tracks","map","trackId","track","playbackProxy","PLAYBACK_SUBTITLE_AVAILABLE","ReceiverAvailability","AVAILABLE","launchSuccess","renderConnected","connectAnimInterval","resetKeepVisible","launchError","renderDisconnected","loadMediaSuccess","how","mediaSession","originalPlayback","assign","addClass","remove","append","stopListening","settingsUpdate","loadMediaError","ACTIVE","addMessageListener","_","tracksJSON","JSON","parse","undefined","removeClass","load","sources","once","CONTAINER_READY","loadMedia","mediaInfo","createMediaInfo","LoadRequest","autoplay","mimeType","mimeTypeFor","MediaInfo","contentType","customData","metadata","createMediaMetadata","type","createCastMediaMetadata","title","subtitle","releaseDate","episode","originalAirdate","season","seriesTitle","studio","images","url","Image","MovieMediaMetadata","TvShowMediaMetadata","GenericMediaMetadata","click","getCurrentTime","requestSession","connectingIcons","connecting1IconSvg","connecting2IconSvg","connecting3IconSvg","setKeepVisible","timeProgress","connectedIconSvg","castIconSvg","find","el","$style","Styler","getStyleFor","chromecastStyle","baseUrl","srcUrl","extension","split","match","indexOf"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QAC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ACA;AACA,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,WAAW,OAAO,WAAW;AAC7B,WAAW,SAAS;AACpB,aAAa,OAAO;AACpB;AACA;AACA,wBAAwB;;AAExB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,iBAAiB;AACjB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA,6BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC5nBA,we;;;;;;ACAA,mpB;;;;;;ACAA,mpB;;;;;;ACAA,slB;;;;;;ACAA,siB;;;;;;;ACAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;;AAEA;AACA,4CAA4C,qBAAqB;AACjE;;AAEA;AACA,KAAK;AACL,IAAI;AACJ;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB,iBAAiB;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,qBAAqB;AACzC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA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Ae,GAAG;AAChB,SAAK9J,GAAL,CAASC,IAAT,CAAc8N,gCAAd;AACD;;AAED7D,oBAAkB,GAAG;AACnB,SAAKlK,GAAL,CAASC,IAAT,CAAc+N,sBAAd;AACD;;AAEDjO,QAAM,GAAG;AACP,SAAKgI,OAAL,GAAe,KAAK+B,eAAL,EAAf,GAAwC,KAAKI,kBAAL,EAAxC;AACA,SAAK9F,IAAL,CAAUtF,YAAV,CAAuBkB,GAAvB,CAA2BiO,IAA3B,CAAgC,4BAAhC,EAA8DvD,MAA9D,CAAqE,KAAKwD,EAA1E;AACA,SAAKC,MAAL,IAAe,KAAKA,MAAL,CAAY1D,MAAZ,EAAf;AACA,SAAK0D,MAAL,GAAcC,6BAAM,CAACC,WAAP,CAAmBC,eAAnB,EAAoC;AAACC,aAAO,EAAE,KAAKnK,IAAL,CAAUzF,OAAV,CAAkB4P;AAA5B,KAApC,CAAd;AACA,SAAKnK,IAAL,CAAUpE,GAAV,CAAc0K,MAAd,CAAqB,KAAKyD,MAA1B;AACA,WAAO,IAAP;AACD;;AAEiB,SAAXnC,WAAW,CAACwC,MAAD,EAAS;AACzB,QAAIC,SAAS,GAAG,CAACD,MAAM,CAACE,KAAP,CAAa,GAAb,EAAkB,CAAlB,EAAqBC,KAArB,CAA2B,WAA3B,KAA2C,EAA5C,EAAgD,CAAhD,CAAhB;;AACA,QAAIpL,SAAS,CAACkL,SAAD,CAAb,EAA0B;AACxB,aAAOlL,SAAS,CAACkL,SAAD,CAAhB;AACD,KAFD,MAEO,IAAID,MAAM,CAACI,OAAP,CAAe,MAAf,IAAyB,CAAC,CAA9B,EAAiC;AACtC,aAAO,6BAAP;AACD;AACF;;AAhbwD,C","file":"clappr-chromecast-plugin.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@clappr/player\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@clappr/player\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ChromecastPlugin\"] = factory(require(\"@clappr/player\"));\n\telse\n\t\troot[\"ChromecastPlugin\"] = factory(root[\"Clappr\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = \"
\\n
\\n\";","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".chromecast-playback{height:100%;width:100%}.chromecast-playback .chromecast-playback-background,.chromecast-playback .chromecast-playback-overlay{position:absolute;height:100%;width:100%}.chromecast-playback .chromecast-playback-background{background-size:contain}.chromecast-playback .chromecast-playback-overlay{background-color:#000;opacity:0.4}.chromecast-button{background:transparent;border:0;width:32px;height:32px;font-size:22px;line-height:32px;letter-spacing:0;margin:0 6px;color:#fff;opacity:0.5;vertical-align:middle;text-align:left;cursor:pointer;-webkit-font-smoothing:antialiased;transition:all 0.1s ease}.chromecast-button:hover{opacity:0.75;text-shadow:rgba(255,255,255,0.8) 0 0 5px}.chromecast-button:focus{outline:none}.chromecast-button svg{width:24px;height:24px}.chromecast-button svg #cast,.chromecast-button svg #cast-on,.chromecast-button svg #Path{fill:#fff;stroke:#fff;stroke-width:0.5px}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import {Events, Log, Playback, template} from '@clappr/player'\nimport chromecastHTML from './public/chromecast.html'\n\nconst TICK_INTERVAL = 100\n\nexport default class ChromecastPlayback extends Playback {\n\n get name() { return 'chromecast_playback' }\n get template() { return template(chromecastHTML) }\n get attributes() { return { class: 'chromecast-playback' } }\n\n get isReady() { return true }\n\n constructor(options) {\n super(options)\n this.src = options.src\n this.currentMedia = options.currentMedia\n this.mediaControl = options.mediaControl\n this.currentMedia.addUpdateListener(() => this.onMediaStatusUpdate())\n this.settings = options.settings\n let noVolume = (name) => name != 'volume'\n this.settings.default && (this.settings.default = this.settings.default.filter(noVolume))\n this.settings.left && (this.settings.left = this.settings.left.filter(noVolume))\n this.settings.right && (this.settings.right = this.settings.right.filter(noVolume))\n this._closedCaptionsTracks = options.ccTracks || []\n this._ccTrackId = -1\n this._updateCCTrackID = options.updateCCTrackID\n }\n\n get closedCaptionsTracks() {\n return this._closedCaptionsTracks\n }\n\n get closedCaptionsTrackId() {\n return this._ccTrackId\n }\n\n set closedCaptionsTrackId(trackID) {\n this._ccTrackId = trackID\n this._updateCCTrackID(trackID)\n }\n\n render() {\n let template = this.template()\n this.$el.html(template)\n if (this.options.poster) {\n this.$('.chromecast-playback-background').css('background-image', 'url(' + this.options.poster + ')')\n } else {\n this.$('.chromecast-playback-background').css('background-color', '#666')\n }\n }\n\n play() {\n this.currentMedia.play()\n }\n\n pause() {\n this.stopTimer()\n this.currentMedia.pause()\n if (this.getPlaybackType() === Playback.LIVE) {\n this.trigger(Events.PLAYBACK_DVR, true)\n }\n }\n\n stop() {\n this.stopTimer()\n this.currentMedia.pause() // FIXME: properly handle media stop\n }\n\n seek(time) {\n this.stopTimer()\n let request = new chrome.cast.media.SeekRequest()\n request.currentTime = time\n this.currentMedia.seek(request,\n () => this.startTimer(), () => Log.warn('seek failed'))\n if (this.getPlaybackType() === Playback.LIVE) {\n // assume live if time within 30 seconds of end of live stream\n this.trigger(Events.PLAYBACK_DVR, time < this.getDuration() - 30)\n }\n }\n\n seekPercentage(percentage) {\n if (percentage >= 0 && percentage <= 100) {\n let duration = this.getDuration()\n this.seek(percentage * duration / 100)\n }\n }\n\n startTimer() {\n this.timer = setInterval(() => this.updateMediaControl(), TICK_INTERVAL)\n }\n\n stopTimer() {\n clearInterval(this.timer)\n this.timer = null\n }\n\n getDuration() {\n return this.currentMedia.media.duration\n }\n\n isPlaying() {\n return this.currentMedia.playerState === 'PLAYING' || this.currentMedia.playerState === 'BUFFERING'\n }\n\n getPlaybackType() {\n return this.currentMedia.liveSeekableRange ? Playback.LIVE : Playback.VOD\n }\n\n onMediaStatusUpdate() {\n this.mediaControl.changeTogglePlay()\n if (this.isPlaying() && !this.timer) {\n this.startTimer()\n }\n\n if (this.currentMedia.playerState === 'BUFFERING') {\n this.isBuffering = true\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n } else if (this.currentMedia.playerState === 'PLAYING') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n }\n } else if (this.currentMedia.playerState === 'IDLE') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n } else if (this.currentMedia.playerState === 'PAUSED') {\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PAUSE, this.name)\n }\n }\n\n this.prevState = this.currentMedia.playerState\n }\n\n updateMediaControl() {\n let position = this.currentMedia.getEstimatedTime()\n let duration = this.currentMedia.media.duration\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: position, total: duration}, this.name)\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n}\n","import {Browser, Events, Log, Styler, UICorePlugin} from '@clappr/player'\nimport ChromecastPlayback from './chromecast_playback'\nimport chromecastStyle from './public/style.scss'\nimport assign from 'lodash.assign'\nimport castIconSvg from './public/ic_cast_24dp.svg'\nimport connecting1IconSvg from './public/ic_cast0_24dp.svg'\nimport connecting2IconSvg from './public/ic_cast1_24dp.svg'\nimport connecting3IconSvg from './public/ic_cast2_24dp.svg'\nimport connectedIconSvg from './public/ic_cast_connected_24dp.svg'\n\nconst DEVICE_STATE = {\n 'IDLE' : 0,\n 'ACTIVE' : 1,\n 'WARNING' : 2,\n 'ERROR' : 3\n}\n\nconst DEFAULT_CLAPPR_APP_ID = '9DFB77C0'\n\nconst DEFAULT_MESSAGE_NAMESPACE = 'clappr-chromecast-plugin'\n\nconst MIMETYPES = {\n 'mp4': 'video/mp4',\n 'ogg': 'video/ogg',\n '3gpp': 'video/3gpp',\n 'webm': 'video/webm',\n 'mkv': 'video/x-matroska',\n 'm3u8': 'application/x-mpegurl',\n 'mpd': 'application/dash+xml'\n}\nMIMETYPES['ogv'] = MIMETYPES['ogg']\nMIMETYPES['3gp'] = MIMETYPES['3gpp']\n\nexport default class ChromecastPlugin extends UICorePlugin {\n get supportedVersion() {\n return { min: '0.4.0', max: '0.5.0' }\n }\n\n static get Movie() { return 'movie' }\n static get TvShow() { return 'tv_show' }\n static get Generic() { return 'none' }\n\n static get version() { return VERSION }\n get version() { return VERSION }\n\n get name() { return 'chromecast' }\n get tagName() { return 'button' }\n get attributes() {\n return {\n 'class' : 'chromecast-button',\n 'type' : 'button'\n }\n }\n get events() {\n return {\n 'click': 'click'\n }\n }\n get options() { return this.core.options.chromecast || (this.core.options.chromecast = {}) }\n get container() {\n return this.core.getCurrentContainer\n ? this.core.getCurrentContainer()\n : this.core.activeContainer // Clappr 0.3.0 or greater\n }\n get playback() {\n return this.core.getCurrentPlayback\n ? this.core.getCurrentPlayback()\n : this.core.activePlayback // Clappr 0.3.0 or greater\n }\n\n constructor(core) {\n super(core)\n\n this.bootTryDelay = this.options.bootTryDelay || 500 // Default is 500 milliseconds between each attempt\n this.bootMaxTryCount = this.options.bootMaxTryCount || 6 // Default is 6 attempts (3 seconds)\n this.bootTryCount = 0\n this.textTracks = []\n this.messageNamespace = this.options.customNamespace || DEFAULT_MESSAGE_NAMESPACE\n\n if (this.isBootable()) {\n this.appId = this.options.appId || DEFAULT_CLAPPR_APP_ID\n this.deviceState = DEVICE_STATE.IDLE\n this.embedScript()\n } else {\n this.disable()\n }\n }\n\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)\n\n if (Events.CORE_ACTIVE_CONTAINER_CHANGED) {\n // Clappr 0.3.0 or greater\n this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged)\n } else {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n }\n\n if (this.container) {\n this.listenTo(this.container, Events.CONTAINER_TIMEUPDATE, this.containerTimeUpdate)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.containerPlay)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.sessionStopped)\n }\n }\n\n isBootable() {\n // Browser must be Chrome\n if (!Browser.isChrome) {\n return false\n }\n\n // Chrome lesser than or equals to 71\n // does not require secure page\n if (Browser.version <= 71) {\n return true\n }\n\n // Chrome greater than or equals to 72\n // require secure page or localhost\n return this.isSecure() || this.isLocalhost()\n }\n\n isLocalhost() {\n return window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'\n }\n\n isSecure() {\n return window.location.protocol === 'https:'\n }\n\n enable() {\n super.enable()\n this.render()\n this.embedScript()\n }\n\n embedScript() {\n if (!window.chrome || !window.chrome.cast || !window.chrome.cast.isAvailable) {\n let script = document.createElement('script')\n script.setAttribute('type', 'text/javascript')\n script.setAttribute('async', 'async')\n script.setAttribute('src', 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js')\n script.onload = () => this.bootstrapCastApi()\n document.body.appendChild(script)\n } else {\n this.bootstrapCastApi()\n }\n }\n\n bootstrapCastApi() {\n this.bootTryCount++\n\n if (this.bootTryCount > this.bootMaxTryCount) {\n this.bootTryCount = 0\n Log.warn('GCastApi bootstrap timeout')\n this.disable()\n return\n }\n\n // The \"chrome\" property may not be available immediately on some iOS devices\n if (window.chrome) {\n this.bootTryCount = 0\n\n if (window.chrome.cast && window.chrome.cast.isAvailable) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n window['__onGCastApiAvailable'] = (loaded, errorInfo) => {\n if (loaded) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n Log.warn('GCastApi error', errorInfo)\n this.disable()\n }\n }\n }\n } else {\n setTimeout(() => { this.bootstrapCastApi() }, this.bootTryDelay)\n }\n }\n\n updateCCTrackID(trackID) {\n if (trackID !== -1) {\n if (this.textTracks.filter(t => t.id === trackID).length === 0) {\n console.warn(`Failed to enable text track with ID ${trackID}, as it does not exist.`)\n return\n }\n }\n var enabledTextTrackIDs = []\n if (trackID !== -1) {\n enabledTextTrackIDs = [trackID]\n }\n if (this.session) {\n this.session.sendMessage(\n `urn:x-cast:${this.messageNamespace}:active-text-tracks`,\n enabledTextTrackIDs\n )\n }\n let container = this.core.getCurrentContainer()\n if (container) {\n container.trigger(Events.CONTAINER_SUBTITLE_CHANGED, {id: trackID})\n }\n }\n\n initializeCastApi() {\n let autoJoinPolicy = chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED\n let sessionRequest = new chrome.cast.SessionRequest(this.appId)\n let apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n (session) => this.sessionListener(session), (e) => this.receiverListener(e), autoJoinPolicy)\n chrome.cast.initialize(apiConfig, () => Log.debug(this.name, 'init success'), () => Log.warn(this.name, 'init error'))\n }\n\n sessionListener(session) {\n Log.debug(this.name, 'new session id:' + session.sessionId)\n this.newSession(session)\n }\n\n sessionUpdateListener() {\n if (this.session) {\n Log.debug(this.name, this.session.status)\n if (this.session.status === chrome.cast.SessionStatus.STOPPED) {\n this.sessionStopped()\n this.session = null\n }\n }\n }\n\n onSessionTextTracks(tracks) {\n this.textTracks = tracks.map(t => {return {id: t.trackId, name: t.name, track: t}})\n if (this.textTracks.length > 0) {\n if (this.playbackProxy) {\n this.playbackProxy._closedCaptionsTracks = this.textTracks\n }\n this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)\n this.updateCCTrackID(this.core.getCurrentContainer().closedCaptionsTrackId)\n }\n }\n\n receiverListener(e) {\n if ( e === chrome.cast.ReceiverAvailability.AVAILABLE ) {\n Log.debug(this.name, 'receiver found')\n this.show()\n } else {\n Log.debug(this.name, 'receiver list empty')\n this.hide()\n }\n }\n\n launchSuccess(session) {\n this.renderConnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n Log.debug(this.name, 'launch success - session: ' + session.sessionId)\n this.newSession(session)\n }\n\n launchError(e) {\n Log.debug(this.name, 'error on launch', e)\n this.renderDisconnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n this.container.play()\n }\n\n loadMediaSuccess(how, mediaSession) {\n Log.debug(this.name, 'new media session', mediaSession, '(', how , ')')\n\n this.originalPlayback = this.playback\n\n let options = assign({}, this.originalPlayback.options, {\n currentMedia: mediaSession,\n mediaControl: this.core.mediaControl,\n poster: this.options.poster || this.core.options.poster,\n settings: this.originalPlayback.settings,\n ccTracks: this.textTracks,\n updateCCTrackID: (id) => this.updateCCTrackID(id)\n })\n this.src = this.originalPlayback.src\n this.playbackProxy = new ChromecastPlayback(options)\n this.playbackProxy.render()\n this.core.$el.addClass('chromecast-active')\n\n this.mediaSession = mediaSession\n\n this.originalPlayback.$el.remove()\n\n let container = this.container\n container.$el.append(this.playbackProxy.$el)\n container.stopListening()\n container.playback = this.playbackProxy\n container.bindEvents()\n container.settingsUpdate()\n }\n\n loadMediaError(e) {\n Log.warn(this.name, 'media error', e)\n }\n\n newSession(session) {\n this.session = session\n this.deviceState = DEVICE_STATE.ACTIVE\n this.renderConnected()\n\n session.addUpdateListener(() => this.sessionUpdateListener())\n session.addMessageListener(\n `urn:x-cast:${this.messageNamespace}:text-tracks`,\n (_, tracksJSON) => this.onSessionTextTracks(JSON.parse(tracksJSON))\n )\n\n this.containerPlay()\n }\n\n sessionStopped() {\n this.renderDisconnected()\n\n let time = this.currentTime\n\n let playerState = undefined\n if (this.mediaSession) {\n playerState = this.mediaSession.playerState\n this.mediaSession = null\n }\n\n this.core.$el.removeClass('chromecast-active')\n this.core.load(this.src || this.core.options.sources)\n\n let container = this.container\n\n if (this.playbackProxy) {\n if (this.playbackProxy.isPlaying() || playerState === 'PAUSED') {\n container.once(Events.CONTAINER_READY, () => {\n container.play()\n container.playback.seek(100 * time / container.getDuration())\n })\n }\n this.playbackProxy.stop()\n }\n }\n\n loadMedia() {\n this.container.pause()\n let src = this.container.options.src\n Log.debug(this.name, 'loading... ' + src)\n let mediaInfo = this.createMediaInfo(src)\n let request = new chrome.cast.media.LoadRequest(mediaInfo)\n request.autoplay = true\n if (this.currentTime) {\n request.currentTime = this.currentTime\n }\n this.session.loadMedia(request, (mediaSession) => this.loadMediaSuccess('loadMedia', mediaSession), (e) => this.loadMediaError(e))\n }\n\n createMediaInfo(src) {\n let mimeType = ChromecastPlugin.mimeTypeFor(src)\n let mediaInfo = new chrome.cast.media.MediaInfo(src)\n mediaInfo.contentType = this.options.contentType || mimeType\n mediaInfo.customData = this.options.customData\n let metadata = this.createMediaMetadata()\n mediaInfo.metadata = metadata\n return mediaInfo\n }\n\n createMediaMetadata() {\n this.options.media || (this.options.media = {})\n let type = this.options.media.type\n\n let metadata = this.createCastMediaMetadata(type)\n metadata.title = this.options.media.title\n metadata.subtitle = this.options.media.subtitle\n metadata.releaseDate = this.options.media.releaseDate\n\n if (type === ChromecastPlugin.TvShow) {\n metadata.episode = this.options.media.episode\n metadata.originalAirdate = this.options.media.originalAirdate\n metadata.season = this.options.media.season\n metadata.seriesTitle = this.options.media.seriesTitle\n } else if (type === ChromecastPlugin.Movie) {\n metadata.studio = this.options.media.studio\n }\n\n if (this.options.media.images) {\n metadata.images = this.options.media.images.map((url) => new chrome.cast.Image(url))\n }\n if (!metadata.images && this.options.poster) {\n metadata.images = [new chrome.cast.Image(this.options.poster)]\n }\n if (!metadata.images && this.core.options.poster) {\n metadata.images = [new chrome.cast.Image(this.core.options.poster)]\n }\n return metadata\n }\n\n createCastMediaMetadata(type) {\n switch (type) {\n case ChromecastPlugin.Movie: return new chrome.cast.media.MovieMediaMetadata()\n case ChromecastPlugin.TvShow: return new chrome.cast.media.TvShowMediaMetadata()\n default: return new chrome.cast.media.GenericMediaMetadata()\n }\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n\n click() {\n this.currentTime = this.container.getCurrentTime()\n this.container.pause()\n chrome.cast.requestSession((session) => this.launchSuccess(session), (e) => this.launchError(e))\n if (!this.session) {\n let position = 0\n let connectingIcons = [connecting1IconSvg, connecting2IconSvg, connecting3IconSvg]\n clearInterval(this.connectAnimInterval)\n this.connectAnimInterval = setInterval(() => {\n this.$el.html(connectingIcons[position])\n position = (position + 1) % 3\n }, 600)\n this.core.mediaControl.setKeepVisible()\n }\n }\n\n containerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n containerTimeUpdate(timeProgress) {\n this.currentTime = timeProgress.current\n }\n\n containerPlay() {\n if (this.session && (!this.mediaSession || this.mediaSession.playerState === 'IDLE' || this.mediaSession.playerState === 'PAUSED')) {\n Log.debug(this.name, 'load media')\n this.loadMedia()\n }\n }\n\n renderConnected() {\n this.$el.html(connectedIconSvg)\n }\n\n renderDisconnected() {\n this.$el.html(castIconSvg)\n }\n\n render() {\n this.session ? this.renderConnected() : this.renderDisconnected()\n this.core.mediaControl.$el.find('.media-control-right-panel').append(this.el)\n this.$style && this.$style.remove()\n this.$style = Styler.getStyleFor(chromecastStyle, {baseUrl: this.core.options.baseUrl})\n this.core.$el.append(this.$style)\n return this\n }\n\n static mimeTypeFor(srcUrl) {\n let extension = (srcUrl.split('?')[0].match(/.*\\.(.*)$/) || [])[1]\n if (MIMETYPES[extension]) {\n return MIMETYPES[extension]\n } else if (srcUrl.indexOf('.ism') > -1) {\n return 'application/vnd.ms-sstr+xml'\n }\n }\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/clappr-chromecast-plugin.min.js b/lib/clappr-chromecast-plugin.min.js index 5634ed8..3445f6c 100644 --- a/lib/clappr-chromecast-plugin.min.js +++ b/lib/clappr-chromecast-plugin.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@clappr/player")):"function"==typeof define&&define.amd?define(["@clappr/player"],e):"object"==typeof exports?exports.ChromecastPlugin=e(require("@clappr/player")):t.ChromecastPlugin=e(t.Clappr)}(window,(function(t){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var a=e[s]={i:s,l:!1,exports:{}};return t[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(s,a,function(e){return t[e]}.bind(null,a));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=10)}([function(e,i){e.exports=t},function(t,e){t.exports='
\n
\n'},function(t,e,i){(e=i(9)(!1)).push([t.i,".chromecast-playback{height:100%;width:100%}.chromecast-playback .chromecast-playback-background,.chromecast-playback .chromecast-playback-overlay{position:absolute;height:100%;width:100%}.chromecast-playback .chromecast-playback-background{background-size:contain}.chromecast-playback .chromecast-playback-overlay{background-color:#000;opacity:0.4}.chromecast-button{background:transparent;border:0;width:32px;height:32px;font-size:22px;line-height:32px;letter-spacing:0;margin:0 6px;color:#fff;opacity:0.5;vertical-align:middle;text-align:left;cursor:pointer;-webkit-font-smoothing:antialiased;transition:all 0.1s ease}.chromecast-button:hover{opacity:0.75;text-shadow:rgba(255,255,255,0.8) 0 0 5px}.chromecast-button:focus{outline:none}.chromecast-button svg{width:24px;height:24px}.chromecast-button svg #cast,.chromecast-button svg #cast-on,.chromecast-button svg #Path{fill:#fff;stroke:#fff;stroke-width:0.5px}\n",""]),t.exports=e},function(t,e){var i=/^(?:0|[1-9]\d*)$/;function s(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}var a,r,n=Object.prototype,o=n.hasOwnProperty,c=n.toString,h=n.propertyIsEnumerable,l=(a=Object.keys,r=Object,function(t){return a(r(t))}),d=Math.max,p=!h.call({valueOf:1},"valueOf");function u(t,e){var i=b(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&y(t)}(t)&&o.call(t,"callee")&&(!h.call(t,"callee")||"[object Arguments]"==c.call(t))}(t)?function(t,e){for(var i=-1,s=Array(t);++i-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){var e=C(t)?c.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}function C(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var k,T=(k=function(t,e){if(p||v(e)||y(e))!function(t,e,i,s){i||(i={});for(var a=-1,r=e.length;++a1?e[s-1]:void 0,r=s>2?e[2]:void 0;for(a=k.length>3&&"function"==typeof a?(s--,a):void 0,r&&function(t,e,i){if(!C(i))return!1;var s=typeof e;return!!("number"==s?y(i)&&m(e,i.length):"string"==s&&e in i)&&f(i[e],t)}(e[0],e[1],r)&&(a=s<3?void 0:a,s=1),t=Object(t);++i'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e,i){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=function(t,e){var i=t[1]||"",s=t[3];if(!s)return i;if(e&&"function"==typeof btoa){var a=(n=s,o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),"/*# ".concat(c," */")),r=s.sources.map((function(t){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(t," */")}));return[i].concat(r).concat([a]).join("\n")}var n,o,c;return[i].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,s){"string"==typeof t&&(t=[[null,t,""]]);var a={};if(s)for(var r=0;rthis.onMediaStatusUpdate()),this.settings=t.settings;let e=t=>"volume"!=t;this.settings.default&&(this.settings.default=this.settings.default.filter(e)),this.settings.left&&(this.settings.left=this.settings.left.filter(e)),this.settings.right&&(this.settings.right=this.settings.right.filter(e)),this._closedCaptionsTracks=t.ccTracks||[],this._ccTrackId=-1,this._updateCCTrackID=t.updateCCTrackID}get closedCaptionsTracks(){return this._closedCaptionsTracks}get closedCaptionsTrackId(){return this._ccTrackId}set closedCaptionsTrackId(t){this._ccTrackId=t,this._updateCCTrackID(t)}render(){let t=this.template();this.$el.html(t),this.options.poster?this.$(".chromecast-playback-background").css("background-image","url("+this.options.poster+")"):this.$(".chromecast-playback-background").css("background-color","#666")}play(){this.currentMedia.play()}pause(){this.stopTimer(),this.currentMedia.pause(),this.getPlaybackType()===s.Playback.LIVE&&this.trigger(s.Events.PLAYBACK_DVR,!0)}stop(){this.stopTimer(),this.currentMedia.pause()}seek(t){this.stopTimer();let e=new chrome.cast.media.SeekRequest;e.currentTime=t,this.currentMedia.seek(e,()=>this.startTimer(),()=>s.Log.warn("seek failed")),this.getPlaybackType()===s.Playback.LIVE&&this.trigger(s.Events.PLAYBACK_DVR,t=0&&t<=100){let e=this.getDuration();this.seek(t*e/100)}}startTimer(){this.timer=setInterval(()=>this.updateMediaControl(),100)}stopTimer(){clearInterval(this.timer),this.timer=null}getDuration(){return this.currentMedia.media.duration}isPlaying(){return"PLAYING"===this.currentMedia.playerState||"BUFFERING"===this.currentMedia.playerState}getPlaybackType(){return this.currentMedia.liveSeekableRange?s.Playback.LIVE:s.Playback.VOD}onMediaStatusUpdate(){this.mediaControl.changeTogglePlay(),this.isPlaying()&&!this.timer&&this.startTimer(),"BUFFERING"===this.currentMedia.playerState?(this.isBuffering=!0,this.trigger(s.Events.PLAYBACK_BUFFERING,this.name)):"PLAYING"===this.currentMedia.playerState?(this.isBuffering&&(this.isBuffering=!1,this.trigger(s.Events.PLAYBACK_BUFFERFULL,this.name)),this.prevState!==this.currentMedia.playerState&&this.trigger(s.Events.PLAYBACK_PLAY,this.name)):"IDLE"===this.currentMedia.playerState?(this.isBuffering&&(this.isBuffering=!1,this.trigger(s.Events.PLAYBACK_BUFFERFULL,this.name)),this.trigger(s.Events.PLAYBACK_ENDED,this.name)):"PAUSED"===this.currentMedia.playerState&&this.prevState!==this.currentMedia.playerState&&this.trigger(s.Events.PLAYBACK_PAUSE,this.name),this.prevState=this.currentMedia.playerState}updateMediaControl(){let t=this.currentMedia.getEstimatedTime(),e=this.currentMedia.media.duration;this.trigger(s.Events.PLAYBACK_TIMEUPDATE,{current:t,total:e},this.name)}show(){this.$el.show()}hide(){this.$el.hide()}}var o=i(2),c=i.n(o),h=i(3),l=i.n(h),d=i(4),p=i.n(d),u=i(5),g=i.n(u),m=i(6),v=i.n(m),f=i(7),b=i.n(f),y=i(8),C=i.n(y);const k=0,T=1,w={mp4:"video/mp4",ogg:"video/ogg","3gpp":"video/3gpp",webm:"video/webm",mkv:"video/x-matroska",m3u8:"application/x-mpegurl",mpd:"application/dash+xml"};w.ogv=w.ogg,w["3gp"]=w["3gpp"];class M extends s.UICorePlugin{get supportedVersion(){return{min:"0.4.0",max:"0.5.0"}}static get Movie(){return"movie"}static get TvShow(){return"tv_show"}static get Generic(){return"none"}static get version(){return VERSION}get version(){return VERSION}get name(){return"chromecast"}get tagName(){return"button"}get attributes(){return{class:"chromecast-button",type:"button"}}get events(){return{click:"click"}}get options(){return this.core.options.chromecast||(this.core.options.chromecast={})}get container(){return this.core.getCurrentContainer?this.core.getCurrentContainer():this.core.activeContainer}get playback(){return this.core.getCurrentPlayback?this.core.getCurrentPlayback():this.core.activePlayback}constructor(t){super(t),this.bootTryDelay=this.options.bootTryDelay||500,this.bootMaxTryCount=this.options.bootMaxTryCount||6,this.bootTryCount=0,this.textTracks=[],this.messageNamespace=this.options.customNamespace||"clappr-chromecast-plugin",this.isBootable()?(this.appId=this.options.appId||"9DFB77C0",this.deviceState=k,this.embedScript()):this.disable()}bindEvents(){this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_RENDERED,this.render),s.Events.CORE_ACTIVE_CONTAINER_CHANGED?this.listenTo(this.core,s.Events.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged):this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.container&&(this.listenTo(this.container,s.Events.CONTAINER_TIMEUPDATE,this.containerTimeUpdate),this.listenTo(this.container,s.Events.CONTAINER_PLAY,this.containerPlay),this.listenTo(this.container,s.Events.CONTAINER_ENDED,this.sessionStopped))}isBootable(){return!!s.Browser.isChrome&&(s.Browser.version<=71||(this.isSecure()||this.isLocalhost()))}isLocalhost(){return"localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname}isSecure(){return"https:"===window.location.protocol}enable(){super.enable(),this.render(),this.embedScript()}embedScript(){if(window.chrome&&window.chrome.cast&&window.chrome.cast.isAvailable)this.bootstrapCastApi();else{let t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),t.setAttribute("src","https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"),t.onload=()=>this.bootstrapCastApi(),document.body.appendChild(t)}}bootstrapCastApi(){if(this.bootTryCount++,this.bootTryCount>this.bootMaxTryCount)return this.bootTryCount=0,s.Log.warn("GCastApi bootstrap timeout"),void this.disable();window.chrome?(this.bootTryCount=0,window.chrome.cast&&window.chrome.cast.isAvailable?(this.appId=this.appId||"9DFB77C0",this.initializeCastApi()):window.__onGCastApiAvailable=(t,e)=>{t?(this.appId=this.appId||"9DFB77C0",this.initializeCastApi()):(s.Log.warn("GCastApi error",e),this.disable())}):setTimeout(()=>{this.bootstrapCastApi()},this.bootTryDelay)}updateCCTrackID(t){if(-1!==t&&0===this.textTracks.filter(e=>e.id===t).length)return void console.warn(`Failed to enable text track with ID ${t}, as it does not exist.`);var e=[];-1!==t&&(e=[t]),this.session&&this.session.sendMessage(`urn:x-cast:${this.messageNamespace}:active-text-tracks`,e);let i=this.core.getCurrentContainer();i&&i.trigger(s.Events.CONTAINER_SUBTITLE_CHANGED,{id:t})}initializeCastApi(){let t=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,e=new chrome.cast.SessionRequest(this.appId),i=new chrome.cast.ApiConfig(e,t=>this.sessionListener(t),t=>this.receiverListener(t),t);chrome.cast.initialize(i,()=>s.Log.debug(this.name,"init success"),()=>s.Log.warn(this.name,"init error"))}sessionListener(t){s.Log.debug(this.name,"new session id:"+t.sessionId),this.newSession(t)}sessionUpdateListener(){this.session&&(s.Log.debug(this.name,this.session.status),this.session.status===chrome.cast.SessionStatus.STOPPED&&(this.sessionStopped(),this.session=null))}onSessionTextTracks(t){this.textTracks=t.map(t=>({id:t.trackId,name:t.name,track:t})),this.textTracks.length>0&&(this.playbackProxy&&(this.playbackProxy._closedCaptionsTracks=this.textTracks),this.trigger(s.Events.PLAYBACK_SUBTITLE_AVAILABLE),this.updateCCTrackID(this.core.getCurrentContainer().closedCaptionsTrackId))}receiverListener(t){t===chrome.cast.ReceiverAvailability.AVAILABLE?(s.Log.debug(this.name,"receiver found"),this.show()):(s.Log.debug(this.name,"receiver list empty"),this.hide())}launchSuccess(t){this.renderConnected(),clearInterval(this.connectAnimInterval),this.core.mediaControl.resetKeepVisible(),s.Log.debug(this.name,"launch success - session: "+t.sessionId),this.newSession(t)}launchError(t){s.Log.debug(this.name,"error on launch",t),this.renderDisconnected(),clearInterval(this.connectAnimInterval),this.core.mediaControl.resetKeepVisible(),this.container.play()}loadMediaSuccess(t,e){s.Log.debug(this.name,"new media session",e,"(",t,")"),this.originalPlayback=this.playback;let i=l()({},this.originalPlayback.options,{currentMedia:e,mediaControl:this.core.mediaControl,poster:this.options.poster||this.core.options.poster,settings:this.originalPlayback.settings,ccTracks:this.textTracks,updateCCTrackID:t=>this.updateCCTrackID(t)});this.src=this.originalPlayback.src,this.playbackProxy=new n(i),this.playbackProxy.render(),this.core.$el.addClass("chromecast-active"),this.mediaSession=e,this.originalPlayback.$el.remove();let a=this.container;a.$el.append(this.playbackProxy.$el),a.stopListening(),a.playback=this.playbackProxy,a.bindEvents(),a.settingsUpdate()}loadMediaError(t){s.Log.warn(this.name,"media error",t)}newSession(t){this.session=t,this.deviceState=T,this.renderConnected(),t.addUpdateListener(()=>this.sessionUpdateListener()),t.addMessageListener(`urn:x-cast:${this.messageNamespace}:text-tracks`,(t,e)=>this.onSessionTextTracks(JSON.parse(e))),this.containerPlay()}sessionStopped(){this.renderDisconnected();let t=this.currentTime,e=void 0;this.mediaSession&&(e=this.mediaSession.playerState,this.mediaSession=null),this.core.$el.removeClass("chromecast-active"),this.core.load(this.src||this.core.options.sources);let i=this.container;this.playbackProxy&&((this.playbackProxy.isPlaying()||"PAUSED"===e)&&i.once(s.Events.CONTAINER_READY,()=>{i.play(),i.playback.seek(100*t/i.getDuration())}),this.playbackProxy.stop())}loadMedia(){this.container.pause();let t=this.container.options.src;s.Log.debug(this.name,"loading... "+t);let e=this.createMediaInfo(t),i=new chrome.cast.media.LoadRequest(e);i.autoplay=!0,this.currentTime&&(i.currentTime=this.currentTime),this.session.loadMedia(i,t=>this.loadMediaSuccess("loadMedia",t),t=>this.loadMediaError(t))}createMediaInfo(t){let e=M.mimeTypeFor(t),i=new chrome.cast.media.MediaInfo(t);i.contentType=this.options.contentType||e,i.customData=this.options.customData;let s=this.createMediaMetadata();return i.metadata=s,i}createMediaMetadata(){this.options.media||(this.options.media={});let t=this.options.media.type,e=this.createCastMediaMetadata(t);return e.title=this.options.media.title,e.subtitle=this.options.media.subtitle,e.releaseDate=this.options.media.releaseDate,t===M.TvShow?(e.episode=this.options.media.episode,e.originalAirdate=this.options.media.originalAirdate,e.season=this.options.media.season,e.seriesTitle=this.options.media.seriesTitle):t===M.Movie&&(e.studio=this.options.media.studio),this.options.media.images&&(e.images=this.options.media.images.map(t=>new chrome.cast.Image(t))),!e.images&&this.options.poster&&(e.images=[new chrome.cast.Image(this.options.poster)]),!e.images&&this.core.options.poster&&(e.images=[new chrome.cast.Image(this.core.options.poster)]),e}createCastMediaMetadata(t){switch(t){case M.Movie:return new chrome.cast.media.MovieMediaMetadata;case M.TvShow:return new chrome.cast.media.TvShowMediaMetadata;default:return new chrome.cast.media.GenericMediaMetadata}}show(){this.$el.show()}hide(){this.$el.hide()}click(){if(this.currentTime=this.container.getCurrentTime(),this.container.pause(),chrome.cast.requestSession(t=>this.launchSuccess(t),t=>this.launchError(t)),!this.session){let t=0,e=[g.a,v.a,b.a];clearInterval(this.connectAnimInterval),this.connectAnimInterval=setInterval(()=>{this.$el.html(e[t]),t=(t+1)%3},600),this.core.mediaControl.setKeepVisible()}}containerChanged(){this.stopListening(),this.bindEvents()}containerTimeUpdate(t){this.currentTime=t.current}containerPlay(){!this.session||this.mediaSession&&"IDLE"!==this.mediaSession.playerState&&"PAUSED"!==this.mediaSession.playerState||(s.Log.debug(this.name,"load media"),this.loadMedia())}renderConnected(){this.$el.html(C.a)}renderDisconnected(){this.$el.html(p.a)}render(){return this.session?this.renderConnected():this.renderDisconnected(),this.core.mediaControl.$el.find(".media-control-right-panel[data-media-control]").append(this.$el),this.$style&&this.$style.remove(),this.$style=s.Styler.getStyleFor(c.a,{baseUrl:this.core.options.baseUrl}),this.core.$el.append(this.$style),this}static mimeTypeFor(t){let e=(t.split("?")[0].match(/.*\.(.*)$/)||[])[1];return w[e]?w[e]:t.indexOf(".ism")>-1?"application/vnd.ms-sstr+xml":void 0}}}]).default})); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@clappr/player")):"function"==typeof define&&define.amd?define(["@clappr/player"],e):"object"==typeof exports?exports.ChromecastPlugin=e(require("@clappr/player")):t.ChromecastPlugin=e(t.Clappr)}(window,(function(t){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var a=e[s]={i:s,l:!1,exports:{}};return t[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(s,a,function(e){return t[e]}.bind(null,a));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=10)}([function(e,i){e.exports=t},function(t,e){t.exports='
\n
\n'},function(t,e,i){(e=i(9)(!1)).push([t.i,".chromecast-playback{height:100%;width:100%}.chromecast-playback .chromecast-playback-background,.chromecast-playback .chromecast-playback-overlay{position:absolute;height:100%;width:100%}.chromecast-playback .chromecast-playback-background{background-size:contain}.chromecast-playback .chromecast-playback-overlay{background-color:#000;opacity:0.4}.chromecast-button{background:transparent;border:0;width:32px;height:32px;font-size:22px;line-height:32px;letter-spacing:0;margin:0 6px;color:#fff;opacity:0.5;vertical-align:middle;text-align:left;cursor:pointer;-webkit-font-smoothing:antialiased;transition:all 0.1s ease}.chromecast-button:hover{opacity:0.75;text-shadow:rgba(255,255,255,0.8) 0 0 5px}.chromecast-button:focus{outline:none}.chromecast-button svg{width:24px;height:24px}.chromecast-button svg #cast,.chromecast-button svg #cast-on,.chromecast-button svg #Path{fill:#fff;stroke:#fff;stroke-width:0.5px}\n",""]),t.exports=e},function(t,e){var i=/^(?:0|[1-9]\d*)$/;function s(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}var a,r,n=Object.prototype,o=n.hasOwnProperty,c=n.toString,h=n.propertyIsEnumerable,l=(a=Object.keys,r=Object,function(t){return a(r(t))}),d=Math.max,p=!h.call({valueOf:1},"valueOf");function u(t,e){var i=b(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&y(t)}(t)&&o.call(t,"callee")&&(!h.call(t,"callee")||"[object Arguments]"==c.call(t))}(t)?function(t,e){for(var i=-1,s=Array(t);++i-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){var e=C(t)?c.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}function C(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var k,T=(k=function(t,e){if(p||v(e)||y(e))!function(t,e,i,s){i||(i={});for(var a=-1,r=e.length;++a1?e[s-1]:void 0,r=s>2?e[2]:void 0;for(a=k.length>3&&"function"==typeof a?(s--,a):void 0,r&&function(t,e,i){if(!C(i))return!1;var s=typeof e;return!!("number"==s?y(i)&&m(e,i.length):"string"==s&&e in i)&&f(i[e],t)}(e[0],e[1],r)&&(a=s<3?void 0:a,s=1),t=Object(t);++i'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e,i){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=function(t,e){var i=t[1]||"",s=t[3];if(!s)return i;if(e&&"function"==typeof btoa){var a=(n=s,o=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),"/*# ".concat(c," */")),r=s.sources.map((function(t){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(t," */")}));return[i].concat(r).concat([a]).join("\n")}var n,o,c;return[i].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,s){"string"==typeof t&&(t=[[null,t,""]]);var a={};if(s)for(var r=0;rthis.onMediaStatusUpdate()),this.settings=t.settings;let e=t=>"volume"!=t;this.settings.default&&(this.settings.default=this.settings.default.filter(e)),this.settings.left&&(this.settings.left=this.settings.left.filter(e)),this.settings.right&&(this.settings.right=this.settings.right.filter(e)),this._closedCaptionsTracks=t.ccTracks||[],this._ccTrackId=-1,this._updateCCTrackID=t.updateCCTrackID}get closedCaptionsTracks(){return this._closedCaptionsTracks}get closedCaptionsTrackId(){return this._ccTrackId}set closedCaptionsTrackId(t){this._ccTrackId=t,this._updateCCTrackID(t)}render(){let t=this.template();this.$el.html(t),this.options.poster?this.$(".chromecast-playback-background").css("background-image","url("+this.options.poster+")"):this.$(".chromecast-playback-background").css("background-color","#666")}play(){this.currentMedia.play()}pause(){this.stopTimer(),this.currentMedia.pause(),this.getPlaybackType()===s.Playback.LIVE&&this.trigger(s.Events.PLAYBACK_DVR,!0)}stop(){this.stopTimer(),this.currentMedia.pause()}seek(t){this.stopTimer();let e=new chrome.cast.media.SeekRequest;e.currentTime=t,this.currentMedia.seek(e,()=>this.startTimer(),()=>s.Log.warn("seek failed")),this.getPlaybackType()===s.Playback.LIVE&&this.trigger(s.Events.PLAYBACK_DVR,t=0&&t<=100){let e=this.getDuration();this.seek(t*e/100)}}startTimer(){this.timer=setInterval(()=>this.updateMediaControl(),100)}stopTimer(){clearInterval(this.timer),this.timer=null}getDuration(){return this.currentMedia.media.duration}isPlaying(){return"PLAYING"===this.currentMedia.playerState||"BUFFERING"===this.currentMedia.playerState}getPlaybackType(){return this.currentMedia.liveSeekableRange?s.Playback.LIVE:s.Playback.VOD}onMediaStatusUpdate(){this.mediaControl.changeTogglePlay(),this.isPlaying()&&!this.timer&&this.startTimer(),"BUFFERING"===this.currentMedia.playerState?(this.isBuffering=!0,this.trigger(s.Events.PLAYBACK_BUFFERING,this.name)):"PLAYING"===this.currentMedia.playerState?(this.isBuffering&&(this.isBuffering=!1,this.trigger(s.Events.PLAYBACK_BUFFERFULL,this.name)),this.prevState!==this.currentMedia.playerState&&this.trigger(s.Events.PLAYBACK_PLAY,this.name)):"IDLE"===this.currentMedia.playerState?(this.isBuffering&&(this.isBuffering=!1,this.trigger(s.Events.PLAYBACK_BUFFERFULL,this.name)),this.trigger(s.Events.PLAYBACK_ENDED,this.name)):"PAUSED"===this.currentMedia.playerState&&this.prevState!==this.currentMedia.playerState&&this.trigger(s.Events.PLAYBACK_PAUSE,this.name),this.prevState=this.currentMedia.playerState}updateMediaControl(){let t=this.currentMedia.getEstimatedTime(),e=this.currentMedia.media.duration;this.trigger(s.Events.PLAYBACK_TIMEUPDATE,{current:t,total:e},this.name)}show(){this.$el.show()}hide(){this.$el.hide()}}var o=i(2),c=i.n(o),h=i(3),l=i.n(h),d=i(4),p=i.n(d),u=i(5),g=i.n(u),m=i(6),v=i.n(m),f=i(7),b=i.n(f),y=i(8),C=i.n(y);const k=0,T=1,w={mp4:"video/mp4",ogg:"video/ogg","3gpp":"video/3gpp",webm:"video/webm",mkv:"video/x-matroska",m3u8:"application/x-mpegurl",mpd:"application/dash+xml"};w.ogv=w.ogg,w["3gp"]=w["3gpp"];class M extends s.UICorePlugin{get supportedVersion(){return{min:"0.4.0",max:"0.5.0"}}static get Movie(){return"movie"}static get TvShow(){return"tv_show"}static get Generic(){return"none"}static get version(){return VERSION}get version(){return VERSION}get name(){return"chromecast"}get tagName(){return"button"}get attributes(){return{class:"chromecast-button",type:"button"}}get events(){return{click:"click"}}get options(){return this.core.options.chromecast||(this.core.options.chromecast={})}get container(){return this.core.getCurrentContainer?this.core.getCurrentContainer():this.core.activeContainer}get playback(){return this.core.getCurrentPlayback?this.core.getCurrentPlayback():this.core.activePlayback}constructor(t){super(t),this.bootTryDelay=this.options.bootTryDelay||500,this.bootMaxTryCount=this.options.bootMaxTryCount||6,this.bootTryCount=0,this.textTracks=[],this.messageNamespace=this.options.customNamespace||"clappr-chromecast-plugin",this.isBootable()?(this.appId=this.options.appId||"9DFB77C0",this.deviceState=k,this.embedScript()):this.disable()}bindEvents(){this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_RENDERED,this.render),s.Events.CORE_ACTIVE_CONTAINER_CHANGED?this.listenTo(this.core,s.Events.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged):this.listenTo(this.core.mediaControl,s.Events.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.container&&(this.listenTo(this.container,s.Events.CONTAINER_TIMEUPDATE,this.containerTimeUpdate),this.listenTo(this.container,s.Events.CONTAINER_PLAY,this.containerPlay),this.listenTo(this.container,s.Events.CONTAINER_ENDED,this.sessionStopped))}isBootable(){return!!s.Browser.isChrome&&(s.Browser.version<=71||(this.isSecure()||this.isLocalhost()))}isLocalhost(){return"localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname}isSecure(){return"https:"===window.location.protocol}enable(){super.enable(),this.render(),this.embedScript()}embedScript(){if(window.chrome&&window.chrome.cast&&window.chrome.cast.isAvailable)this.bootstrapCastApi();else{let t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),t.setAttribute("src","https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"),t.onload=()=>this.bootstrapCastApi(),document.body.appendChild(t)}}bootstrapCastApi(){if(this.bootTryCount++,this.bootTryCount>this.bootMaxTryCount)return this.bootTryCount=0,s.Log.warn("GCastApi bootstrap timeout"),void this.disable();window.chrome?(this.bootTryCount=0,window.chrome.cast&&window.chrome.cast.isAvailable?(this.appId=this.appId||"9DFB77C0",this.initializeCastApi()):window.__onGCastApiAvailable=(t,e)=>{t?(this.appId=this.appId||"9DFB77C0",this.initializeCastApi()):(s.Log.warn("GCastApi error",e),this.disable())}):setTimeout(()=>{this.bootstrapCastApi()},this.bootTryDelay)}updateCCTrackID(t){if(-1!==t&&0===this.textTracks.filter(e=>e.id===t).length)return void console.warn(`Failed to enable text track with ID ${t}, as it does not exist.`);var e=[];-1!==t&&(e=[t]),this.session&&this.session.sendMessage(`urn:x-cast:${this.messageNamespace}:active-text-tracks`,e);let i=this.core.getCurrentContainer();i&&i.trigger(s.Events.CONTAINER_SUBTITLE_CHANGED,{id:t})}initializeCastApi(){let t=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,e=new chrome.cast.SessionRequest(this.appId),i=new chrome.cast.ApiConfig(e,t=>this.sessionListener(t),t=>this.receiverListener(t),t);chrome.cast.initialize(i,()=>s.Log.debug(this.name,"init success"),()=>s.Log.warn(this.name,"init error"))}sessionListener(t){s.Log.debug(this.name,"new session id:"+t.sessionId),this.newSession(t)}sessionUpdateListener(){this.session&&(s.Log.debug(this.name,this.session.status),this.session.status===chrome.cast.SessionStatus.STOPPED&&(this.sessionStopped(),this.session=null))}onSessionTextTracks(t){this.textTracks=t.map(t=>({id:t.trackId,name:t.name,track:t})),this.textTracks.length>0&&(this.playbackProxy&&(this.playbackProxy._closedCaptionsTracks=this.textTracks),this.trigger(s.Events.PLAYBACK_SUBTITLE_AVAILABLE),this.updateCCTrackID(this.core.getCurrentContainer().closedCaptionsTrackId))}receiverListener(t){t===chrome.cast.ReceiverAvailability.AVAILABLE?(s.Log.debug(this.name,"receiver found"),this.show()):(s.Log.debug(this.name,"receiver list empty"),this.hide())}launchSuccess(t){this.renderConnected(),clearInterval(this.connectAnimInterval),this.core.mediaControl.resetKeepVisible(),s.Log.debug(this.name,"launch success - session: "+t.sessionId),this.newSession(t)}launchError(t){s.Log.debug(this.name,"error on launch",t),this.renderDisconnected(),clearInterval(this.connectAnimInterval),this.core.mediaControl.resetKeepVisible(),this.container.play()}loadMediaSuccess(t,e){s.Log.debug(this.name,"new media session",e,"(",t,")"),this.originalPlayback=this.playback;let i=l()({},this.originalPlayback.options,{currentMedia:e,mediaControl:this.core.mediaControl,poster:this.options.poster||this.core.options.poster,settings:this.originalPlayback.settings,ccTracks:this.textTracks,updateCCTrackID:t=>this.updateCCTrackID(t)});this.src=this.originalPlayback.src,this.playbackProxy=new n(i),this.playbackProxy.render(),this.core.$el.addClass("chromecast-active"),this.mediaSession=e,this.originalPlayback.$el.remove();let a=this.container;a.$el.append(this.playbackProxy.$el),a.stopListening(),a.playback=this.playbackProxy,a.bindEvents(),a.settingsUpdate()}loadMediaError(t){s.Log.warn(this.name,"media error",t)}newSession(t){this.session=t,this.deviceState=T,this.renderConnected(),t.addUpdateListener(()=>this.sessionUpdateListener()),t.addMessageListener(`urn:x-cast:${this.messageNamespace}:text-tracks`,(t,e)=>this.onSessionTextTracks(JSON.parse(e))),this.containerPlay()}sessionStopped(){this.renderDisconnected();let t=this.currentTime,e=void 0;this.mediaSession&&(e=this.mediaSession.playerState,this.mediaSession=null),this.core.$el.removeClass("chromecast-active"),this.core.load(this.src||this.core.options.sources);let i=this.container;this.playbackProxy&&((this.playbackProxy.isPlaying()||"PAUSED"===e)&&i.once(s.Events.CONTAINER_READY,()=>{i.play(),i.playback.seek(100*t/i.getDuration())}),this.playbackProxy.stop())}loadMedia(){this.container.pause();let t=this.container.options.src;s.Log.debug(this.name,"loading... "+t);let e=this.createMediaInfo(t),i=new chrome.cast.media.LoadRequest(e);i.autoplay=!0,this.currentTime&&(i.currentTime=this.currentTime),this.session.loadMedia(i,t=>this.loadMediaSuccess("loadMedia",t),t=>this.loadMediaError(t))}createMediaInfo(t){let e=M.mimeTypeFor(t),i=new chrome.cast.media.MediaInfo(t);i.contentType=this.options.contentType||e,i.customData=this.options.customData;let s=this.createMediaMetadata();return i.metadata=s,i}createMediaMetadata(){this.options.media||(this.options.media={});let t=this.options.media.type,e=this.createCastMediaMetadata(t);return e.title=this.options.media.title,e.subtitle=this.options.media.subtitle,e.releaseDate=this.options.media.releaseDate,t===M.TvShow?(e.episode=this.options.media.episode,e.originalAirdate=this.options.media.originalAirdate,e.season=this.options.media.season,e.seriesTitle=this.options.media.seriesTitle):t===M.Movie&&(e.studio=this.options.media.studio),this.options.media.images&&(e.images=this.options.media.images.map(t=>new chrome.cast.Image(t))),!e.images&&this.options.poster&&(e.images=[new chrome.cast.Image(this.options.poster)]),!e.images&&this.core.options.poster&&(e.images=[new chrome.cast.Image(this.core.options.poster)]),e}createCastMediaMetadata(t){switch(t){case M.Movie:return new chrome.cast.media.MovieMediaMetadata;case M.TvShow:return new chrome.cast.media.TvShowMediaMetadata;default:return new chrome.cast.media.GenericMediaMetadata}}show(){this.$el.show()}hide(){this.$el.hide()}click(){if(this.currentTime=this.container.getCurrentTime(),this.container.pause(),chrome.cast.requestSession(t=>this.launchSuccess(t),t=>this.launchError(t)),!this.session){let t=0,e=[g.a,v.a,b.a];clearInterval(this.connectAnimInterval),this.connectAnimInterval=setInterval(()=>{this.$el.html(e[t]),t=(t+1)%3},600),this.core.mediaControl.setKeepVisible()}}containerChanged(){this.stopListening(),this.bindEvents()}containerTimeUpdate(t){this.currentTime=t.current}containerPlay(){!this.session||this.mediaSession&&"IDLE"!==this.mediaSession.playerState&&"PAUSED"!==this.mediaSession.playerState||(s.Log.debug(this.name,"load media"),this.loadMedia())}renderConnected(){this.$el.html(C.a)}renderDisconnected(){this.$el.html(p.a)}render(){return this.session?this.renderConnected():this.renderDisconnected(),this.core.mediaControl.$el.find(".media-control-right-panel").append(this.el),this.$style&&this.$style.remove(),this.$style=s.Styler.getStyleFor(c.a,{baseUrl:this.core.options.baseUrl}),this.core.$el.append(this.$style),this}static mimeTypeFor(t){let e=(t.split("?")[0].match(/.*\.(.*)$/)||[])[1];return w[e]?w[e]:t.indexOf(".ism")>-1?"application/vnd.ms-sstr+xml":void 0}}}]).default})); //# sourceMappingURL=clappr-chromecast-plugin.min.js.map \ No newline at end of file diff --git a/lib/clappr-chromecast-plugin.min.js.map b/lib/clappr-chromecast-plugin.min.js.map index 5885ac8..5faed98 100644 --- a/lib/clappr-chromecast-plugin.min.js.map +++ b/lib/clappr-chromecast-plugin.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://ChromecastPlugin/webpack/universalModuleDefinition","webpack://ChromecastPlugin/webpack/bootstrap","webpack://ChromecastPlugin/external {\"amd\":\"@clappr/player\",\"commonjs\":\"@clappr/player\",\"commonjs2\":\"@clappr/player\",\"root\":\"Clappr\"}","webpack://ChromecastPlugin/./src/public/chromecast.html","webpack://ChromecastPlugin/./src/public/style.scss","webpack://ChromecastPlugin//Users/mdg/Source/boxcast_js/node_modules/lodash.assign/index.js","webpack://ChromecastPlugin/./src/public/ic_cast_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast0_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast1_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast2_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast_connected_24dp.svg","webpack://ChromecastPlugin/./node_modules/css-loader/dist/runtime/api.js","webpack://ChromecastPlugin/./src/chromecast_playback.js","webpack://ChromecastPlugin/./src/chromecast.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","___CSS_LOADER_API_IMPORT___","push","reIsUint","apply","func","thisArg","args","length","transform","objectProto","objectToString","toString","propertyIsEnumerable","nativeKeys","keys","arg","nativeMax","Math","max","nonEnumShadows","arrayLikeKeys","inherited","result","isArray","isObjectLike","isArrayLike","isArrayLikeObject","isArguments","iteratee","index","Array","baseTimes","String","skipIndexes","isIndex","assignValue","objValue","eq","undefined","test","isPrototype","Ctor","constructor","other","isLength","tag","isObject","isFunction","type","assigner","assign","source","props","customizer","newValue","copyObject","baseKeys","start","arguments","array","otherArgs","this","baseRest","sources","guard","isIterateeCall","useSourceMap","list","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sourceRoot","join","cssWithMappingToString","mediaQuery","dedupe","alreadyImportedModules","id","_i","ChromecastPlayback","Playback","template","chromecastHTML","class","options","super","src","currentMedia","mediaControl","addUpdateListener","onMediaStatusUpdate","settings","noVolume","default","filter","left","right","_closedCaptionsTracks","ccTracks","_ccTrackId","_updateCCTrackID","updateCCTrackID","trackID","render","$el","html","poster","$","css","play","pause","stopTimer","getPlaybackType","LIVE","trigger","Events","PLAYBACK_DVR","stop","seek","time","request","chrome","cast","media","SeekRequest","currentTime","startTimer","Log","warn","getDuration","seekPercentage","percentage","duration","timer","setInterval","updateMediaControl","clearInterval","isPlaying","playerState","liveSeekableRange","VOD","changeTogglePlay","isBuffering","PLAYBACK_BUFFERING","PLAYBACK_BUFFERFULL","prevState","PLAYBACK_PLAY","PLAYBACK_ENDED","PLAYBACK_PAUSE","position","getEstimatedTime","PLAYBACK_TIMEUPDATE","current","total","show","hide","DEVICE_STATE","MIMETYPES","ChromecastPlugin","UICorePlugin","min","VERSION","core","chromecast","getCurrentContainer","activeContainer","getCurrentPlayback","activePlayback","bootTryDelay","bootMaxTryCount","bootTryCount","textTracks","messageNamespace","customNamespace","isBootable","appId","deviceState","embedScript","disable","bindEvents","listenTo","MEDIACONTROL_RENDERED","CORE_ACTIVE_CONTAINER_CHANGED","containerChanged","MEDIACONTROL_CONTAINERCHANGED","container","CONTAINER_TIMEUPDATE","containerTimeUpdate","CONTAINER_PLAY","containerPlay","CONTAINER_ENDED","sessionStopped","Browser","isChrome","version","isSecure","isLocalhost","location","hostname","protocol","enable","isAvailable","bootstrapCastApi","script","document","createElement","setAttribute","onload","body","appendChild","initializeCastApi","loaded","errorInfo","setTimeout","console","enabledTextTrackIDs","session","sendMessage","CONTAINER_SUBTITLE_CHANGED","autoJoinPolicy","AutoJoinPolicy","ORIGIN_SCOPED","sessionRequest","SessionRequest","apiConfig","ApiConfig","sessionListener","e","receiverListener","initialize","debug","sessionId","newSession","sessionUpdateListener","status","SessionStatus","STOPPED","onSessionTextTracks","tracks","trackId","track","playbackProxy","PLAYBACK_SUBTITLE_AVAILABLE","closedCaptionsTrackId","ReceiverAvailability","AVAILABLE","launchSuccess","renderConnected","connectAnimInterval","resetKeepVisible","launchError","renderDisconnected","loadMediaSuccess","how","mediaSession","originalPlayback","playback","addClass","remove","append","stopListening","settingsUpdate","loadMediaError","addMessageListener","_","tracksJSON","parse","removeClass","load","once","CONTAINER_READY","loadMedia","mediaInfo","createMediaInfo","LoadRequest","autoplay","mimeType","mimeTypeFor","MediaInfo","contentType","customData","metadata","createMediaMetadata","createCastMediaMetadata","title","subtitle","releaseDate","TvShow","episode","originalAirdate","season","seriesTitle","Movie","studio","images","url","Image","MovieMediaMetadata","TvShowMediaMetadata","GenericMediaMetadata","click","getCurrentTime","requestSession","connectingIcons","connecting1IconSvg","connecting2IconSvg","connecting3IconSvg","setKeepVisible","timeProgress","connectedIconSvg","castIconSvg","find","$style","Styler","getStyleFor","chromecastStyle","baseUrl","srcUrl","extension","split","match","indexOf"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ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AChE,OAAInK,EAAUiK,GACLjK,EAAUiK,GACRD,EAAOI,QAAQ,SAAW,EAC5B,mCADF,O","file":"clappr-chromecast-plugin.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@clappr/player\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@clappr/player\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ChromecastPlugin\"] = factory(require(\"@clappr/player\"));\n\telse\n\t\troot[\"ChromecastPlugin\"] = factory(root[\"Clappr\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = \"
\\n
\\n\";","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".chromecast-playback{height:100%;width:100%}.chromecast-playback .chromecast-playback-background,.chromecast-playback .chromecast-playback-overlay{position:absolute;height:100%;width:100%}.chromecast-playback .chromecast-playback-background{background-size:contain}.chromecast-playback .chromecast-playback-overlay{background-color:#000;opacity:0.4}.chromecast-button{background:transparent;border:0;width:32px;height:32px;font-size:22px;line-height:32px;letter-spacing:0;margin:0 6px;color:#fff;opacity:0.5;vertical-align:middle;text-align:left;cursor:pointer;-webkit-font-smoothing:antialiased;transition:all 0.1s ease}.chromecast-button:hover{opacity:0.75;text-shadow:rgba(255,255,255,0.8) 0 0 5px}.chromecast-button:focus{outline:none}.chromecast-button svg{width:24px;height:24px}.chromecast-button svg #cast,.chromecast-button svg #cast-on,.chromecast-button svg #Path{fill:#fff;stroke:#fff;stroke-width:0.5px}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import {Events, Log, Playback, template} from '@clappr/player'\nimport chromecastHTML from './public/chromecast.html'\n\nconst TICK_INTERVAL = 100\n\nexport default class ChromecastPlayback extends Playback {\n\n get name() { return 'chromecast_playback' }\n get template() { return template(chromecastHTML) }\n get attributes() { return { class: 'chromecast-playback' } }\n\n get isReady() { return true }\n\n constructor(options) {\n super(options)\n this.src = options.src\n this.currentMedia = options.currentMedia\n this.mediaControl = options.mediaControl\n this.currentMedia.addUpdateListener(() => this.onMediaStatusUpdate())\n this.settings = options.settings\n let noVolume = (name) => name != 'volume'\n this.settings.default && (this.settings.default = this.settings.default.filter(noVolume))\n this.settings.left && (this.settings.left = this.settings.left.filter(noVolume))\n this.settings.right && (this.settings.right = this.settings.right.filter(noVolume))\n this._closedCaptionsTracks = options.ccTracks || []\n this._ccTrackId = -1\n this._updateCCTrackID = options.updateCCTrackID\n }\n\n get closedCaptionsTracks() {\n return this._closedCaptionsTracks\n }\n\n get closedCaptionsTrackId() {\n return this._ccTrackId\n }\n\n set closedCaptionsTrackId(trackID) {\n this._ccTrackId = trackID\n this._updateCCTrackID(trackID)\n }\n\n render() {\n let template = this.template()\n this.$el.html(template)\n if (this.options.poster) {\n this.$('.chromecast-playback-background').css('background-image', 'url(' + this.options.poster + ')')\n } else {\n this.$('.chromecast-playback-background').css('background-color', '#666')\n }\n }\n\n play() {\n this.currentMedia.play()\n }\n\n pause() {\n this.stopTimer()\n this.currentMedia.pause()\n if (this.getPlaybackType() === Playback.LIVE) {\n this.trigger(Events.PLAYBACK_DVR, true)\n }\n }\n\n stop() {\n this.stopTimer()\n this.currentMedia.pause() // FIXME: properly handle media stop\n }\n\n seek(time) {\n this.stopTimer()\n let request = new chrome.cast.media.SeekRequest()\n request.currentTime = time\n this.currentMedia.seek(request,\n () => this.startTimer(), () => Log.warn('seek failed'))\n if (this.getPlaybackType() === Playback.LIVE) {\n // assume live if time within 30 seconds of end of live stream\n this.trigger(Events.PLAYBACK_DVR, time < this.getDuration() - 30)\n }\n }\n\n seekPercentage(percentage) {\n if (percentage >= 0 && percentage <= 100) {\n let duration = this.getDuration()\n this.seek(percentage * duration / 100)\n }\n }\n\n startTimer() {\n this.timer = setInterval(() => this.updateMediaControl(), TICK_INTERVAL)\n }\n\n stopTimer() {\n clearInterval(this.timer)\n this.timer = null\n }\n\n getDuration() {\n return this.currentMedia.media.duration\n }\n\n isPlaying() {\n return this.currentMedia.playerState === 'PLAYING' || this.currentMedia.playerState === 'BUFFERING'\n }\n\n getPlaybackType() {\n return this.currentMedia.liveSeekableRange ? Playback.LIVE : Playback.VOD\n }\n\n onMediaStatusUpdate() {\n this.mediaControl.changeTogglePlay()\n if (this.isPlaying() && !this.timer) {\n this.startTimer()\n }\n\n if (this.currentMedia.playerState === 'BUFFERING') {\n this.isBuffering = true\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n } else if (this.currentMedia.playerState === 'PLAYING') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n }\n } else if (this.currentMedia.playerState === 'IDLE') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n } else if (this.currentMedia.playerState === 'PAUSED') {\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PAUSE, this.name)\n }\n }\n\n this.prevState = this.currentMedia.playerState\n }\n\n updateMediaControl() {\n let position = this.currentMedia.getEstimatedTime()\n let duration = this.currentMedia.media.duration\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: position, total: duration}, this.name)\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n}\n","import {Browser, Events, Log, Styler, UICorePlugin} from '@clappr/player'\nimport ChromecastPlayback from './chromecast_playback'\nimport chromecastStyle from './public/style.scss'\nimport assign from 'lodash.assign'\nimport castIconSvg from './public/ic_cast_24dp.svg'\nimport connecting1IconSvg from './public/ic_cast0_24dp.svg'\nimport connecting2IconSvg from './public/ic_cast1_24dp.svg'\nimport connecting3IconSvg from './public/ic_cast2_24dp.svg'\nimport connectedIconSvg from './public/ic_cast_connected_24dp.svg'\n\nconst DEVICE_STATE = {\n 'IDLE' : 0,\n 'ACTIVE' : 1,\n 'WARNING' : 2,\n 'ERROR' : 3\n}\n\nconst DEFAULT_CLAPPR_APP_ID = '9DFB77C0'\n\nconst DEFAULT_MESSAGE_NAMESPACE = 'clappr-chromecast-plugin'\n\nconst MIMETYPES = {\n 'mp4': 'video/mp4',\n 'ogg': 'video/ogg',\n '3gpp': 'video/3gpp',\n 'webm': 'video/webm',\n 'mkv': 'video/x-matroska',\n 'm3u8': 'application/x-mpegurl',\n 'mpd': 'application/dash+xml'\n}\nMIMETYPES['ogv'] = MIMETYPES['ogg']\nMIMETYPES['3gp'] = MIMETYPES['3gpp']\n\nexport default class ChromecastPlugin extends UICorePlugin {\n get supportedVersion() {\n return { min: '0.4.0', max: '0.5.0' }\n }\n\n static get Movie() { return 'movie' }\n static get TvShow() { return 'tv_show' }\n static get Generic() { return 'none' }\n\n static get version() { return VERSION }\n get version() { return VERSION }\n\n get name() { return 'chromecast' }\n get tagName() { return 'button' }\n get attributes() {\n return {\n 'class' : 'chromecast-button',\n 'type' : 'button'\n }\n }\n get events() {\n return {\n 'click': 'click'\n }\n }\n get options() { return this.core.options.chromecast || (this.core.options.chromecast = {}) }\n get container() {\n return this.core.getCurrentContainer\n ? this.core.getCurrentContainer()\n : this.core.activeContainer // Clappr 0.3.0 or greater\n }\n get playback() {\n return this.core.getCurrentPlayback\n ? this.core.getCurrentPlayback()\n : this.core.activePlayback // Clappr 0.3.0 or greater\n }\n\n constructor(core) {\n super(core)\n\n this.bootTryDelay = this.options.bootTryDelay || 500 // Default is 500 milliseconds between each attempt\n this.bootMaxTryCount = this.options.bootMaxTryCount || 6 // Default is 6 attempts (3 seconds)\n this.bootTryCount = 0\n this.textTracks = []\n this.messageNamespace = this.options.customNamespace || DEFAULT_MESSAGE_NAMESPACE\n\n if (this.isBootable()) {\n this.appId = this.options.appId || DEFAULT_CLAPPR_APP_ID\n this.deviceState = DEVICE_STATE.IDLE\n this.embedScript()\n } else {\n this.disable()\n }\n }\n\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)\n\n if (Events.CORE_ACTIVE_CONTAINER_CHANGED) {\n // Clappr 0.3.0 or greater\n this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged)\n } else {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n }\n\n if (this.container) {\n this.listenTo(this.container, Events.CONTAINER_TIMEUPDATE, this.containerTimeUpdate)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.containerPlay)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.sessionStopped)\n }\n }\n\n isBootable() {\n // Browser must be Chrome\n if (!Browser.isChrome) {\n return false\n }\n\n // Chrome lesser than or equals to 71\n // does not require secure page\n if (Browser.version <= 71) {\n return true\n }\n\n // Chrome greater than or equals to 72\n // require secure page or localhost\n return this.isSecure() || this.isLocalhost()\n }\n\n isLocalhost() {\n return window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'\n }\n\n isSecure() {\n return window.location.protocol === 'https:'\n }\n\n enable() {\n super.enable()\n this.render()\n this.embedScript()\n }\n\n embedScript() {\n if (!window.chrome || !window.chrome.cast || !window.chrome.cast.isAvailable) {\n let script = document.createElement('script')\n script.setAttribute('type', 'text/javascript')\n script.setAttribute('async', 'async')\n script.setAttribute('src', 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js')\n script.onload = () => this.bootstrapCastApi()\n document.body.appendChild(script)\n } else {\n this.bootstrapCastApi()\n }\n }\n\n bootstrapCastApi() {\n this.bootTryCount++\n\n if (this.bootTryCount > this.bootMaxTryCount) {\n this.bootTryCount = 0\n Log.warn('GCastApi bootstrap timeout')\n this.disable()\n return\n }\n\n // The \"chrome\" property may not be available immediately on some iOS devices\n if (window.chrome) {\n this.bootTryCount = 0\n\n if (window.chrome.cast && window.chrome.cast.isAvailable) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n window['__onGCastApiAvailable'] = (loaded, errorInfo) => {\n if (loaded) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n Log.warn('GCastApi error', errorInfo)\n this.disable()\n }\n }\n }\n } else {\n setTimeout(() => { this.bootstrapCastApi() }, this.bootTryDelay)\n }\n }\n\n updateCCTrackID(trackID) {\n if (trackID !== -1) {\n if (this.textTracks.filter(t => t.id === trackID).length === 0) {\n console.warn(`Failed to enable text track with ID ${trackID}, as it does not exist.`)\n return\n }\n }\n var enabledTextTrackIDs = []\n if (trackID !== -1) {\n enabledTextTrackIDs = [trackID]\n }\n if (this.session) {\n this.session.sendMessage(\n `urn:x-cast:${this.messageNamespace}:active-text-tracks`,\n enabledTextTrackIDs\n )\n }\n let container = this.core.getCurrentContainer()\n if (container) {\n container.trigger(Events.CONTAINER_SUBTITLE_CHANGED, {id: trackID})\n }\n }\n\n initializeCastApi() {\n let autoJoinPolicy = chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED\n let sessionRequest = new chrome.cast.SessionRequest(this.appId)\n let apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n (session) => this.sessionListener(session), (e) => this.receiverListener(e), autoJoinPolicy)\n chrome.cast.initialize(apiConfig, () => Log.debug(this.name, 'init success'), () => Log.warn(this.name, 'init error'))\n }\n\n sessionListener(session) {\n Log.debug(this.name, 'new session id:' + session.sessionId)\n this.newSession(session)\n }\n\n sessionUpdateListener() {\n if (this.session) {\n Log.debug(this.name, this.session.status)\n if (this.session.status === chrome.cast.SessionStatus.STOPPED) {\n this.sessionStopped()\n this.session = null\n }\n }\n }\n\n onSessionTextTracks(tracks) {\n this.textTracks = tracks.map(t => {return {id: t.trackId, name: t.name, track: t}})\n if (this.textTracks.length > 0) {\n if (this.playbackProxy) {\n this.playbackProxy._closedCaptionsTracks = this.textTracks\n }\n this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)\n this.updateCCTrackID(this.core.getCurrentContainer().closedCaptionsTrackId)\n }\n }\n\n receiverListener(e) {\n if ( e === chrome.cast.ReceiverAvailability.AVAILABLE ) {\n Log.debug(this.name, 'receiver found')\n this.show()\n } else {\n Log.debug(this.name, 'receiver list empty')\n this.hide()\n }\n }\n\n launchSuccess(session) {\n this.renderConnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n Log.debug(this.name, 'launch success - session: ' + session.sessionId)\n this.newSession(session)\n }\n\n launchError(e) {\n Log.debug(this.name, 'error on launch', e)\n this.renderDisconnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n this.container.play()\n }\n\n loadMediaSuccess(how, mediaSession) {\n Log.debug(this.name, 'new media session', mediaSession, '(', how , ')')\n\n this.originalPlayback = this.playback\n\n let options = assign({}, this.originalPlayback.options, {\n currentMedia: mediaSession,\n mediaControl: this.core.mediaControl,\n poster: this.options.poster || this.core.options.poster,\n settings: this.originalPlayback.settings,\n ccTracks: this.textTracks,\n updateCCTrackID: (id) => this.updateCCTrackID(id)\n })\n this.src = this.originalPlayback.src\n this.playbackProxy = new ChromecastPlayback(options)\n this.playbackProxy.render()\n this.core.$el.addClass('chromecast-active')\n\n this.mediaSession = mediaSession\n\n this.originalPlayback.$el.remove()\n\n let container = this.container\n container.$el.append(this.playbackProxy.$el)\n container.stopListening()\n container.playback = this.playbackProxy\n container.bindEvents()\n container.settingsUpdate()\n }\n\n loadMediaError(e) {\n Log.warn(this.name, 'media error', e)\n }\n\n newSession(session) {\n this.session = session\n this.deviceState = DEVICE_STATE.ACTIVE\n this.renderConnected()\n\n session.addUpdateListener(() => this.sessionUpdateListener())\n session.addMessageListener(\n `urn:x-cast:${this.messageNamespace}:text-tracks`,\n (_, tracksJSON) => this.onSessionTextTracks(JSON.parse(tracksJSON))\n )\n\n this.containerPlay()\n }\n\n sessionStopped() {\n this.renderDisconnected()\n\n let time = this.currentTime\n\n let playerState = undefined\n if (this.mediaSession) {\n playerState = this.mediaSession.playerState\n this.mediaSession = null\n }\n\n this.core.$el.removeClass('chromecast-active')\n this.core.load(this.src || this.core.options.sources)\n\n let container = this.container\n\n if (this.playbackProxy) {\n if (this.playbackProxy.isPlaying() || playerState === 'PAUSED') {\n container.once(Events.CONTAINER_READY, () => {\n container.play()\n container.playback.seek(100 * time / container.getDuration())\n })\n }\n this.playbackProxy.stop()\n }\n }\n\n loadMedia() {\n this.container.pause()\n let src = this.container.options.src\n Log.debug(this.name, 'loading... ' + src)\n let mediaInfo = this.createMediaInfo(src)\n let request = new chrome.cast.media.LoadRequest(mediaInfo)\n request.autoplay = true\n if (this.currentTime) {\n request.currentTime = this.currentTime\n }\n this.session.loadMedia(request, (mediaSession) => this.loadMediaSuccess('loadMedia', mediaSession), (e) => this.loadMediaError(e))\n }\n\n createMediaInfo(src) {\n let mimeType = ChromecastPlugin.mimeTypeFor(src)\n let mediaInfo = new chrome.cast.media.MediaInfo(src)\n mediaInfo.contentType = this.options.contentType || mimeType\n mediaInfo.customData = this.options.customData\n let metadata = this.createMediaMetadata()\n mediaInfo.metadata = metadata\n return mediaInfo\n }\n\n createMediaMetadata() {\n this.options.media || (this.options.media = {})\n let type = this.options.media.type\n\n let metadata = this.createCastMediaMetadata(type)\n metadata.title = this.options.media.title\n metadata.subtitle = this.options.media.subtitle\n metadata.releaseDate = this.options.media.releaseDate\n\n if (type === ChromecastPlugin.TvShow) {\n metadata.episode = this.options.media.episode\n metadata.originalAirdate = this.options.media.originalAirdate\n metadata.season = this.options.media.season\n metadata.seriesTitle = this.options.media.seriesTitle\n } else if (type === ChromecastPlugin.Movie) {\n metadata.studio = this.options.media.studio\n }\n\n if (this.options.media.images) {\n metadata.images = this.options.media.images.map((url) => new chrome.cast.Image(url))\n }\n if (!metadata.images && this.options.poster) {\n metadata.images = [new chrome.cast.Image(this.options.poster)]\n }\n if (!metadata.images && this.core.options.poster) {\n metadata.images = [new chrome.cast.Image(this.core.options.poster)]\n }\n return metadata\n }\n\n createCastMediaMetadata(type) {\n switch (type) {\n case ChromecastPlugin.Movie: return new chrome.cast.media.MovieMediaMetadata()\n case ChromecastPlugin.TvShow: return new chrome.cast.media.TvShowMediaMetadata()\n default: return new chrome.cast.media.GenericMediaMetadata()\n }\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n\n click() {\n this.currentTime = this.container.getCurrentTime()\n this.container.pause()\n chrome.cast.requestSession((session) => this.launchSuccess(session), (e) => this.launchError(e))\n if (!this.session) {\n let position = 0\n let connectingIcons = [connecting1IconSvg, connecting2IconSvg, connecting3IconSvg]\n clearInterval(this.connectAnimInterval)\n this.connectAnimInterval = setInterval(() => {\n this.$el.html(connectingIcons[position])\n position = (position + 1) % 3\n }, 600)\n this.core.mediaControl.setKeepVisible()\n }\n }\n\n containerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n containerTimeUpdate(timeProgress) {\n this.currentTime = timeProgress.current\n }\n\n containerPlay() {\n if (this.session && (!this.mediaSession || this.mediaSession.playerState === 'IDLE' || this.mediaSession.playerState === 'PAUSED')) {\n Log.debug(this.name, 'load media')\n this.loadMedia()\n }\n }\n\n renderConnected() {\n this.$el.html(connectedIconSvg)\n }\n\n renderDisconnected() {\n this.$el.html(castIconSvg)\n }\n\n render() {\n this.session ? this.renderConnected() : this.renderDisconnected()\n this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').append(this.$el)\n this.$style && this.$style.remove()\n this.$style = Styler.getStyleFor(chromecastStyle, {baseUrl: this.core.options.baseUrl})\n this.core.$el.append(this.$style)\n return this\n }\n\n static mimeTypeFor(srcUrl) {\n let extension = (srcUrl.split('?')[0].match(/.*\\.(.*)$/) || [])[1]\n if (MIMETYPES[extension]) {\n return MIMETYPES[extension]\n } else if (srcUrl.indexOf('.ism') > -1) {\n return 'application/vnd.ms-sstr+xml'\n }\n }\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://ChromecastPlugin/webpack/universalModuleDefinition","webpack://ChromecastPlugin/webpack/bootstrap","webpack://ChromecastPlugin/external {\"amd\":\"@clappr/player\",\"commonjs\":\"@clappr/player\",\"commonjs2\":\"@clappr/player\",\"root\":\"Clappr\"}","webpack://ChromecastPlugin/./src/public/chromecast.html","webpack://ChromecastPlugin/./src/public/style.scss","webpack://ChromecastPlugin/./node_modules/lodash.assign/index.js","webpack://ChromecastPlugin/./src/public/ic_cast_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast0_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast1_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast2_24dp.svg","webpack://ChromecastPlugin/./src/public/ic_cast_connected_24dp.svg","webpack://ChromecastPlugin/./node_modules/css-loader/dist/runtime/api.js","webpack://ChromecastPlugin/./src/chromecast_playback.js","webpack://ChromecastPlugin/./src/chromecast.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","___CSS_LOADER_API_IMPORT___","push","reIsUint","apply","func","thisArg","args","length","transform","objectProto","objectToString","toString","propertyIsEnumerable","nativeKeys","keys","arg","nativeMax","Math","max","nonEnumShadows","arrayLikeKeys","inherited","result","isArray","isObjectLike","isArrayLike","isArrayLikeObject","isArguments","iteratee","index","Array","baseTimes","String","skipIndexes","isIndex","assignValue","objValue","eq","undefined","test","isPrototype","Ctor","constructor","other","isLength","tag","isObject","isFunction","type","assigner","assign","source","props","customizer","newValue","copyObject","baseKeys","start","arguments","array","otherArgs","this","baseRest","sources","guard","isIterateeCall","useSourceMap","list","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sourceRoot","join","cssWithMappingToString","mediaQuery","dedupe","alreadyImportedModules","id","_i","ChromecastPlayback","Playback","template","chromecastHTML","class","options","super","src","currentMedia","mediaControl","addUpdateListener","onMediaStatusUpdate","settings","noVolume","default","filter","left","right","_closedCaptionsTracks","ccTracks","_ccTrackId","_updateCCTrackID","updateCCTrackID","trackID","render","$el","html","poster","$","css","play","pause","stopTimer","getPlaybackType","LIVE","trigger","Events","PLAYBACK_DVR","stop","seek","time","request","chrome","cast","media","SeekRequest","currentTime","startTimer","Log","warn","getDuration","seekPercentage","percentage","duration","timer","setInterval","updateMediaControl","clearInterval","isPlaying","playerState","liveSeekableRange","VOD","changeTogglePlay","isBuffering","PLAYBACK_BUFFERING","PLAYBACK_BUFFERFULL","prevState","PLAYBACK_PLAY","PLAYBACK_ENDED","PLAYBACK_PAUSE","position","getEstimatedTime","PLAYBACK_TIMEUPDATE","current","total","show","hide","DEVICE_STATE","MIMETYPES","ChromecastPlugin","UICorePlugin","min","VERSION","core","chromecast","getCurrentContainer","activeContainer","getCurrentPlayback","activePlayback","bootTryDelay","bootMaxTryCount","bootTryCount","textTracks","messageNamespace","customNamespace","isBootable","appId","deviceState","embedScript","disable","bindEvents","listenTo","MEDIACONTROL_RENDERED","CORE_ACTIVE_CONTAINER_CHANGED","containerChanged","MEDIACONTROL_CONTAINERCHANGED","container","CONTAINER_TIMEUPDATE","containerTimeUpdate","CONTAINER_PLAY","containerPlay","CONTAINER_ENDED","sessionStopped","Browser","isChrome","version","isSecure","isLocalhost","location","hostname","protocol","enable","isAvailable","bootstrapCastApi","script","document","createElement","setAttribute","onload","body","appendChild","initializeCastApi","loaded","errorInfo","setTimeout","console","enabledTextTrackIDs","session","sendMessage","CONTAINER_SUBTITLE_CHANGED","autoJoinPolicy","AutoJoinPolicy","ORIGIN_SCOPED","sessionRequest","SessionRequest","apiConfig","ApiConfig","sessionListener","e","receiverListener","initialize","debug","sessionId","newSession","sessionUpdateListener","status","SessionStatus","STOPPED","onSessionTextTracks","tracks","trackId","track","playbackProxy","PLAYBACK_SUBTITLE_AVAILABLE","closedCaptionsTrackId","ReceiverAvailability","AVAILABLE","launchSuccess","renderConnected","connectAnimInterval","resetKeepVisible","launchError","renderDisconnected","loadMediaSuccess","how","mediaSession","originalPlayback","playback","addClass","remove","append","stopListening","settingsUpdate","loadMediaError","addMessageListener","_","tracksJSON","parse","removeClass","load","once","CONTAINER_READY","loadMedia","mediaInfo","createMediaInfo","LoadRequest","autoplay","mimeType","mimeTypeFor","MediaInfo","contentType","customData","metadata","createMediaMetadata","createCastMediaMetadata","title","subtitle","releaseDate","TvShow","episode","originalAirdate","season","seriesTitle","Movie","studio","images","url","Image","MovieMediaMetadata","TvShowMediaMetadata","GenericMediaMetadata","click","getCurrentTime","requestSession","connectingIcons","connecting1IconSvg","connecting2IconSvg","connecting3IconSvg","setKeepVisible","timeProgress","connectedIconSvg","castIconSvg","find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,QAAQyO,UAC9E5Q,KAAKiH,KAAK1D,IAAI2J,OAAOlN,KAAKwQ,QACnBxQ,KAGS,mBAAC6Q,GACjB,IAAIC,GAAaD,EAAOE,MAAM,KAAK,GAAGC,MAAM,cAAgB,IAAI,GAChE,OAAIpK,EAAUkK,GACLlK,EAAUkK,GACRD,EAAOI,QAAQ,SAAW,EAC5B,mCADF,O","file":"clappr-chromecast-plugin.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@clappr/player\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@clappr/player\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ChromecastPlugin\"] = factory(require(\"@clappr/player\"));\n\telse\n\t\troot[\"ChromecastPlugin\"] = factory(root[\"Clappr\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = \"
\\n
\\n\";","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".chromecast-playback{height:100%;width:100%}.chromecast-playback .chromecast-playback-background,.chromecast-playback .chromecast-playback-overlay{position:absolute;height:100%;width:100%}.chromecast-playback .chromecast-playback-background{background-size:contain}.chromecast-playback .chromecast-playback-overlay{background-color:#000;opacity:0.4}.chromecast-button{background:transparent;border:0;width:32px;height:32px;font-size:22px;line-height:32px;letter-spacing:0;margin:0 6px;color:#fff;opacity:0.5;vertical-align:middle;text-align:left;cursor:pointer;-webkit-font-smoothing:antialiased;transition:all 0.1s ease}.chromecast-button:hover{opacity:0.75;text-shadow:rgba(255,255,255,0.8) 0 0 5px}.chromecast-button:focus{outline:none}.chromecast-button svg{width:24px;height:24px}.chromecast-button svg #cast,.chromecast-button svg #cast-on,.chromecast-button svg #Path{fill:#fff;stroke:#fff;stroke-width:0.5px}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","module.exports = \"\"","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import {Events, Log, Playback, template} from '@clappr/player'\nimport chromecastHTML from './public/chromecast.html'\n\nconst TICK_INTERVAL = 100\n\nexport default class ChromecastPlayback extends Playback {\n\n get name() { return 'chromecast_playback' }\n get template() { return template(chromecastHTML) }\n get attributes() { return { class: 'chromecast-playback' } }\n\n get isReady() { return true }\n\n constructor(options) {\n super(options)\n this.src = options.src\n this.currentMedia = options.currentMedia\n this.mediaControl = options.mediaControl\n this.currentMedia.addUpdateListener(() => this.onMediaStatusUpdate())\n this.settings = options.settings\n let noVolume = (name) => name != 'volume'\n this.settings.default && (this.settings.default = this.settings.default.filter(noVolume))\n this.settings.left && (this.settings.left = this.settings.left.filter(noVolume))\n this.settings.right && (this.settings.right = this.settings.right.filter(noVolume))\n this._closedCaptionsTracks = options.ccTracks || []\n this._ccTrackId = -1\n this._updateCCTrackID = options.updateCCTrackID\n }\n\n get closedCaptionsTracks() {\n return this._closedCaptionsTracks\n }\n\n get closedCaptionsTrackId() {\n return this._ccTrackId\n }\n\n set closedCaptionsTrackId(trackID) {\n this._ccTrackId = trackID\n this._updateCCTrackID(trackID)\n }\n\n render() {\n let template = this.template()\n this.$el.html(template)\n if (this.options.poster) {\n this.$('.chromecast-playback-background').css('background-image', 'url(' + this.options.poster + ')')\n } else {\n this.$('.chromecast-playback-background').css('background-color', '#666')\n }\n }\n\n play() {\n this.currentMedia.play()\n }\n\n pause() {\n this.stopTimer()\n this.currentMedia.pause()\n if (this.getPlaybackType() === Playback.LIVE) {\n this.trigger(Events.PLAYBACK_DVR, true)\n }\n }\n\n stop() {\n this.stopTimer()\n this.currentMedia.pause() // FIXME: properly handle media stop\n }\n\n seek(time) {\n this.stopTimer()\n let request = new chrome.cast.media.SeekRequest()\n request.currentTime = time\n this.currentMedia.seek(request,\n () => this.startTimer(), () => Log.warn('seek failed'))\n if (this.getPlaybackType() === Playback.LIVE) {\n // assume live if time within 30 seconds of end of live stream\n this.trigger(Events.PLAYBACK_DVR, time < this.getDuration() - 30)\n }\n }\n\n seekPercentage(percentage) {\n if (percentage >= 0 && percentage <= 100) {\n let duration = this.getDuration()\n this.seek(percentage * duration / 100)\n }\n }\n\n startTimer() {\n this.timer = setInterval(() => this.updateMediaControl(), TICK_INTERVAL)\n }\n\n stopTimer() {\n clearInterval(this.timer)\n this.timer = null\n }\n\n getDuration() {\n return this.currentMedia.media.duration\n }\n\n isPlaying() {\n return this.currentMedia.playerState === 'PLAYING' || this.currentMedia.playerState === 'BUFFERING'\n }\n\n getPlaybackType() {\n return this.currentMedia.liveSeekableRange ? Playback.LIVE : Playback.VOD\n }\n\n onMediaStatusUpdate() {\n this.mediaControl.changeTogglePlay()\n if (this.isPlaying() && !this.timer) {\n this.startTimer()\n }\n\n if (this.currentMedia.playerState === 'BUFFERING') {\n this.isBuffering = true\n this.trigger(Events.PLAYBACK_BUFFERING, this.name)\n } else if (this.currentMedia.playerState === 'PLAYING') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PLAY, this.name)\n }\n } else if (this.currentMedia.playerState === 'IDLE') {\n if (this.isBuffering) {\n this.isBuffering = false\n this.trigger(Events.PLAYBACK_BUFFERFULL, this.name)\n }\n this.trigger(Events.PLAYBACK_ENDED, this.name)\n } else if (this.currentMedia.playerState === 'PAUSED') {\n if (this.prevState !== this.currentMedia.playerState) {\n this.trigger(Events.PLAYBACK_PAUSE, this.name)\n }\n }\n\n this.prevState = this.currentMedia.playerState\n }\n\n updateMediaControl() {\n let position = this.currentMedia.getEstimatedTime()\n let duration = this.currentMedia.media.duration\n this.trigger(Events.PLAYBACK_TIMEUPDATE, {current: position, total: duration}, this.name)\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n}\n","import {Browser, Events, Log, Styler, UICorePlugin} from '@clappr/player'\nimport ChromecastPlayback from './chromecast_playback'\nimport chromecastStyle from './public/style.scss'\nimport assign from 'lodash.assign'\nimport castIconSvg from './public/ic_cast_24dp.svg'\nimport connecting1IconSvg from './public/ic_cast0_24dp.svg'\nimport connecting2IconSvg from './public/ic_cast1_24dp.svg'\nimport connecting3IconSvg from './public/ic_cast2_24dp.svg'\nimport connectedIconSvg from './public/ic_cast_connected_24dp.svg'\n\nconst DEVICE_STATE = {\n 'IDLE' : 0,\n 'ACTIVE' : 1,\n 'WARNING' : 2,\n 'ERROR' : 3\n}\n\nconst DEFAULT_CLAPPR_APP_ID = '9DFB77C0'\n\nconst DEFAULT_MESSAGE_NAMESPACE = 'clappr-chromecast-plugin'\n\nconst MIMETYPES = {\n 'mp4': 'video/mp4',\n 'ogg': 'video/ogg',\n '3gpp': 'video/3gpp',\n 'webm': 'video/webm',\n 'mkv': 'video/x-matroska',\n 'm3u8': 'application/x-mpegurl',\n 'mpd': 'application/dash+xml'\n}\nMIMETYPES['ogv'] = MIMETYPES['ogg']\nMIMETYPES['3gp'] = MIMETYPES['3gpp']\n\nexport default class ChromecastPlugin extends UICorePlugin {\n get supportedVersion() {\n return { min: '0.4.0', max: '0.5.0' }\n }\n\n static get Movie() { return 'movie' }\n static get TvShow() { return 'tv_show' }\n static get Generic() { return 'none' }\n\n static get version() { return VERSION }\n get version() { return VERSION }\n\n get name() { return 'chromecast' }\n get tagName() { return 'button' }\n get attributes() {\n return {\n 'class' : 'chromecast-button',\n 'type' : 'button'\n }\n }\n get events() {\n return {\n 'click': 'click'\n }\n }\n get options() { return this.core.options.chromecast || (this.core.options.chromecast = {}) }\n get container() {\n return this.core.getCurrentContainer\n ? this.core.getCurrentContainer()\n : this.core.activeContainer // Clappr 0.3.0 or greater\n }\n get playback() {\n return this.core.getCurrentPlayback\n ? this.core.getCurrentPlayback()\n : this.core.activePlayback // Clappr 0.3.0 or greater\n }\n\n constructor(core) {\n super(core)\n\n this.bootTryDelay = this.options.bootTryDelay || 500 // Default is 500 milliseconds between each attempt\n this.bootMaxTryCount = this.options.bootMaxTryCount || 6 // Default is 6 attempts (3 seconds)\n this.bootTryCount = 0\n this.textTracks = []\n this.messageNamespace = this.options.customNamespace || DEFAULT_MESSAGE_NAMESPACE\n\n if (this.isBootable()) {\n this.appId = this.options.appId || DEFAULT_CLAPPR_APP_ID\n this.deviceState = DEVICE_STATE.IDLE\n this.embedScript()\n } else {\n this.disable()\n }\n }\n\n bindEvents() {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)\n\n if (Events.CORE_ACTIVE_CONTAINER_CHANGED) {\n // Clappr 0.3.0 or greater\n this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged)\n } else {\n this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged)\n }\n\n if (this.container) {\n this.listenTo(this.container, Events.CONTAINER_TIMEUPDATE, this.containerTimeUpdate)\n this.listenTo(this.container, Events.CONTAINER_PLAY, this.containerPlay)\n this.listenTo(this.container, Events.CONTAINER_ENDED, this.sessionStopped)\n }\n }\n\n isBootable() {\n // Browser must be Chrome\n if (!Browser.isChrome) {\n return false\n }\n\n // Chrome lesser than or equals to 71\n // does not require secure page\n if (Browser.version <= 71) {\n return true\n }\n\n // Chrome greater than or equals to 72\n // require secure page or localhost\n return this.isSecure() || this.isLocalhost()\n }\n\n isLocalhost() {\n return window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'\n }\n\n isSecure() {\n return window.location.protocol === 'https:'\n }\n\n enable() {\n super.enable()\n this.render()\n this.embedScript()\n }\n\n embedScript() {\n if (!window.chrome || !window.chrome.cast || !window.chrome.cast.isAvailable) {\n let script = document.createElement('script')\n script.setAttribute('type', 'text/javascript')\n script.setAttribute('async', 'async')\n script.setAttribute('src', 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js')\n script.onload = () => this.bootstrapCastApi()\n document.body.appendChild(script)\n } else {\n this.bootstrapCastApi()\n }\n }\n\n bootstrapCastApi() {\n this.bootTryCount++\n\n if (this.bootTryCount > this.bootMaxTryCount) {\n this.bootTryCount = 0\n Log.warn('GCastApi bootstrap timeout')\n this.disable()\n return\n }\n\n // The \"chrome\" property may not be available immediately on some iOS devices\n if (window.chrome) {\n this.bootTryCount = 0\n\n if (window.chrome.cast && window.chrome.cast.isAvailable) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n window['__onGCastApiAvailable'] = (loaded, errorInfo) => {\n if (loaded) {\n this.appId = this.appId || DEFAULT_CLAPPR_APP_ID\n this.initializeCastApi()\n } else {\n Log.warn('GCastApi error', errorInfo)\n this.disable()\n }\n }\n }\n } else {\n setTimeout(() => { this.bootstrapCastApi() }, this.bootTryDelay)\n }\n }\n\n updateCCTrackID(trackID) {\n if (trackID !== -1) {\n if (this.textTracks.filter(t => t.id === trackID).length === 0) {\n console.warn(`Failed to enable text track with ID ${trackID}, as it does not exist.`)\n return\n }\n }\n var enabledTextTrackIDs = []\n if (trackID !== -1) {\n enabledTextTrackIDs = [trackID]\n }\n if (this.session) {\n this.session.sendMessage(\n `urn:x-cast:${this.messageNamespace}:active-text-tracks`,\n enabledTextTrackIDs\n )\n }\n let container = this.core.getCurrentContainer()\n if (container) {\n container.trigger(Events.CONTAINER_SUBTITLE_CHANGED, {id: trackID})\n }\n }\n\n initializeCastApi() {\n let autoJoinPolicy = chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED\n let sessionRequest = new chrome.cast.SessionRequest(this.appId)\n let apiConfig = new chrome.cast.ApiConfig(sessionRequest,\n (session) => this.sessionListener(session), (e) => this.receiverListener(e), autoJoinPolicy)\n chrome.cast.initialize(apiConfig, () => Log.debug(this.name, 'init success'), () => Log.warn(this.name, 'init error'))\n }\n\n sessionListener(session) {\n Log.debug(this.name, 'new session id:' + session.sessionId)\n this.newSession(session)\n }\n\n sessionUpdateListener() {\n if (this.session) {\n Log.debug(this.name, this.session.status)\n if (this.session.status === chrome.cast.SessionStatus.STOPPED) {\n this.sessionStopped()\n this.session = null\n }\n }\n }\n\n onSessionTextTracks(tracks) {\n this.textTracks = tracks.map(t => {return {id: t.trackId, name: t.name, track: t}})\n if (this.textTracks.length > 0) {\n if (this.playbackProxy) {\n this.playbackProxy._closedCaptionsTracks = this.textTracks\n }\n this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)\n this.updateCCTrackID(this.core.getCurrentContainer().closedCaptionsTrackId)\n }\n }\n\n receiverListener(e) {\n if ( e === chrome.cast.ReceiverAvailability.AVAILABLE ) {\n Log.debug(this.name, 'receiver found')\n this.show()\n } else {\n Log.debug(this.name, 'receiver list empty')\n this.hide()\n }\n }\n\n launchSuccess(session) {\n this.renderConnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n Log.debug(this.name, 'launch success - session: ' + session.sessionId)\n this.newSession(session)\n }\n\n launchError(e) {\n Log.debug(this.name, 'error on launch', e)\n this.renderDisconnected()\n clearInterval(this.connectAnimInterval)\n this.core.mediaControl.resetKeepVisible()\n this.container.play()\n }\n\n loadMediaSuccess(how, mediaSession) {\n Log.debug(this.name, 'new media session', mediaSession, '(', how , ')')\n\n this.originalPlayback = this.playback\n\n let options = assign({}, this.originalPlayback.options, {\n currentMedia: mediaSession,\n mediaControl: this.core.mediaControl,\n poster: this.options.poster || this.core.options.poster,\n settings: this.originalPlayback.settings,\n ccTracks: this.textTracks,\n updateCCTrackID: (id) => this.updateCCTrackID(id)\n })\n this.src = this.originalPlayback.src\n this.playbackProxy = new ChromecastPlayback(options)\n this.playbackProxy.render()\n this.core.$el.addClass('chromecast-active')\n\n this.mediaSession = mediaSession\n\n this.originalPlayback.$el.remove()\n\n let container = this.container\n container.$el.append(this.playbackProxy.$el)\n container.stopListening()\n container.playback = this.playbackProxy\n container.bindEvents()\n container.settingsUpdate()\n }\n\n loadMediaError(e) {\n Log.warn(this.name, 'media error', e)\n }\n\n newSession(session) {\n this.session = session\n this.deviceState = DEVICE_STATE.ACTIVE\n this.renderConnected()\n\n session.addUpdateListener(() => this.sessionUpdateListener())\n session.addMessageListener(\n `urn:x-cast:${this.messageNamespace}:text-tracks`,\n (_, tracksJSON) => this.onSessionTextTracks(JSON.parse(tracksJSON))\n )\n\n this.containerPlay()\n }\n\n sessionStopped() {\n this.renderDisconnected()\n\n let time = this.currentTime\n\n let playerState = undefined\n if (this.mediaSession) {\n playerState = this.mediaSession.playerState\n this.mediaSession = null\n }\n\n this.core.$el.removeClass('chromecast-active')\n this.core.load(this.src || this.core.options.sources)\n\n let container = this.container\n\n if (this.playbackProxy) {\n if (this.playbackProxy.isPlaying() || playerState === 'PAUSED') {\n container.once(Events.CONTAINER_READY, () => {\n container.play()\n container.playback.seek(100 * time / container.getDuration())\n })\n }\n this.playbackProxy.stop()\n }\n }\n\n loadMedia() {\n this.container.pause()\n let src = this.container.options.src\n Log.debug(this.name, 'loading... ' + src)\n let mediaInfo = this.createMediaInfo(src)\n let request = new chrome.cast.media.LoadRequest(mediaInfo)\n request.autoplay = true\n if (this.currentTime) {\n request.currentTime = this.currentTime\n }\n this.session.loadMedia(request, (mediaSession) => this.loadMediaSuccess('loadMedia', mediaSession), (e) => this.loadMediaError(e))\n }\n\n createMediaInfo(src) {\n let mimeType = ChromecastPlugin.mimeTypeFor(src)\n let mediaInfo = new chrome.cast.media.MediaInfo(src)\n mediaInfo.contentType = this.options.contentType || mimeType\n mediaInfo.customData = this.options.customData\n let metadata = this.createMediaMetadata()\n mediaInfo.metadata = metadata\n return mediaInfo\n }\n\n createMediaMetadata() {\n this.options.media || (this.options.media = {})\n let type = this.options.media.type\n\n let metadata = this.createCastMediaMetadata(type)\n metadata.title = this.options.media.title\n metadata.subtitle = this.options.media.subtitle\n metadata.releaseDate = this.options.media.releaseDate\n\n if (type === ChromecastPlugin.TvShow) {\n metadata.episode = this.options.media.episode\n metadata.originalAirdate = this.options.media.originalAirdate\n metadata.season = this.options.media.season\n metadata.seriesTitle = this.options.media.seriesTitle\n } else if (type === ChromecastPlugin.Movie) {\n metadata.studio = this.options.media.studio\n }\n\n if (this.options.media.images) {\n metadata.images = this.options.media.images.map((url) => new chrome.cast.Image(url))\n }\n if (!metadata.images && this.options.poster) {\n metadata.images = [new chrome.cast.Image(this.options.poster)]\n }\n if (!metadata.images && this.core.options.poster) {\n metadata.images = [new chrome.cast.Image(this.core.options.poster)]\n }\n return metadata\n }\n\n createCastMediaMetadata(type) {\n switch (type) {\n case ChromecastPlugin.Movie: return new chrome.cast.media.MovieMediaMetadata()\n case ChromecastPlugin.TvShow: return new chrome.cast.media.TvShowMediaMetadata()\n default: return new chrome.cast.media.GenericMediaMetadata()\n }\n }\n\n show() {\n this.$el.show()\n }\n\n hide() {\n this.$el.hide()\n }\n\n click() {\n this.currentTime = this.container.getCurrentTime()\n this.container.pause()\n chrome.cast.requestSession((session) => this.launchSuccess(session), (e) => this.launchError(e))\n if (!this.session) {\n let position = 0\n let connectingIcons = [connecting1IconSvg, connecting2IconSvg, connecting3IconSvg]\n clearInterval(this.connectAnimInterval)\n this.connectAnimInterval = setInterval(() => {\n this.$el.html(connectingIcons[position])\n position = (position + 1) % 3\n }, 600)\n this.core.mediaControl.setKeepVisible()\n }\n }\n\n containerChanged() {\n this.stopListening()\n this.bindEvents()\n }\n\n containerTimeUpdate(timeProgress) {\n this.currentTime = timeProgress.current\n }\n\n containerPlay() {\n if (this.session && (!this.mediaSession || this.mediaSession.playerState === 'IDLE' || this.mediaSession.playerState === 'PAUSED')) {\n Log.debug(this.name, 'load media')\n this.loadMedia()\n }\n }\n\n renderConnected() {\n this.$el.html(connectedIconSvg)\n }\n\n renderDisconnected() {\n this.$el.html(castIconSvg)\n }\n\n render() {\n this.session ? this.renderConnected() : this.renderDisconnected()\n this.core.mediaControl.$el.find('.media-control-right-panel').append(this.el)\n this.$style && this.$style.remove()\n this.$style = Styler.getStyleFor(chromecastStyle, {baseUrl: this.core.options.baseUrl})\n this.core.$el.append(this.$style)\n return this\n }\n\n static mimeTypeFor(srcUrl) {\n let extension = (srcUrl.split('?')[0].match(/.*\\.(.*)$/) || [])[1]\n if (MIMETYPES[extension]) {\n return MIMETYPES[extension]\n } else if (srcUrl.indexOf('.ism') > -1) {\n return 'application/vnd.ms-sstr+xml'\n }\n }\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 36f55ad..dcc5068 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5685,6 +5685,11 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -8075,6 +8080,12 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "simple-html-tokenizer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/simple-html-tokenizer/-/simple-html-tokenizer-0.1.1.tgz", + "integrity": "sha1-BcLuxXn//+FFoDCsJs/qYbmA+r4=", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -9039,6 +9050,17 @@ "has-flag": "^3.0.0" } }, + "svg-inline-loader": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/svg-inline-loader/-/svg-inline-loader-0.8.2.tgz", + "integrity": "sha512-kbrcEh5n5JkypaSC152eGfGcnT4lkR0eSfvefaUJkLqgGjRQJyKDvvEE/CCv5aTSdfXuc+N98w16iAojhShI3g==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "object-assign": "^4.0.1", + "simple-html-tokenizer": "^0.1.1" + } + }, "svg-tags": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", diff --git a/package.json b/package.json index 4bf183e..ab43011 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,13 @@ "sass-loader": "^8.0", "stylelint": "^13.2", "stylelint-config-recommended": "^3.0", + "svg-inline-loader": "^0.8.2", "terser-webpack-plugin": "^2.3", "webpack": "^4.0", "webpack-cli": "^3.3", "webpack-dev-server": "^3.10" + }, + "dependencies": { + "lodash.assign": "^4.2.0" } } diff --git a/src/chromecast.js b/src/chromecast.js index 74e133f..1c2f41c 100644 --- a/src/chromecast.js +++ b/src/chromecast.js @@ -449,7 +449,7 @@ export default class ChromecastPlugin extends UICorePlugin { render() { this.session ? this.renderConnected() : this.renderDisconnected() - this.core.mediaControl.$el.find('.media-control-right-panel[data-media-control]').append(this.$el) + this.core.mediaControl.$el.find('.media-control-right-panel').append(this.el) this.$style && this.$style.remove() this.$style = Styler.getStyleFor(chromecastStyle, {baseUrl: this.core.options.baseUrl}) this.core.$el.append(this.$style) diff --git a/webpack.config.js b/webpack.config.js index 0aa144c..85b502d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,11 +18,11 @@ if (process.env.npm_lifecycle_event === 'dist') { } module.exports = { - entry: path.resolve(__dirname, 'src/chromecast.js'), + entry: path.resolve(__dirname, 'src/chromecast.js'), // eslint-disable-line devtool: 'source-map', optimization: optimization, output: { - path: path.resolve(__dirname, 'lib'), + path: path.resolve(__dirname, 'lib'), // eslint-disable-line filename: outputFile, library: 'ChromecastPlugin', libraryExport: 'default', @@ -36,7 +36,7 @@ module.exports = { loader: 'babel-loader' }, include: [ - path.resolve(__dirname, 'src') + path.resolve(__dirname, 'src') // eslint-disable-line ], }, { @@ -78,7 +78,7 @@ module.exports = { }, devServer: { contentBase: [ - path.resolve(__dirname, 'public'), + path.resolve(__dirname, 'public'), // eslint-disable-line ], // publicPath: '/js/', disableHostCheck: true, // https://github.com/webpack/webpack-dev-server/issues/882