-
Notifications
You must be signed in to change notification settings - Fork 1
/
dash-dashjs-playback.js
1 lines (1 loc) · 2.53 KB
/
dash-dashjs-playback.js
1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("Clappr")):"function"==typeof define&&define.amd?define(["Clappr"],e):"object"==typeof exports?exports.DashDashjsPlayback=e(require("Clappr")):t.DashDashjsPlayback=e(t.Clappr)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(t,e,r){for(var n=!0;n;){var o=t,a=e,i=r;n=!1,null===o&&(o=Function.prototype);var u=Object.getOwnPropertyDescriptor(o,a);if(void 0!==u){if("value"in u)return u.value;var s=u.get;return void 0===s?void 0:s.call(i)}var c=Object.getPrototypeOf(o);if(null===c)return void 0;t=c,e=a,r=i,n=!0,u=c=void 0}},u=r(1),s=function(t){function e(t){n(this,e),i(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this._embedScript(this._setup)}return o(e,t),a(e,[{key:"name",value:function(){return"dash_dashjs_playback"}}]),a(e,[{key:"_embedScript",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?this._onError:arguments[1];if(window.Dash)t();else{var r=document.createElement("script");r.setAttribute("type","text/javascript"),r.setAttribute("async","async"),r.setAttribute("src","https://sslplayers-vh.akamaihd.net/dash.js/latest/dash.min.js"),r.onload=function(){return t()},r.onerror=function(t){return e(t)},document.body.appendChild(r)}}},{key:"_onError",value:function(t){u.Log.error(t)}},{key:"_setup",value:function(){var t=new MediaPlayer(new Dash.di.DashContext);t.startup(),t.attachView(this.el),t.attachSource(this.options.src)}}]),e}(u.HTML5Video);e["default"]=s,ClapprDashDashjs.canPlay=function(t,e){var r=t.split("?")[0].match(/.*\.(.*)$/)||[];return"mpd"===r[1]},t.exports=e["default"]},function(e,r){e.exports=t}])});