UNPKG

flowplayer-files

Version:

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

2 lines (1 loc) 5.79 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.fas=t())}(this,(function(){"use strict";function e(e,t,r){for(var o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);o.length;){if(null==e)return r;var i=o.shift();if("string"!=typeof i)return r;e=e[i]}return null==e?r:e}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,r){var o,i;o=t,(i=function(e,t,r){if(!(this instanceof i))return new i(e,t,r);if(void 0===t)this.frameRate=29.97;else{if(!("number"==typeof t&&t>0))throw new Error("Number expected as framerate");this.frameRate=t}if(23.976!==this.frameRate&&24!==this.frameRate&&25!==this.frameRate&&29.97!==this.frameRate&&30!==this.frameRate&&50!==this.frameRate&&59.94!==this.frameRate&&60!==this.frameRate)throw new Error("Unsupported framerate");if(this.dropFrame="boolean"==typeof r?r:29.97===this.frameRate||59.94===this.frameRate,"number"==typeof e)this.frameCount=Math.round(e),this._frameCountToTimeCode();else if("string"==typeof e){var o=e.match("^([012]\\d):(\\d\\d):(\\d\\d)(:|;|\\.)(\\d\\d)$");if(!o)throw new Error("Timecode string expected as HH:MM:SS:FF or HH:MM:SS;FF");this.hours=parseInt(o[1]),this.minutes=parseInt(o[2]),this.seconds=parseInt(o[3]),"boolean"!=typeof r&&(this.dropFrame=":"!==o[4]),this.frames=parseInt(o[5]),this._timeCodeToFrameCount()}else if("object"==typeof e&&e instanceof Date){var n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),s=60*n.getTimezoneOffset()*1e3,a=60*e.getTimezoneOffset()*1e3;this.frameCount=Math.round((e-n+(s-a))*this.frameRate/1e3),this._frameCountToTimeCode()}else if("object"==typeof e&&e.hours>=0)this.hours=e.hours,this.minutes=e.minutes,this.seconds=e.seconds,this.frames=e.frames,this._timeCodeToFrameCount();else{if(void 0!==e)throw new Error("Timecode() constructor expects a number, timecode string, or Date()");this.frameCount=0}return this._validate(e),this}).prototype._validate=function(e){if(this.dropFrame&&29.97!==this.frameRate&&59.94!==this.frameRate)throw new Error("Drop frame is only supported for 29.97 and 59.94 fps");if(this.hours>23||this.minutes>59||this.seconds>59||this.frames>=this.frameRate||this.dropFrame&&0===this.seconds&&this.minutes%10&&this.frames<this.frameRate/29.97*2)throw new Error("Invalid timecode"+JSON.stringify(e))},i.prototype._frameCountToTimeCode=function(){var e=this.frameCount;if(this.dropFrame){var t=29.97===this.frameRate?2:4,r=Math.floor(this.frameCount/(17982*t/2)),o=this.frameCount%(17982*t/2);o<t&&(o+=t),e+=9*t*r+t*Math.floor((o-t)/(1798*t/2))}var i=Math.round(this.frameRate);this.frames=e%i,this.seconds=Math.floor(e/i)%60,this.minutes=Math.floor(e/(60*i))%60,this.hours=Math.floor(e/(3600*i))%24},i.prototype._timeCodeToFrameCount=function(){if(this.frameCount=(3600*this.hours+60*this.minutes+this.seconds)*Math.round(this.frameRate)+this.frames,this.dropFrame){var e=60*this.hours+this.minutes,t=29.97===this.frameRate?2:4;this.frameCount-=t*(e-Math.floor(e/10))}},i.prototype.toString=function(e){var t=this.frames,r="";if("string"==typeof e){if("field"!==e)throw new Error("Unsupported string format");this.frameRate<=30?r=".0":(t=Math.floor(t/2),r=".".concat((this.frameCount%2).toString()))}return"".concat(this.hours<10?"0":"",this.hours.toString(),":",this.minutes<10?"0":"",this.minutes.toString(),":",this.seconds<10?"0":"",this.seconds.toString(),this.dropFrame?";":":",t<10?"0":"",t.toString(),r)},i.prototype.valueOf=function(){return this.frameCount},i.prototype.add=function(e,t,r){if("number"!=typeof e)return e instanceof i||(e=new i(e,this.frameRate,this.dropFrame)),this.add(e.frameCount,t,r);var o=this.frameCount+Math.round(e)*(t?-1:1);if(o<0&&r>0&&(o=Math.round(86400*this.frameRate)+o)/this.frameRate/3600>r)throw new Error("Rollover arithmetic exceeds max permitted");if(o<0)throw new Error("Negative timecodes not supported");return this.frameCount=o,this.frameCount=this.frameCount%Math.round(86400*this.frameRate),this._frameCountToTimeCode(),this},i.prototype.subtract=function(e,t){return this.add(e,!0,t)},i.prototype.toDate=function(){var e=this.frameCount/this.frameRate*1e3,t=new Date;t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);var r=new Date(t.valueOf()+e),o=60*t.getTimezoneOffset()*1e3,i=60*r.getTimezoneOffset()*1e3;return new Date(t.valueOf()+e+(i-o))},"string"!=typeof r.nodeName?e.exports=i:o&&(o.Timecode=i)}));function o(e,t,o){o=o||0;var i=new Date;return i.setHours(0),i.setMinutes(0),i.setSeconds(0),e=Math.max(parseFloat(e.toFixed(3))+.001+1*o/t,0),i.setMilliseconds(1e3*e),new r(i,t).toString()}var i=30,n=0;function s(t,s){var a=this,f=s.frame_rate||i,u=s.frame_offset||n;t.on("loadstart",(function(){t.hls&&t.setOpts({fas:{frame_offset:-1}})})),t.on("config",(function(t){f=e(t,"data.fas.frame_rate",f),u=e(t,"data.fas.frame_offset",u)})),a.current_frame=function(){return function(e,t){return new r(e,t).frameCount}(o(t.currentTime,f,u),f)},a.seek_to=function(e){t.currentTime=function(e,t,o){o=o||0;var i=1*(new r(e,t).frameCount+o)/t;return Number((i+.001).toFixed(5))}(e,f,-u)},a.current_timecode=function(){return o(t.currentTime,f,u)},a.jump=function(e){a.seek_to(a.current_frame()+e)}}function a(e,t,r){r.reaper.put("fas",new s(r,e.fas||{}))}return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});var r=e.flowplayer;"function"==typeof r?r(t):(Array.isArray(r.extensions)||(r.extensions=[]),~r.extensions.indexOf(t)||r.extensions.push(t))}(window,a),a}));