UNPKG

flowplayer-files

Version:

Flowplayer js and css files for v2.5.9 after the reboot of flowplayer

2 lines (1 loc) 3.73 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e=e||self).flowplayer=e.flowplayer||{},e.flowplayer.drm=t())}(this,(function(){"use strict";function e(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];for(var i in t)e[i]=t[i];return e}function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.slice(1).reduce((function(t,n){return e(t,n)}),t[0]||{})}function n(e,t,n){for(var r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);r.length;){if(null==e)return n;var i=r.shift();if("string"!=typeof i)return n;e=e[i]}return null==e?n:e}var r="com.widevine.alpha",i="com.microsoft.playready",a="org.w3.clearkey",s="com.apple.fps.1_0";function o(e){var t={};return Object.keys(e).forEach((function(n){var i;i=n,[r].filter((function(e){return e===i})).length&&function(e,t,n){if(e===r){n.widevineLicenseUrl=t[e].license_server,n.emeEnabled=!0;var i=t[e].http_headers;i&&(n.licenseXhrSetup=function(e){Object.keys(i).forEach((function(t){e.setRequestHeader(t,i[t])}))})}}(n,e,t)})),t}function f(e){var t={};return Object.keys(e).forEach((function(n){var s;s=n,[r,i,a].filter((function(e){return e===s})).length&&(t[n]=function(e,t){var n={serverURL:t[e].license_server};return t[e].http_headers&&(n.httpRequestHeaders=t[e].http_headers),n}(n,e))})),t}function u(e,t,n){var r,i,a;t[s]&&(e.src&&0===e.src.indexOf("blob:")||(r=t[s].certificate,i=function(r){e.webkitSetMediaKeys(new WebKitMediaKeys("com.apple.fps.1_0"));var i=n.initData,a=function(e){var t,n=(t=new Uint16Array(e.buffer),String.fromCharCode.apply(null,t));return n.substring(n.indexOf("skd:")).split(";")[1]}(i);i=function(e,t,n){"string"==typeof t&&(t=function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return n}(t));var r=0,i=new ArrayBuffer(e.byteLength+4+t.byteLength+4+n.byteLength),a=new DataView(i);new Uint8Array(i,r,e.byteLength).set(e),r+=e.byteLength,a.setUint32(r,t.byteLength,!0),r+=4;var s=new Uint16Array(i,r,t.length);return s.set(t),r+=s.byteLength,a.setUint32(r,n.byteLength,!0),r+=4,new Uint8Array(i,r,n.byteLength).set(n),new Uint8Array(i,0,i.byteLength)}(i,a,r);var o=e.webkitKeys.createSession("application/x-mpegurl",i);o.addEventListener("webkitkeyerror",console.debug.bind(console,"webkitkeyerror")),o.addEventListener("webkitkeymessage",(function(e){var n,r,i,f;n=t[s].license_server,r={message:e.message,assetId:a},i=function(e){o.update(e)},(f=new XMLHttpRequest).responseType="arraybuffer",f.addEventListener("load",(function(){f.status>=400||i(new Uint8Array(f.response))}),!1),f.open("POST",n+r.assetId,!0),f.setRequestHeader("Content-type","application/octet-stream"),f.send(r.message)}))},(a=new XMLHttpRequest).responseType="arraybuffer",a.addEventListener("load",(function(){i(new Uint8Array(a.response))}),!1),a.open("GET",r,!0),a.send()))}function c(e,r,i){i.on("config",(function(t){e=t.data})),i.on("src",(function(r){if(r.data.drm){var a=n(e,"hls",{}),s=r.data.drm?o(r.data.drm):{};i.setOpts({hls:t(a,s)}),i.on("webkitneedkey",u.bind(null,i,r.data.drm||{}));var c=n(e,"dash",{}),d=r.data.drm?f(r.data.drm):{};i.setOpts({dash:t(c,{drm:d})})}}))}return t(c,Object.freeze({__proto__:null,WIDEVINE:r,PLAYREADY:i,CLEARKEY:a,FAIRPLAY:s,LICENSE_SERVER:"license_server",KEY:"key",KEY_ID:"kid",HTTP_HEADERS:"http_headers",CERTIFICATE:"certificate"})),function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});var n=e.flowplayer;"function"==typeof n?n(t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t))}(window,c),c}));