Easy Video Player - Version 1.1.8

Version Description

  • Updated the player to version 7.2.7.
Download this release

Release Info

Developer naa986
Plugin Icon 128x128 Easy Video Player
Version 1.1.8
Comparing to
See all releases

Code changes from version 1.1.7 to 1.1.8

easy-video-player.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Easy Video Player
4
- Version: 1.1.7
5
  Plugin URI: https://noorsplugin.com/wordpress-video-plugin/
6
  Author: naa986
7
  Author URI: https://noorsplugin.com/
@@ -17,8 +17,8 @@ if (!class_exists('EASY_VIDEO_PLAYER')) {
17
 
18
  class EASY_VIDEO_PLAYER {
19
 
20
- var $plugin_version = '1.1.7';
21
- var $flowplayer_version = '7.2.1';
22
 
23
  function __construct() {
24
  define('EASY_VIDEO_PLAYER_VERSION', $this->plugin_version);
1
  <?php
2
  /*
3
  Plugin Name: Easy Video Player
4
+ Version: 1.1.8
5
  Plugin URI: https://noorsplugin.com/wordpress-video-plugin/
6
  Author: naa986
7
  Author URI: https://noorsplugin.com/
17
 
18
  class EASY_VIDEO_PLAYER {
19
 
20
+ var $plugin_version = '1.1.8';
21
+ var $flowplayer_version = '7.2.7';
22
 
23
  function __construct() {
24
  define('EASY_VIDEO_PLAYER_VERSION', $this->plugin_version);
index.html ADDED
File without changes
languages/index.html ADDED
File without changes
lib/flowplayer.js CHANGED
@@ -1,11 +1,11 @@
1
  /*!
2
 
3
- Flowplayer v7.2.1 (Thursday, 19. October 2017 01:23PM) | flowplayer.com/license
4
 
5
  */
6
  /*! (C) WebReflection Mit Style License */
7
  (function(e){function g(e,t,n,r){for(var i,s=n.slice(),o=w(t,e),u=0,a=s.length;u<a;u++){handler=s[u],typeof handler=="object"&&typeof handler.handleEvent=="function"?handler.handleEvent(o):handler.call(e,o);if(o.stoppedImmediatePropagation)break}return i=!o.stoppedPropagation,r&&i&&e.parentNode?e.parentNode.dispatchEvent(o):!o.defaultPrevented}function y(e,t){return{configurable:!0,get:e,set:t}}function b(e,t,n){var r=f(t||e,n);u(e,"textContent",y(function(){return r.get.call(this)},function(e){r.set.call(this,e)}))}function w(e,t){return e.currentTarget=t,e.eventPhase=e.target===e.currentTarget?2:3,e}function E(e,t){var n=e.length;while(n--&&e[n]!==t);return n}function S(){if(this.tagName==="BR")return"\n";var e=this.firstChild,t=[];while(e)e.nodeType!==8&&e.nodeType!==7&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function x(e){return e.nodeType!==9&&document.documentElement.contains(e)}function T(e){!n&&d.test(document.readyState)&&(n=!n,document.detachEvent(r,T),e=document.createEvent("Event"),e.initEvent(i,!0,!0),document.dispatchEvent(e))}function N(e){var t;while(t=this.lastChild)this.removeChild(t);e!=null&&this.appendChild(document.createTextNode(e))}function C(t,n){return n||(n=e.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(document.createEvent)return;var t=!0,n=!1,r="onreadystatechange",i="DOMContentLoaded",s="__IE8__"+Math.random(),o=e.Object,u=o.defineProperty||function(e,t,n){e[t]=n.value},a=o.defineProperties||function(t,n){for(var r in n)if(l.call(n,r))try{u(t,r,n[r])}catch(i){e.console&&console.log(r+" failed on object:",t,i.message)}},f=o.getOwnPropertyDescriptor,l=o.prototype.hasOwnProperty,c=e.Element.prototype,h=e.Text.prototype,p=/^[a-z]+$/,d=/loaded|complete/,v={},m=document.createElement("div");b(e.HTMLCommentElement.prototype,c,"nodeValue"),b(e.HTMLScriptElement.prototype,null,"text"),b(h,null,"nodeValue"),b(e.HTMLTitleElement.prototype,null,"text"),u(e.HTMLStyleElement.prototype,"textContent",function(e){return y(function(){return e.get.call(this.styleSheet)},function(t){e.set.call(this.styleSheet,t)})}(f(e.CSSStyleSheet.prototype,"cssText"))),a(c,{textContent:{get:S,set:N},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;t<n;t++)if(e[t].nodeType==1)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(e[t].nodeType==1)return e[t]}},previousElementSibling:{get:function(){var e=this.previousSibling;while(e&&e.nodeType!=1)e=e.previousSibling;return e}},nextElementSibling:{get:function(){var e=this.nextSibling;while(e&&e.nodeType!=1)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=t[n].nodeType==1);return e}},addEventListener:{value:function(e,t,n){var r=this,i="on"+e,o=r[s]||u(r,s,{value:{}})[s],a=o[i]||(o[i]={}),f=a.h||(a.h=[]),c;if(!l.call(a,"w")){a.w=function(e){return e[s]||g(r,C(r,e),f,!1)};if(!l.call(v,i))if(p.test(e))try{c=document.createEventObject(),c[s]=!0,r.nodeType!=9&&r.parentNode==null&&m.appendChild(r),r.fireEvent(i,c),v[i]=!0}catch(c){v[i]=!1;while(m.hasChildNodes())m.removeChild(m.firstChild)}else v[i]=!1;(a.n=v[i])&&r.attachEvent(i,a.w)}E(f,t)<0&&f[n?"unshift":"push"](t)}},dispatchEvent:{value:function(e){var t=this,n="on"+e.type,r=t[s],i=r&&r[n],o=!!i,u;return e.target||(e.target=t),o?i.n?t.fireEvent(n,e):g(t,e,i.h,!0):(u=t.parentNode)?u.dispatchEvent(e):!0,!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var r=this,i="on"+e,o=r[s],u=o&&o[i],a=u&&u.h,f=a?E(a,t):-1;-1<f&&a.splice(f,1)}}}),a(h,{addEventListener:{value:c.addEventListener},dispatchEvent:{value:c.dispatchEvent},removeEventListener:{value:c.removeEventListener}}),a(e.XMLHttpRequest.prototype,{addEventListener:{value:function(e,t,n){var r=this,i="on"+e,o=r[s]||u(r,s,{value:{}})[s],a=o[i]||(o[i]={}),f=a.h||(a.h=[]);E(f,t)<0&&(r[i]||(r[i]=function(){var t=document.createEvent("Event");t.initEvent(e,!0,!0),r.dispatchEvent(t)}),f[n?"unshift":"push"](t))}},dispatchEvent:{value:function(e){var t=this,n="on"+e.type,r=t[s],i=r&&r[n],o=!!i;return o&&(i.n?t.fireEvent(n,e):g(t,e,i.h,!0))}},removeEventListener:{value:c.removeEventListener}}),a(e.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),a(e.HTMLDocument.prototype,{textContent:{get:function(){return this.nodeType===11?S.call(this):null},set:function(e){this.nodeType===11&&N.call(this,e)}},addEventListener:{value:function(n,s,o){var u=this;c.addEventListener.call(u,n,s,o),t&&n===i&&!d.test(u.readyState)&&(t=!1,u.attachEvent(r,T),e==top&&function a(e){try{u.documentElement.doScroll("left"),T()}catch(t){setTimeout(a,50)}}())}},dispatchEvent:{value:c.dispatchEvent},removeEventListener:{value:c.removeEventListener},createEvent:{value:function(e){var t;if(e!=="Event")throw new Error("unsupported "+e);return t=document.createEventObject(),t.timeStamp=(new Date).getTime(),t}}}),a(e.Window.prototype,{getComputedStyle:{value:function(){function i(e){this._=e}function s(){}var e=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,t=/^(top|right|bottom|left)$/,n=/\-([a-z])/g,r=function(e,t){return t.toUpperCase()};return i.prototype.getPropertyValue=function(i){var s=this._,o=s.style,u=s.currentStyle,a=s.runtimeStyle,f,l,c;return i=(i==="float"?"style-float":i).replace(n,r),f=u?u[i]:o[i],e.test(f)&&!t.test(i)&&(l=o.left,c=a&&a.left,c&&(a.left=u.left),o.left=i==="fontSize"?"1em":f,f=o.pixelLeft+"px",o.left=l,c&&(a.left=c)),f==null?f:f+""||"auto"},s.prototype.getPropertyValue=function(){return null},function(e,t){return t?new s(e):new i(e)}}()},addEventListener:{value:function(t,n,r){var i=e,o="on"+t,u;i[o]||(i[o]=function(e){return g(i,C(i,e),u,!1)}),u=i[o][s]||(i[o][s]=[]),E(u,n)<0&&u[r?"unshift":"push"](n)}},dispatchEvent:{value:function(t){var n=e["on"+t.type];return n?n.call(e,t)!==!1&&!t.defaultPrevented:!0}},removeEventListener:{value:function(t,n,r){var i="on"+t,u=(e[i]||o)[s],a=u?E(u,n):-1;-1<a&&u.splice(a,1)}}})})(this);
8
- (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.flowplayer = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
9
  'use strict';
10
  var common = module.exports = {},
11
  ClassList = _dereq_('class-list'),
@@ -193,7 +193,12 @@ common.lastChild = function(el) {
193
  common.hasParent = function(el, parentSelector) {
194
  var parent = el.parentElement;
195
  while (parent) {
196
- if (common.matches(parent, parentSelector)) return true;
 
 
 
 
 
197
  parent = parent.parentElement;
198
  }
199
  return false;
@@ -470,6 +475,7 @@ engineImpl = function flashEngine(player, root) {
470
  if ((conf.rtmp || {}).hasOwnProperty(key)) opts[key] = (conf.rtmp || {})[key];
471
  if ((video.rtmp || {}).hasOwnProperty(key)) opts[key] = (video.rtmp || {})[key];
472
  });
 
473
  if (conf.rtmp) opts.rtmp = conf.rtmp.url || conf.rtmp;
474
  if (video.rtmp) opts.rtmp = video.rtmp.url || video.rtmp;
475
  Object.keys(video.flashls || {}).forEach(function(key) {
@@ -479,8 +485,9 @@ engineImpl = function flashEngine(player, root) {
479
 
480
  var hlsQualities = typeof video.hlsQualities !== 'undefined' ? video.hlsQualities : conf.hlsQualities;
481
  if (typeof hlsQualities !== 'undefined') opts.hlsQualities = hlsQualities ? encodeURIComponent(JSON.stringify(hlsQualities)) : hlsQualities;
482
- // bufferTime might be 0
483
  if (conf.bufferTime !== undefined) opts.bufferTime = conf.bufferTime;
 
484
 
485
  if (is_absolute) delete opts.rtmp;
486
 
@@ -514,7 +521,12 @@ engineImpl = function flashEngine(player, root) {
514
  player.video.hlsQualities :
515
  player.conf.hlsQualities;
516
  if (!hlsQualities) return;
517
- api.__quality(quality);
 
 
 
 
 
518
  });
519
 
520
  // throw error if no loading occurs
@@ -728,6 +740,7 @@ function isAbsolute(url) {
728
  var flowplayer = _dereq_('../flowplayer')
729
  , support = flowplayer.support
730
  , common = flowplayer.common
 
731
  , html5factory = _dereq_('./html5-factory');
732
 
733
 
@@ -741,37 +754,91 @@ var engine;
741
 
742
  engine = function(player, root) {
743
 
744
- var hls, Hls = window.Hls
745
  , lastSelectedLevel
746
  , lastSource;
747
 
748
- return html5factory('hlsjs-lite', player, root, canPlay, function(video, api, engineApi) {
749
- hls = engine.hls = new Hls(flowplayer.extend({}, player.conf.hlsjs, video.hlsjs));
 
 
 
 
750
  engine.extensions.forEach(function(ext) {
751
- ext(hls, player, root);
 
 
 
 
 
752
  });
753
  hls.loadSource(video.src);
754
 
755
  // API overriders
756
  engineApi.resume = function() {
757
- if (player.live && !player.dvr) api.currentTime = hls.liveSyncPosition;
758
  api.play();
759
  };
760
 
761
  engineApi.seek = function(seekTo) {
762
  try {
763
- if (player.live && !player.dvr) api.currentTime = Math.min(seekTo, hls.liveSyncPosition);
 
 
 
 
 
764
  else api.currentTime = seekTo;
765
  } catch (e) {
766
  player.debug('Failed to seek to ', seekTo, e);
767
  }
768
  };
769
 
 
 
 
 
 
 
 
 
 
770
  // Quality selection
771
  player.on('quality', function(_ev, _api, q) {
772
  hls.nextLevel = lastSelectedLevel = q;
773
  });
774
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
 
776
  hls.on(Hls.Events.MANIFEST_PARSED, function(_, data) {
777
  var hlsQualities = video.hlsQualities || player.conf.hlsQualities
@@ -811,7 +878,9 @@ engine = function(player, root) {
811
  }]
812
 
813
  if (Array.isArray(hlsQualities)) {
814
- video.qualities = [];
 
 
815
  confQualities = hlsQualities.map(function(q) {
816
  if (typeof q.level !== 'undefined') qualityLabels[q.level] = q.label;
817
  return typeof q.level !== 'undefined' ? q.level : q;
@@ -844,11 +913,48 @@ engine = function(player, root) {
844
  if (lastSource && video.src !== lastSource) api.play();
845
  lastSource = video.src;
846
  });
847
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
848
  };
849
 
850
 
851
  engine.canPlay = function(type, conf) {
 
852
  if (support.browser.safari && !(conf.clip && conf.clip.hlsjs || conf.hlsjs || {}).safari) return false;
853
  return flowplayer.support.video && canPlay(type);
854
  };
@@ -913,12 +1019,14 @@ function html5factory(engineName, player, root, canPlay, ext) {
913
  },
914
 
915
  load: function(video) {
916
- var container = common.find('.fp-player', root)[0];
 
917
 
918
  if (!api) {
919
  api = document.createElement('video');
920
  common.prepend(container, api);
921
  api.autoplay = !!conf.splash;
 
922
  }
923
  common.addClass(api, 'fp-engine');
924
  common.find('track', api).forEach(common.removeNode);
@@ -976,38 +1084,53 @@ function html5factory(engineName, player, root, canPlay, ext) {
976
  api.volume = volumeLevel;
977
  }
978
 
979
- ext(video, api, self);
980
  if (conf.autoplay || conf.splash || video.autoplay) {
981
  player.debug('Autoplay / Splash setup, try to start video');
982
- try {
983
- var p = api.play();
984
- if (p && p.catch) {
985
- p.catch(function(err) {
986
- if (err.name === 'AbortError' && err.code === 20) return;
987
- player.debug('Play errored, trying muted', err);
988
- player.mute(true);
989
- api.play();
990
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
991
  }
992
- } catch(e) {
993
- player.debug('play() error thrown', e);
994
- }
995
  }
996
 
997
- self._listeners = listen(api, common.find('source', api).concat(api), video) || self._listeners;
998
-
999
 
 
1000
  var preloadCheck = function() {
1001
  if (!isInViewport(root)) return;
 
1002
  if (support.preloadMetadata) api.preload = 'metadata';
1003
  else api.load();
1004
  bean.off(document, 'scroll.preloadviewport');
1005
  };
1006
- preloadCheck();
1007
  bean.off(document, 'scroll.preloadviewport');
1008
  bean.on(document, 'scroll.preloadviewport', function() {
1009
  window.requestAnimationFrame(preloadCheck);
1010
  });
 
1011
  },
1012
 
1013
  mute: function(flag) {
@@ -1029,8 +1152,10 @@ function html5factory(engineName, player, root, canPlay, ext) {
1029
  },
1030
 
1031
  seek: function(time) {
 
1032
  try {
1033
  api.currentTime = time;
 
1034
  } catch (ignored) {}
1035
  },
1036
 
@@ -1045,7 +1170,11 @@ function html5factory(engineName, player, root, canPlay, ext) {
1045
  unload: function() {
1046
  bean.off(document, 'scroll.preloadviewport');
1047
  common.find('video.fp-engine', root).forEach(function (videoTag) {
1048
- common.attr(videoTag, 'src', '');
 
 
 
 
1049
  common.removeNode(videoTag);
1050
  });
1051
  timer = clearInterval(timer);
@@ -1060,7 +1189,7 @@ function html5factory(engineName, player, root, canPlay, ext) {
1060
  }
1061
  };
1062
 
1063
- function listen(api, sources, video) {
1064
  // listen only once
1065
  var instanceId = root.getAttribute('data-flowplayer-instance-id');
1066
 
@@ -1093,6 +1222,7 @@ function html5factory(engineName, player, root, canPlay, ext) {
1093
  if (track.kind !== 'metadata') return;
1094
  track.mode = 'hidden';
1095
  track.addEventListener('cuechange', function() {
 
1096
  player.trigger('metadata', [player, track.activeCues[0].value]);
1097
  }, false);
1098
  };
@@ -1123,7 +1253,7 @@ function html5factory(engineName, player, root, canPlay, ext) {
1123
  video = api.listeners[instanceId];
1124
  if (!e.target || !common.hasClass(e.target, 'fp-engine')) return;
1125
 
1126
- if (conf.debug && !/progress/.test(flow)) console.log(type, '->', flow, e);
1127
 
1128
  var triggerEvent = function(f) {
1129
  player.trigger(f || flow, [player, arg]);
@@ -1144,20 +1274,16 @@ function html5factory(engineName, player, root, canPlay, ext) {
1144
  switch (flow) {
1145
 
1146
  case 'ready':
1147
- if (player.ready) return;
1148
- if (!api.duration && !player.live) return;
1149
  arg = extend(video, {
1150
  duration: api.duration < Number.MAX_VALUE ? api.duration : 0,
1151
  width: api.videoWidth,
1152
  height: api.videoHeight,
1153
- url: api.currentSrc,
1154
- src: api.currentSrc
1155
  });
1156
-
1157
- try {
1158
- arg.seekable = /mpegurl/i.test(video ? (video.type || '') : '') && api.duration || api.seekable && api.seekable.end(null) || player.live;
1159
-
1160
- } catch (ignored) {}
1161
 
1162
  if (!player.live && !arg.duration && !support.hlsDuration && type === 'loadeddata') {
1163
  var durationChanged = function() {
@@ -1207,7 +1333,7 @@ function html5factory(engineName, player, root, canPlay, ext) {
1207
  end: api.buffered.end(i)
1208
  });
1209
  }
1210
- if (api.buffered.end(null) === api.duration) triggerEvent('buffered');
1211
  break;
1212
 
1213
  case 'speed':
@@ -1220,6 +1346,10 @@ function html5factory(engineName, player, root, canPlay, ext) {
1220
 
1221
  case 'error':
1222
  try {
 
 
 
 
1223
  arg = (e.srcElement || e.originalTarget).error;
1224
  arg.video = extend(video, {src: api.src, url: api.src});
1225
  } catch (er) {
@@ -1288,7 +1418,10 @@ engine = function(player, root) {
1288
  common.find('source', api).forEach(common.removeNode);
1289
  api.src = video.src;
1290
  api.type = video.type;
 
 
1291
  }
 
1292
  });
1293
  };
1294
 
@@ -1471,6 +1604,7 @@ flowplayer(function(api, root) {
1471
 
1472
  function createUIElements() {
1473
  var btnContainer = common.find('.fp-header', root)[0];
 
1474
  common.find('.fp-chromecast', btnContainer).forEach(common.removeNode);
1475
  common.find('.fp-chromecast-engine', root).forEach(common.removeNode);
1476
  trigger = common.createElement('a', { 'class': 'fp-chromecast fp-icon', title: 'Play on Cast device'})
@@ -1570,15 +1704,12 @@ flowplayer(function(player, root) {
1570
  var segments = {}, lastFiredSegment = -0.125;
1571
 
1572
  var fire = function(cue) {
1573
- var idx = player.cuepoints.indexOf(cue);
1574
- if (!isNaN(cue)) cue = { time: cue };
1575
- cue.index = idx;
1576
- setClass(idx);
1577
  player.trigger('cuepoint', [player, cue]);
1578
  };
1579
 
1580
  player.on("progress", function(e, api, time) {
1581
- if (cuepointsDisabled) return;
1582
  var segment = segmentForCue(time);
1583
  while (lastFiredSegment < segment) {
1584
  lastFiredSegment += 0.125;
@@ -1601,6 +1732,12 @@ flowplayer(function(player, root) {
1601
  var cues = video.cuepoints || player.conf.cuepoints || [];
1602
  player.setCuepoints(cues);
1603
  }).on('finish', function() {
 
 
 
 
 
 
1604
  lastFiredSegment = -0.125;
1605
  });
1606
  if (player.conf.generate_cuepoints) {
@@ -1624,9 +1761,16 @@ flowplayer(function(player, root) {
1624
  };
1625
  player.addCuepoint = function(cue) {
1626
  if (!player.cuepoints) player.cuepoints = [];
 
 
 
 
 
 
1627
  var segment = segmentForCue(cue);
1628
  if (!segments[segment]) segments[segment] = [];
1629
  segments[segment].push(cue);
 
1630
  player.cuepoints.push(cue);
1631
 
1632
  if (player.conf.generate_cuepoints && cue.visible !== false) {
@@ -1637,7 +1781,7 @@ flowplayer(function(player, root) {
1637
  var time = cue.time || cue;
1638
  if (time < 0) time = duration + time;
1639
 
1640
- var el = common.createElement('a', {className: 'fp-cuepoint fp-cuepoint' + (player.cuepoints.length - 1)});
1641
  common.css(el, "left", (time / duration * 100) + "%");
1642
 
1643
  timeline.appendChild(el);
@@ -1651,10 +1795,15 @@ flowplayer(function(player, root) {
1651
  };
1652
 
1653
  player.removeCuepoint = function(cue) {
 
1654
  var idx = player.cuepoints.indexOf(cue),
1655
  segment = segmentForCue(cue);
1656
  if (idx === -1) return;
1657
- player.cuepoints = player.cuepoints.slice(0, idx).concat(player.cuepoints.slice(idx+1));
 
 
 
 
1658
 
1659
  var sIdx = segments[segment].indexOf(cue);
1660
  if (sIdx === -1) return;
@@ -1875,10 +2024,7 @@ var flowplayer = _dereq_('../flowplayer'),
1875
  FS_ENTER = "fullscreen",
1876
  FS_EXIT = "fullscreen-exit",
1877
  FULL_PLAYER,
1878
- FS_SUPPORT = flowplayer.support.fullscreen,
1879
- ua = navigator.userAgent.toLowerCase(),
1880
- IS_SAFARI = /(safari)[ \/]([\w.]+)/.exec(ua) && !/(chrome)[ \/]([\w.]+)/.exec(ua);
1881
-
1882
 
1883
  // esc button
1884
  bean.on(document, "fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr", function(e) {
@@ -1927,6 +2073,7 @@ flowplayer(function(player, root) {
1927
  ['requestFullScreen', 'webkitRequestFullScreen', 'mozRequestFullScreen', 'msRequestFullscreen'].forEach(function(fName) {
1928
  if (typeof wrapper[fName] === 'function') {
1929
  wrapper[fName](Element.ALLOW_KEYBOARD_INPUT);
 
1930
  }
1931
  });
1932
 
@@ -1980,6 +2127,7 @@ flowplayer(function(player, root) {
1980
 
1981
  player.on('shutdown', function() {
1982
  FULL_PLAYER = null;
 
1983
  });
1984
 
1985
  });
@@ -2003,44 +2151,35 @@ bean.on(document, "keydown.fp", function(e) {
2003
 
2004
  if (!el || !conf.keyboard || el.disabled) return;
2005
 
2006
- // help dialog (shift key not truly required)
2007
- if ([63, 187, 191].indexOf(key) != -1) {
2008
- common.toggleClass(focusedRoot, IS_HELP);
2009
- return false;
2010
- }
2011
-
2012
- // close help / unload
2013
- if (key == 27 && common.hasClass(focusedRoot, IS_HELP)) {
2014
- common.toggleClass(focusedRoot, IS_HELP);
2015
- return false;
2016
- }
2017
-
2018
  if (!metaKeyPressed && el.ready) {
2019
 
2020
- e.preventDefault();
2021
-
2022
  // slow motion / fast forward
2023
  if (e.shiftKey) {
2024
  if (key == 39) el.speed(true);
2025
  else if (key == 37) el.speed(false);
2026
- return;
2027
  }
2028
 
2029
  // 1, 2, 3, 4 ..
2030
- if (key < 58 && key > 47) return el.seekTo(key - 48);
2031
-
2032
- switch (key) {
2033
- case 38: case 75: el.volume(el.volumeLevel + 0.15); break; // volume up
2034
- case 40: case 74: el.volume(el.volumeLevel - 0.15); break; // volume down
2035
- case 39: case 76: el.seeking = true; el.seek(true); break; // forward
2036
- case 37: case 72: el.seeking = true; el.seek(false); break; // backward
2037
- case 190: el.seekTo(); break; // to last seek position
2038
- case 32: el.toggle(); break; // spacebar
2039
- case 70: if(conf.fullscreen) el.fullscreen(); break; // toggle fullscreen
2040
- case 77: el.mute(); break; // mute
2041
- case 81: el.unload(); break; // unload/stop
2042
  }
2043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2044
  }
2045
 
2046
  });
@@ -2050,9 +2189,13 @@ flowplayer(function(api, root) {
2050
  // no keyboard configured
2051
  if (!api.conf.keyboard) return;
2052
 
2053
- // hover
2054
- bean.on(root, "mouseenter mouseleave", function(e) {
2055
- focused = !api.disabled && e.type == 'mouseover' ? api : 0;
 
 
 
 
2056
  if (focused) focusedRoot = root;
2057
  });
2058
 
@@ -2093,7 +2236,8 @@ flowplayer(function(api, root) {
2093
  if (common.height(menu) + top > common.height(ui)) top = top - common.height(menu);
2094
  common.css(menu, {
2095
  top: top + 'px',
2096
- left: left + 'px'
 
2097
  });
2098
  };
2099
 
@@ -2223,6 +2367,7 @@ if (support.touch || isIeMobile) {
2223
  bean.on(root, 'touchmove', function() {
2224
  hasMoved = true;
2225
  });
 
2226
  bean.on(root, 'touchend click', function(e) {
2227
  if (hasMoved) { //not intentional, most likely scrolling
2228
  hasMoved = false;
@@ -2230,7 +2375,8 @@ if (support.touch || isIeMobile) {
2230
  }
2231
 
2232
  var video = common.find('video.fp-engine', root)[0];
2233
- if (video && video.muted && player.conf.autoplay) video.muted = false;
 
2234
 
2235
  if (player.playing && !common.hasClass(root, 'is-mouseover')) {
2236
  common.addClass(root, 'is-mouseover');
@@ -2281,7 +2427,7 @@ if (support.touch || isIeMobile) {
2281
  // Android browser gives video.duration == 1 until second 'timeupdate' event
2282
  if (isAndroid || isSilk) player.bind("ready", function() {
2283
  var video = common.find('video.fp-engine', root)[0];
2284
- if (player.conf.splash && video.paused) {
2285
  bean.one(video, 'canplay', function() {
2286
  video.play();
2287
  });
@@ -2534,6 +2680,7 @@ flowplayer(function(player, root) {
2534
  player.conf.playlist.forEach(function(itm, i) {
2535
  common.removeClass(root, 'video' + i);
2536
  });
 
2537
  });
2538
 
2539
  if (player.conf.playlist.length) {
@@ -2727,18 +2874,20 @@ flowplayer.defaults.subtitleParser = parser;
2727
 
2728
  flowplayer(function(p, root) {
2729
  var currentPoint, wrap,
2730
- subtitleControl, subtitleMenu;
2731
 
2732
  if (
2733
  !flowplayer.support.inlineVideo ||
2734
  (!flowplayer.support.fullscreen && p.conf.native_fullscreen)) p.conf.nativesubtitles = true;
2735
 
2736
- var createSubtitleControl = function() {
 
 
2737
  subtitleControl = subtitleControl || common.createElement('strong', { className: 'fp-cc' }, 'CC');
2738
  subtitleMenu = subtitleMenu || common.createElement('div', {className: 'fp-menu fp-subtitle-menu'}, '<strong>Closed Captions</strong>');
2739
  common.find('a', subtitleMenu).forEach(common.removeNode);
2740
  subtitleMenu.appendChild(common.createElement('a', {'data-subtitle-index': -1}, 'No subtitles'));
2741
- (p.video.subtitles || []).forEach(function(st, i) {
2742
  var srcLang = st.srclang || 'en',
2743
  label = st.label || 'Default (' + srcLang + ')';
2744
  var item = common.createElement('a', {'data-subtitle-index': i}, label);
@@ -2746,9 +2895,14 @@ flowplayer(function(p, root) {
2746
  });
2747
  common.find('.fp-ui', root)[0].appendChild(subtitleMenu);
2748
  common.find('.fp-controls', root)[0].appendChild(subtitleControl);
 
2749
  return subtitleControl;
2750
  };
2751
 
 
 
 
 
2752
  bean.on(root, 'click', '.fp-cc', function() {
2753
  if (common.hasClass(subtitleMenu, 'fp-active')) p.hideMenu();
2754
  else p.showMenu(subtitleMenu);
@@ -2757,6 +2911,7 @@ flowplayer(function(p, root) {
2757
  bean.on(root, 'click', '.fp-subtitle-menu [data-subtitle-index]', function(ev) {
2758
  ev.preventDefault();
2759
  var idx = ev.target.getAttribute('data-subtitle-index');
 
2760
  if (idx === '-1') return p.disableSubtitles();
2761
  p.loadSubtitles(idx);
2762
  });
@@ -2765,7 +2920,7 @@ flowplayer(function(p, root) {
2765
  wrap = common.find('.fp-captions', root)[0];
2766
  wrap = wrap || common.appendTo(common.createElement('div', {'class': 'fp-captions'}), common.find('.fp-player', root)[0]);
2767
  Array.prototype.forEach.call(wrap.children, common.removeNode);
2768
- createSubtitleControl();
2769
  };
2770
 
2771
 
@@ -2778,7 +2933,6 @@ flowplayer(function(p, root) {
2778
 
2779
  p.disableSubtitles();
2780
 
2781
- common.toggleClass(subtitleControl, 'fp-hidden', !video.subtitles || !video.subtitles.length);
2782
  if (!video.subtitles || !video.subtitles.length) return;
2783
 
2784
  var defaultSubtitle = video.subtitles.filter(function(one) {
@@ -2787,13 +2941,21 @@ flowplayer(function(p, root) {
2787
  if (defaultSubtitle) player.loadSubtitles(video.subtitles.indexOf(defaultSubtitle));
2788
  });
2789
 
 
 
 
 
 
 
 
 
 
2790
  p.bind("cuepoint", function(e, api, cue) {
2791
  if (cue.subtitle) {
2792
  currentPoint = cue.index;
2793
- common.html(wrap, cue.subtitle.text);
2794
- common.addClass(wrap, 'fp-shown');
2795
  } else if (cue.subtitleEnd) {
2796
- common.removeClass(wrap, 'fp-shown');
2797
  currentPoint = cue.index;
2798
  }
2799
  });
@@ -2864,7 +3026,8 @@ flowplayer(function(p, root) {
2864
  }
2865
  common.xhrGet(url, function(txt) {
2866
  var entries = p.conf.subtitleParser(txt);
2867
- entries.forEach(function(entry) {
 
2868
  var cue = { time: entry.startTime, subtitle: entry, visible: false };
2869
  p.subtitles.push(entry);
2870
  p.addCuepoint(cue);
@@ -2975,7 +3138,7 @@ var flowplayer = _dereq_('../flowplayer'),
2975
  WP_VER = IS_WP ? parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(UA)[1], 10) : 0,
2976
  IE_MOBILE_VER = IS_WP ? parseFloat(/IEMobile\/(\d+\.\d+)/.exec(UA)[1], 10) : 0,
2977
  IOS_VER = IS_IPAD || IS_IPHONE ? parseIOSVersion(UA) : 0,
2978
- ANDROID_VER = IS_ANDROID ? parseFloat(/Android\ (\d\.\d)/.exec(UA)[1], 10) : 0;
2979
 
2980
  var ios = (IS_IPHONE || IS_IPAD || IS_IPAD_CHROME) && {
2981
  iPhone: IS_IPHONE,
@@ -3009,11 +3172,10 @@ var flowplayer = _dereq_('../flowplayer'),
3009
  // pretend lacking firstframe support because so far we treat
3010
  // support.autoplay as synonym of support.firstframe
3011
  firstframe: !IS_SILK && !IS_WP && !IS_ANDROID_FIREFOX && !IS_ANDROID_SAMSUNG && !(IOS_VER && IOS_VER < 10) && !(IS_ANDROID && ANDROID_VER < 4.4),
3012
- mutedAutoplay: (IS_IPHONE || IS_IPAD || IS_IPAD_CHROME) && IOS_VER >=10 || IS_ANDROID && ANDROID_VER > 4.3 && !IS_ANDROID_SAMSUNG,
3013
  inlineVideo: (!IS_IPHONE || IOS_VER >= 10) && (!IS_WP || (WP_VER >= 8.1 && IE_MOBILE_VER >= 11)) && (!IS_ANDROID || ANDROID_VER >= 3),
3014
  hlsDuration: !IS_ANDROID && (!b.safari || IS_IPAD || IS_IPHONE || IS_IPAD_CHROME),
3015
  seekable: !IS_IPAD && !IS_IPAD_CHROME,
3016
- preloadMetadata: !ios && (!b.safari || parseFloat(b.version) > 9.1)
3017
  });
3018
  s.autoplay = s.firstframe;
3019
  if (IS_WP) {
@@ -3567,10 +3729,13 @@ flowplayer(function(api, root) {
3567
  common.addClass(root, "is-poster");
3568
  common.addClass(play, 'fp-visible');
3569
  api.poster = true;
3570
- api.one(conf.autoplay ? "progress beforeseek" : "resume beforeseek", function() {
3571
- common.removeClass(root, "is-poster");
3572
- common.removeClass(play, 'fp-visible');
3573
- api.poster = false;
 
 
 
3574
  });
3575
  }
3576
  api.on('stop', function() { initPoster(); });
@@ -3622,11 +3787,13 @@ flowplayer(function(api, root) {
3622
  bean.off(timeline);
3623
  bean.off(volumeSlider);
3624
  if (resizeHandle) window.cancelAnimationFrame(resizeHandle);
 
 
3625
  });
3626
 
3627
  if (typeof window.requestAnimationFrame === 'function') {
 
3628
  var resize = function() {
3629
- var playerEl = common.find('.fp-player', root)[0] || root;
3630
  common.toggleClass(root, 'is-tiny', playerEl.clientWidth < 400);
3631
  common.toggleClass(root, 'is-small', playerEl.clientWidth < 600 && playerEl.clientWidth >= 400);
3632
  resizeHandle = window.requestAnimationFrame(resize);
@@ -3913,14 +4080,6 @@ window.onbeforeunload = function(ev) {
3913
  if (oldHandler) return oldHandler(ev);
3914
  };
3915
 
3916
- var supportLocalStorage = false;
3917
- try {
3918
- if (typeof window.localStorage == "object") {
3919
- window.localStorage.flowplayerTestStorage = "test";
3920
- supportLocalStorage = true;
3921
- }
3922
- } catch (ignored) {}
3923
-
3924
  var isSafari = /Safari/.exec(navigator.userAgent) && !/Chrome/.exec(navigator.userAgent),
3925
  m = /(\d+\.\d+) Safari/.exec(navigator.userAgent),
3926
  safariVersion = m ? Number(m[1]) : 100;
@@ -3945,7 +4104,7 @@ var flowplayer = module.exports = function(fn, opts, callback) {
3945
 
3946
  extend(flowplayer, {
3947
 
3948
- version: '7.2.1',
3949
 
3950
  engines: [],
3951
 
@@ -3970,7 +4129,7 @@ extend(flowplayer, {
3970
 
3971
  defaults: {
3972
 
3973
- debug: supportLocalStorage ? !!localStorage.flowplayerDebug : false,
3974
 
3975
  // true = forced playback
3976
  disabled: false,
@@ -3991,13 +4150,15 @@ extend(flowplayer, {
3991
 
3992
  hlsQualities: true,
3993
 
 
 
3994
  splash: false,
3995
 
3996
  live: false,
3997
  livePositionOffset: 120,
3998
 
3999
- swf: "//releases.flowplayer.org/7.2.1/flowplayer.swf",
4000
- swfHls: "//releases.flowplayer.org/7.2.1/flowplayerhls.swf",
4001
 
4002
  speeds: [0.25, 0.5, 1, 1.5, 2],
4003
 
@@ -4005,8 +4166,12 @@ extend(flowplayer, {
4005
 
4006
  mouseoutTimeout: 5000,
4007
 
 
 
 
 
4008
  // initial volume level
4009
- volume: !supportLocalStorage ? 1 : localStorage.muted == "true" ? 0 : !isNaN(localStorage.volume) ? localStorage.volume || 1 : 1,
4010
 
4011
  // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#error-codes
4012
  errors: [
@@ -4059,7 +4224,7 @@ if (typeof window.jQuery !== 'undefined') {
4059
  // auto-install (any video tag with parent .flowplayer)
4060
  $(function() {
4061
  if (typeof $.fn.flowplayer == 'function') {
4062
- $('.flowplayer:has(video,script[type="application/json"])').flowplayer();
4063
  }
4064
  });
4065
 
@@ -4109,9 +4274,20 @@ if (typeof window.jQuery !== 'undefined') {
4109
  function initializePlayer(element, opts, callback) {
4110
  if (opts && opts.embed) opts.embed = extend({}, flowplayer.defaults.embed, opts.embed);
4111
 
 
 
 
 
 
 
 
 
 
 
4112
  var root = element,
4113
  conf = extend({}, flowplayer.defaults, flowplayer.conf, opts),
4114
  storage = {},
 
4115
  lastSeekPosition,
4116
  engine,
4117
  urlResolver = new URLResolver();
@@ -4120,9 +4296,13 @@ function initializePlayer(element, opts, callback) {
4120
  common.toggleClass(root, 'no-flex', !flowplayer.support.flex);
4121
  common.toggleClass(root, 'no-svg', !flowplayer.support.svg);
4122
  try {
4123
- storage = supportLocalStorage ? window.localStorage : storage;
4124
  } catch(e) {}
4125
 
 
 
 
 
4126
  if (conf.aspectRatio && typeof conf.aspectRatio === 'string') {
4127
  var parts = conf.aspectRatio.split(/[:\/]/);
4128
  conf.ratio = parts[1] / parts[0];
@@ -4201,7 +4381,7 @@ function initializePlayer(element, opts, callback) {
4201
  });
4202
  }
4203
 
4204
- extend(video, engine.pick(video.sources.filter(function(source) { // Filter out sources explicitely configured for some other engine
4205
  if (!source.engine) return true;
4206
  return source.engine === engine.engineName;
4207
  })));
@@ -4262,7 +4442,7 @@ function initializePlayer(element, opts, callback) {
4262
  */
4263
  seek: function(time, callback) {
4264
  if (typeof time == "boolean") {
4265
- var delta = api.video.duration * 0.1;
4266
  time = api.video.time + (time ? delta : -delta);
4267
  time = Math.min(Math.max(time, 0), api.video.duration - 0.1);
4268
  }
@@ -4299,8 +4479,9 @@ function initializePlayer(element, opts, callback) {
4299
 
4300
  mute: function(flag, skipStore) {
4301
  if (flag === undefined) flag = !api.muted;
 
4302
  if (!skipStore) {
4303
- storage.muted = api.muted = flag;
4304
  storage.volume = !isNaN(storage.volume) ? storage.volume : conf.volume; // make sure storage has volume
4305
  }
4306
  if (typeof engine.mute !== 'undefined') engine.mute(flag);
@@ -4433,7 +4614,7 @@ function initializePlayer(element, opts, callback) {
4433
 
4434
 
4435
  api.on('boot', function() {
4436
- var support = flowplayer.support;
4437
 
4438
  // splash
4439
  if (conf.splash || common.hasClass(root, "is-splash") ||
@@ -4470,6 +4651,8 @@ function initializePlayer(element, opts, callback) {
4470
  // initial callback
4471
  api.one("ready", callback);
4472
 
 
 
4473
 
4474
  }).on("load", function(e, api, video) {
4475
 
@@ -4528,14 +4711,13 @@ function initializePlayer(element, opts, callback) {
4528
  }).on("progress", function(e, api, time) {
4529
  api.video.time = time;
4530
  }).on('buffer', function(e, api, buffered) {
4531
- api.video.buffer = typeof buffered === 'number' ? buffered : buffered[buffered.length - 1].end;
4532
  }).on("speed", function(e, api, val) {
4533
  api.currentSpeed = val;
4534
 
4535
  }).on("volume", function(e, api, level) {
4536
  api.volumeLevel = Math.round(level * 100) / 100;
4537
- if (!api.muted) storage.volume = level;
4538
- else if (level) api.mute(false);
4539
 
4540
 
4541
  }).on("beforeseek seek", function(e) {
@@ -4610,7 +4792,7 @@ _dereq_('./ext/menu');
4610
  _dereq_('./ext/fullscreen');
4611
 
4612
  _dereq_('./ext/mobile');
4613
- flowplayer(function(e,o){function a(e){var o=document.createElement("a");return o.href=e,t.hostname(o.hostname)}var l=function(e,o){var a=e.className.split(" ");-1===a.indexOf(o)&&(e.className+=" "+o)},r=function(e){return"none"!==window.getComputedStyle(e).display},n=e.conf,t=flowplayer.common,p=t.createElement,i=n.swf.indexOf("flowplayer.org")&&n.e&&o.getAttribute("data-origin"),f=i?a(i):t.hostname(),s=(document,n.key);if("file:"==location.protocol&&(f="localhost"),e.load.ed=1,n.hostname=f,n.origin=i||location.href,i&&l(o,"is-embedded"),"string"==typeof s&&(s=s.split(/,\s*/)),s&&"function"==typeof key_check&&key_check(s,f)){if(n.logo){var d=t.find(".fp-player",o)[0],c=n.logo.href||"",h=n.logo.src||n.logo,m=p("a",{className:"fp-logo",href:c});i&&(m.href=m.href||i),n.embed&&n.embed.popup&&(m.target="_blank");var y=p("img",{src:h});m.appendChild(y),(d||o).appendChild(m)}}else{var m=p("a",{href:"https://flowplayer.com/hello/?from=player"});o.appendChild(m);var u=p("div",{className:"fp-context-menu fp-menu"},'<strong>&copy; 2017 Flowplayer</strong><a href="https://flowplayer.com/hello/?from=player">About Flowplayer</a><a href="https://flowplayer.com/license">GPL based license</a>'),g=window.location.href.indexOf("localhost"),d=t.find(".fp-player",o)[0];7!==g&&(d||o).appendChild(u),e.on("pause resume finish unload ready",function(e,a){var l=-1;if(a.video.src)for(var n=[["org","flowplayer","drive"],["org","flowplayer","my"],["org","flowplayer","cdn"],["com","flowplayer","cdn"]],t=0;t<n.length&&(l=a.video.src.indexOf("://"+n[t].reverse().join(".")),-1===l);t++);if(/pause|resume/.test(e.type)&&"flash"!=a.engine.engineName&&4!=l&&5!=l){var p={display:"block",position:"absolute",left:"16px",bottom:"70px",zIndex:99999,width:"100px",height:"20px",backgroundImage:"url("+[".png","logo","/",".net",".cloudfront","d32wqyuo10o653","//"].reverse().join("")+")"};for(var i in p)p.hasOwnProperty(i)&&(m.style[i]=p[i]);a.load.ed=r(m)&&(7===g||u.parentNode==o||u.parentNode==d),a.load.ed||a.pause()}else m.style.display="none"})}});
4614
 
4615
 
4616
  },{"./engine/embed":2,"./engine/flash":3,"./engine/hlsjs":4,"./engine/html5":6,"./ext/airplay":7,"./ext/analytics":8,"./ext/chromecast":9,"./ext/cuepoint":10,"./ext/embed":11,"./ext/facebook":13,"./ext/fullscreen":14,"./ext/keyboard":15,"./ext/menu":16,"./ext/message":17,"./ext/mobile":18,"./ext/playlist":19,"./ext/qsel":20,"./ext/share":22,"./ext/subtitle":23,"./ext/support":25,"./ext/twitter":26,"./ext/ui":27,"./flowplayer":31,"es5-shim":38}],33:[function(_dereq_,module,exports){
@@ -4630,68 +4812,102 @@ for (var i = 0, len = code.length; i < len; ++i) {
4630
  revLookup[code.charCodeAt(i)] = i
4631
  }
4632
 
 
 
4633
  revLookup['-'.charCodeAt(0)] = 62
4634
  revLookup['_'.charCodeAt(0)] = 63
4635
 
4636
- function placeHoldersCount (b64) {
4637
  var len = b64.length
 
4638
  if (len % 4 > 0) {
4639
  throw new Error('Invalid string. Length must be a multiple of 4')
4640
  }
4641
 
4642
- // the number of equal signs (place holders)
4643
- // if there are two placeholders, than the two characters before it
4644
- // represent one byte
4645
- // if there is only one, then the three characters before it represent 2 bytes
4646
- // this is just a cheap hack to not do indexOf twice
4647
- return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
 
 
 
 
4648
  }
4649
 
 
4650
  function byteLength (b64) {
4651
- // base64 is 4/3 + up to two characters of the original data
4652
- return (b64.length * 3 / 4) - placeHoldersCount(b64)
 
 
 
 
 
 
4653
  }
4654
 
4655
  function toByteArray (b64) {
4656
- var i, l, tmp, placeHolders, arr
4657
- var len = b64.length
4658
- placeHolders = placeHoldersCount(b64)
 
4659
 
4660
- arr = new Arr((len * 3 / 4) - placeHolders)
 
 
4661
 
4662
  // if there are placeholders, only get up to the last complete 4 chars
4663
- l = placeHolders > 0 ? len - 4 : len
 
 
4664
 
4665
- var L = 0
 
 
 
 
 
 
 
 
 
4666
 
4667
- for (i = 0; i < l; i += 4) {
4668
- tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
4669
- arr[L++] = (tmp >> 16) & 0xFF
4670
- arr[L++] = (tmp >> 8) & 0xFF
4671
- arr[L++] = tmp & 0xFF
4672
  }
4673
 
4674
- if (placeHolders === 2) {
4675
- tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
4676
- arr[L++] = tmp & 0xFF
4677
- } else if (placeHolders === 1) {
4678
- tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
4679
- arr[L++] = (tmp >> 8) & 0xFF
4680
- arr[L++] = tmp & 0xFF
4681
  }
4682
 
4683
  return arr
4684
  }
4685
 
4686
  function tripletToBase64 (num) {
4687
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
 
 
 
4688
  }
4689
 
4690
  function encodeChunk (uint8, start, end) {
4691
  var tmp
4692
  var output = []
4693
  for (var i = start; i < end; i += 3) {
4694
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
 
 
 
4695
  output.push(tripletToBase64(tmp))
4696
  }
4697
  return output.join('')
@@ -4701,31 +4917,34 @@ function fromByteArray (uint8) {
4701
  var tmp
4702
  var len = uint8.length
4703
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
4704
- var output = ''
4705
  var parts = []
4706
  var maxChunkLength = 16383 // must be multiple of 3
4707
 
4708
  // go through the array every three bytes, we'll deal with trailing stuff later
4709
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
4710
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
 
 
4711
  }
4712
 
4713
  // pad the end with zeros, but make sure to not forget the extra bytes
4714
  if (extraBytes === 1) {
4715
  tmp = uint8[len - 1]
4716
- output += lookup[tmp >> 2]
4717
- output += lookup[(tmp << 4) & 0x3F]
4718
- output += '=='
 
 
4719
  } else if (extraBytes === 2) {
4720
- tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
4721
- output += lookup[tmp >> 10]
4722
- output += lookup[(tmp >> 4) & 0x3F]
4723
- output += lookup[(tmp << 2) & 0x3F]
4724
- output += '='
 
 
4725
  }
4726
 
4727
- parts.push(output)
4728
-
4729
  return parts.join('')
4730
  }
4731
 
@@ -7738,6 +7957,26 @@ module.exports = computedStyle;
7738
  var toStr = call.bind(ObjectPrototype.toString);
7739
  var arraySlice = call.bind(array_slice);
7740
  var arraySliceApply = apply.bind(array_slice);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7741
  var strSlice = call.bind(StringPrototype.slice);
7742
  var strSplit = call.bind(StringPrototype.split);
7743
  var strIndexOf = call.bind(StringPrototype.indexOf);
@@ -8331,10 +8570,14 @@ module.exports = computedStyle;
8331
  var sortIgnoresNonFunctions = (function () {
8332
  try {
8333
  [1, 2].sort(null);
8334
- [1, 2].sort({});
8335
- return true;
8336
- } catch (e) {}
8337
- return false;
 
 
 
 
8338
  }());
8339
  var sortThrowsOnRegex = (function () {
8340
  // this is a problem in Firefox 4, in which `typeof /a/ === 'function'`
@@ -8373,14 +8616,14 @@ module.exports = computedStyle;
8373
  // http://es5.github.com/#x15.2.3.14
8374
 
8375
  // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
8376
- var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString');
8377
  var hasProtoEnumBug = isEnum(function () {}, 'prototype');
8378
  var hasStringEnumBug = !owns('x', '0');
8379
  var equalsConstructorPrototype = function (o) {
8380
  var ctor = o.constructor;
8381
  return ctor && ctor.prototype === o;
8382
  };
8383
- var blacklistedKeys = {
8384
  $window: true,
8385
  $console: true,
8386
  $parent: true,
@@ -8390,7 +8633,11 @@ module.exports = computedStyle;
8390
  $frameElement: true,
8391
  $webkitIndexedDB: true,
8392
  $webkitStorageInfo: true,
8393
- $external: true
 
 
 
 
8394
  };
8395
  var hasAutomationEqualityBug = (function () {
8396
  /* globals window */
@@ -8399,7 +8646,7 @@ module.exports = computedStyle;
8399
  }
8400
  for (var k in window) {
8401
  try {
8402
- if (!blacklistedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
8403
  equalsConstructorPrototype(window[k]);
8404
  }
8405
  } catch (e) {
@@ -8435,12 +8682,12 @@ module.exports = computedStyle;
8435
  return toStr(value) === '[object Arguments]';
8436
  };
8437
  var isLegacyArguments = function isArguments(value) {
8438
- return value !== null &&
8439
- typeof value === 'object' &&
8440
- typeof value.length === 'number' &&
8441
- value.length >= 0 &&
8442
- !isArray(value) &&
8443
- isCallable(value.callee);
8444
  };
8445
  var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
8446
 
@@ -8517,10 +8764,10 @@ module.exports = computedStyle;
8517
  var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
8518
  if (timeZoneOffset < -720) {
8519
  hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
8520
- hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
8521
  } else {
8522
  hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
8523
- hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
8524
  }
8525
 
8526
  var originalGetFullYear = call.bind(Date.prototype.getFullYear);
@@ -8629,13 +8876,13 @@ module.exports = computedStyle;
8629
  var hour = originalGetUTCHours(this);
8630
  var minute = originalGetUTCMinutes(this);
8631
  var second = originalGetUTCSeconds(this);
8632
- return dayName[day] + ', ' +
8633
- (date < 10 ? '0' + date : date) + ' ' +
8634
- monthName[month] + ' ' +
8635
- year + ' ' +
8636
- (hour < 10 ? '0' + hour : hour) + ':' +
8637
- (minute < 10 ? '0' + minute : minute) + ':' +
8638
- (second < 10 ? '0' + second : second) + ' GMT';
8639
  }
8640
  }, hasNegativeMonthYearBug || hasToUTCStringFormatBug);
8641
 
@@ -8649,10 +8896,10 @@ module.exports = computedStyle;
8649
  var date = this.getDate();
8650
  var month = this.getMonth();
8651
  var year = this.getFullYear();
8652
- return dayName[day] + ' ' +
8653
- monthName[month] + ' ' +
8654
- (date < 10 ? '0' + date : date) + ' ' +
8655
- year;
8656
  }
8657
  }, hasNegativeMonthYearBug || hasToDateStringFormatBug);
8658
 
@@ -8672,16 +8919,16 @@ module.exports = computedStyle;
8672
  var timezoneOffset = this.getTimezoneOffset();
8673
  var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
8674
  var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
8675
- return dayName[day] + ' ' +
8676
- monthName[month] + ' ' +
8677
- (date < 10 ? '0' + date : date) + ' ' +
8678
- year + ' ' +
8679
- (hour < 10 ? '0' + hour : hour) + ':' +
8680
- (minute < 10 ? '0' + minute : minute) + ':' +
8681
- (second < 10 ? '0' + second : second) + ' GMT' +
8682
- (timezoneOffset > 0 ? '-' : '+') +
8683
- (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) +
8684
- (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset);
8685
  };
8686
  if (supportsDescriptors) {
8687
  $Object.defineProperty(Date.prototype, 'toString', {
@@ -8701,7 +8948,7 @@ module.exports = computedStyle;
8701
  // this object is not a finite Number a RangeError exception is thrown.
8702
  var negativeDate = -62198755200000;
8703
  var negativeYearString = '-000001';
8704
- var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
8705
  var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
8706
 
8707
  var getTime = call.bind(Date.prototype.getTime);
@@ -8718,13 +8965,19 @@ module.exports = computedStyle;
8718
  var month = originalGetUTCMonth(this);
8719
  // see https://github.com/es-shims/es5-shim/issues/111
8720
  year += Math.floor(month / 12);
8721
- month = (month % 12 + 12) % 12;
8722
 
8723
  // the date time string format is specified in 15.9.1.15.
8724
- var result = [month + 1, originalGetUTCDate(this), originalGetUTCHours(this), originalGetUTCMinutes(this), originalGetUTCSeconds(this)];
 
 
 
 
 
 
8725
  year = (
8726
- (year < 0 ? '-' : (year > 9999 ? '+' : '')) +
8727
- strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
8728
  );
8729
 
8730
  for (var i = 0; i < result.length; ++i) {
@@ -8733,9 +8986,9 @@ module.exports = computedStyle;
8733
  }
8734
  // pad milliseconds to have three digits.
8735
  return (
8736
- year + '-' + arraySlice(result, 0, 2).join('-') +
8737
- 'T' + arraySlice(result, 2).join(':') + '.' +
8738
- strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z'
8739
  );
8740
  }
8741
  }, hasNegativeDateBug || hasSafari51DateBug);
@@ -8746,10 +8999,10 @@ module.exports = computedStyle;
8746
  // JSON.stringify (15.12.3).
8747
  var dateToJSONIsSupported = (function () {
8748
  try {
8749
- return Date.prototype.toJSON &&
8750
- new Date(NaN).toJSON() === null &&
8751
- new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
8752
- Date.prototype.toJSON.call({ // generic
8753
  toISOString: function () { return true; }
8754
  });
8755
  } catch (e) {
@@ -8803,13 +9056,10 @@ module.exports = computedStyle;
8803
  // XXX global assignment won't work in embeddings that use
8804
  // an alternate object for the context.
8805
  /* global Date: true */
8806
- /* eslint-disable no-undef */
8807
  var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
8808
  var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
8809
- /* eslint-disable no-implicit-globals */
8810
  Date = (function (NativeDate) {
8811
- /* eslint-enable no-implicit-globals */
8812
- /* eslint-enable no-undef */
8813
  // Date.length === 7
8814
  var DateShim = function Date(Y, M, D, h, m, s, ms) {
8815
  var length = arguments.length;
@@ -8824,19 +9074,19 @@ module.exports = computedStyle;
8824
  seconds += sToShift;
8825
  millis -= sToShift * 1e3;
8826
  }
8827
- date = length === 1 && $String(Y) === Y ? // isString(Y)
8828
  // We explicitly pass it through parse:
8829
- new NativeDate(DateShim.parse(Y)) :
8830
  // We have to manually make calls depending on argument
8831
  // length here
8832
- length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) :
8833
- length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) :
8834
- length >= 5 ? new NativeDate(Y, M, D, h, m) :
8835
- length >= 4 ? new NativeDate(Y, M, D, h) :
8836
- length >= 3 ? new NativeDate(Y, M, D) :
8837
- length >= 2 ? new NativeDate(Y, M) :
8838
- length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) :
8839
- new NativeDate();
8840
  } else {
8841
  date = NativeDate.apply(this, arguments);
8842
  }
@@ -8848,38 +9098,37 @@ module.exports = computedStyle;
8848
  };
8849
 
8850
  // 15.9.1.15 Date Time String Format.
8851
- var isoDateExpression = new RegExp('^' +
8852
- '(\\d{4}|[+-]\\d{6})' + // four-digit year capture or sign +
8853
- // 6-digit extended year
8854
- '(?:-(\\d{2})' + // optional month capture
8855
- '(?:-(\\d{2})' + // optional day capture
8856
- '(?:' + // capture hours:minutes:seconds.milliseconds
8857
- 'T(\\d{2})' + // hours capture
8858
- ':(\\d{2})' + // minutes capture
8859
- '(?:' + // optional :seconds.milliseconds
8860
- ':(\\d{2})' + // seconds capture
8861
- '(?:(\\.\\d{1,}))?' + // milliseconds capture
8862
- ')?' +
8863
- '(' + // capture UTC offset component
8864
- 'Z|' + // UTC capture
8865
- '(?:' + // offset specifier +/-hours:minutes
8866
- '([-+])' + // sign capture
8867
- '(\\d{2})' + // hours offset capture
8868
- ':(\\d{2})' + // minutes offset capture
8869
- ')' +
8870
- ')?)?)?)?' +
8871
- '$');
8872
 
8873
  var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
8874
 
8875
  var dayFromMonth = function dayFromMonth(year, month) {
8876
  var t = month > 1 ? 1 : 0;
8877
  return (
8878
- months[month] +
8879
- Math.floor((year - 1969 + t) / 4) -
8880
- Math.floor((year - 1901 + t) / 100) +
8881
- Math.floor((year - 1601 + t) / 400) +
8882
- 365 * (year - 1970)
8883
  );
8884
  };
8885
 
@@ -8909,9 +9158,7 @@ module.exports = computedStyle;
8909
  UTC: NativeDate.UTC
8910
  }, true);
8911
  DateShim.prototype = NativeDate.prototype;
8912
- defineProperties(DateShim.prototype, {
8913
- constructor: DateShim
8914
- }, true);
8915
 
8916
  // Upgrade Date.parse to handle simplified ISO 8601 strings
8917
  var parseShim = function parse(string) {
@@ -8937,22 +9184,22 @@ module.exports = computedStyle;
8937
  result;
8938
  var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
8939
  if (
8940
- hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
8941
- minute < 60 && second < 60 && millisecond < 1000 &&
8942
- month > -1 && month < 12 && hourOffset < 24 &&
8943
- minuteOffset < 60 && // detect invalid offsets
8944
- day > -1 &&
8945
- day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
8946
  ) {
8947
  result = (
8948
- (dayFromMonth(year, month) + day) * 24 +
8949
- hour +
8950
- hourOffset * signOffset
8951
  ) * 60;
8952
- result = (
8953
- (result + minute + minuteOffset * signOffset) * 60 +
8954
- second
8955
- ) * 1000 + millisecond;
8956
  if (isLocalTime) {
8957
  result = toUTC(result);
8958
  }
@@ -8987,10 +9234,10 @@ module.exports = computedStyle;
8987
  // ES5.1 15.7.4.5
8988
  // http://es5.github.com/#x15.7.4.5
8989
  var hasToFixedBugs = NumberPrototype.toFixed && (
8990
- (0.00008).toFixed(3) !== '0.000' ||
8991
- (0.9).toFixed(0) !== '1' ||
8992
- (1.255).toFixed(2) !== '1.25' ||
8993
- (1000000000000000128).toFixed(0) !== '1000000000000000128'
8994
  );
8995
 
8996
  var toFixedHelpers = {
@@ -9168,12 +9415,12 @@ module.exports = computedStyle;
9168
  // '.'.split(/()()/) should be ["."], not ["", "", "."]
9169
 
9170
  if (
9171
- 'ab'.split(/(?:ab)*/).length !== 2 ||
9172
- '.'.split(/(.?)(.?)/).length !== 4 ||
9173
- 'tesst'.split(/(s)*/)[1] === 't' ||
9174
- 'test'.split(/(?:)/, -1).length !== 4 ||
9175
- ''.split(/.?/).length ||
9176
- '.'.split(/()()/).length > 1
9177
  ) {
9178
  (function () {
9179
  var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
@@ -9191,10 +9438,10 @@ module.exports = computedStyle;
9191
  }
9192
 
9193
  var output = [];
9194
- var flags = (separator.ignoreCase ? 'i' : '') +
9195
- (separator.multiline ? 'm' : '') +
9196
- (separator.unicode ? 'u' : '') + // in ES6
9197
- (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
9198
  lastLastIndex = 0,
9199
  // Make `global` and avoid `lastIndex` issues by working with a copy
9200
  separator2, match, lastIndex, lastLength;
@@ -9319,9 +9566,9 @@ module.exports = computedStyle;
9319
 
9320
  // ES5 15.5.4.20
9321
  // whitespace from: http://es5.github.io/#x15.5.4.20
9322
- var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
9323
- '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' +
9324
- '\u2029\uFEFF';
9325
  var zeroWidth = '\u200b';
9326
  var wsRegexChars = '[' + ws + ']';
9327
  var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
@@ -9371,13 +9618,18 @@ module.exports = computedStyle;
9371
  }, StringPrototype.lastIndexOf.length !== 1);
9372
 
9373
  // ES-5 15.1.2.2
9374
- /* eslint-disable radix */
9375
  if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
9376
- /* eslint-enable radix */
9377
  /* global parseInt: true */
9378
  parseInt = (function (origParseInt) {
9379
- var hexRegex = /^[\-+]?0[xX]/;
9380
  return function parseInt(str, radix) {
 
 
 
 
 
 
9381
  var string = trim(String(str));
9382
  var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
9383
  return origParseInt(string, defaultedRadix);
@@ -9482,7 +9734,7 @@ module.exports = function(obj) {
9482
  },{}],40:[function(_dereq_,module,exports){
9483
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
9484
  var e, m
9485
- var eLen = nBytes * 8 - mLen - 1
9486
  var eMax = (1 << eLen) - 1
9487
  var eBias = eMax >> 1
9488
  var nBits = -7
@@ -9495,12 +9747,12 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
9495
  e = s & ((1 << (-nBits)) - 1)
9496
  s >>= (-nBits)
9497
  nBits += eLen
9498
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
9499
 
9500
  m = e & ((1 << (-nBits)) - 1)
9501
  e >>= (-nBits)
9502
  nBits += mLen
9503
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
9504
 
9505
  if (e === 0) {
9506
  e = 1 - eBias
@@ -9515,7 +9767,7 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
9515
 
9516
  exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
9517
  var e, m, c
9518
- var eLen = nBytes * 8 - mLen - 1
9519
  var eMax = (1 << eLen) - 1
9520
  var eBias = eMax >> 1
9521
  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
@@ -9548,7 +9800,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
9548
  m = 0
9549
  e = eMax
9550
  } else if (e + eBias >= 1) {
9551
- m = (value * c - 1) * Math.pow(2, mLen)
9552
  e = e + eBias
9553
  } else {
9554
  m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
1
  /*!
2
 
3
+ Flowplayer v7.2.7 (Monday, 13. August 2018 08:40AM) | flowplayer.com/license
4
 
5
  */
6
  /*! (C) WebReflection Mit Style License */
7
  (function(e){function g(e,t,n,r){for(var i,s=n.slice(),o=w(t,e),u=0,a=s.length;u<a;u++){handler=s[u],typeof handler=="object"&&typeof handler.handleEvent=="function"?handler.handleEvent(o):handler.call(e,o);if(o.stoppedImmediatePropagation)break}return i=!o.stoppedPropagation,r&&i&&e.parentNode?e.parentNode.dispatchEvent(o):!o.defaultPrevented}function y(e,t){return{configurable:!0,get:e,set:t}}function b(e,t,n){var r=f(t||e,n);u(e,"textContent",y(function(){return r.get.call(this)},function(e){r.set.call(this,e)}))}function w(e,t){return e.currentTarget=t,e.eventPhase=e.target===e.currentTarget?2:3,e}function E(e,t){var n=e.length;while(n--&&e[n]!==t);return n}function S(){if(this.tagName==="BR")return"\n";var e=this.firstChild,t=[];while(e)e.nodeType!==8&&e.nodeType!==7&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function x(e){return e.nodeType!==9&&document.documentElement.contains(e)}function T(e){!n&&d.test(document.readyState)&&(n=!n,document.detachEvent(r,T),e=document.createEvent("Event"),e.initEvent(i,!0,!0),document.dispatchEvent(e))}function N(e){var t;while(t=this.lastChild)this.removeChild(t);e!=null&&this.appendChild(document.createTextNode(e))}function C(t,n){return n||(n=e.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(document.createEvent)return;var t=!0,n=!1,r="onreadystatechange",i="DOMContentLoaded",s="__IE8__"+Math.random(),o=e.Object,u=o.defineProperty||function(e,t,n){e[t]=n.value},a=o.defineProperties||function(t,n){for(var r in n)if(l.call(n,r))try{u(t,r,n[r])}catch(i){e.console&&console.log(r+" failed on object:",t,i.message)}},f=o.getOwnPropertyDescriptor,l=o.prototype.hasOwnProperty,c=e.Element.prototype,h=e.Text.prototype,p=/^[a-z]+$/,d=/loaded|complete/,v={},m=document.createElement("div");b(e.HTMLCommentElement.prototype,c,"nodeValue"),b(e.HTMLScriptElement.prototype,null,"text"),b(h,null,"nodeValue"),b(e.HTMLTitleElement.prototype,null,"text"),u(e.HTMLStyleElement.prototype,"textContent",function(e){return y(function(){return e.get.call(this.styleSheet)},function(t){e.set.call(this.styleSheet,t)})}(f(e.CSSStyleSheet.prototype,"cssText"))),a(c,{textContent:{get:S,set:N},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;t<n;t++)if(e[t].nodeType==1)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(e[t].nodeType==1)return e[t]}},previousElementSibling:{get:function(){var e=this.previousSibling;while(e&&e.nodeType!=1)e=e.previousSibling;return e}},nextElementSibling:{get:function(){var e=this.nextSibling;while(e&&e.nodeType!=1)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=t[n].nodeType==1);return e}},addEventListener:{value:function(e,t,n){var r=this,i="on"+e,o=r[s]||u(r,s,{value:{}})[s],a=o[i]||(o[i]={}),f=a.h||(a.h=[]),c;if(!l.call(a,"w")){a.w=function(e){return e[s]||g(r,C(r,e),f,!1)};if(!l.call(v,i))if(p.test(e))try{c=document.createEventObject(),c[s]=!0,r.nodeType!=9&&r.parentNode==null&&m.appendChild(r),r.fireEvent(i,c),v[i]=!0}catch(c){v[i]=!1;while(m.hasChildNodes())m.removeChild(m.firstChild)}else v[i]=!1;(a.n=v[i])&&r.attachEvent(i,a.w)}E(f,t)<0&&f[n?"unshift":"push"](t)}},dispatchEvent:{value:function(e){var t=this,n="on"+e.type,r=t[s],i=r&&r[n],o=!!i,u;return e.target||(e.target=t),o?i.n?t.fireEvent(n,e):g(t,e,i.h,!0):(u=t.parentNode)?u.dispatchEvent(e):!0,!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var r=this,i="on"+e,o=r[s],u=o&&o[i],a=u&&u.h,f=a?E(a,t):-1;-1<f&&a.splice(f,1)}}}),a(h,{addEventListener:{value:c.addEventListener},dispatchEvent:{value:c.dispatchEvent},removeEventListener:{value:c.removeEventListener}}),a(e.XMLHttpRequest.prototype,{addEventListener:{value:function(e,t,n){var r=this,i="on"+e,o=r[s]||u(r,s,{value:{}})[s],a=o[i]||(o[i]={}),f=a.h||(a.h=[]);E(f,t)<0&&(r[i]||(r[i]=function(){var t=document.createEvent("Event");t.initEvent(e,!0,!0),r.dispatchEvent(t)}),f[n?"unshift":"push"](t))}},dispatchEvent:{value:function(e){var t=this,n="on"+e.type,r=t[s],i=r&&r[n],o=!!i;return o&&(i.n?t.fireEvent(n,e):g(t,e,i.h,!0))}},removeEventListener:{value:c.removeEventListener}}),a(e.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),a(e.HTMLDocument.prototype,{textContent:{get:function(){return this.nodeType===11?S.call(this):null},set:function(e){this.nodeType===11&&N.call(this,e)}},addEventListener:{value:function(n,s,o){var u=this;c.addEventListener.call(u,n,s,o),t&&n===i&&!d.test(u.readyState)&&(t=!1,u.attachEvent(r,T),e==top&&function a(e){try{u.documentElement.doScroll("left"),T()}catch(t){setTimeout(a,50)}}())}},dispatchEvent:{value:c.dispatchEvent},removeEventListener:{value:c.removeEventListener},createEvent:{value:function(e){var t;if(e!=="Event")throw new Error("unsupported "+e);return t=document.createEventObject(),t.timeStamp=(new Date).getTime(),t}}}),a(e.Window.prototype,{getComputedStyle:{value:function(){function i(e){this._=e}function s(){}var e=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,t=/^(top|right|bottom|left)$/,n=/\-([a-z])/g,r=function(e,t){return t.toUpperCase()};return i.prototype.getPropertyValue=function(i){var s=this._,o=s.style,u=s.currentStyle,a=s.runtimeStyle,f,l,c;return i=(i==="float"?"style-float":i).replace(n,r),f=u?u[i]:o[i],e.test(f)&&!t.test(i)&&(l=o.left,c=a&&a.left,c&&(a.left=u.left),o.left=i==="fontSize"?"1em":f,f=o.pixelLeft+"px",o.left=l,c&&(a.left=c)),f==null?f:f+""||"auto"},s.prototype.getPropertyValue=function(){return null},function(e,t){return t?new s(e):new i(e)}}()},addEventListener:{value:function(t,n,r){var i=e,o="on"+t,u;i[o]||(i[o]=function(e){return g(i,C(i,e),u,!1)}),u=i[o][s]||(i[o][s]=[]),E(u,n)<0&&u[r?"unshift":"push"](n)}},dispatchEvent:{value:function(t){var n=e["on"+t.type];return n?n.call(e,t)!==!1&&!t.defaultPrevented:!0}},removeEventListener:{value:function(t,n,r){var i="on"+t,u=(e[i]||o)[s],a=u?E(u,n):-1;-1<a&&u.splice(a,1)}}})})(this);
8
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.flowplayer = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
9
  'use strict';
10
  var common = module.exports = {},
11
  ClassList = _dereq_('class-list'),
193
  common.hasParent = function(el, parentSelector) {
194
  var parent = el.parentElement;
195
  while (parent) {
196
+ if (typeof parentSelector !== 'string') {
197
+ // is an element
198
+ if (parent === parentSelector) return true;
199
+ } else {
200
+ if (common.matches(parent, parentSelector)) return true;
201
+ }
202
  parent = parent.parentElement;
203
  }
204
  return false;
475
  if ((conf.rtmp || {}).hasOwnProperty(key)) opts[key] = (conf.rtmp || {})[key];
476
  if ((video.rtmp || {}).hasOwnProperty(key)) opts[key] = (video.rtmp || {})[key];
477
  });
478
+ if (conf.splash) opts.autoplay = true;
479
  if (conf.rtmp) opts.rtmp = conf.rtmp.url || conf.rtmp;
480
  if (video.rtmp) opts.rtmp = video.rtmp.url || video.rtmp;
481
  Object.keys(video.flashls || {}).forEach(function(key) {
485
 
486
  var hlsQualities = typeof video.hlsQualities !== 'undefined' ? video.hlsQualities : conf.hlsQualities;
487
  if (typeof hlsQualities !== 'undefined') opts.hlsQualities = hlsQualities ? encodeURIComponent(JSON.stringify(hlsQualities)) : hlsQualities;
488
+ // bufferTime, bufferTimeMax might be 0
489
  if (conf.bufferTime !== undefined) opts.bufferTime = conf.bufferTime;
490
+ if (conf.bufferTimeMax !== undefined) opts.bufferTimeMax = conf.bufferTimeMax;
491
 
492
  if (is_absolute) delete opts.rtmp;
493
 
521
  player.video.hlsQualities :
522
  player.conf.hlsQualities;
523
  if (!hlsQualities) return;
524
+ try {
525
+ api.__quality(quality);
526
+ } catch (e) {
527
+ // VOD / RTMP engine does not support quality
528
+ player.debug('Error changing quality in flash engine', e);
529
+ }
530
  });
531
 
532
  // throw error if no loading occurs
740
  var flowplayer = _dereq_('../flowplayer')
741
  , support = flowplayer.support
742
  , common = flowplayer.common
743
+ , bean = flowplayer.bean
744
  , html5factory = _dereq_('./html5-factory');
745
 
746
 
754
 
755
  engine = function(player, root) {
756
 
757
+ var Hls = window.Hls
758
  , lastSelectedLevel
759
  , lastSource;
760
 
761
+ function hlsjsExt(video, api, engineApi) {
762
+ var conf = flowplayer.extend({
763
+ recoverMediaError: true
764
+ }, player.conf.hlsjs, video.hlsjs);
765
+ if (player.engine.hls) player.engine.hls.destroy();
766
+ var hls = player.engine.hls = new Hls(conf);
767
  engine.extensions.forEach(function(ext) {
768
+ ext({
769
+ hls: hls,
770
+ player: player,
771
+ root: root,
772
+ videoTag: api
773
+ });
774
  });
775
  hls.loadSource(video.src);
776
 
777
  // API overriders
778
  engineApi.resume = function() {
779
+ if (player.live && !player.dvr) api.currentTime = hls.liveSyncPosition || 0;
780
  api.play();
781
  };
782
 
783
  engineApi.seek = function(seekTo) {
784
  try {
785
+ if (player.live || player.dvr) {
786
+ api.currentTime = Math.min(
787
+ seekTo,
788
+ (hls.liveSyncPosition || api.duration - conf.livePositionOffset)
789
+ );
790
+ }
791
  else api.currentTime = seekTo;
792
  } catch (e) {
793
  player.debug('Failed to seek to ', seekTo, e);
794
  }
795
  };
796
 
797
+ if (conf.bufferWhilePaused === false) {
798
+ player.on('pause', function() {
799
+ hls.stopLoad();
800
+ player.one('resume', function() {
801
+ hls.startLoad();
802
+ });
803
+ });
804
+ }
805
+
806
  // Quality selection
807
  player.on('quality', function(_ev, _api, q) {
808
  hls.nextLevel = lastSelectedLevel = q;
809
  });
810
 
811
+ // HLS.js error handling
812
+ var recoverMediaErrorDate
813
+ , swapAudioCodecDate;
814
+ var recover = function(isNetworkError) {
815
+ player.debug('hlsjs - recovery');
816
+
817
+ common.removeClass(root, 'is-paused');
818
+ common.addClass(root, 'is-seeking');
819
+
820
+ bean.one(api, 'seeked', function() {
821
+ if (api.paused) {
822
+ common.removeClass(root, 'is-poster');
823
+ player.poster = false;
824
+ api.play();
825
+ }
826
+ common.removeClass(root, 'is-seeking');
827
+ });
828
+
829
+
830
+ if (isNetworkError) return hls.startLoad();
831
+ var now = performance.now();
832
+ if (!recoverMediaErrorDate || now - recoverMediaErrorDate > 3000) {
833
+ recoverMediaErrorDate = performance.now();
834
+ hls.recoverMediaError();
835
+ } else if (!swapAudioCodecDate || (now - swapAudioCodecDate) > 3000) {
836
+ swapAudioCodecDate = performance.now();
837
+ hls.swapAudioCodec();
838
+ hls.recoverMediaError();
839
+ }
840
+ };
841
+
842
 
843
  hls.on(Hls.Events.MANIFEST_PARSED, function(_, data) {
844
  var hlsQualities = video.hlsQualities || player.conf.hlsQualities
878
  }]
879
 
880
  if (Array.isArray(hlsQualities)) {
881
+ var confAutoQuality = hlsQualities.find(function(q) { return q === -1 || q.level && q.level === -1; });
882
+ if (!confAutoQuality) video.qualities = [];
883
+ else video.qualities[0].label = typeof confAutoQuality !== 'number' ? confAutoQuality.label : video.qualities[0].label;
884
  confQualities = hlsQualities.map(function(q) {
885
  if (typeof q.level !== 'undefined') qualityLabels[q.level] = q.label;
886
  return typeof q.level !== 'undefined' ? q.level : q;
913
  if (lastSource && video.src !== lastSource) api.play();
914
  lastSource = video.src;
915
  });
916
+
917
+ hls.on(Hls.Events.ERROR, function(ev, data) {
918
+ if (!data.fatal) return;
919
+ if (conf.recoverNetworkError && data.type === Hls.ErrorTypes.NETWORK_ERROR) recover(true);
920
+ else if (conf.recoverMediaError && data.type === Hls.ErrorTypes.MEDIA_ERROR) recover(false);
921
+ else {
922
+ var code = 5;
923
+ if (data.type === Hls.ErrorTypes.NETWORK_ERROR) code = 2;
924
+ if (data.type === Hls.ErrorTypes.MEDIA_ERROR) code = 3;
925
+ hls.destroy();
926
+ player.trigger('error', [player, { code: code }]);
927
+ }
928
+ });
929
+
930
+ player.one('unload', function() {
931
+ hls.destroy();
932
+ });
933
+
934
+ return {
935
+ handlers: {
936
+ error: function(e, videoTag) {
937
+ var errorCode = videoTag.error && videoTag.error.code;
938
+ if (conf.recoverMediaError && errorCode === 3 || !errorCode) {
939
+ e.preventDefault();
940
+ recover(false);
941
+ return true;
942
+ }
943
+ if (conf.recoverNetworkError && errorCode === 2) {
944
+ e.preventDefault();
945
+ recover(true);
946
+ return true;
947
+ }
948
+ }
949
+ }
950
+ };
951
+ }
952
+ return html5factory('hlsjs-lite', player, root, canPlay, hlsjsExt);
953
  };
954
 
955
 
956
  engine.canPlay = function(type, conf) {
957
+ if (conf.hlsjs === false || (conf.clip && conf.clip.hlsjs === false)) return false;
958
  if (support.browser.safari && !(conf.clip && conf.clip.hlsjs || conf.hlsjs || {}).safari) return false;
959
  return flowplayer.support.video && canPlay(type);
960
  };
1019
  },
1020
 
1021
  load: function(video) {
1022
+ var container = common.find('.fp-player', root)[0]
1023
+ , created = false;
1024
 
1025
  if (!api) {
1026
  api = document.createElement('video');
1027
  common.prepend(container, api);
1028
  api.autoplay = !!conf.splash;
1029
+ created = true;
1030
  }
1031
  common.addClass(api, 'fp-engine');
1032
  common.find('track', api).forEach(common.removeNode);
1084
  api.volume = volumeLevel;
1085
  }
1086
 
1087
+ var extra = ext(video, api, self);
1088
  if (conf.autoplay || conf.splash || video.autoplay) {
1089
  player.debug('Autoplay / Splash setup, try to start video');
1090
+ api.load();
1091
+ var play = function () {
1092
+ try {
1093
+ var p = api.play();
1094
+ if (p && p.catch) {
1095
+ var recoverAutoplay = function(err) {
1096
+ if (err.name === 'AbortError' && err.code === 20) {
1097
+ if (!created) return api.play().catch(recoverAutoplay);
1098
+ else return;
1099
+ }
1100
+ if (!conf.mutedAutoplay) throw new Error('Unable to autoplay');
1101
+ player.debug('Play errored, trying muted', err);
1102
+ player.mute(true, true);
1103
+ return api.play();
1104
+ }
1105
+ p.catch(recoverAutoplay).catch(function() {
1106
+ conf.autoplay = false;
1107
+ player.mute(false, true); // Restore volume as playback failed
1108
+ player.trigger('stop', [player]);
1109
+ });
1110
+ }
1111
+ } catch(e) {
1112
+ player.debug('play() error thrown', e);
1113
  }
1114
+ };
1115
+ if (api.readyState > 0) play();
1116
+ else bean.one(api, 'canplay', play);
1117
  }
1118
 
1119
+ self._listeners = listen(api, common.find('source', api).concat(api), video, extra) || self._listeners;
 
1120
 
1121
+ if (conf.autoplay || conf.splash || video.autoplay) return; // No preload check needed
1122
  var preloadCheck = function() {
1123
  if (!isInViewport(root)) return;
1124
+ player.debug('player is in viewport, preload');
1125
  if (support.preloadMetadata) api.preload = 'metadata';
1126
  else api.load();
1127
  bean.off(document, 'scroll.preloadviewport');
1128
  };
 
1129
  bean.off(document, 'scroll.preloadviewport');
1130
  bean.on(document, 'scroll.preloadviewport', function() {
1131
  window.requestAnimationFrame(preloadCheck);
1132
  });
1133
+ preloadCheck();
1134
  },
1135
 
1136
  mute: function(flag) {
1152
  },
1153
 
1154
  seek: function(time) {
1155
+ var pausedState = api.paused || player.finished;
1156
  try {
1157
  api.currentTime = time;
1158
+ if (pausedState) bean.one(api, 'seeked', function() { api.pause(); });
1159
  } catch (ignored) {}
1160
  },
1161
 
1170
  unload: function() {
1171
  bean.off(document, 'scroll.preloadviewport');
1172
  common.find('video.fp-engine', root).forEach(function (videoTag) {
1173
+ if ('MediaSource' in window) {
1174
+ videoTag.src = URL.createObjectURL(new MediaSource());
1175
+ } else {
1176
+ videoTag.src = '';
1177
+ }
1178
  common.removeNode(videoTag);
1179
  });
1180
  timer = clearInterval(timer);
1189
  }
1190
  };
1191
 
1192
+ function listen(api, sources, video, extra) {
1193
  // listen only once
1194
  var instanceId = root.getAttribute('data-flowplayer-instance-id');
1195
 
1222
  if (track.kind !== 'metadata') return;
1223
  track.mode = 'hidden';
1224
  track.addEventListener('cuechange', function() {
1225
+ if (!track.activeCues.length) return;
1226
  player.trigger('metadata', [player, track.activeCues[0].value]);
1227
  }, false);
1228
  };
1253
  video = api.listeners[instanceId];
1254
  if (!e.target || !common.hasClass(e.target, 'fp-engine')) return;
1255
 
1256
+ if (!/progress/.test(flow)) player.debug(type, '->', flow, e);
1257
 
1258
  var triggerEvent = function(f) {
1259
  player.trigger(f || flow, [player, arg]);
1274
  switch (flow) {
1275
 
1276
  case 'ready':
1277
+ if (player.ready) return player.debug('Player already ready, not sending duplicate ready event');
1278
+ if ((!api.duration || api.duration === Infinity) && !player.live) return player.debug('No duration and VOD setup, not sending ready event');
1279
  arg = extend(video, {
1280
  duration: api.duration < Number.MAX_VALUE ? api.duration : 0,
1281
  width: api.videoWidth,
1282
  height: api.videoHeight,
1283
+ url: api.currentSrc
 
1284
  });
1285
+ arg.seekable = arg.duration;
1286
+ player.debug('Ready: ', arg);
 
 
 
1287
 
1288
  if (!player.live && !arg.duration && !support.hlsDuration && type === 'loadeddata') {
1289
  var durationChanged = function() {
1333
  end: api.buffered.end(i)
1334
  });
1335
  }
1336
+ if (api.buffered.length && api.buffered.end(null) === api.duration) triggerEvent('buffered');
1337
  break;
1338
 
1339
  case 'speed':
1346
 
1347
  case 'error':
1348
  try {
1349
+ if (extra && extra.handlers && extra.handlers.error) {
1350
+ var handled = extra.handlers.error(e, api);
1351
+ if (handled) return;
1352
+ }
1353
  arg = (e.srcElement || e.originalTarget).error;
1354
  arg.video = extend(video, {src: api.src, url: api.src});
1355
  } catch (er) {
1418
  common.find('source', api).forEach(common.removeNode);
1419
  api.src = video.src;
1420
  api.type = video.type;
1421
+ } else if (video.autoplay) {
1422
+ api.load();
1423
  }
1424
+
1425
  });
1426
  };
1427
 
1604
 
1605
  function createUIElements() {
1606
  var btnContainer = common.find('.fp-header', root)[0];
1607
+ if (!btnContainer) return; // UI no more available
1608
  common.find('.fp-chromecast', btnContainer).forEach(common.removeNode);
1609
  common.find('.fp-chromecast-engine', root).forEach(common.removeNode);
1610
  trigger = common.createElement('a', { 'class': 'fp-chromecast fp-icon', title: 'Play on Cast device'})
1704
  var segments = {}, lastFiredSegment = -0.125;
1705
 
1706
  var fire = function(cue) {
1707
+ setClass(cue.index);
 
 
 
1708
  player.trigger('cuepoint', [player, cue]);
1709
  };
1710
 
1711
  player.on("progress", function(e, api, time) {
1712
+ if (cuepointsDisabled) return;
1713
  var segment = segmentForCue(time);
1714
  while (lastFiredSegment < segment) {
1715
  lastFiredSegment += 0.125;
1732
  var cues = video.cuepoints || player.conf.cuepoints || [];
1733
  player.setCuepoints(cues);
1734
  }).on('finish', function() {
1735
+ var segment = segmentForCue(player.video.duration);
1736
+ while (lastFiredSegment < segment) {
1737
+ lastFiredSegment += 0.125;
1738
+ if (!segments[lastFiredSegment]) continue;
1739
+ segments[lastFiredSegment].forEach(fire);
1740
+ }
1741
  lastFiredSegment = -0.125;
1742
  });
1743
  if (player.conf.generate_cuepoints) {
1761
  };
1762
  player.addCuepoint = function(cue) {
1763
  if (!player.cuepoints) player.cuepoints = [];
1764
+ if (typeof cue === 'number') {
1765
+ cue = {
1766
+ time: cue,
1767
+ };
1768
+ }
1769
+ cue.index = 0;
1770
  var segment = segmentForCue(cue);
1771
  if (!segments[segment]) segments[segment] = [];
1772
  segments[segment].push(cue);
1773
+ if (player.cuepoints.length) cue.index = Math.max.apply(null, player.cuepoints.map(function(cue) { return cue.index; })) + 1;
1774
  player.cuepoints.push(cue);
1775
 
1776
  if (player.conf.generate_cuepoints && cue.visible !== false) {
1781
  var time = cue.time || cue;
1782
  if (time < 0) time = duration + time;
1783
 
1784
+ var el = common.createElement('a', {className: 'fp-cuepoint fp-cuepoint' + cue.index});
1785
  common.css(el, "left", (time / duration * 100) + "%");
1786
 
1787
  timeline.appendChild(el);
1795
  };
1796
 
1797
  player.removeCuepoint = function(cue) {
1798
+ if (typeof cue === 'number') cue = player.cuepoints.filter(function(c) { return c.index === cue; })[0];
1799
  var idx = player.cuepoints.indexOf(cue),
1800
  segment = segmentForCue(cue);
1801
  if (idx === -1) return;
1802
+ player.cuepoints = player.cuepoints.slice(0, idx).concat(player.cuepoints.slice(idx+1));
1803
+
1804
+ var timeline = common.find('.fp-timeline', root)[0];
1805
+
1806
+ common.find('.fp-cuepoint' + cue.index, timeline).forEach(common.removeNode);
1807
 
1808
  var sIdx = segments[segment].indexOf(cue);
1809
  if (sIdx === -1) return;
2024
  FS_ENTER = "fullscreen",
2025
  FS_EXIT = "fullscreen-exit",
2026
  FULL_PLAYER,
2027
+ FS_SUPPORT = flowplayer.support.fullscreen;
 
 
 
2028
 
2029
  // esc button
2030
  bean.on(document, "fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr", function(e) {
2073
  ['requestFullScreen', 'webkitRequestFullScreen', 'mozRequestFullScreen', 'msRequestFullscreen'].forEach(function(fName) {
2074
  if (typeof wrapper[fName] === 'function') {
2075
  wrapper[fName](Element.ALLOW_KEYBOARD_INPUT);
2076
+ if (fName === 'webkitRequestFullScreen' && !document.webkitFullscreenElement) wrapper[fName]();
2077
  }
2078
  });
2079
 
2127
 
2128
  player.on('shutdown', function() {
2129
  FULL_PLAYER = null;
2130
+ common.removeNode(wrapper);
2131
  });
2132
 
2133
  });
2151
 
2152
  if (!el || !conf.keyboard || el.disabled) return;
2153
 
 
 
 
 
 
 
 
 
 
 
 
 
2154
  if (!metaKeyPressed && el.ready) {
2155
 
 
 
2156
  // slow motion / fast forward
2157
  if (e.shiftKey) {
2158
  if (key == 39) el.speed(true);
2159
  else if (key == 37) el.speed(false);
2160
+ return e.preventDefault();
2161
  }
2162
 
2163
  // 1, 2, 3, 4 ..
2164
+ if (key < 58 && key > 47) {
2165
+ e.preventDefault();
2166
+ return el.seekTo(key - 48);
 
 
 
 
 
 
 
 
 
2167
  }
2168
 
2169
+ var handled = (function() {
2170
+ switch (key) {
2171
+ case 38: case 75: el.volume(el.volumeLevel + 0.15); return true; // volume up
2172
+ case 40: case 74: el.volume(el.volumeLevel - 0.15); return true; // volume down
2173
+ case 39: case 76: el.seeking = true; el.seek(true); return true; // forward
2174
+ case 37: case 72: el.seeking = true; el.seek(false); return true; // backward
2175
+ case 190: el.seekTo(); return true; // to last seek position
2176
+ case 32: el.toggle(); return true; // spacebar
2177
+ case 70: if(conf.fullscreen) el.fullscreen(); return true; // toggle fullscreen
2178
+ case 77: el.mute(); return true; // mute
2179
+ case 81: el.unload(); return true; // unload/stop
2180
+ }
2181
+ })();
2182
+ if (handled) e.preventDefault();
2183
  }
2184
 
2185
  });
2189
  // no keyboard configured
2190
  if (!api.conf.keyboard) return;
2191
 
2192
+ bean.on(document, 'click', function(ev) {
2193
+ if (common.hasParent(ev.target, root)) {
2194
+ focused = !api.disabled ? api : 0;
2195
+ } else {
2196
+ if (focused !== api) return;
2197
+ focused = 0;
2198
+ }
2199
  if (focused) focusedRoot = root;
2200
  });
2201
 
2236
  if (common.height(menu) + top > common.height(ui)) top = top - common.height(menu);
2237
  common.css(menu, {
2238
  top: top + 'px',
2239
+ left: left + 'px',
2240
+ right: 'auto'
2241
  });
2242
  };
2243
 
2367
  bean.on(root, 'touchmove', function() {
2368
  hasMoved = true;
2369
  });
2370
+ var initialClick = true;
2371
  bean.on(root, 'touchend click', function(e) {
2372
  if (hasMoved) { //not intentional, most likely scrolling
2373
  hasMoved = false;
2375
  }
2376
 
2377
  var video = common.find('video.fp-engine', root)[0];
2378
+ if (initialClick && player.conf.clickToUnMute && video && video.muted && player.conf.autoplay) video.muted = false;
2379
+ initialClick = false;
2380
 
2381
  if (player.playing && !common.hasClass(root, 'is-mouseover')) {
2382
  common.addClass(root, 'is-mouseover');
2427
  // Android browser gives video.duration == 1 until second 'timeupdate' event
2428
  if (isAndroid || isSilk) player.bind("ready", function() {
2429
  var video = common.find('video.fp-engine', root)[0];
2430
+ if (player.conf.splash && video.paused && player.engine.engineName !== 'hlsjs-lite') {
2431
  bean.one(video, 'canplay', function() {
2432
  video.play();
2433
  });
2680
  player.conf.playlist.forEach(function(itm, i) {
2681
  common.removeClass(root, 'video' + i);
2682
  });
2683
+ delete player.video.index;
2684
  });
2685
 
2686
  if (player.conf.playlist.length) {
2874
 
2875
  flowplayer(function(p, root) {
2876
  var currentPoint, wrap,
2877
+ subtitleControl, subtitleMenu, changeHandler;
2878
 
2879
  if (
2880
  !flowplayer.support.inlineVideo ||
2881
  (!flowplayer.support.fullscreen && p.conf.native_fullscreen)) p.conf.nativesubtitles = true;
2882
 
2883
+ if (!p.ui) p.ui = {};
2884
+ p.ui.createSubtitleControl = function(subtitles, onChange) {
2885
+ changeHandler = onChange;
2886
  subtitleControl = subtitleControl || common.createElement('strong', { className: 'fp-cc' }, 'CC');
2887
  subtitleMenu = subtitleMenu || common.createElement('div', {className: 'fp-menu fp-subtitle-menu'}, '<strong>Closed Captions</strong>');
2888
  common.find('a', subtitleMenu).forEach(common.removeNode);
2889
  subtitleMenu.appendChild(common.createElement('a', {'data-subtitle-index': -1}, 'No subtitles'));
2890
+ (subtitles || []).forEach(function(st, i) {
2891
  var srcLang = st.srclang || 'en',
2892
  label = st.label || 'Default (' + srcLang + ')';
2893
  var item = common.createElement('a', {'data-subtitle-index': i}, label);
2895
  });
2896
  common.find('.fp-ui', root)[0].appendChild(subtitleMenu);
2897
  common.find('.fp-controls', root)[0].appendChild(subtitleControl);
2898
+ common.toggleClass(subtitleControl, 'fp-hidden', !subtitles || !subtitles.length);
2899
  return subtitleControl;
2900
  };
2901
 
2902
+ p.ui.setActiveSubtitleItem = function(idx) {
2903
+ setActiveSubtitleClass(idx);
2904
+ };
2905
+
2906
  bean.on(root, 'click', '.fp-cc', function() {
2907
  if (common.hasClass(subtitleMenu, 'fp-active')) p.hideMenu();
2908
  else p.showMenu(subtitleMenu);
2911
  bean.on(root, 'click', '.fp-subtitle-menu [data-subtitle-index]', function(ev) {
2912
  ev.preventDefault();
2913
  var idx = ev.target.getAttribute('data-subtitle-index');
2914
+ if (changeHandler) return changeHandler(idx);
2915
  if (idx === '-1') return p.disableSubtitles();
2916
  p.loadSubtitles(idx);
2917
  });
2920
  wrap = common.find('.fp-captions', root)[0];
2921
  wrap = wrap || common.appendTo(common.createElement('div', {'class': 'fp-captions'}), common.find('.fp-player', root)[0]);
2922
  Array.prototype.forEach.call(wrap.children, common.removeNode);
2923
+ p.ui.createSubtitleControl(p.video.subtitles);
2924
  };
2925
 
2926
 
2933
 
2934
  p.disableSubtitles();
2935
 
 
2936
  if (!video.subtitles || !video.subtitles.length) return;
2937
 
2938
  var defaultSubtitle = video.subtitles.filter(function(one) {
2941
  if (defaultSubtitle) player.loadSubtitles(video.subtitles.indexOf(defaultSubtitle));
2942
  });
2943
 
2944
+ p.showSubtitle = function(text) {
2945
+ common.html(wrap, text);
2946
+ common.addClass(wrap, 'fp-shown');
2947
+ };
2948
+
2949
+ p.hideSubtitle = function() {
2950
+ common.removeClass(wrap, 'fp-shown');
2951
+ };
2952
+
2953
  p.bind("cuepoint", function(e, api, cue) {
2954
  if (cue.subtitle) {
2955
  currentPoint = cue.index;
2956
+ p.showSubtitle(cue.subtitle.text);
 
2957
  } else if (cue.subtitleEnd) {
2958
+ p.hideSubtitle();
2959
  currentPoint = cue.index;
2960
  }
2961
  });
3026
  }
3027
  common.xhrGet(url, function(txt) {
3028
  var entries = p.conf.subtitleParser(txt);
3029
+ entries.forEach(function(entry, idx) {
3030
+ if (!entry.title) entry.title = 'subtitle' + idx;
3031
  var cue = { time: entry.startTime, subtitle: entry, visible: false };
3032
  p.subtitles.push(entry);
3033
  p.addCuepoint(cue);
3138
  WP_VER = IS_WP ? parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(UA)[1], 10) : 0,
3139
  IE_MOBILE_VER = IS_WP ? parseFloat(/IEMobile\/(\d+\.\d+)/.exec(UA)[1], 10) : 0,
3140
  IOS_VER = IS_IPAD || IS_IPHONE ? parseIOSVersion(UA) : 0,
3141
+ ANDROID_VER = IS_ANDROID ? parseFloat(/Android\ (\d+(\.\d+)?)/.exec(UA)[1], 10) : 0;
3142
 
3143
  var ios = (IS_IPHONE || IS_IPAD || IS_IPAD_CHROME) && {
3144
  iPhone: IS_IPHONE,
3172
  // pretend lacking firstframe support because so far we treat
3173
  // support.autoplay as synonym of support.firstframe
3174
  firstframe: !IS_SILK && !IS_WP && !IS_ANDROID_FIREFOX && !IS_ANDROID_SAMSUNG && !(IOS_VER && IOS_VER < 10) && !(IS_ANDROID && ANDROID_VER < 4.4),
 
3175
  inlineVideo: (!IS_IPHONE || IOS_VER >= 10) && (!IS_WP || (WP_VER >= 8.1 && IE_MOBILE_VER >= 11)) && (!IS_ANDROID || ANDROID_VER >= 3),
3176
  hlsDuration: !IS_ANDROID && (!b.safari || IS_IPAD || IS_IPHONE || IS_IPAD_CHROME),
3177
  seekable: !IS_IPAD && !IS_IPAD_CHROME,
3178
+ preloadMetadata: !ios && !b.safari
3179
  });
3180
  s.autoplay = s.firstframe;
3181
  if (IS_WP) {
3729
  common.addClass(root, "is-poster");
3730
  common.addClass(play, 'fp-visible');
3731
  api.poster = true;
3732
+ api.on('resume.poster progress.poster beforeseek.poster', function(ev) {
3733
+ if (ev.type === 'beforeseek' || api.playing) {
3734
+ common.removeClass(root, 'is-poster');
3735
+ common.removeClass(play, 'fp-visible');
3736
+ api.poster = false;
3737
+ api.off('.poster');
3738
+ }
3739
  });
3740
  }
3741
  api.on('stop', function() { initPoster(); });
3787
  bean.off(timeline);
3788
  bean.off(volumeSlider);
3789
  if (resizeHandle) window.cancelAnimationFrame(resizeHandle);
3790
+ common.removeNode(ui);
3791
+ common.find('.fp-ratio', root).forEach(common.removeNode);
3792
  });
3793
 
3794
  if (typeof window.requestAnimationFrame === 'function') {
3795
+ var playerEl = common.find('.fp-player', root)[0] || root;
3796
  var resize = function() {
 
3797
  common.toggleClass(root, 'is-tiny', playerEl.clientWidth < 400);
3798
  common.toggleClass(root, 'is-small', playerEl.clientWidth < 600 && playerEl.clientWidth >= 400);
3799
  resizeHandle = window.requestAnimationFrame(resize);
4080
  if (oldHandler) return oldHandler(ev);
4081
  };
4082
 
 
 
 
 
 
 
 
 
4083
  var isSafari = /Safari/.exec(navigator.userAgent) && !/Chrome/.exec(navigator.userAgent),
4084
  m = /(\d+\.\d+) Safari/.exec(navigator.userAgent),
4085
  safariVersion = m ? Number(m[1]) : 100;
4104
 
4105
  extend(flowplayer, {
4106
 
4107
+ version: '7.2.7',
4108
 
4109
  engines: [],
4110
 
4129
 
4130
  defaults: {
4131
 
4132
+ debug: false,
4133
 
4134
  // true = forced playback
4135
  disabled: false,
4150
 
4151
  hlsQualities: true,
4152
 
4153
+ seekStep: false,
4154
+
4155
  splash: false,
4156
 
4157
  live: false,
4158
  livePositionOffset: 120,
4159
 
4160
+ swf: "//releases.flowplayer.org/7.2.7/flowplayer.swf",
4161
+ swfHls: "//releases.flowplayer.org/7.2.7/flowplayerhls.swf",
4162
 
4163
  speeds: [0.25, 0.5, 1, 1.5, 2],
4164
 
4166
 
4167
  mouseoutTimeout: 5000,
4168
 
4169
+ mutedAutoplay: true,
4170
+
4171
+ clickToUnMute: true,
4172
+
4173
  // initial volume level
4174
+ volume: 1,
4175
 
4176
  // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#error-codes
4177
  errors: [
4224
  // auto-install (any video tag with parent .flowplayer)
4225
  $(function() {
4226
  if (typeof $.fn.flowplayer == 'function') {
4227
+ $('.flowplayer:has(video:not(.fp-engine),script[type="application/json"])').flowplayer();
4228
  }
4229
  });
4230
 
4274
  function initializePlayer(element, opts, callback) {
4275
  if (opts && opts.embed) opts.embed = extend({}, flowplayer.defaults.embed, opts.embed);
4276
 
4277
+ var supportLocalStorage = false;
4278
+ try {
4279
+ if (typeof flowplayer.conf.storage === 'undefined' && typeof window.localStorage == "object") {
4280
+ window.localStorage.flowplayerTestStorage = "test";
4281
+ supportLocalStorage = true;
4282
+ }
4283
+ } catch (ignored) {}
4284
+
4285
+
4286
+
4287
  var root = element,
4288
  conf = extend({}, flowplayer.defaults, flowplayer.conf, opts),
4289
  storage = {},
4290
+ originalClass = root.className,
4291
  lastSeekPosition,
4292
  engine,
4293
  urlResolver = new URLResolver();
4296
  common.toggleClass(root, 'no-flex', !flowplayer.support.flex);
4297
  common.toggleClass(root, 'no-svg', !flowplayer.support.svg);
4298
  try {
4299
+ storage = flowplayer.conf.storage || (supportLocalStorage ? window.localStorage : storage);
4300
  } catch(e) {}
4301
 
4302
+ conf.volume = storage.muted === "true" ? 0 : conf.volume !== flowplayer.defaults.volume ? conf.volume : !isNaN(storage.volume) ? storage.volume : conf.volume;
4303
+
4304
+ conf.debug = !!storage.flowplayerDebug || conf.debug;
4305
+
4306
  if (conf.aspectRatio && typeof conf.aspectRatio === 'string') {
4307
  var parts = conf.aspectRatio.split(/[:\/]/);
4308
  conf.ratio = parts[1] / parts[0];
4381
  });
4382
  }
4383
 
4384
+ extend(video, engine.pick(video.sources.filter(function(source) { // Filter out sources explicitly configured for some other engine
4385
  if (!source.engine) return true;
4386
  return source.engine === engine.engineName;
4387
  })));
4442
  */
4443
  seek: function(time, callback) {
4444
  if (typeof time == "boolean") {
4445
+ var delta = api.conf.seekStep || api.video.duration * 0.1;
4446
  time = api.video.time + (time ? delta : -delta);
4447
  time = Math.min(Math.max(time, 0), api.video.duration - 0.1);
4448
  }
4479
 
4480
  mute: function(flag, skipStore) {
4481
  if (flag === undefined) flag = !api.muted;
4482
+ api.muted = flag;
4483
  if (!skipStore) {
4484
+ storage.muted = flag;
4485
  storage.volume = !isNaN(storage.volume) ? storage.volume : conf.volume; // make sure storage has volume
4486
  }
4487
  if (typeof engine.mute !== 'undefined') engine.mute(flag);
4614
 
4615
 
4616
  api.on('boot', function() {
4617
+ var support = flowplayer.support;
4618
 
4619
  // splash
4620
  if (conf.splash || common.hasClass(root, "is-splash") ||
4651
  // initial callback
4652
  api.one("ready", callback);
4653
 
4654
+ api.one('shutdown', function() { root.className = originalClass; });
4655
+
4656
 
4657
  }).on("load", function(e, api, video) {
4658
 
4711
  }).on("progress", function(e, api, time) {
4712
  api.video.time = time;
4713
  }).on('buffer', function(e, api, buffered) {
4714
+ api.video.buffer = typeof buffered === 'number' ? buffered : buffered.length ? buffered[buffered.length - 1].end : 0;
4715
  }).on("speed", function(e, api, val) {
4716
  api.currentSpeed = val;
4717
 
4718
  }).on("volume", function(e, api, level) {
4719
  api.volumeLevel = Math.round(level * 100) / 100;
4720
+ if (api.muted && level) api.mute(false);
 
4721
 
4722
 
4723
  }).on("beforeseek seek", function(e) {
4792
  _dereq_('./ext/fullscreen');
4793
 
4794
  _dereq_('./ext/mobile');
4795
+ flowplayer(function(e,o){function a(e){var o=document.createElement("a");return o.href=e,t.hostname(o.hostname)}var l=function(e,o){var a=e.className.split(" ");-1===a.indexOf(o)&&(e.className+=" "+o)},r=function(e){return"none"!==window.getComputedStyle(e).display},n=e.conf,t=flowplayer.common,p=t.createElement,i=n.swf.indexOf("flowplayer.org")&&n.e&&o.getAttribute("data-origin"),f=i?a(i):t.hostname(),s=(document,n.key);if("file:"==location.protocol&&(f="localhost"),e.load.ed=1,n.hostname=f,n.origin=i||location.href,i&&l(o,"is-embedded"),"string"==typeof s&&(s=s.split(/,\s*/)),s&&"function"==typeof key_check&&key_check(s,f)){if(n.logo){var d=t.find(".fp-player",o)[0],c=n.logo.href||"",h=n.logo.src||n.logo,m=p("a",{className:"fp-logo",href:c});i&&(m.href=m.href||i),n.embed&&n.embed.popup&&(m.target="_blank");var y=p("img",{src:h});m.appendChild(y),(d||o).appendChild(m)}}else{var m=p("a",{href:"https://flowplayer.com/hello/?from=player"}),d=t.find(".fp-player",o)[0];(d||o).appendChild(m);var u=p("div",{className:"fp-context-menu fp-menu"},'<strong>&copy; 2018 Flowplayer AB</strong><a href="https://flowplayer.com/hello/?from=player">About Flowplayer</a><a href="https://flowplayer.com/license">GPL based license</a>'),g=window.location.href.indexOf("localhost");7!==g&&(d||o).appendChild(u),e.on("pause resume finish unload ready",function(e,a){var l=-1;if(a.video.src)for(var n=[["org","flowplayer","drive"],["org","flowplayer","my"],["org","flowplayer","cdn"],["com","flowplayer","cdn"]],t=0;t<n.length&&(l=a.video.src.indexOf("://"+n[t].reverse().join(".")),-1===l);t++);if(/pause|resume/.test(e.type)&&"flash"!=a.engine.engineName&&4!=l&&5!=l){var p={display:"block",position:"absolute",left:"16px",bottom:"70px",zIndex:99999,width:"100px",height:"20px",backgroundImage:"url("+[".png","logo","/",".net",".cloudfront","d32wqyuo10o653","//","https:"].reverse().join("")+")"};for(var i in p)p.hasOwnProperty(i)&&(m.style[i]=p[i]);a.load.ed=r(m)&&(7===g||u.parentNode==o||u.parentNode==d),a.load.ed||a.pause()}else m.style.display="none"})}});
4796
 
4797
 
4798
  },{"./engine/embed":2,"./engine/flash":3,"./engine/hlsjs":4,"./engine/html5":6,"./ext/airplay":7,"./ext/analytics":8,"./ext/chromecast":9,"./ext/cuepoint":10,"./ext/embed":11,"./ext/facebook":13,"./ext/fullscreen":14,"./ext/keyboard":15,"./ext/menu":16,"./ext/message":17,"./ext/mobile":18,"./ext/playlist":19,"./ext/qsel":20,"./ext/share":22,"./ext/subtitle":23,"./ext/support":25,"./ext/twitter":26,"./ext/ui":27,"./flowplayer":31,"es5-shim":38}],33:[function(_dereq_,module,exports){
4812
  revLookup[code.charCodeAt(i)] = i
4813
  }
4814
 
4815
+ // Support decoding URL-safe base64 strings, as Node.js does.
4816
+ // See: https://en.wikipedia.org/wiki/Base64#URL_applications
4817
  revLookup['-'.charCodeAt(0)] = 62
4818
  revLookup['_'.charCodeAt(0)] = 63
4819
 
4820
+ function getLens (b64) {
4821
  var len = b64.length
4822
+
4823
  if (len % 4 > 0) {
4824
  throw new Error('Invalid string. Length must be a multiple of 4')
4825
  }
4826
 
4827
+ // Trim off extra bytes after placeholder bytes are found
4828
+ // See: https://github.com/beatgammit/base64-js/issues/42
4829
+ var validLen = b64.indexOf('=')
4830
+ if (validLen === -1) validLen = len
4831
+
4832
+ var placeHoldersLen = validLen === len
4833
+ ? 0
4834
+ : 4 - (validLen % 4)
4835
+
4836
+ return [validLen, placeHoldersLen]
4837
  }
4838
 
4839
+ // base64 is 4/3 + up to two characters of the original data
4840
  function byteLength (b64) {
4841
+ var lens = getLens(b64)
4842
+ var validLen = lens[0]
4843
+ var placeHoldersLen = lens[1]
4844
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
4845
+ }
4846
+
4847
+ function _byteLength (b64, validLen, placeHoldersLen) {
4848
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
4849
  }
4850
 
4851
  function toByteArray (b64) {
4852
+ var tmp
4853
+ var lens = getLens(b64)
4854
+ var validLen = lens[0]
4855
+ var placeHoldersLen = lens[1]
4856
 
4857
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
4858
+
4859
+ var curByte = 0
4860
 
4861
  // if there are placeholders, only get up to the last complete 4 chars
4862
+ var len = placeHoldersLen > 0
4863
+ ? validLen - 4
4864
+ : validLen
4865
 
4866
+ for (var i = 0; i < len; i += 4) {
4867
+ tmp =
4868
+ (revLookup[b64.charCodeAt(i)] << 18) |
4869
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
4870
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
4871
+ revLookup[b64.charCodeAt(i + 3)]
4872
+ arr[curByte++] = (tmp >> 16) & 0xFF
4873
+ arr[curByte++] = (tmp >> 8) & 0xFF
4874
+ arr[curByte++] = tmp & 0xFF
4875
+ }
4876
 
4877
+ if (placeHoldersLen === 2) {
4878
+ tmp =
4879
+ (revLookup[b64.charCodeAt(i)] << 2) |
4880
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
4881
+ arr[curByte++] = tmp & 0xFF
4882
  }
4883
 
4884
+ if (placeHoldersLen === 1) {
4885
+ tmp =
4886
+ (revLookup[b64.charCodeAt(i)] << 10) |
4887
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
4888
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
4889
+ arr[curByte++] = (tmp >> 8) & 0xFF
4890
+ arr[curByte++] = tmp & 0xFF
4891
  }
4892
 
4893
  return arr
4894
  }
4895
 
4896
  function tripletToBase64 (num) {
4897
+ return lookup[num >> 18 & 0x3F] +
4898
+ lookup[num >> 12 & 0x3F] +
4899
+ lookup[num >> 6 & 0x3F] +
4900
+ lookup[num & 0x3F]
4901
  }
4902
 
4903
  function encodeChunk (uint8, start, end) {
4904
  var tmp
4905
  var output = []
4906
  for (var i = start; i < end; i += 3) {
4907
+ tmp =
4908
+ ((uint8[i] << 16) & 0xFF0000) +
4909
+ ((uint8[i + 1] << 8) & 0xFF00) +
4910
+ (uint8[i + 2] & 0xFF)
4911
  output.push(tripletToBase64(tmp))
4912
  }
4913
  return output.join('')
4917
  var tmp
4918
  var len = uint8.length
4919
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
 
4920
  var parts = []
4921
  var maxChunkLength = 16383 // must be multiple of 3
4922
 
4923
  // go through the array every three bytes, we'll deal with trailing stuff later
4924
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
4925
+ parts.push(encodeChunk(
4926
+ uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
4927
+ ))
4928
  }
4929
 
4930
  // pad the end with zeros, but make sure to not forget the extra bytes
4931
  if (extraBytes === 1) {
4932
  tmp = uint8[len - 1]
4933
+ parts.push(
4934
+ lookup[tmp >> 2] +
4935
+ lookup[(tmp << 4) & 0x3F] +
4936
+ '=='
4937
+ )
4938
  } else if (extraBytes === 2) {
4939
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
4940
+ parts.push(
4941
+ lookup[tmp >> 10] +
4942
+ lookup[(tmp >> 4) & 0x3F] +
4943
+ lookup[(tmp << 2) & 0x3F] +
4944
+ '='
4945
+ )
4946
  }
4947
 
 
 
4948
  return parts.join('')
4949
  }
4950
 
7957
  var toStr = call.bind(ObjectPrototype.toString);
7958
  var arraySlice = call.bind(array_slice);
7959
  var arraySliceApply = apply.bind(array_slice);
7960
+ /* globals document */
7961
+ if (typeof document === 'object' && document && document.documentElement) {
7962
+ try {
7963
+ arraySlice(document.documentElement.childNodes);
7964
+ } catch (e) {
7965
+ var origArraySlice = arraySlice;
7966
+ var origArraySliceApply = arraySliceApply;
7967
+ arraySlice = function arraySliceIE(arr) {
7968
+ var r = [];
7969
+ var i = arr.length;
7970
+ while (i-- > 0) {
7971
+ r[i] = arr[i];
7972
+ }
7973
+ return origArraySliceApply(r, origArraySlice(arguments, 1));
7974
+ };
7975
+ arraySliceApply = function arraySliceApplyIE(arr, args) {
7976
+ return origArraySliceApply(arraySlice(arr), args);
7977
+ };
7978
+ }
7979
+ }
7980
  var strSlice = call.bind(StringPrototype.slice);
7981
  var strSplit = call.bind(StringPrototype.split);
7982
  var strIndexOf = call.bind(StringPrototype.indexOf);
8570
  var sortIgnoresNonFunctions = (function () {
8571
  try {
8572
  [1, 2].sort(null);
8573
+ } catch (e) {
8574
+ try {
8575
+ [1, 2].sort({});
8576
+ } catch (e2) {
8577
+ return false;
8578
+ }
8579
+ }
8580
+ return true;
8581
  }());
8582
  var sortThrowsOnRegex = (function () {
8583
  // this is a problem in Firefox 4, in which `typeof /a/ === 'function'`
8616
  // http://es5.github.com/#x15.2.3.14
8617
 
8618
  // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
8619
+ var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString'); // jscs:ignore disallowQuotedKeysInObjects
8620
  var hasProtoEnumBug = isEnum(function () {}, 'prototype');
8621
  var hasStringEnumBug = !owns('x', '0');
8622
  var equalsConstructorPrototype = function (o) {
8623
  var ctor = o.constructor;
8624
  return ctor && ctor.prototype === o;
8625
  };
8626
+ var excludedKeys = {
8627
  $window: true,
8628
  $console: true,
8629
  $parent: true,
8633
  $frameElement: true,
8634
  $webkitIndexedDB: true,
8635
  $webkitStorageInfo: true,
8636
+ $external: true,
8637
+ $width: true,
8638
+ $height: true,
8639
+ $top: true,
8640
+ $localStorage: true
8641
  };
8642
  var hasAutomationEqualityBug = (function () {
8643
  /* globals window */
8646
  }
8647
  for (var k in window) {
8648
  try {
8649
+ if (!excludedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
8650
  equalsConstructorPrototype(window[k]);
8651
  }
8652
  } catch (e) {
8682
  return toStr(value) === '[object Arguments]';
8683
  };
8684
  var isLegacyArguments = function isArguments(value) {
8685
+ return value !== null
8686
+ && typeof value === 'object'
8687
+ && typeof value.length === 'number'
8688
+ && value.length >= 0
8689
+ && !isArray(value)
8690
+ && isCallable(value.callee);
8691
  };
8692
  var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
8693
 
8764
  var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
8765
  if (timeZoneOffset < -720) {
8766
  hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
8767
+ hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate));
8768
  } else {
8769
  hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
8770
+ hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate));
8771
  }
8772
 
8773
  var originalGetFullYear = call.bind(Date.prototype.getFullYear);
8876
  var hour = originalGetUTCHours(this);
8877
  var minute = originalGetUTCMinutes(this);
8878
  var second = originalGetUTCSeconds(this);
8879
+ return dayName[day] + ', '
8880
+ + (date < 10 ? '0' + date : date) + ' '
8881
+ + monthName[month] + ' '
8882
+ + year + ' '
8883
+ + (hour < 10 ? '0' + hour : hour) + ':'
8884
+ + (minute < 10 ? '0' + minute : minute) + ':'
8885
+ + (second < 10 ? '0' + second : second) + ' GMT';
8886
  }
8887
  }, hasNegativeMonthYearBug || hasToUTCStringFormatBug);
8888
 
8896
  var date = this.getDate();
8897
  var month = this.getMonth();
8898
  var year = this.getFullYear();
8899
+ return dayName[day] + ' '
8900
+ + monthName[month] + ' '
8901
+ + (date < 10 ? '0' + date : date) + ' '
8902
+ + year;
8903
  }
8904
  }, hasNegativeMonthYearBug || hasToDateStringFormatBug);
8905
 
8919
  var timezoneOffset = this.getTimezoneOffset();
8920
  var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
8921
  var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
8922
+ return dayName[day] + ' '
8923
+ + monthName[month] + ' '
8924
+ + (date < 10 ? '0' + date : date) + ' '
8925
+ + year + ' '
8926
+ + (hour < 10 ? '0' + hour : hour) + ':'
8927
+ + (minute < 10 ? '0' + minute : minute) + ':'
8928
+ + (second < 10 ? '0' + second : second) + ' GMT'
8929
+ + (timezoneOffset > 0 ? '-' : '+')
8930
+ + (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset)
8931
+ + (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset);
8932
  };
8933
  if (supportsDescriptors) {
8934
  $Object.defineProperty(Date.prototype, 'toString', {
8948
  // this object is not a finite Number a RangeError exception is thrown.
8949
  var negativeDate = -62198755200000;
8950
  var negativeYearString = '-000001';
8951
+ var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; // eslint-disable-line max-len
8952
  var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
8953
 
8954
  var getTime = call.bind(Date.prototype.getTime);
8965
  var month = originalGetUTCMonth(this);
8966
  // see https://github.com/es-shims/es5-shim/issues/111
8967
  year += Math.floor(month / 12);
8968
+ month = ((month % 12) + 12) % 12;
8969
 
8970
  // the date time string format is specified in 15.9.1.15.
8971
+ var result = [
8972
+ month + 1,
8973
+ originalGetUTCDate(this),
8974
+ originalGetUTCHours(this),
8975
+ originalGetUTCMinutes(this),
8976
+ originalGetUTCSeconds(this)
8977
+ ];
8978
  year = (
8979
+ (year < 0 ? '-' : (year > 9999 ? '+' : ''))
8980
+ + strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
8981
  );
8982
 
8983
  for (var i = 0; i < result.length; ++i) {
8986
  }
8987
  // pad milliseconds to have three digits.
8988
  return (
8989
+ year + '-' + arraySlice(result, 0, 2).join('-')
8990
+ + 'T' + arraySlice(result, 2).join(':') + '.'
8991
+ + strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z'
8992
  );
8993
  }
8994
  }, hasNegativeDateBug || hasSafari51DateBug);
8999
  // JSON.stringify (15.12.3).
9000
  var dateToJSONIsSupported = (function () {
9001
  try {
9002
+ return Date.prototype.toJSON
9003
+ && new Date(NaN).toJSON() === null
9004
+ && new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1
9005
+ && Date.prototype.toJSON.call({ // generic
9006
  toISOString: function () { return true; }
9007
  });
9008
  } catch (e) {
9056
  // XXX global assignment won't work in embeddings that use
9057
  // an alternate object for the context.
9058
  /* global Date: true */
 
9059
  var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
9060
  var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
9061
+ // eslint-disable-next-line no-implicit-globals, no-global-assign
9062
  Date = (function (NativeDate) {
 
 
9063
  // Date.length === 7
9064
  var DateShim = function Date(Y, M, D, h, m, s, ms) {
9065
  var length = arguments.length;
9074
  seconds += sToShift;
9075
  millis -= sToShift * 1e3;
9076
  }
9077
+ date = length === 1 && $String(Y) === Y // isString(Y)
9078
  // We explicitly pass it through parse:
9079
+ ? new NativeDate(DateShim.parse(Y))
9080
  // We have to manually make calls depending on argument
9081
  // length here
9082
+ : length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis)
9083
+ : length >= 6 ? new NativeDate(Y, M, D, h, m, seconds)
9084
+ : length >= 5 ? new NativeDate(Y, M, D, h, m)
9085
+ : length >= 4 ? new NativeDate(Y, M, D, h)
9086
+ : length >= 3 ? new NativeDate(Y, M, D)
9087
+ : length >= 2 ? new NativeDate(Y, M)
9088
+ : length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y)
9089
+ : new NativeDate();
9090
  } else {
9091
  date = NativeDate.apply(this, arguments);
9092
  }
9098
  };
9099
 
9100
  // 15.9.1.15 Date Time String Format.
9101
+ var isoDateExpression = new RegExp('^'
9102
+ + '(\\d{4}|[+-]\\d{6})' // four-digit year capture or sign + 6-digit extended year
9103
+ + '(?:-(\\d{2})' // optional month capture
9104
+ + '(?:-(\\d{2})' // optional day capture
9105
+ + '(?:' // capture hours:minutes:seconds.milliseconds
9106
+ + 'T(\\d{2})' // hours capture
9107
+ + ':(\\d{2})' // minutes capture
9108
+ + '(?:' // optional :seconds.milliseconds
9109
+ + ':(\\d{2})' // seconds capture
9110
+ + '(?:(\\.\\d{1,}))?' // milliseconds capture
9111
+ + ')?'
9112
+ + '(' // capture UTC offset component
9113
+ + 'Z|' // UTC capture
9114
+ + '(?:' // offset specifier +/-hours:minutes
9115
+ + '([-+])' // sign capture
9116
+ + '(\\d{2})' // hours offset capture
9117
+ + ':(\\d{2})' // minutes offset capture
9118
+ + ')'
9119
+ + ')?)?)?)?'
9120
+ + '$');
 
9121
 
9122
  var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
9123
 
9124
  var dayFromMonth = function dayFromMonth(year, month) {
9125
  var t = month > 1 ? 1 : 0;
9126
  return (
9127
+ months[month]
9128
+ + Math.floor((year - 1969 + t) / 4)
9129
+ - Math.floor((year - 1901 + t) / 100)
9130
+ + Math.floor((year - 1601 + t) / 400)
9131
+ + (365 * (year - 1970))
9132
  );
9133
  };
9134
 
9158
  UTC: NativeDate.UTC
9159
  }, true);
9160
  DateShim.prototype = NativeDate.prototype;
9161
+ defineProperties(DateShim.prototype, { constructor: DateShim }, true);
 
 
9162
 
9163
  // Upgrade Date.parse to handle simplified ISO 8601 strings
9164
  var parseShim = function parse(string) {
9184
  result;
9185
  var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
9186
  if (
9187
+ hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25)
9188
+ && minute < 60 && second < 60 && millisecond < 1000
9189
+ && month > -1 && month < 12 && hourOffset < 24
9190
+ && minuteOffset < 60 // detect invalid offsets
9191
+ && day > -1
9192
+ && day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
9193
  ) {
9194
  result = (
9195
+ ((dayFromMonth(year, month) + day) * 24)
9196
+ + hour
9197
+ + (hourOffset * signOffset)
9198
  ) * 60;
9199
+ result = ((
9200
+ ((result + minute + (minuteOffset * signOffset)) * 60)
9201
+ + second
9202
+ ) * 1000) + millisecond;
9203
  if (isLocalTime) {
9204
  result = toUTC(result);
9205
  }
9234
  // ES5.1 15.7.4.5
9235
  // http://es5.github.com/#x15.7.4.5
9236
  var hasToFixedBugs = NumberPrototype.toFixed && (
9237
+ (0.00008).toFixed(3) !== '0.000'
9238
+ || (0.9).toFixed(0) !== '1'
9239
+ || (1.255).toFixed(2) !== '1.25'
9240
+ || (1000000000000000128).toFixed(0) !== '1000000000000000128'
9241
  );
9242
 
9243
  var toFixedHelpers = {
9415
  // '.'.split(/()()/) should be ["."], not ["", "", "."]
9416
 
9417
  if (
9418
+ 'ab'.split(/(?:ab)*/).length !== 2
9419
+ || '.'.split(/(.?)(.?)/).length !== 4
9420
+ || 'tesst'.split(/(s)*/)[1] === 't'
9421
+ || 'test'.split(/(?:)/, -1).length !== 4
9422
+ || ''.split(/.?/).length
9423
+ || '.'.split(/()()/).length > 1
9424
  ) {
9425
  (function () {
9426
  var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
9438
  }
9439
 
9440
  var output = [];
9441
+ var flags = (separator.ignoreCase ? 'i' : '')
9442
+ + (separator.multiline ? 'm' : '')
9443
+ + (separator.unicode ? 'u' : '') // in ES6
9444
+ + (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
9445
  lastLastIndex = 0,
9446
  // Make `global` and avoid `lastIndex` issues by working with a copy
9447
  separator2, match, lastIndex, lastLength;
9566
 
9567
  // ES5 15.5.4.20
9568
  // whitespace from: http://es5.github.io/#x15.5.4.20
9569
+ var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003'
9570
+ + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028'
9571
+ + '\u2029\uFEFF';
9572
  var zeroWidth = '\u200b';
9573
  var wsRegexChars = '[' + ws + ']';
9574
  var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
9618
  }, StringPrototype.lastIndexOf.length !== 1);
9619
 
9620
  // ES-5 15.1.2.2
9621
+ // eslint-disable-next-line radix
9622
  if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
 
9623
  /* global parseInt: true */
9624
  parseInt = (function (origParseInt) {
9625
+ var hexRegex = /^[-+]?0[xX]/;
9626
  return function parseInt(str, radix) {
9627
+ if (typeof str === 'symbol') {
9628
+ // handle Symbols in node 8.3/8.4
9629
+ // eslint-disable-next-line no-implicit-coercion, no-unused-expressions
9630
+ '' + str; // jscs:ignore disallowImplicitTypeConversion
9631
+ }
9632
+
9633
  var string = trim(String(str));
9634
  var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
9635
  return origParseInt(string, defaultedRadix);
9734
  },{}],40:[function(_dereq_,module,exports){
9735
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
9736
  var e, m
9737
+ var eLen = (nBytes * 8) - mLen - 1
9738
  var eMax = (1 << eLen) - 1
9739
  var eBias = eMax >> 1
9740
  var nBits = -7
9747
  e = s & ((1 << (-nBits)) - 1)
9748
  s >>= (-nBits)
9749
  nBits += eLen
9750
+ for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
9751
 
9752
  m = e & ((1 << (-nBits)) - 1)
9753
  e >>= (-nBits)
9754