MediaElement.js – HTML5 Video & Audio Player - Version 2.2.5

Version Description

  • Update to 2.2.5 codebase
  • Support for true fullscreen in Chrome and Firefox (in addition to Safari)
  • Support for 100% sizing
Download this release

Release Info

Developer johndyer
Plugin Icon 128x128 MediaElement.js – HTML5 Video & Audio Player
Version 2.2.5
Comparing to
See all releases

Code changes from version 2.1.7 to 2.2.5

mediaelement-js-wp.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package MediaElementJS
4
- * @version 2.1.7
5
  */
6
 
7
  /*
@@ -9,7 +9,7 @@ Plugin Name: MediaElement.js - HTML5 Audio and Video
9
  Plugin URI: http://mediaelementjs.com/
10
  Description: Video and audio plugin for WordPress built on MediaElement.js HTML5 video and audio player library. Embeds media in your post or page using HTML5 with Flash or Silverlight fallback support for non-HTML5 browsers. Video support: MP4, Ogg, WebM, WMV. Audio support: MP3, WMA, WAV
11
  Author: John Dyer
12
- Version: 2.1.7
13
  Author URI: http://j.hn/
14
  License: GPLv3, MIT
15
  */
1
  <?php
2
  /**
3
  * @package MediaElementJS
4
+ * @version 2.2.5
5
  */
6
 
7
  /*
9
  Plugin URI: http://mediaelementjs.com/
10
  Description: Video and audio plugin for WordPress built on MediaElement.js HTML5 video and audio player library. Embeds media in your post or page using HTML5 with Flash or Silverlight fallback support for non-HTML5 browsers. Video support: MP4, Ogg, WebM, WMV. Audio support: MP3, WMA, WAV
11
  Author: John Dyer
12
+ Version: 2.2.5
13
  Author URI: http://j.hn/
14
  License: GPLv3, MIT
15
  */
mediaelement/flashmediaelement.swf CHANGED
Binary file
mediaelement/mediaelement-and-player.js CHANGED
@@ -15,7 +15,7 @@
15
  var mejs = mejs || {};
16
 
17
  // version number
18
- mejs.version = '2.1.7';
19
 
20
  // player number (for missing, same id attr)
21
  mejs.meIndex = 0;
@@ -27,7 +27,7 @@ mejs.plugins = {
27
  ],
28
  flash: [
29
  {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg']}
30
- //,{version: [11,0], types: ['video/webm']} // for future reference
31
  ]
32
  };
33
 
@@ -70,23 +70,48 @@ mejs.Utility = {
70
  }
71
  return path;
72
  },
73
- secondsToTimeCode: function(seconds,forceHours) {
74
- seconds = Math.round(seconds);
75
- var hours,
76
- minutes = Math.floor(seconds / 60);
77
- if (minutes >= 60) {
78
- hours = Math.floor(minutes / 60);
79
- minutes = minutes % 60;
80
- }
81
- hours = hours === undefined ? "00" : (hours >= 10) ? hours : "0" + hours;
82
- minutes = (minutes >= 10) ? minutes : "0" + minutes;
83
- seconds = Math.floor(seconds % 60);
84
- seconds = (seconds >= 10) ? seconds : "0" + seconds;
85
- return ((hours > 0 || forceHours === true) ? hours + ":" :'') + minutes + ":" + seconds;
 
 
 
 
 
 
86
  },
87
- timeCodeToSeconds: function(timecode){
88
- var tab = timecode.split(':');
89
- return tab[0]*60*60 + tab[1]*60 + parseFloat(tab[2].replace(',','.'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  };
92
 
@@ -192,18 +217,12 @@ PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PD
192
  return version;
193
  });
194
  */
195
-
196
- // special case for Android which sadly doesn't implement the canPlayType function (always returns '')
197
- if (mejs.PluginDetector.ua.match(/android 2\.[12]/) !== null) {
198
- HTMLMediaElement.canPlayType = function(type) {
199
- return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'probably' : '';
200
- };
201
- }
202
-
203
  // necessary detection (fixes for <IE9)
204
  mejs.MediaFeatures = {
205
  init: function() {
206
  var
 
 
207
  nav = mejs.PluginDetector.nav,
208
  ua = mejs.PluginDetector.ua.toLowerCase(),
209
  i,
@@ -211,26 +230,78 @@ mejs.MediaFeatures = {
211
  html5Elements = ['source','track','audio','video'];
212
 
213
  // detect browsers (only the ones that have some kind of quirk we need to work around)
214
- this.isiPad = (ua.match(/ipad/i) !== null);
215
- this.isiPhone = (ua.match(/iphone/i) !== null);
216
- this.isAndroid = (ua.match(/android/i) !== null);
217
- this.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1);
218
- this.isChrome = (ua.match(/chrome/gi) !== null);
 
 
 
 
 
219
 
220
  // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
221
  for (i=0; i<html5Elements.length; i++) {
222
  v = document.createElement(html5Elements[i]);
223
  }
 
 
224
 
225
- // detect native JavaScript fullscreen (Safari only, Chrome fails)
226
- this.hasNativeFullScreen = (typeof v.webkitEnterFullScreen !== 'undefined');
 
 
 
 
 
 
 
 
 
 
227
  if (this.isChrome) {
228
- this.hasNativeFullScreen = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  }
 
 
230
  // OS X 10.5 can't do this even if it says it can :(
231
- if (this.hasNativeFullScreen && ua.match(/mac os x 10_5/i)) {
232
- this.hasNativeFullScreen = false;
 
233
  }
 
234
  }
235
  };
236
  mejs.MediaFeatures.init();
@@ -263,6 +334,14 @@ mejs.HtmlMediaElement = {
263
  // This can be a url string
264
  // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
265
  setSrc: function (url) {
 
 
 
 
 
 
 
 
266
  if (typeof url == 'string') {
267
  this.src = url;
268
  } else {
@@ -427,6 +506,14 @@ mejs.PluginMediaElement.prototype = {
427
  this.pluginApi.setFullscreen(fullscreen);
428
  }
429
  },
 
 
 
 
 
 
 
 
430
 
431
  // start: fake events
432
  addEventListener: function (eventName, callback, bubble) {
@@ -572,6 +659,8 @@ mejs.MediaElementDefaults = {
572
  // rate in milliseconds for Flash and Silverlight to fire the timeupdate event
573
  // larger number is less accurate, but less strain on plugin->JavaScript bridge
574
  timerRate: 250,
 
 
575
  success: function () { },
576
  error: function () { }
577
  };
@@ -591,13 +680,14 @@ mejs.HtmlMediaElementShim = {
591
  var
592
  options = mejs.MediaElementDefaults,
593
  htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el,
594
- isVideo = (htmlMediaElement.tagName.toLowerCase() == 'video'),
595
- supportsMediaTag = (typeof(htmlMediaElement.canPlayType) != 'undefined'),
596
- playback = {method:'', url:''},
597
  poster = htmlMediaElement.getAttribute('poster'),
598
  autoplay = htmlMediaElement.getAttribute('autoplay'),
599
  preload = htmlMediaElement.getAttribute('preload'),
600
  controls = htmlMediaElement.getAttribute('controls'),
 
601
  prop;
602
 
603
  // extend options
@@ -605,28 +695,39 @@ mejs.HtmlMediaElementShim = {
605
  options[prop] = o[prop];
606
  }
607
 
608
- // check for real poster
 
609
  poster = (typeof poster == 'undefined' || poster === null) ? '' : poster;
610
  preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload;
611
  autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false');
612
  controls = !(typeof controls == 'undefined' || controls === null || controls === 'false');
613
 
614
  // test for HTML5 and plugin capabilities
615
- playback = this.determinePlayback(htmlMediaElement, options, isVideo, supportsMediaTag);
 
616
 
617
  if (playback.method == 'native') {
 
 
 
 
 
 
 
 
618
  // add methods to native HTMLMediaElement
619
- return this.updateNative( htmlMediaElement, options, autoplay, preload, playback);
620
  } else if (playback.method !== '') {
621
  // create plugin to mimic HTMLMediaElement
622
- return this.createPlugin( htmlMediaElement, options, isVideo, playback.method, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster, autoplay, preload, controls);
 
623
  } else {
624
  // boo, no HTML5, no Flash, no Silverlight.
625
- this.createErrorMessage( htmlMediaElement, options, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster );
626
  }
627
  },
628
-
629
- determinePlayback: function(htmlMediaElement, options, isVideo, supportsMediaTag) {
630
  var
631
  mediaFiles = [],
632
  i,
@@ -635,25 +736,30 @@ mejs.HtmlMediaElementShim = {
635
  l,
636
  n,
637
  type,
638
- result = { method: '', url: ''},
639
- src = htmlMediaElement.getAttribute('src'),
640
  pluginName,
641
  pluginVersions,
642
- pluginInfo;
643
-
644
- // clean up src attr
645
- if (src == 'undefined' || src == '' || src === null)
646
- src = null;
647
 
648
  // STEP 1: Get URL and type from <video src> or <source src>
649
 
650
- // supplied type overrides all HTML
651
- if (typeof (options.type) != 'undefined' && options.type !== '') {
652
- mediaFiles.push({type:options.type, url:src});
 
 
 
 
 
 
 
 
 
653
 
654
  // test for src attribute first
655
- } else if (src !== null) {
656
- type = this.checkType(src, htmlMediaElement.getAttribute('type'), isVideo);
657
  mediaFiles.push({type:type, url:src});
658
 
659
  // then test for <source> elements
@@ -663,16 +769,43 @@ mejs.HtmlMediaElementShim = {
663
  n = htmlMediaElement.childNodes[i];
664
  if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') {
665
  src = n.getAttribute('src');
666
- type = this.checkType(src, n.getAttribute('type'), isVideo);
667
  mediaFiles.push({type:type, url:src});
668
  }
669
  }
670
  }
 
 
 
 
 
 
 
671
 
672
  // STEP 2: Test for playback method
 
 
 
 
 
 
 
 
673
 
674
  // test for native playback first
675
  if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'native')) {
 
 
 
 
 
 
 
 
 
 
 
 
676
  for (i=0; i<mediaFiles.length; i++) {
677
  // normal check
678
  if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== ''
@@ -680,8 +813,16 @@ mejs.HtmlMediaElementShim = {
680
  || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '') {
681
  result.method = 'native';
682
  result.url = mediaFiles[i].url;
683
- return result;
684
  }
 
 
 
 
 
 
 
 
685
  }
686
  }
687
 
@@ -726,13 +867,12 @@ mejs.HtmlMediaElementShim = {
726
  return result;
727
  },
728
 
729
- checkType: function(url, type, isVideo) {
730
  var ext;
731
 
732
  // if no type is supplied, fake it with the extension
733
- if (url && !type) {
734
- ext = url.substring(url.lastIndexOf('.') + 1);
735
- return ((isVideo) ? 'video' : 'audio') + '/' + ext;
736
  } else {
737
  // only return the mime part of the type in case the attribute contains the codec
738
  // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element
@@ -745,9 +885,17 @@ mejs.HtmlMediaElementShim = {
745
  }
746
  }
747
  },
 
 
 
 
 
748
 
749
- createErrorMessage: function(htmlMediaElement, options, downloadUrl, poster) {
750
- var errorContainer = document.createElement('div');
 
 
 
751
  errorContainer.className = 'me-cannotplay';
752
 
753
  try {
@@ -756,8 +904,8 @@ mejs.HtmlMediaElementShim = {
756
  } catch (e) {}
757
 
758
  errorContainer.innerHTML = (poster !== '') ?
759
- '<a href="' + downloadUrl + '"><img src="' + poster + '" /></a>' :
760
- '<a href="' + downloadUrl + '"><span>Download File</span></a>';
761
 
762
  htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
763
  htmlMediaElement.style.display = 'none';
@@ -765,11 +913,13 @@ mejs.HtmlMediaElementShim = {
765
  options.error(htmlMediaElement);
766
  },
767
 
768
- createPlugin:function(htmlMediaElement, options, isVideo, pluginType, mediaUrl, poster, autoplay, preload, controls) {
769
- var width = 1,
 
 
770
  height = 1,
771
- pluginid = 'me_' + pluginType + '_' + (mejs.meIndex++),
772
- pluginMediaElement = new mejs.PluginMediaElement(pluginid, pluginType, mediaUrl),
773
  container = document.createElement('div'),
774
  specialIEContainer,
775
  node,
@@ -785,9 +935,14 @@ mejs.HtmlMediaElementShim = {
785
  node = node.parentNode;
786
  }
787
 
788
- if (isVideo) {
789
  width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth;
790
  height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight;
 
 
 
 
 
791
  } else {
792
  if (options.enablePluginDebug) {
793
  width = 320;
@@ -806,7 +961,7 @@ mejs.HtmlMediaElementShim = {
806
  // flash/silverlight vars
807
  initVars = [
808
  'id=' + pluginid,
809
- 'isvideo=' + ((isVideo) ? "true" : "false"),
810
  'autoplay=' + ((autoplay) ? "true" : "false"),
811
  'preload=' + preload,
812
  'width=' + width,
@@ -814,11 +969,11 @@ mejs.HtmlMediaElementShim = {
814
  'timerrate=' + options.timerRate,
815
  'height=' + height];
816
 
817
- if (mediaUrl !== null) {
818
- if (pluginType == 'flash') {
819
- initVars.push('file=' + mejs.Utility.encodeUrl(mediaUrl));
820
  } else {
821
- initVars.push('file=' + mediaUrl);
822
  }
823
  }
824
  if (options.enablePluginDebug) {
@@ -831,7 +986,7 @@ mejs.HtmlMediaElementShim = {
831
  initVars.push('controls=true'); // shows controls in the plugin if desired
832
  }
833
 
834
- switch (pluginType) {
835
  case 'silverlight':
836
  container.innerHTML =
837
  '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' +
@@ -888,9 +1043,14 @@ mejs.HtmlMediaElementShim = {
888
  return pluginMediaElement;
889
  },
890
 
891
- updateNative: function(htmlMediaElement, options, autoplay, preload, playback) {
 
 
 
 
 
892
  // add methods to video object to bring it into parity with Flash Object
893
- for (var m in mejs.HtmlMediaElement) {
894
  htmlMediaElement[m] = mejs.HtmlMediaElement[m];
895
  }
896
 
@@ -948,7 +1108,7 @@ if (typeof jQuery != 'undefined') {
948
  } else if (typeof ender != 'undefined') {
949
  mejs.$ = ender;
950
  }
951
- (function ($) {
952
 
953
  // default player values
954
  mejs.MepDefaults = {
@@ -974,10 +1134,24 @@ if (typeof jQuery != 'undefined') {
974
  enableAutosize: true,
975
  // forces the hour marker (##:00:00)
976
  alwaysShowHours: false,
 
 
 
 
 
 
977
  // Hide controls when playing and mouse is not over the video
978
  alwaysShowControls: false,
 
 
 
 
 
 
979
  // features to show
980
- features: ['playpause','current','progress','duration','tracks','volume','fullscreen']
 
 
981
  };
982
 
983
  mejs.mepIndex = 0;
@@ -989,16 +1163,11 @@ if (typeof jQuery != 'undefined') {
989
  return new mejs.MediaElementPlayer(node, o);
990
  }
991
 
992
- var
993
- t = this,
994
- mf = mejs.MediaFeatures;
995
-
996
- // create options
997
- t.options = $.extend({},mejs.MepDefaults,o);
998
- t.$media = t.$node = $(node);
999
 
1000
  // these will be reset after the MediaElement.success fires
1001
- t.node = t.media = t.$media[0];
 
1002
 
1003
  // check for existing player
1004
  if (typeof t.node.player != 'undefined') {
@@ -1007,54 +1176,11 @@ if (typeof jQuery != 'undefined') {
1007
  // attach player to DOM node for reference
1008
  t.node.player = t;
1009
  }
 
 
 
1010
 
1011
- t.isVideo = (t.media.tagName.toLowerCase() === 'video');
1012
-
1013
- /* FUTURE WORK = create player without existing <video> or <audio> node
1014
-
1015
- // if not a video or audio tag, then we'll dynamically create it
1016
- if (tagName == 'video' || tagName == 'audio') {
1017
- t.$media = $($node);
1018
- } else if (o.tagName !== '' && o.src !== '') {
1019
- // create a new node
1020
- if (o.mode == 'auto' || o.mode == 'native') {
1021
-
1022
- $media = $(o.tagName);
1023
- if (typeof o.src == 'string') {
1024
- $media.attr('src',o.src);
1025
- } else if (typeof o.src == 'object') {
1026
- // create source nodes
1027
- for (var x in o.src) {
1028
- $media.append($('<source src="' + o.src[x].src + '" type="' + o.src[x].type + '" />'));
1029
- }
1030
- }
1031
- if (o.type != '') {
1032
- $media.attr('type',o.type);
1033
- }
1034
- if (o.poster != '') {
1035
- $media.attr('poster',o.poster);
1036
- }
1037
- if (o.videoWidth > 0) {
1038
- $media.attr('width',o.videoWidth);
1039
- }
1040
- if (o.videoHeight > 0) {
1041
- $media.attr('height',o.videoHeight);
1042
- }
1043
-
1044
- $node.clear();
1045
- $node.append($media);
1046
- t.$media = $media;
1047
- } else if (o.mode == 'shim') {
1048
- $media = $();
1049
- // doesn't want a media node
1050
- // let MediaElement object handle this
1051
- }
1052
- } else {
1053
- // fail?
1054
- return;
1055
- }
1056
- */
1057
-
1058
  t.init();
1059
 
1060
  return t;
@@ -1071,15 +1197,25 @@ if (typeof jQuery != 'undefined') {
1071
  meOptions = $.extend(true, {}, t.options, {
1072
  success: function(media, domNode) { t.meReady(media, domNode); },
1073
  error: function(e) { t.handleError(e);}
1074
- });
 
1075
 
 
 
 
 
 
 
 
 
1076
 
1077
  // use native controls in iPad, iPhone, and Android
1078
- if (mf.isiPad || mf.isiPhone) {
 
1079
  // add controls and stop
1080
  t.$media.attr('controls', 'controls');
1081
 
1082
- // fix iOS 3 bug
1083
  t.$media.removeAttr('poster');
1084
 
1085
  // override Apple's autoplay override for iPads
@@ -1088,30 +1224,9 @@ if (typeof jQuery != 'undefined') {
1088
  t.media.play();
1089
  }
1090
 
1091
- } else if (mf.isAndroid) {
1092
-
1093
- if (t.isVideo) {
1094
- // Android fails when there are multiple source elements and the type is specified
1095
- // <video>
1096
- // <source src="file.mp4" type="video/mp4" />
1097
- // <source src="file.webm" type="video/webm" />
1098
- // </video>
1099
- if (t.$media.find('source').length > 0) {
1100
- // find an mp4 and make it the root element source
1101
- t.media.src = t.$media.find('source[src$="mp4"]').attr('src');
1102
- }
1103
-
1104
- // attach a click event to the video and hope Android can play it
1105
- t.$media.click(function() {
1106
- t.media.play();
1107
- });
1108
-
1109
- } else {
1110
- // audio?
1111
- // 2.1 = no support
1112
- // 2.2 = Flash support
1113
- // 2.3 = Native HTML5
1114
- }
1115
 
1116
  } else {
1117
 
@@ -1137,15 +1252,30 @@ if (typeof jQuery != 'undefined') {
1137
  .insertBefore(t.$media);
1138
 
1139
  // move the <video/video> tag into the right spot
1140
- t.container.find('.mejs-mediaelement').append(t.$media);
1141
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1142
  // find parts
1143
  t.controls = t.container.find('.mejs-controls');
1144
  t.layers = t.container.find('.mejs-layers');
1145
 
1146
  // determine the size
1147
  if (t.isVideo) {
1148
- // priority = videoWidth (forced), width attribute, defaultVideoWidth
1149
  t.width = (t.options.videoWidth > 0) ? t.options.videoWidth : (t.$media[0].getAttribute('width') !== null) ? t.$media.attr('width') : t.options.defaultVideoWidth;
1150
  t.height = (t.options.videoHeight > 0) ? t.options.videoHeight : (t.$media[0].getAttribute('height') !== null) ? t.$media.attr('height') : t.options.defaultVideoHeight;
1151
  } else {
@@ -1164,6 +1294,128 @@ if (typeof jQuery != 'undefined') {
1164
  // create MediaElement shim
1165
  mejs.MediaElement(t.$media[0], meOptions);
1166
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1167
 
1168
  // Sets up all controls and events
1169
  meReady: function(media, domNode) {
@@ -1171,67 +1423,104 @@ if (typeof jQuery != 'undefined') {
1171
 
1172
  var t = this,
1173
  mf = mejs.MediaFeatures,
1174
- f,
 
 
1175
  feature;
1176
 
1177
  // make sure it can't create itself again if a plugin reloads
1178
- if (this.created)
1179
  return;
1180
  else
1181
- this.created = true;
1182
 
1183
  t.media = media;
1184
  t.domNode = domNode;
1185
 
1186
- if (!mf.isiPhone && !mf.isAndroid && !mf.isiPad) {
1187
 
1188
-
1189
  // two built in features
1190
  t.buildposter(t, t.controls, t.layers, t.media);
1191
  t.buildoverlays(t, t.controls, t.layers, t.media);
1192
 
1193
- // grab for use by feautres
1194
  t.findTracks();
1195
 
1196
  // add user-defined features/controls
1197
- for (f in t.options.features) {
1198
- feature = t.options.features[f];
1199
  if (t['build' + feature]) {
1200
  try {
1201
  t['build' + feature](t, t.controls, t.layers, t.media);
1202
  } catch (e) {
1203
  // TODO: report control error
1204
  //throw e;
 
 
1205
  }
1206
  }
1207
  }
1208
 
 
 
1209
  // reset all layers and controls
1210
  t.setPlayerSize(t.width, t.height);
1211
  t.setControlsSize();
 
1212
 
1213
  // controls fade
1214
  if (t.isVideo) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1215
  // show/hide controls
1216
  t.container
1217
- .bind('mouseenter', function () {
1218
- if (!t.options.alwaysShowControls) {
1219
- t.controls.css('visibility','visible');
1220
- t.controls.stop(true, true).fadeIn(200);
 
 
 
 
 
 
 
 
 
 
 
1221
  }
1222
  })
1223
  .bind('mouseleave', function () {
1224
- if (!t.media.paused && !t.options.alwaysShowControls) {
1225
- t.controls.stop(true, true).fadeOut(200, function() {
1226
- $(this).css('visibility','hidden');
1227
- $(this).css('display','block');
1228
- });
1229
  }
1230
  });
1231
 
1232
  // check for autoplay
1233
- if (t.domNode.getAttribute('autoplay') !== null && !t.options.alwaysShowControls) {
1234
- t.controls.css('visibility','hidden');
1235
  }
1236
 
1237
  // resizer
@@ -1260,8 +1549,8 @@ if (typeof jQuery != 'undefined') {
1260
 
1261
  if (t.options.loop) {
1262
  t.media.play();
1263
- } else if (!t.options.alwaysShowControls) {
1264
- t.controls.css('visibility','visible');
1265
  }
1266
  }, true);
1267
 
@@ -1274,28 +1563,51 @@ if (typeof jQuery != 'undefined') {
1274
  t.updateCurrent();
1275
  }
1276
 
 
1277
  t.setControlsSize();
1278
  }, true);
1279
 
1280
 
1281
  // webkit has trouble doing this without a delay
1282
  setTimeout(function () {
1283
- t.setControlsSize();
1284
  t.setPlayerSize(t.width, t.height);
 
1285
  }, 50);
1286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1287
  }
1288
 
1289
 
1290
  if (t.options.success) {
1291
- t.options.success(t.media, t.domNode);
1292
  }
1293
  },
1294
 
1295
  handleError: function(e) {
 
 
 
 
1296
  // Tell user that the file cannot be played
1297
- if (this.options.error) {
1298
- this.options.error(e);
1299
  }
1300
  },
1301
 
@@ -1303,16 +1615,60 @@ if (typeof jQuery != 'undefined') {
1303
  var t = this;
1304
 
1305
  // ie9 appears to need this (jQuery bug?)
1306
- t.width = parseInt(width, 10);
1307
- t.height = parseInt(height, 10);
1308
-
1309
- t.container
1310
- .width(t.width)
1311
- .height(t.height);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1312
 
1313
- t.layers.children('.mejs-layer')
1314
- .width(t.width)
1315
- .height(t.height);
 
 
 
 
 
 
1316
  },
1317
 
1318
  setControlsSize: function() {
@@ -1347,28 +1703,41 @@ if (typeof jQuery != 'undefined') {
1347
 
1348
 
1349
  buildposter: function(player, controls, layers, media) {
1350
- var poster =
1351
- $('<div class="mejs-poster mejs-layer">'+
1352
- '<img />'+
1353
  '</div>')
1354
  .appendTo(layers),
1355
- posterUrl = player.$media.attr('poster'),
1356
- posterImg = poster.find('img').width(player.width).height(player.height);
1357
 
1358
  // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
1359
- if (player.options.poster != '') {
1360
- posterImg.attr('src',player.options.poster);
 
 
1361
  // second, try the real poster
1362
- } else if (posterUrl !== '' && posterUrl != null) {
1363
- posterImg.attr('src',posterUrl);
1364
  } else {
1365
- poster.remove();
1366
  }
1367
 
1368
  media.addEventListener('play',function() {
1369
  poster.hide();
1370
  }, false);
1371
  },
 
 
 
 
 
 
 
 
 
 
 
 
1372
 
1373
  buildoverlays: function(player, controls, layers, media) {
1374
  if (!player.isVideo)
@@ -1401,6 +1770,11 @@ if (typeof jQuery != 'undefined') {
1401
  media.pause();
1402
  }
1403
  });
 
 
 
 
 
1404
 
1405
 
1406
  // show/hide big play button
@@ -1413,10 +1787,10 @@ if (typeof jQuery != 'undefined') {
1413
  }, false);
1414
 
1415
  // show/hide loading
1416
- media.addEventListener('loadstart',function() {
1417
  // for some reason Chrome is firing this event
1418
- if (mejs.MediaFeatures.isChrome && media.getAttribute('preload') === 'none')
1419
- return;
1420
 
1421
  loading.show();
1422
  }, false);
@@ -1497,490 +1871,647 @@ if (typeof jQuery != 'undefined') {
1497
  })(mejs.$);
1498
  (function($) {
1499
  // PLAY/pause BUTTON
1500
- MediaElementPlayer.prototype.buildplaypause = function(player, controls, layers, media) {
1501
- var play =
1502
- $('<div class="mejs-button mejs-playpause-button mejs-play" type="button">' +
1503
- '<button type="button"></button>' +
1504
- '</div>')
1505
- .appendTo(controls)
1506
- .click(function(e) {
1507
- e.preventDefault();
1508
-
1509
- if (media.paused) {
1510
- media.play();
1511
- } else {
1512
- media.pause();
1513
- }
1514
 
1515
- return false;
1516
- });
 
 
 
 
 
 
1517
 
1518
- media.addEventListener('play',function() {
1519
- play.removeClass('mejs-play').addClass('mejs-pause');
1520
- }, false);
1521
- media.addEventListener('playing',function() {
1522
- play.removeClass('mejs-play').addClass('mejs-pause');
1523
- }, false);
1524
 
1525
 
1526
- media.addEventListener('pause',function() {
1527
- play.removeClass('mejs-pause').addClass('mejs-play');
1528
- }, false);
1529
- media.addEventListener('paused',function() {
1530
- play.removeClass('mejs-pause').addClass('mejs-play');
1531
- }, false);
1532
- }
 
1533
 
1534
  })(mejs.$);
1535
  (function($) {
1536
  // STOP BUTTON
1537
- MediaElementPlayer.prototype.buildstop = function(player, controls, layers, media) {
1538
- var stop =
1539
- $('<div class="mejs-button mejs-stop-button mejs-stop">' +
1540
- '<button type="button"></button>' +
1541
- '</div>')
1542
- .appendTo(controls)
1543
- .click(function() {
1544
- if (!media.paused) {
1545
- media.pause();
1546
- }
1547
- if (media.currentTime > 0) {
1548
- media.setCurrentTime(0);
1549
- controls.find('.mejs-time-current').width('0px');
1550
- controls.find('.mejs-time-handle').css('left', '0px');
1551
- controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
1552
- controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
1553
- layers.find('.mejs-poster').show();
1554
- }
1555
- });
1556
- }
 
 
 
1557
 
1558
  })(mejs.$);
1559
  (function($) {
1560
  // progress/loaded bar
1561
- MediaElementPlayer.prototype.buildprogress = function(player, controls, layers, media) {
1562
-
1563
- $('<div class="mejs-time-rail">'+
1564
- '<span class="mejs-time-total">'+
1565
- '<span class="mejs-time-loaded"></span>'+
1566
- '<span class="mejs-time-current"></span>'+
1567
- '<span class="mejs-time-handle"></span>'+
1568
- '<span class="mejs-time-float">' +
1569
- '<span class="mejs-time-float-current">00:00</span>' +
1570
- '<span class="mejs-time-float-corner"></span>' +
 
 
1571
  '</span>'+
1572
- '</span>'+
1573
- '</div>')
1574
- .appendTo(controls);
1575
 
1576
- var
1577
- t = this,
1578
- total = controls.find('.mejs-time-total'),
1579
- loaded = controls.find('.mejs-time-loaded'),
1580
- current = controls.find('.mejs-time-current'),
1581
- handle = controls.find('.mejs-time-handle'),
1582
- timefloat = controls.find('.mejs-time-float'),
1583
- timefloatcurrent = controls.find('.mejs-time-float-current'),
1584
- handleMouseMove = function (e) {
1585
- // mouse position relative to the object
1586
- var x = e.pageX,
1587
- offset = total.offset(),
1588
- width = total.outerWidth(),
1589
- percentage = 0,
1590
- newTime = 0;
1591
-
1592
-
1593
- if (x > offset.left && x <= width + offset.left && media.duration) {
1594
- percentage = ((x - offset.left) / width);
1595
- newTime = (percentage <= 0.02) ? 0 : percentage * media.duration;
1596
-
1597
- // seek to where the mouse is
1598
- if (mouseIsDown) {
1599
- media.setCurrentTime(newTime);
 
 
 
 
 
 
1600
  }
 
 
 
1601
 
1602
- // position floating time box
1603
- var pos = x - offset.left;
1604
- timefloat.css('left', pos);
1605
- timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime) );
1606
- }
1607
- },
1608
- mouseIsDown = false,
1609
- mouseIsOver = false;
1610
-
1611
- // handle clicks
1612
- //controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove);
1613
- total
1614
- .bind('mousedown', function (e) {
1615
- mouseIsDown = true;
1616
- handleMouseMove(e);
1617
- return false;
1618
- });
1619
 
1620
- controls.find('.mejs-time-rail')
1621
- .bind('mouseenter', function(e) {
1622
- mouseIsOver = true;
1623
- })
1624
- .bind('mouseleave',function(e) {
1625
- mouseIsOver = false;
1626
- });
1627
 
1628
- $(document)
1629
- .bind('mouseup', function (e) {
1630
- mouseIsDown = false;
1631
- //handleMouseMove(e);
1632
- })
1633
- .bind('mousemove', function (e) {
1634
- if (mouseIsDown || mouseIsOver) {
1635
- handleMouseMove(e);
1636
- }
1637
- });
1638
 
1639
- // loading
1640
- media.addEventListener('progress', function (e) {
1641
- player.setProgressRail(e);
1642
- player.setCurrentRail(e);
1643
- }, false);
1644
-
1645
- // current time
1646
- media.addEventListener('timeupdate', function(e) {
1647
- player.setProgressRail(e);
1648
- player.setCurrentRail(e);
1649
- }, false);
1650
-
1651
-
1652
- // store for later use
1653
- t.loaded = loaded;
1654
- t.total = total;
1655
- t.current = current;
1656
- t.handle = handle;
1657
- }
1658
- MediaElementPlayer.prototype.setProgressRail = function(e) {
1659
 
1660
- var
1661
- t = this,
1662
- target = (e != undefined) ? e.target : t.media,
1663
- percent = null;
 
 
 
 
 
 
 
 
 
 
1664
 
1665
- // newest HTML5 spec has buffered array (FF4, Webkit)
1666
- if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
1667
- // TODO: account for a real array with multiple values (only Firefox 4 has this so far)
1668
- percent = target.buffered.end(0) / target.duration;
1669
- }
1670
- // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
1671
- // to be anything other than 0. If the byte count is available we use this instead.
1672
- // Browsers that support the else if do not seem to have the bufferedBytes value and
1673
- // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
1674
- else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
1675
- percent = target.bufferedBytes / target.bytesTotal;
1676
- }
1677
- // Firefox 3 with an Ogg file seems to go this way
1678
- else if (e && e.lengthComputable && e.total != 0) {
1679
- percent = e.loaded/e.total;
1680
- }
 
 
 
 
 
1681
 
1682
- // finally update the progress bar
1683
- if (percent !== null) {
1684
- percent = Math.min(1, Math.max(0, percent));
1685
- // update loaded bar
1686
- if (t.loaded && t.total) {
1687
- t.loaded.width(t.total.width() * percent);
 
1688
  }
1689
- }
1690
- }
1691
- MediaElementPlayer.prototype.setCurrentRail = function() {
1692
 
1693
- var t = this;
1694
-
1695
- if (t.media.currentTime != undefined && t.media.duration) {
1696
 
1697
- // update bar and handle
1698
- if (t.total && t.handle) {
1699
- var
1700
- newWidth = t.total.width() * t.media.currentTime / t.media.duration,
1701
- handlePos = newWidth - (t.handle.outerWidth(true) / 2);
1702
 
1703
- t.current.width(newWidth);
1704
- t.handle.css('left', handlePos);
 
1705
  }
1706
- }
1707
-
1708
- }
1709
 
 
 
1710
  })(mejs.$);
1711
  (function($) {
1712
  // current and duration 00:00 / 00:00
1713
- MediaElementPlayer.prototype.buildcurrent = function(player, controls, layers, media) {
1714
- var t = this;
1715
-
1716
- $('<div class="mejs-time">'+
1717
- '<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>'+
1718
- '</div>')
1719
- .appendTo(controls);
1720
-
1721
- t.currenttime = t.controls.find('.mejs-currenttime');
 
 
1722
 
1723
- media.addEventListener('timeupdate',function() {
1724
- player.updateCurrent();
1725
- }, false);
1726
- };
1727
 
1728
- MediaElementPlayer.prototype.buildduration = function(player, controls, layers, media) {
1729
- var t = this;
1730
-
1731
- if (controls.children().last().find('.mejs-currenttime').length > 0) {
1732
- $(' <span> | </span> '+
1733
- '<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>')
1734
- .appendTo(controls.find('.mejs-time'));
1735
- } else {
1736
 
1737
- // add class to current time
1738
- controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container');
1739
 
1740
- $('<div class="mejs-time mejs-duration-container">'+
1741
- '<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>'+
1742
- '</div>')
1743
- .appendTo(controls);
1744
- }
1745
-
1746
- t.durationD = t.controls.find('.mejs-duration');
1747
 
1748
- media.addEventListener('timeupdate',function() {
1749
- player.updateDuration();
1750
- }, false);
1751
- };
1752
-
1753
- MediaElementPlayer.prototype.updateCurrent = function() {
1754
- var t = this;
 
 
 
 
1755
 
1756
- if (t.currenttime) {
1757
- t.currenttime.html(mejs.Utility.secondsToTimeCode(t.media.currentTime | 0, t.options.alwaysShowHours || t.media.duration > 3600 ));
1758
- }
1759
- }
1760
- MediaElementPlayer.prototype.updateDuration = function() {
1761
- var t = this;
1762
 
1763
- if (t.media.duration && t.durationD) {
1764
- t.durationD.html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours));
1765
- }
1766
- };
 
 
 
 
 
 
 
 
 
 
 
 
1767
 
1768
  })(mejs.$);
1769
  (function($) {
1770
- MediaElementPlayer.prototype.buildvolume = function(player, controls, layers, media) {
1771
- var mute =
1772
- $('<div class="mejs-button mejs-volume-button mejs-mute">'+
1773
- '<button type="button"></button>'+
1774
- '<div class="mejs-volume-slider">'+ // outer background
1775
- '<div class="mejs-volume-total"></div>'+ // line background
1776
- '<div class="mejs-volume-current"></div>'+ // current volume
1777
- '<div class="mejs-volume-handle"></div>'+ // handle
1778
- '</div>'+
1779
- '</div>')
1780
- .appendTo(controls),
1781
- volumeSlider = mute.find('.mejs-volume-slider'),
1782
- volumeTotal = mute.find('.mejs-volume-total'),
1783
- volumeCurrent = mute.find('.mejs-volume-current'),
1784
- volumeHandle = mute.find('.mejs-volume-handle'),
1785
 
1786
- positionVolumeHandle = function(volume) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1787
 
1788
- var
1789
- top = volumeTotal.height() - (volumeTotal.height() * volume);
 
 
 
 
 
 
 
 
 
1790
 
1791
- // handle
1792
- volumeHandle.css('top', top - (volumeHandle.height() / 2));
1793
 
1794
- // show the current visibility
1795
- volumeCurrent.height(volumeTotal.height() - top + parseInt(volumeTotal.css('top').replace(/px/,''),10));
1796
- volumeCurrent.css('top', top);
1797
- },
1798
- handleVolumeMove = function(e) {
1799
- var
1800
- railHeight = volumeTotal.height(),
1801
- totalOffset = volumeTotal.offset(),
1802
- totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
1803
- newY = e.pageY - totalOffset.top,
1804
- volume = (railHeight - newY) / railHeight
1805
-
1806
- // TODO: handle vertical and horizontal CSS
1807
- // only allow it to move within the rail
1808
- if (newY < 0)
1809
- newY = 0;
1810
- else if (newY > railHeight)
1811
- newY = railHeight;
1812
-
1813
- // move the handle to match the mouse
1814
- volumeHandle.css('top', newY - (volumeHandle.height() / 2) + totalTop );
1815
-
1816
- // show the current visibility
1817
- volumeCurrent.height(railHeight-newY);
1818
- volumeCurrent.css('top',newY+totalTop);
1819
-
1820
- // set mute status
1821
- if (volume == 0) {
1822
- media.setMuted(true);
1823
- mute.removeClass('mejs-mute').addClass('mejs-unmute');
1824
- } else {
1825
- media.setMuted(false);
1826
- mute.removeClass('mejs-unmute').addClass('mejs-mute');
1827
- }
 
 
 
 
 
 
 
 
1828
 
1829
- volume = Math.max(0,volume);
1830
- volume = Math.min(volume,1);
1831
 
1832
- // set the volume
1833
- media.setVolume(volume);
1834
- },
1835
- mouseIsDown = false;
1836
-
1837
- // SLIDER
1838
- volumeSlider
1839
- .bind('mousedown', function (e) {
1840
- handleVolumeMove(e);
1841
- mouseIsDown = true;
1842
- return false;
1843
- });
1844
- $(document)
1845
- .bind('mouseup', function (e) {
1846
- mouseIsDown = false;
1847
- })
1848
- .bind('mousemove', function (e) {
1849
- if (mouseIsDown) {
1850
  handleVolumeMove(e);
1851
- }
1852
- });
 
 
 
 
 
 
 
 
 
 
1853
 
1854
 
1855
- // MUTE button
1856
- mute.find('button').click(function() {
1857
- if (media.muted) {
1858
- media.setMuted(false);
1859
- mute.removeClass('mejs-unmute').addClass('mejs-mute');
1860
- positionVolumeHandle(1);
1861
- } else {
1862
- media.setMuted(true);
1863
- mute.removeClass('mejs-mute').addClass('mejs-unmute');
1864
- positionVolumeHandle(0);
1865
- }
1866
- });
1867
 
1868
- // listen for volume change events from other sources
1869
- media.addEventListener('volumechange', function(e) {
1870
- if (!mouseIsDown) {
1871
- positionVolumeHandle(e.target.volume);
1872
- }
1873
- }, true);
1874
 
1875
- // set initial volume
1876
- positionVolumeHandle(player.options.startVolume);
1877
-
1878
- // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements
1879
- if (media.pluginType === 'native') {
1880
- media.setVolume(player.options.startVolume);
1881
- }
1882
- }
 
 
 
 
1883
 
 
 
 
 
 
 
 
 
 
 
 
1884
  })(mejs.$);
1885
 
1886
  (function($) {
1887
- MediaElementPlayer.prototype.buildfullscreen = function(player, controls, layers, media) {
1888
-
1889
- if (!player.isVideo)
1890
- return;
1891
-
1892
- var
1893
- normalHeight = 0,
1894
- normalWidth = 0,
1895
- container = player.container,
1896
- fullscreenBtn =
1897
- $('<div class="mejs-button mejs-fullscreen-button"><button type="button"></button></div>')
1898
- .appendTo(controls)
1899
- .click(function() {
1900
- var goFullscreen = (mejs.MediaFeatures.hasNativeFullScreen) ?
1901
- !media.webkitDisplayingFullscreen :
1902
- !media.isFullScreen;
1903
- setFullScreen(goFullscreen);
1904
- }),
1905
- setFullScreen = function(goFullScreen) {
1906
- switch (media.pluginType) {
1907
- case 'flash':
1908
- case 'silverlight':
1909
- media.setFullscreen(goFullScreen);
1910
- break;
1911
- case 'native':
1912
-
1913
- if (mejs.MediaFeatures.hasNativeFullScreen) {
1914
- if (goFullScreen) {
1915
- media.webkitEnterFullScreen();
1916
- media.isFullScreen = true;
1917
- } else {
1918
- media.webkitExitFullScreen();
1919
- media.isFullScreen = false;
1920
- }
1921
- } else {
1922
- if (goFullScreen) {
1923
-
1924
- // store
1925
- normalHeight = player.$media.height();
1926
- normalWidth = player.$media.width();
1927
-
1928
- // make full size
1929
- container
1930
- .addClass('mejs-container-fullscreen')
1931
- .width('100%')
1932
- .height('100%')
1933
- .css('z-index', 1000);
1934
-
1935
- player.$media
1936
- .width('100%')
1937
- .height('100%');
1938
-
1939
-
1940
- layers.children('div')
1941
- .width('100%')
1942
- .height('100%');
1943
 
1944
- fullscreenBtn
1945
- .removeClass('mejs-fullscreen')
1946
- .addClass('mejs-unfullscreen');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1947
 
1948
- player.setControlsSize();
1949
- media.isFullScreen = true;
1950
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1951
 
1952
- container
1953
- .removeClass('mejs-container-fullscreen')
1954
- .width(normalWidth)
1955
- .height(normalHeight)
1956
- .css('z-index', 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1957
 
1958
- player.$media
1959
- .width(normalWidth)
1960
- .height(normalHeight);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1961
 
1962
- layers.children('div')
1963
- .width(normalWidth)
1964
- .height(normalHeight);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1965
 
1966
- fullscreenBtn
1967
- .removeClass('mejs-unfullscreen')
1968
- .addClass('mejs-fullscreen');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1969
 
1970
- player.setControlsSize();
1971
- media.isFullScreen = false;
1972
- }
1973
- }
1974
- }
1975
- };
1976
 
1977
- $(document).bind('keydown',function (e) {
1978
- if (media.isFullScreen && e.keyCode == 27) {
1979
- setFullScreen(false);
1980
- }
1981
- });
1982
 
1983
- }
 
 
 
1984
 
1985
  })(mejs.$);
1986
  (function($) {
@@ -1998,6 +2529,8 @@ if (typeof jQuery != 'undefined') {
1998
  });
1999
 
2000
  $.extend(MediaElementPlayer.prototype, {
 
 
2001
 
2002
  buildtracks: function(player, controls, layers, media) {
2003
  if (!player.isVideo)
@@ -2017,7 +2550,7 @@ if (typeof jQuery != 'undefined') {
2017
  player.captionsText = player.captions.find('.mejs-captions-text');
2018
  player.captionsButton =
2019
  $('<div class="mejs-button mejs-captions-button">'+
2020
- '<button type="button" ></button>'+
2021
  '<div class="mejs-captions-selector">'+
2022
  '<ul>'+
2023
  '<li>'+
@@ -2026,8 +2559,16 @@ if (typeof jQuery != 'undefined') {
2026
  '</li>' +
2027
  '</ul>'+
2028
  '</div>'+
2029
- '</button>')
2030
  .appendTo(controls)
 
 
 
 
 
 
 
 
2031
  // handle clicks to the language radio buttons
2032
  .delegate('input[type=radio]','click',function() {
2033
  lang = this.value;
@@ -2106,11 +2647,13 @@ if (typeof jQuery != 'undefined') {
2106
  player.container.hover(
2107
  function () {
2108
  // chapters
2109
- player.chapters.css('visibility','visible');
2110
- player.chapters.fadeIn(200);
 
 
2111
  },
2112
  function () {
2113
- if (!media.paused) {
2114
  player.chapters.fadeOut(200, function() {
2115
  $(this).css('visibility','hidden');
2116
  $(this).css('display','block');
@@ -2296,6 +2839,7 @@ if (typeof jQuery != 'undefined') {
2296
  for (i=0; i<t.tracks.length; i++) {
2297
  if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) {
2298
  t.drawChapters(t.tracks[i]);
 
2299
  break;
2300
  }
2301
  }
@@ -2429,8 +2973,9 @@ if (typeof jQuery != 'undefined') {
2429
  Adapted from: http://www.delphiki.com/html5/playr
2430
  */
2431
  mejs.TrackFormatParser = {
2432
- pattern_identifier: /^[0-9]+$/,
2433
- pattern_timecode: /^([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{3})?)(.*)$/,
 
2434
 
2435
  split2: function (text, regex) {
2436
  // normal version for compliant browsers
@@ -2450,7 +2995,8 @@ if (typeof jQuery != 'undefined') {
2450
  if (this.pattern_identifier.exec(lines[i])){
2451
  // skip to the next line where the start --> end time code should be
2452
  i++;
2453
- timecode = this.pattern_timecode.exec(lines[i]);
 
2454
  if (timecode && i<lines.length){
2455
  i++;
2456
  // grab all the (possibly multi-line) text that follows
@@ -2588,4 +3134,197 @@ if (typeof jQuery != 'undefined') {
2588
 
2589
  })(mejs.$);
2590
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2591
 
15
  var mejs = mejs || {};
16
 
17
  // version number
18
+ mejs.version = '2.2.5';
19
 
20
  // player number (for missing, same id attr)
21
  mejs.meIndex = 0;
27
  ],
28
  flash: [
29
  {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg']}
30
+ //,{version: [12,0], types: ['video/webm']} // for future reference
31
  ]
32
  };
33
 
70
  }
71
  return path;
72
  },
73
+ secondsToTimeCode: function(time, forceHours, showFrameCount, fps) {
74
+ //add framecount
75
+ if (typeof showFrameCount == 'undefined') {
76
+ showFrameCount=false;
77
+ } else if(typeof fps == 'undefined') {
78
+ fps = 25;
79
+ }
80
+
81
+ var hours = Math.floor(time / 3600) % 24,
82
+ minutes = Math.floor(time / 60) % 60,
83
+ seconds = Math.floor(time % 60),
84
+ frames = Math.floor(((time % 1)*fps).toFixed(3)),
85
+ result =
86
+ ( (forceHours || hours > 0) ? (hours < 10 ? '0' + hours : hours) + ':' : '')
87
+ + (minutes < 10 ? '0' + minutes : minutes) + ':'
88
+ + (seconds < 10 ? '0' + seconds : seconds)
89
+ + ((showFrameCount) ? ':' + (frames < 10 ? '0' + frames : frames) : '');
90
+
91
+ return result;
92
  },
93
+
94
+ timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){
95
+ if (typeof showFrameCount == 'undefined') {
96
+ showFrameCount=false;
97
+ } else if(typeof fps == 'undefined') {
98
+ fps = 25;
99
+ }
100
+
101
+ var tc_array = hh_mm_ss_ff.split(":"),
102
+ tc_hh = parseInt(tc_array[0]),
103
+ tc_mm = parseInt(tc_array[1]),
104
+ tc_ss = parseInt(tc_array[2]),
105
+ tc_ff = 0,
106
+ tc_in_seconds = 0;
107
+
108
+ if (showFrameCount) {
109
+ tc_ff = parseInt(tc_array[3])/fps;
110
+ }
111
+
112
+ tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff;
113
+
114
+ return tc_in_seconds;
115
  }
116
  };
117
 
217
  return version;
218
  });
219
  */
 
 
 
 
 
 
 
 
220
  // necessary detection (fixes for <IE9)
221
  mejs.MediaFeatures = {
222
  init: function() {
223
  var
224
+ t = this,
225
+ d = document,
226
  nav = mejs.PluginDetector.nav,
227
  ua = mejs.PluginDetector.ua.toLowerCase(),
228
  i,
230
  html5Elements = ['source','track','audio','video'];
231
 
232
  // detect browsers (only the ones that have some kind of quirk we need to work around)
233
+ t.isiPad = (ua.match(/ipad/i) !== null);
234
+ t.isiPhone = (ua.match(/iphone/i) !== null);
235
+ t.isiOS = t.isiPhone || t.isiPad;
236
+ t.isAndroid = (ua.match(/android/i) !== null);
237
+ t.isBustedAndroid = (ua.match(/android 2\.[12]/) !== null);
238
+ t.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1);
239
+ t.isChrome = (ua.match(/chrome/gi) !== null);
240
+ t.isFirefox = (ua.match(/firefox/gi) !== null);
241
+ t.isGecko = (ua.match(/gecko/gi) !== null);
242
+ t.isWebkit = (ua.match(/webkit/gi) !== null);
243
 
244
  // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
245
  for (i=0; i<html5Elements.length; i++) {
246
  v = document.createElement(html5Elements[i]);
247
  }
248
+
249
+ t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid);
250
 
251
+ // detect native JavaScript fullscreen (Safari/Firefox only, Chrome still fails)
252
+
253
+ // iOS
254
+ t.hasSemiNativeFullScreen = (typeof v.webkitEnterFullscreen !== 'undefined');
255
+
256
+ // Webkit/firefox
257
+ t.hasWebkitNativeFullScreen = (typeof v.webkitRequestFullScreen !== 'undefined');
258
+ t.hasMozNativeFullScreen = (typeof v.mozRequestFullScreen !== 'undefined');
259
+
260
+ t.hasTrueNativeFullScreen = (t.hasWebkitNativeFullScreen || t.hasMozNativeFullScreen);
261
+
262
+
263
  if (this.isChrome) {
264
+ t.hasSemiNativeFullScreen = false;
265
+ }
266
+
267
+ if (t.hasTrueNativeFullScreen) {
268
+ t.fullScreenEventName = (t.hasWebkitNativeFullScreen) ? 'webkitfullscreenchange' : 'mozfullscreenchange';
269
+
270
+
271
+ t.isFullScreen = function() {
272
+ if (v.mozRequestFullScreen) {
273
+ return d.mozFullScreen;
274
+ } else if (v.webkitRequestFullScreen) {
275
+ return d.webkitIsFullScreen;
276
+ }
277
+ }
278
+
279
+ t.requestFullScreen = function(el) {
280
+
281
+ if (t.hasWebkitNativeFullScreen) {
282
+ el.webkitRequestFullScreen();
283
+ } else if (t.hasMozNativeFullScreen) {
284
+ el.mozRequestFullScreen();
285
+ }
286
+ }
287
+
288
+ t.cancelFullScreen = function() {
289
+ if (t.hasWebkitNativeFullScreen) {
290
+ document.webkitCancelFullScreen();
291
+ } else if (t.hasMozNativeFullScreen) {
292
+ document.mozCancelFullScreen();
293
+ }
294
+ }
295
+
296
  }
297
+
298
+
299
  // OS X 10.5 can't do this even if it says it can :(
300
+ if (t.hasSemiNativeFullScreen && ua.match(/mac os x 10_5/i)) {
301
+ t.hasNativeFullScreen = false;
302
+ t.hasSemiNativeFullScreen = false;
303
  }
304
+
305
  }
306
  };
307
  mejs.MediaFeatures.init();
334
  // This can be a url string
335
  // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
336
  setSrc: function (url) {
337
+
338
+ // Fix for IE9 which can't set .src when there are <source> elements. Awesome, right?
339
+ var
340
+ existingSources = this.getElementsByTagName('source');
341
+ while (existingSources.length > 0){
342
+ this.removeChild(existingSources[0]);
343
+ }
344
+
345
  if (typeof url == 'string') {
346
  this.src = url;
347
  } else {
506
  this.pluginApi.setFullscreen(fullscreen);
507
  }
508
  },
509
+
510
+ enterFullScreen: function() {
511
+ this.setFullscreen(true);
512
+ },
513
+
514
+ enterFullScreen: function() {
515
+ this.setFullscreen(false);
516
+ },
517
 
518
  // start: fake events
519
  addEventListener: function (eventName, callback, bubble) {
659
  // rate in milliseconds for Flash and Silverlight to fire the timeupdate event
660
  // larger number is less accurate, but less strain on plugin->JavaScript bridge
661
  timerRate: 250,
662
+ // initial volume for player
663
+ startVolume: 0.8,
664
  success: function () { },
665
  error: function () { }
666
  };
680
  var
681
  options = mejs.MediaElementDefaults,
682
  htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el,
683
+ tagName = htmlMediaElement.tagName.toLowerCase(),
684
+ isMediaTag = (tagName === 'audio' || tagName === 'video'),
685
+ src = (isMediaTag) ? htmlMediaElement.getAttribute('src') : htmlMediaElement.getAttribute('href'),
686
  poster = htmlMediaElement.getAttribute('poster'),
687
  autoplay = htmlMediaElement.getAttribute('autoplay'),
688
  preload = htmlMediaElement.getAttribute('preload'),
689
  controls = htmlMediaElement.getAttribute('controls'),
690
+ playback,
691
  prop;
692
 
693
  // extend options
695
  options[prop] = o[prop];
696
  }
697
 
698
+ // clean up attributes
699
+ src = (src == 'undefined' || src == '' || src === null) ? null : src;
700
  poster = (typeof poster == 'undefined' || poster === null) ? '' : poster;
701
  preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload;
702
  autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false');
703
  controls = !(typeof controls == 'undefined' || controls === null || controls === 'false');
704
 
705
  // test for HTML5 and plugin capabilities
706
+ playback = this.determinePlayback(htmlMediaElement, options, mejs.MediaFeatures.supportsMediaTag, isMediaTag, src);
707
+ playback.url = (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '';
708
 
709
  if (playback.method == 'native') {
710
+ // second fix for android
711
+ if (mejs.MediaFeatures.isBustedAndroid) {
712
+ htmlMediaElement.src = playback.url;
713
+ htmlMediaElement.addEventListener('click', function() {
714
+ htmlMediaElement.play();
715
+ }, true);
716
+ }
717
+
718
  // add methods to native HTMLMediaElement
719
+ return this.updateNative(playback, options, autoplay, preload);
720
  } else if (playback.method !== '') {
721
  // create plugin to mimic HTMLMediaElement
722
+
723
+ return this.createPlugin( playback, options, poster, autoplay, preload, controls);
724
  } else {
725
  // boo, no HTML5, no Flash, no Silverlight.
726
+ this.createErrorMessage( playback, options, poster );
727
  }
728
  },
729
+
730
+ determinePlayback: function(htmlMediaElement, options, supportsMediaTag, isMediaTag, src) {
731
  var
732
  mediaFiles = [],
733
  i,
736
  l,
737
  n,
738
  type,
739
+ result = { method: '', url: '', htmlMediaElement: htmlMediaElement, isVideo: (htmlMediaElement.tagName.toLowerCase() != 'audio')},
 
740
  pluginName,
741
  pluginVersions,
742
+ pluginInfo,
743
+ dummy;
 
 
 
744
 
745
  // STEP 1: Get URL and type from <video src> or <source src>
746
 
747
+ // supplied type overrides <video type> and <source type>
748
+ if (typeof options.type != 'undefined' && options.type !== '') {
749
+
750
+ // accept either string or array of types
751
+ if (typeof options.type == 'string') {
752
+ mediaFiles.push({type:options.type, url:src});
753
+ } else {
754
+
755
+ for (i=0; i<options.type.length; i++) {
756
+ mediaFiles.push({type:options.type[i], url:src});
757
+ }
758
+ }
759
 
760
  // test for src attribute first
761
+ } else if (src !== null) {
762
+ type = this.formatType(src, htmlMediaElement.getAttribute('type'));
763
  mediaFiles.push({type:type, url:src});
764
 
765
  // then test for <source> elements
769
  n = htmlMediaElement.childNodes[i];
770
  if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') {
771
  src = n.getAttribute('src');
772
+ type = this.formatType(src, n.getAttribute('type'));
773
  mediaFiles.push({type:type, url:src});
774
  }
775
  }
776
  }
777
+
778
+ // in the case of dynamicly created players
779
+ // check for audio types
780
+ if (!isMediaTag && mediaFiles.length > 0 && mediaFiles[0].url !== null && this.getTypeFromFile(mediaFiles[0].url).indexOf('audio') > -1) {
781
+ result.isVideo = false;
782
+ }
783
+
784
 
785
  // STEP 2: Test for playback method
786
+
787
+ // special case for Android which sadly doesn't implement the canPlayType function (always returns '')
788
+ if (mejs.MediaFeatures.isBustedAndroid) {
789
+ htmlMediaElement.canPlayType = function(type) {
790
+ return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'maybe' : '';
791
+ };
792
+ }
793
+
794
 
795
  // test for native playback first
796
  if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'native')) {
797
+
798
+ if (!isMediaTag) {
799
+
800
+ // create a real HTML5 Media Element
801
+ dummy = document.createElement( result.isVideo ? 'video' : 'audio');
802
+ htmlMediaElement.parentNode.insertBefore(dummy, htmlMediaElement);
803
+ htmlMediaElement.style.display = 'none';
804
+
805
+ // use this one from now on
806
+ result.htmlMediaElement = htmlMediaElement = dummy;
807
+ }
808
+
809
  for (i=0; i<mediaFiles.length; i++) {
810
  // normal check
811
  if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== ''
813
  || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '') {
814
  result.method = 'native';
815
  result.url = mediaFiles[i].url;
816
+ break;
817
  }
818
+ }
819
+
820
+ if (result.method === 'native') {
821
+ if (result.url !== null) {
822
+ htmlMediaElement.src = result.url;
823
+ }
824
+
825
+ return result;
826
  }
827
  }
828
 
867
  return result;
868
  },
869
 
870
+ formatType: function(url, type) {
871
  var ext;
872
 
873
  // if no type is supplied, fake it with the extension
874
+ if (url && !type) {
875
+ return this.getTypeFromFile(url);
 
876
  } else {
877
  // only return the mime part of the type in case the attribute contains the codec
878
  // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element
885
  }
886
  }
887
  },
888
+
889
+ getTypeFromFile: function(url) {
890
+ var ext = url.substring(url.lastIndexOf('.') + 1);
891
+ return (/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + ext;
892
+ },
893
 
894
+ createErrorMessage: function(playback, options, poster) {
895
+ var
896
+ htmlMediaElement = playback.htmlMediaElement,
897
+ errorContainer = document.createElement('div');
898
+
899
  errorContainer.className = 'me-cannotplay';
900
 
901
  try {
904
  } catch (e) {}
905
 
906
  errorContainer.innerHTML = (poster !== '') ?
907
+ '<a href="' + playback.url + '"><img src="' + poster + '" /></a>' :
908
+ '<a href="' + playback.url + '"><span>Download File</span></a>';
909
 
910
  htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
911
  htmlMediaElement.style.display = 'none';
913
  options.error(htmlMediaElement);
914
  },
915
 
916
+ createPlugin:function(playback, options, poster, autoplay, preload, controls) {
917
+ var
918
+ htmlMediaElement = playback.htmlMediaElement,
919
+ width = 1,
920
  height = 1,
921
+ pluginid = 'me_' + playback.method + '_' + (mejs.meIndex++),
922
+ pluginMediaElement = new mejs.PluginMediaElement(pluginid, playback.method, playback.url),
923
  container = document.createElement('div'),
924
  specialIEContainer,
925
  node,
935
  node = node.parentNode;
936
  }
937
 
938
+ if (playback.isVideo) {
939
  width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth;
940
  height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight;
941
+
942
+ // in case of '%' make sure it's encoded
943
+ width = mejs.Utility.encodeUrl(width);
944
+ height = mejs.Utility.encodeUrl(height);
945
+
946
  } else {
947
  if (options.enablePluginDebug) {
948
  width = 320;
961
  // flash/silverlight vars
962
  initVars = [
963
  'id=' + pluginid,
964
+ 'isvideo=' + ((playback.isVideo) ? "true" : "false"),
965
  'autoplay=' + ((autoplay) ? "true" : "false"),
966
  'preload=' + preload,
967
  'width=' + width,
969
  'timerrate=' + options.timerRate,
970
  'height=' + height];
971
 
972
+ if (playback.url !== null) {
973
+ if (playback.method == 'flash') {
974
+ initVars.push('file=' + mejs.Utility.encodeUrl(playback.url));
975
  } else {
976
+ initVars.push('file=' + playback.url);
977
  }
978
  }
979
  if (options.enablePluginDebug) {
986
  initVars.push('controls=true'); // shows controls in the plugin if desired
987
  }
988
 
989
+ switch (playback.method) {
990
  case 'silverlight':
991
  container.innerHTML =
992
  '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' +
1043
  return pluginMediaElement;
1044
  },
1045
 
1046
+ updateNative: function(playback, options, autoplay, preload) {
1047
+
1048
+ var htmlMediaElement = playback.htmlMediaElement,
1049
+ m;
1050
+
1051
+
1052
  // add methods to video object to bring it into parity with Flash Object
1053
+ for (m in mejs.HtmlMediaElement) {
1054
  htmlMediaElement[m] = mejs.HtmlMediaElement[m];
1055
  }
1056
 
1108
  } else if (typeof ender != 'undefined') {
1109
  mejs.$ = ender;
1110
  }
1111
+ (function ($) {
1112
 
1113
  // default player values
1114
  mejs.MepDefaults = {
1134
  enableAutosize: true,
1135
  // forces the hour marker (##:00:00)
1136
  alwaysShowHours: false,
1137
+
1138
+ // show framecount in timecode (##:00:00:00)
1139
+ showTimecodeFrameCount: false,
1140
+ // used when showTimecodeFrameCount is set to true
1141
+ framesPerSecond: 25,
1142
+
1143
  // Hide controls when playing and mouse is not over the video
1144
  alwaysShowControls: false,
1145
+ // force iPad's native controls
1146
+ iPadUseNativeControls: false,
1147
+ // force iPad's native controls
1148
+ iPhoneUseNativeControls: false,
1149
+ // force iPad's native controls
1150
+ AndroidUseNativeControls: false,
1151
  // features to show
1152
+ features: ['playpause','current','progress','duration','tracks','volume','fullscreen'],
1153
+ // only for dynamic
1154
+ isVideo: true
1155
  };
1156
 
1157
  mejs.mepIndex = 0;
1163
  return new mejs.MediaElementPlayer(node, o);
1164
  }
1165
 
1166
+ var t = this;
 
 
 
 
 
 
1167
 
1168
  // these will be reset after the MediaElement.success fires
1169
+ t.$media = t.$node = $(node);
1170
+ t.node = t.media = t.$media[0];
1171
 
1172
  // check for existing player
1173
  if (typeof t.node.player != 'undefined') {
1176
  // attach player to DOM node for reference
1177
  t.node.player = t;
1178
  }
1179
+
1180
+ // create options
1181
+ t.options = $.extend({},mejs.MepDefaults,o);
1182
 
1183
+ // start up
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1184
  t.init();
1185
 
1186
  return t;
1197
  meOptions = $.extend(true, {}, t.options, {
1198
  success: function(media, domNode) { t.meReady(media, domNode); },
1199
  error: function(e) { t.handleError(e);}
1200
+ }),
1201
+ tagName = t.media.tagName.toLowerCase();
1202
 
1203
+ t.isDynamic = (tagName !== 'audio' && tagName !== 'video');
1204
+
1205
+ if (t.isDynamic) {
1206
+ // get video from src or href?
1207
+ t.isVideo = t.options.isVideo;
1208
+ } else {
1209
+ t.isVideo = (tagName !== 'audio' && t.options.isVideo);
1210
+ }
1211
 
1212
  // use native controls in iPad, iPhone, and Android
1213
+ if ((mf.isiPad && t.options.iPadUseNativeControls) || (mf.isiPhone && t.options.iPhoneUseNativeControls)) {
1214
+
1215
  // add controls and stop
1216
  t.$media.attr('controls', 'controls');
1217
 
1218
+ // attempt to fix iOS 3 bug
1219
  t.$media.removeAttr('poster');
1220
 
1221
  // override Apple's autoplay override for iPads
1224
  t.media.play();
1225
  }
1226
 
1227
+ } else if (mf.isAndroid && t.AndroidUseNativeControls) {
1228
+
1229
+ // leave default player
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1230
 
1231
  } else {
1232
 
1252
  .insertBefore(t.$media);
1253
 
1254
  // move the <video/video> tag into the right spot
1255
+ if (mf.isiPad || mf.isiPhone) {
1256
+
1257
+ // sadly, you can't move nodes in iOS, so we have to destroy and recreate it!
1258
+ var $newMedia = t.$media.clone();
1259
+
1260
+ t.container.find('.mejs-mediaelement').append($newMedia);
1261
+
1262
+ t.$media.remove();
1263
+ t.$node = t.$media = $newMedia;
1264
+ t.node = t.media = $newMedia[0]
1265
+
1266
+ } else {
1267
+
1268
+ // normal way of moving it into place (doesn't work on iOS)
1269
+ t.container.find('.mejs-mediaelement').append(t.$media);
1270
+ }
1271
+
1272
  // find parts
1273
  t.controls = t.container.find('.mejs-controls');
1274
  t.layers = t.container.find('.mejs-layers');
1275
 
1276
  // determine the size
1277
  if (t.isVideo) {
1278
+ // priority = videoWidth (forced), width attribute, defaultVideoWidth (for unspecified cases)
1279
  t.width = (t.options.videoWidth > 0) ? t.options.videoWidth : (t.$media[0].getAttribute('width') !== null) ? t.$media.attr('width') : t.options.defaultVideoWidth;
1280
  t.height = (t.options.videoHeight > 0) ? t.options.videoHeight : (t.$media[0].getAttribute('height') !== null) ? t.$media.attr('height') : t.options.defaultVideoHeight;
1281
  } else {
1294
  // create MediaElement shim
1295
  mejs.MediaElement(t.$media[0], meOptions);
1296
  },
1297
+
1298
+ controlsAreVisible: true,
1299
+
1300
+ showControls: function(doAnimation) {
1301
+ var t = this,
1302
+ doAnimation = typeof doAnimation == 'undefined' || doAnimation;
1303
+
1304
+ if (t.controlsAreVisible)
1305
+ return;
1306
+
1307
+ if (doAnimation) {
1308
+ t.controls
1309
+ .css('visibility','visible')
1310
+ .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;});
1311
+
1312
+ // any additional controls people might add and want to hide
1313
+ t.container.find('.mejs-control')
1314
+ .css('visibility','visible')
1315
+ .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;});
1316
+
1317
+ } else {
1318
+ t.controls
1319
+ .css('visibility','visible')
1320
+ .css('display','block');
1321
+
1322
+ // any additional controls people might add and want to hide
1323
+ t.container.find('.mejs-control')
1324
+ .css('visibility','visible')
1325
+ .css('display','block');
1326
+
1327
+ t.controlsAreVisible = true;
1328
+ }
1329
+
1330
+ t.setControlsSize();
1331
+
1332
+ },
1333
+
1334
+ hideControls: function(doAnimation) {
1335
+ //console.log('hide doAnimation', doAnimation);
1336
+ var t = this,
1337
+ doAnimation = typeof doAnimation == 'undefined' || doAnimation;
1338
+
1339
+ if (!t.controlsAreVisible)
1340
+ return;
1341
+
1342
+ if (doAnimation) {
1343
+ // fade out main controls
1344
+ t.controls.stop(true, true).fadeOut(200, function() {
1345
+ $(this)
1346
+ .css('visibility','hidden')
1347
+ .css('display','block');
1348
+
1349
+ t.controlsAreVisible = false;
1350
+ });
1351
+
1352
+ // any additional controls people might add and want to hide
1353
+ t.container.find('.mejs-control').stop(true, true).fadeOut(200, function() {
1354
+ $(this)
1355
+ .css('visibility','hidden')
1356
+ .css('display','block');
1357
+ });
1358
+ } else {
1359
+
1360
+ // hide main controls
1361
+ t.controls
1362
+ .css('visibility','hidden')
1363
+ .css('display','block');
1364
+
1365
+ // hide others
1366
+ t.container.find('.mejs-control')
1367
+ .css('visibility','hidden')
1368
+ .css('display','block');
1369
+
1370
+ t.controlsAreVisible = false;
1371
+ }
1372
+ },
1373
+
1374
+ controlsTimer: null,
1375
+
1376
+ startControlsTimer: function(timeout) {
1377
+
1378
+ var t = this,
1379
+ timeout = typeof timeout != 'undefined' ? timeout : 500;
1380
+
1381
+ t.killControlsTimer('start');
1382
+
1383
+ t.controlsTimer = setTimeout(function() {
1384
+ //console.log('timer fired');
1385
+ t.hideControls();
1386
+ t.killControlsTimer('hide');
1387
+ }, timeout);
1388
+ },
1389
+
1390
+ killControlsTimer: function(src) {
1391
+
1392
+ var t = this;
1393
+
1394
+ if (t.controlsTimer !== null) {
1395
+ clearTimeout(t.controlsTimer);
1396
+ delete t.controlsTimer;
1397
+ t.controlsTimer = null;
1398
+ }
1399
+ },
1400
+
1401
+ controlsEnabled: true,
1402
+
1403
+ disableControls: function() {
1404
+ var t= this;
1405
+
1406
+ t.killControlsTimer();
1407
+ t.hideControls(false);
1408
+ this.controlsEnabled = false;
1409
+ },
1410
+
1411
+ enableControls: function() {
1412
+ var t= this;
1413
+
1414
+ t.showControls(false);
1415
+
1416
+ t.controlsEnabled = true;
1417
+ },
1418
+
1419
 
1420
  // Sets up all controls and events
1421
  meReady: function(media, domNode) {
1423
 
1424
  var t = this,
1425
  mf = mejs.MediaFeatures,
1426
+ autoplayAttr = domNode.getAttribute('autoplay'),
1427
+ autoplay = !(typeof autoplayAttr == 'undefined' || autoplayAttr === null || autoplayAttr === 'false'),
1428
+ featureIndex,
1429
  feature;
1430
 
1431
  // make sure it can't create itself again if a plugin reloads
1432
+ if (t.created)
1433
  return;
1434
  else
1435
+ t.created = true;
1436
 
1437
  t.media = media;
1438
  t.domNode = domNode;
1439
 
1440
+ if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) {
1441
 
 
1442
  // two built in features
1443
  t.buildposter(t, t.controls, t.layers, t.media);
1444
  t.buildoverlays(t, t.controls, t.layers, t.media);
1445
 
1446
+ // grab for use by features
1447
  t.findTracks();
1448
 
1449
  // add user-defined features/controls
1450
+ for (featureIndex in t.options.features) {
1451
+ feature = t.options.features[featureIndex];
1452
  if (t['build' + feature]) {
1453
  try {
1454
  t['build' + feature](t, t.controls, t.layers, t.media);
1455
  } catch (e) {
1456
  // TODO: report control error
1457
  //throw e;
1458
+ //console.log('error building ' + feature);
1459
+ //console.log(e);
1460
  }
1461
  }
1462
  }
1463
 
1464
+ t.container.trigger('controlsready');
1465
+
1466
  // reset all layers and controls
1467
  t.setPlayerSize(t.width, t.height);
1468
  t.setControlsSize();
1469
+
1470
 
1471
  // controls fade
1472
  if (t.isVideo) {
1473
+ // click controls
1474
+ if (t.media.pluginType == 'native') {
1475
+ t.$media.click(function() {
1476
+ if (media.paused) {
1477
+ media.play();
1478
+ } else {
1479
+ media.pause();
1480
+ }
1481
+ });
1482
+ } else {
1483
+ $(t.media.pluginElement).click(function() {
1484
+ if (media.paused) {
1485
+ media.play();
1486
+ } else {
1487
+ media.pause();
1488
+ }
1489
+ });
1490
+ }
1491
+
1492
+
1493
+
1494
  // show/hide controls
1495
  t.container
1496
+ .bind('mouseenter mouseover', function () {
1497
+ if (t.controlsEnabled) {
1498
+ if (!t.options.alwaysShowControls) {
1499
+ t.killControlsTimer('enter');
1500
+ t.showControls();
1501
+ t.startControlsTimer(2500);
1502
+ }
1503
+ }
1504
+ })
1505
+ .bind('mousemove', function() {
1506
+ if (t.controlsEnabled) {
1507
+ if (!t.controlsAreVisible)
1508
+ t.showControls();
1509
+ //t.killControlsTimer('move');
1510
+ t.startControlsTimer(2500);
1511
  }
1512
  })
1513
  .bind('mouseleave', function () {
1514
+ if (t.controlsEnabled) {
1515
+ if (!t.media.paused && !t.options.alwaysShowControls) {
1516
+ t.startControlsTimer(1000);
1517
+ }
 
1518
  }
1519
  });
1520
 
1521
  // check for autoplay
1522
+ if (autoplay && !t.options.alwaysShowControls) {
1523
+ t.hideControls();
1524
  }
1525
 
1526
  // resizer
1549
 
1550
  if (t.options.loop) {
1551
  t.media.play();
1552
+ } else if (!t.options.alwaysShowControls && t.controlsEnabled) {
1553
+ t.showControls();
1554
  }
1555
  }, true);
1556
 
1563
  t.updateCurrent();
1564
  }
1565
 
1566
+ t.setPlayerSize(t.width, t.height);
1567
  t.setControlsSize();
1568
  }, true);
1569
 
1570
 
1571
  // webkit has trouble doing this without a delay
1572
  setTimeout(function () {
 
1573
  t.setPlayerSize(t.width, t.height);
1574
+ t.setControlsSize();
1575
  }, 50);
1576
 
1577
+ // adjust controls whenever window sizes (used to be in fullscreen only)
1578
+ $(window).resize(function() {
1579
+
1580
+ // don't resize for fullscreen mode
1581
+ if ( !(t.isFullScreen || (mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen)) ) {
1582
+ t.setPlayerSize(t.width, t.height);
1583
+ }
1584
+
1585
+ // always adjust controls
1586
+ t.setControlsSize();
1587
+ });
1588
+
1589
+ }
1590
+
1591
+ // force autoplay for HTML5
1592
+ if (autoplay && media.pluginType == 'native') {
1593
+ media.load();
1594
+ media.play();
1595
  }
1596
 
1597
 
1598
  if (t.options.success) {
1599
+ t.options.success(t.media, t.domNode, t);
1600
  }
1601
  },
1602
 
1603
  handleError: function(e) {
1604
+ var t = this;
1605
+
1606
+ t.controls.hide();
1607
+
1608
  // Tell user that the file cannot be played
1609
+ if (t.options.error) {
1610
+ t.options.error(e);
1611
  }
1612
  },
1613
 
1615
  var t = this;
1616
 
1617
  // ie9 appears to need this (jQuery bug?)
1618
+ //t.width = parseInt(width, 10);
1619
+ //t.height = parseInt(height, 10);
1620
+
1621
+ if (t.height.toString().indexOf('%') > 0) {
1622
+
1623
+ // do we have the native dimensions yet?
1624
+ var
1625
+ nativeWidth = (t.media.videoWidth && t.media.videoWidth > 0) ? t.media.videoWidth : t.options.defaultVideoWidth,
1626
+ nativeHeight = (t.media.videoHeight && t.media.videoHeight > 0) ? t.media.videoHeight : t.options.defaultVideoHeight,
1627
+ parentWidth = t.container.parent().width(),
1628
+ newHeight = parseInt(parentWidth * nativeHeight/nativeWidth, 10);
1629
+
1630
+ if (t.container.parent()[0].tagName.toLowerCase() === 'body') { // && t.container.siblings().count == 0) {
1631
+ parentWidth = $(window).width();
1632
+ newHeight = $(window).height();
1633
+ }
1634
+
1635
+
1636
+ // set outer container size
1637
+ t.container
1638
+ .width(parentWidth)
1639
+ .height(newHeight);
1640
+
1641
+ // set native <video>
1642
+ t.$media
1643
+ .width('100%')
1644
+ .height('100%');
1645
+
1646
+ // set shims
1647
+ t.container.find('object embed')
1648
+ .width('100%')
1649
+ .height('100%');
1650
+
1651
+ // if shim is ready, send the size to the embeded plugin
1652
+ if (t.media.setVideoSize)
1653
+ t.media.setVideoSize(parentWidth, newHeight);
1654
+
1655
+ // set the layers
1656
+ t.layers.children('.mejs-layer')
1657
+ .width('100%')
1658
+ .height('100%');
1659
+
1660
+
1661
+ } else {
1662
 
1663
+ t.container
1664
+ .width(t.width)
1665
+ .height(t.height);
1666
+
1667
+ t.layers.children('.mejs-layer')
1668
+ .width(t.width)
1669
+ .height(t.height);
1670
+
1671
+ }
1672
  },
1673
 
1674
  setControlsSize: function() {
1703
 
1704
 
1705
  buildposter: function(player, controls, layers, media) {
1706
+ var t = this,
1707
+ poster =
1708
+ $('<div class="mejs-poster mejs-layer">' +
1709
  '</div>')
1710
  .appendTo(layers),
1711
+ posterUrl = player.$media.attr('poster');
 
1712
 
1713
  // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
1714
+ if (player.options.poster !== '') {
1715
+ posterUrl = player.options.poster;
1716
+ }
1717
+
1718
  // second, try the real poster
1719
+ if (posterUrl !== '' && posterUrl != null) {
1720
+ t.setPoster(posterUrl);
1721
  } else {
1722
+ poster.hide();
1723
  }
1724
 
1725
  media.addEventListener('play',function() {
1726
  poster.hide();
1727
  }, false);
1728
  },
1729
+
1730
+ setPoster: function(url) {
1731
+ var t = this,
1732
+ posterDiv = t.container.find('.mejs-poster'),
1733
+ posterImg = posterDiv.find('img');
1734
+
1735
+ if (posterImg.length == 0) {
1736
+ posterImg = $('<img width="100%" height="100%" />').appendTo(posterDiv);
1737
+ }
1738
+
1739
+ posterImg.attr('src', url);
1740
+ },
1741
 
1742
  buildoverlays: function(player, controls, layers, media) {
1743
  if (!player.isVideo)
1770
  media.pause();
1771
  }
1772
  });
1773
+
1774
+ if (mejs.MediaFeatures.isiOS || mejs.MediaFeatures.isAndroid) {
1775
+ bigPlay.remove();
1776
+ loading.remove();
1777
+ }
1778
 
1779
 
1780
  // show/hide big play button
1787
  }, false);
1788
 
1789
  // show/hide loading
1790
+ media.addEventListener('loadeddata',function() {
1791
  // for some reason Chrome is firing this event
1792
+ //if (mejs.MediaFeatures.isChrome && media.getAttribute && media.getAttribute('preload') === 'none')
1793
+ // return;
1794
 
1795
  loading.show();
1796
  }, false);
1871
  })(mejs.$);
1872
  (function($) {
1873
  // PLAY/pause BUTTON
1874
+ $.extend(MediaElementPlayer.prototype, {
1875
+ buildplaypause: function(player, controls, layers, media) {
1876
+ var
1877
+ t = this,
1878
+ play =
1879
+ $('<div class="mejs-button mejs-playpause-button mejs-play" >' +
1880
+ '<button type="button" aria-controls="' + t.id + '" title="Play/Pause"></button>' +
1881
+ '</div>')
1882
+ .appendTo(controls)
1883
+ .click(function(e) {
1884
+ e.preventDefault();
 
 
 
1885
 
1886
+ if (media.paused) {
1887
+ media.play();
1888
+ } else {
1889
+ media.pause();
1890
+ }
1891
+
1892
+ return false;
1893
+ });
1894
 
1895
+ media.addEventListener('play',function() {
1896
+ play.removeClass('mejs-play').addClass('mejs-pause');
1897
+ }, false);
1898
+ media.addEventListener('playing',function() {
1899
+ play.removeClass('mejs-play').addClass('mejs-pause');
1900
+ }, false);
1901
 
1902
 
1903
+ media.addEventListener('pause',function() {
1904
+ play.removeClass('mejs-pause').addClass('mejs-play');
1905
+ }, false);
1906
+ media.addEventListener('paused',function() {
1907
+ play.removeClass('mejs-pause').addClass('mejs-play');
1908
+ }, false);
1909
+ }
1910
+ });
1911
 
1912
  })(mejs.$);
1913
  (function($) {
1914
  // STOP BUTTON
1915
+ $.extend(MediaElementPlayer.prototype, {
1916
+ buildstop: function(player, controls, layers, media) {
1917
+ var t = this,
1918
+ stop =
1919
+ $('<div class="mejs-button mejs-stop-button mejs-stop">' +
1920
+ '<button type="button" aria-controls="' + t.id + '" title="Stop"></button>' +
1921
+ '</div>')
1922
+ .appendTo(controls)
1923
+ .click(function() {
1924
+ if (!media.paused) {
1925
+ media.pause();
1926
+ }
1927
+ if (media.currentTime > 0) {
1928
+ media.setCurrentTime(0);
1929
+ controls.find('.mejs-time-current').width('0px');
1930
+ controls.find('.mejs-time-handle').css('left', '0px');
1931
+ controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
1932
+ controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
1933
+ layers.find('.mejs-poster').show();
1934
+ }
1935
+ });
1936
+ }
1937
+ });
1938
 
1939
  })(mejs.$);
1940
  (function($) {
1941
  // progress/loaded bar
1942
+ $.extend(MediaElementPlayer.prototype, {
1943
+ buildprogress: function(player, controls, layers, media) {
1944
+
1945
+ $('<div class="mejs-time-rail">'+
1946
+ '<span class="mejs-time-total">'+
1947
+ '<span class="mejs-time-loaded"></span>'+
1948
+ '<span class="mejs-time-current"></span>'+
1949
+ '<span class="mejs-time-handle"></span>'+
1950
+ '<span class="mejs-time-float">' +
1951
+ '<span class="mejs-time-float-current">00:00</span>' +
1952
+ '<span class="mejs-time-float-corner"></span>' +
1953
+ '</span>'+
1954
  '</span>'+
1955
+ '</div>')
1956
+ .appendTo(controls);
 
1957
 
1958
+ var
1959
+ t = this,
1960
+ total = controls.find('.mejs-time-total'),
1961
+ loaded = controls.find('.mejs-time-loaded'),
1962
+ current = controls.find('.mejs-time-current'),
1963
+ handle = controls.find('.mejs-time-handle'),
1964
+ timefloat = controls.find('.mejs-time-float'),
1965
+ timefloatcurrent = controls.find('.mejs-time-float-current'),
1966
+ handleMouseMove = function (e) {
1967
+ // mouse position relative to the object
1968
+ var x = e.pageX,
1969
+ offset = total.offset(),
1970
+ width = total.outerWidth(),
1971
+ percentage = 0,
1972
+ newTime = 0;
1973
+
1974
+
1975
+ if (x > offset.left && x <= width + offset.left && media.duration) {
1976
+ percentage = ((x - offset.left) / width);
1977
+ newTime = (percentage <= 0.02) ? 0 : percentage * media.duration;
1978
+
1979
+ // seek to where the mouse is
1980
+ if (mouseIsDown) {
1981
+ media.setCurrentTime(newTime);
1982
+ }
1983
+
1984
+ // position floating time box
1985
+ var pos = x - offset.left;
1986
+ timefloat.css('left', pos);
1987
+ timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime) );
1988
  }
1989
+ },
1990
+ mouseIsDown = false,
1991
+ mouseIsOver = false;
1992
 
1993
+ // handle clicks
1994
+ //controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove);
1995
+ total
1996
+ .bind('mousedown', function (e) {
1997
+ // only handle left clicks
1998
+ if (e.which === 1) {
1999
+ mouseIsDown = true;
2000
+ handleMouseMove(e);
2001
+ return false;
2002
+ }
2003
+ });
 
 
 
 
 
 
2004
 
2005
+ controls.find('.mejs-time-total')
2006
+ .bind('mouseenter', function(e) {
2007
+ mouseIsOver = true;
2008
+ })
2009
+ .bind('mouseleave',function(e) {
2010
+ mouseIsOver = false;
2011
+ });
2012
 
2013
+ $(document)
2014
+ .bind('mouseup', function (e) {
2015
+ mouseIsDown = false;
2016
+ //handleMouseMove(e);
2017
+ })
2018
+ .bind('mousemove', function (e) {
2019
+ if (mouseIsDown || mouseIsOver) {
2020
+ handleMouseMove(e);
2021
+ }
2022
+ });
2023
 
2024
+ // loading
2025
+ media.addEventListener('progress', function (e) {
2026
+ player.setProgressRail(e);
2027
+ player.setCurrentRail(e);
2028
+ }, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2029
 
2030
+ // current time
2031
+ media.addEventListener('timeupdate', function(e) {
2032
+ player.setProgressRail(e);
2033
+ player.setCurrentRail(e);
2034
+ }, false);
2035
+
2036
+
2037
+ // store for later use
2038
+ t.loaded = loaded;
2039
+ t.total = total;
2040
+ t.current = current;
2041
+ t.handle = handle;
2042
+ },
2043
+ setProgressRail: function(e) {
2044
 
2045
+ var
2046
+ t = this,
2047
+ target = (e != undefined) ? e.target : t.media,
2048
+ percent = null;
2049
+
2050
+ // newest HTML5 spec has buffered array (FF4, Webkit)
2051
+ if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
2052
+ // TODO: account for a real array with multiple values (only Firefox 4 has this so far)
2053
+ percent = target.buffered.end(0) / target.duration;
2054
+ }
2055
+ // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
2056
+ // to be anything other than 0. If the byte count is available we use this instead.
2057
+ // Browsers that support the else if do not seem to have the bufferedBytes value and
2058
+ // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
2059
+ else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
2060
+ percent = target.bufferedBytes / target.bytesTotal;
2061
+ }
2062
+ // Firefox 3 with an Ogg file seems to go this way
2063
+ else if (e && e.lengthComputable && e.total != 0) {
2064
+ percent = e.loaded/e.total;
2065
+ }
2066
 
2067
+ // finally update the progress bar
2068
+ if (percent !== null) {
2069
+ percent = Math.min(1, Math.max(0, percent));
2070
+ // update loaded bar
2071
+ if (t.loaded && t.total) {
2072
+ t.loaded.width(t.total.width() * percent);
2073
+ }
2074
  }
2075
+ },
2076
+ setCurrentRail: function() {
 
2077
 
2078
+ var t = this;
2079
+
2080
+ if (t.media.currentTime != undefined && t.media.duration) {
2081
 
2082
+ // update bar and handle
2083
+ if (t.total && t.handle) {
2084
+ var
2085
+ newWidth = t.total.width() * t.media.currentTime / t.media.duration,
2086
+ handlePos = newWidth - (t.handle.outerWidth(true) / 2);
2087
 
2088
+ t.current.width(newWidth);
2089
+ t.handle.css('left', handlePos);
2090
+ }
2091
  }
 
 
 
2092
 
2093
+ }
2094
+ });
2095
  })(mejs.$);
2096
  (function($) {
2097
  // current and duration 00:00 / 00:00
2098
+ $.extend(MediaElementPlayer.prototype, {
2099
+ buildcurrent: function(player, controls, layers, media) {
2100
+ var t = this;
2101
+
2102
+ $('<div class="mejs-time">'+
2103
+ '<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '')
2104
+ + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')+ '</span>'+
2105
+ '</div>')
2106
+ .appendTo(controls);
2107
+
2108
+ t.currenttime = t.controls.find('.mejs-currenttime');
2109
 
2110
+ media.addEventListener('timeupdate',function() {
2111
+ player.updateCurrent();
2112
+ }, false);
2113
+ },
2114
 
 
 
 
 
 
 
 
 
2115
 
2116
+ buildduration: function(player, controls, layers, media) {
2117
+ var t = this;
2118
 
2119
+ if (controls.children().last().find('.mejs-currenttime').length > 0) {
2120
+ $(' <span> | </span> '+
2121
+ '<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '')
2122
+ + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')+ '</span>')
2123
+ .appendTo(controls.find('.mejs-time'));
2124
+ } else {
 
2125
 
2126
+ // add class to current time
2127
+ controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container');
2128
+
2129
+ $('<div class="mejs-time mejs-duration-container">'+
2130
+ '<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '')
2131
+ + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')+ '</span>' +
2132
+ '</div>')
2133
+ .appendTo(controls);
2134
+ }
2135
+
2136
+ t.durationD = t.controls.find('.mejs-duration');
2137
 
2138
+ media.addEventListener('timeupdate',function() {
2139
+ player.updateDuration();
2140
+ }, false);
2141
+ },
 
 
2142
 
2143
+ updateCurrent: function() {
2144
+ var t = this;
2145
+
2146
+ if (t.currenttime) {
2147
+ t.currenttime.html(mejs.Utility.secondsToTimeCode(t.media.currentTime, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25));
2148
+ }
2149
+ },
2150
+
2151
+ updateDuration: function() {
2152
+ var t = this;
2153
+
2154
+ if (t.media.duration && t.durationD) {
2155
+ t.durationD.html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25));
2156
+ }
2157
+ }
2158
+ });
2159
 
2160
  })(mejs.$);
2161
  (function($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2162
 
2163
+ $.extend(MediaElementPlayer.prototype, {
2164
+ buildvolume: function(player, controls, layers, media) {
2165
+ var t = this,
2166
+ mute =
2167
+ $('<div class="mejs-button mejs-volume-button mejs-mute">'+
2168
+ '<button type="button" aria-controls="' + t.id + '" title="Mute/Unmute"></button>'+
2169
+ '<div class="mejs-volume-slider">'+ // outer background
2170
+ '<div class="mejs-volume-total"></div>'+ // line background
2171
+ '<div class="mejs-volume-current"></div>'+ // current volume
2172
+ '<div class="mejs-volume-handle"></div>'+ // handle
2173
+ '</div>'+
2174
+ '</div>')
2175
+ .appendTo(controls),
2176
+ volumeSlider = mute.find('.mejs-volume-slider'),
2177
+ volumeTotal = mute.find('.mejs-volume-total'),
2178
+ volumeCurrent = mute.find('.mejs-volume-current'),
2179
+ volumeHandle = mute.find('.mejs-volume-handle'),
2180
+
2181
+ positionVolumeHandle = function(volume) {
2182
+
2183
+ if (!volumeSlider.is(':visible')) {
2184
+ volumeSlider.show();
2185
+ positionVolumeHandle(volume);
2186
+ volumeSlider.hide()
2187
+ return;
2188
+ }
2189
 
2190
+ var
2191
+
2192
+ // height of the full size volume slider background
2193
+ totalHeight = volumeTotal.height(),
2194
+
2195
+ // top/left of full size volume slider background
2196
+ totalPosition = volumeTotal.position(),
2197
+
2198
+ // the new top position based on the current volume
2199
+ // 70% volume on 100px height == top:30px
2200
+ newTop = totalHeight - (totalHeight * volume);
2201
 
2202
+ // handle
2203
+ volumeHandle.css('top', totalPosition.top + newTop - (volumeHandle.height() / 2));
2204
 
2205
+ // show the current visibility
2206
+ volumeCurrent.height(totalHeight - newTop );
2207
+ volumeCurrent.css('top', totalPosition.top + newTop);
2208
+ },
2209
+ handleVolumeMove = function(e) {
2210
+ var
2211
+ railHeight = volumeTotal.height(),
2212
+ totalOffset = volumeTotal.offset(),
2213
+ totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
2214
+ newY = e.pageY - totalOffset.top,
2215
+ volume = (railHeight - newY) / railHeight
2216
+
2217
+ // the controls just hide themselves (usually when mouse moves too far up)
2218
+ if (totalOffset.top == 0)
2219
+ return;
2220
+
2221
+ // 0-1
2222
+ volume = Math.max(0,volume);
2223
+ volume = Math.min(volume,1);
2224
+
2225
+ // TODO: handle vertical and horizontal CSS
2226
+ // only allow it to move within the rail
2227
+ if (newY < 0)
2228
+ newY = 0;
2229
+ else if (newY > railHeight)
2230
+ newY = railHeight;
2231
+
2232
+ // move the handle to match the mouse
2233
+ volumeHandle.css('top', newY - (volumeHandle.height() / 2) + totalTop );
2234
+
2235
+ // show the current visibility
2236
+ volumeCurrent.height(railHeight-newY);
2237
+ volumeCurrent.css('top',newY+totalTop);
2238
+
2239
+ // set mute status
2240
+ if (volume == 0) {
2241
+ media.setMuted(true);
2242
+ mute.removeClass('mejs-mute').addClass('mejs-unmute');
2243
+ } else {
2244
+ media.setMuted(false);
2245
+ mute.removeClass('mejs-unmute').addClass('mejs-mute');
2246
+ }
2247
 
2248
+ volume = Math.max(0,volume);
2249
+ volume = Math.min(volume,1);
2250
 
2251
+ // set the volume
2252
+ media.setVolume(volume);
2253
+ },
2254
+ mouseIsDown = false;
2255
+
2256
+ // SLIDER
2257
+ mute
2258
+ .hover(function() {
2259
+ volumeSlider.show();
2260
+ }, function() {
2261
+ volumeSlider.hide();
2262
+ })
2263
+
2264
+ volumeSlider
2265
+ .bind('mousedown', function (e) {
 
 
 
2266
  handleVolumeMove(e);
2267
+ mouseIsDown = true;
2268
+ return false;
2269
+ });
2270
+ $(document)
2271
+ .bind('mouseup', function (e) {
2272
+ mouseIsDown = false;
2273
+ })
2274
+ .bind('mousemove', function (e) {
2275
+ if (mouseIsDown) {
2276
+ handleVolumeMove(e);
2277
+ }
2278
+ });
2279
 
2280
 
2281
+ // MUTE button
2282
+ mute.find('button').click(function() {
 
 
 
 
 
 
 
 
 
 
2283
 
2284
+ media.setMuted( !media.muted );
2285
+
2286
+ });
 
 
 
2287
 
2288
+ // listen for volume change events from other sources
2289
+ media.addEventListener('volumechange', function(e) {
2290
+ if (!mouseIsDown) {
2291
+ if (media.muted) {
2292
+ positionVolumeHandle(0);
2293
+ mute.removeClass('mejs-mute').addClass('mejs-unmute');
2294
+ } else {
2295
+ positionVolumeHandle(e.target.volume);
2296
+ mute.removeClass('mejs-unmute').addClass('mejs-mute');
2297
+ }
2298
+ }
2299
+ }, true);
2300
 
2301
+ // set initial volume
2302
+ //console.log('init volume',player.options.startVolume);
2303
+ positionVolumeHandle(player.options.startVolume);
2304
+
2305
+ // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements
2306
+ if (media.pluginType === 'native') {
2307
+ media.setVolume(player.options.startVolume);
2308
+ }
2309
+ }
2310
+ });
2311
+
2312
  })(mejs.$);
2313
 
2314
  (function($) {
2315
+
2316
+ $.extend(mejs.MepDefaults, {
2317
+ forcePluginFullScreen: false,
2318
+ newWindowCallback: function() { return '';}
2319
+ });
2320
+
2321
+ $.extend(MediaElementPlayer.prototype, {
2322
+
2323
+ isFullScreen: false,
2324
+
2325
+ docStyleOverflow: null,
2326
+
2327
+ isInIframe: false,
2328
+
2329
+ buildfullscreen: function(player, controls, layers, media) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2330
 
2331
+ if (!player.isVideo)
2332
+ return;
2333
+
2334
+ player.isInIframe = (window.location != window.parent.location);
2335
+
2336
+ // native events
2337
+ if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
2338
+ //player.container.bind(mejs.MediaFeatures.fullScreenEventName, function(e) {
2339
+ player.container.bind('webkitfullscreenchange', function(e) {
2340
+
2341
+ if (mejs.MediaFeatures.isFullScreen()) {
2342
+ // reset the controls once we are fully in full screen
2343
+ player.setControlsSize();
2344
+ } else {
2345
+ // when a user presses ESC
2346
+ // make sure to put the player back into place
2347
+ player.exitFullScreen();
2348
+ }
2349
+ });
2350
+ }
2351
 
2352
+ var t = this,
2353
+ normalHeight = 0,
2354
+ normalWidth = 0,
2355
+ container = player.container,
2356
+ fullscreenBtn =
2357
+ $('<div class="mejs-button mejs-fullscreen-button">' +
2358
+ '<button type="button" aria-controls="' + t.id + '" title="Fullscreen"></button>' +
2359
+ '</div>')
2360
+ .appendTo(controls)
2361
+ .click(function() {
2362
+ var isFullScreen = (mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || player.isFullScreen;
2363
+
2364
+ if (isFullScreen) {
2365
+ player.exitFullScreen();
2366
+ } else {
2367
+ player.enterFullScreen();
2368
+ }
2369
+ });
2370
+
2371
+ player.fullscreenBtn = fullscreenBtn;
2372
 
2373
+ $(document).bind('keydown',function (e) {
2374
+ if (((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen) && e.keyCode == 27) {
2375
+ player.exitFullScreen();
2376
+ }
2377
+ });
2378
+
2379
+ },
2380
+ enterFullScreen: function() {
2381
+
2382
+ var t = this;
2383
+
2384
+
2385
+
2386
+ // firefox+flash can't adjust plugin sizes without resetting :(
2387
+ if (t.media.pluginType !== 'native' && (mejs.MediaFeatures.isGecko || t.options.forcePluginFullScreen)) {
2388
+ t.media.setFullscreen(true);
2389
+ //player.isFullScreen = true;
2390
+ return;
2391
+ }
2392
+
2393
+ // store overflow
2394
+ docStyleOverflow = document.documentElement.style.overflow;
2395
+ // set it to not show scroll bars so 100% will work
2396
+ document.documentElement.style.overflow = 'hidden';
2397
+
2398
+ // store sizing
2399
+ normalHeight = t.container.height();
2400
+ normalWidth = t.container.width();
2401
+
2402
+
2403
+ // attempt to do true fullscreen (Safari 5.1 and Firefox Nightly only for now)
2404
+ if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
2405
+
2406
+ mejs.MediaFeatures.requestFullScreen(t.container[0]);
2407
+ //return;
2408
+
2409
+ } else if (mejs.MediaFeatures.hasSemiNativeFullScreen) {
2410
+ t.media.webkitEnterFullscreen();
2411
+ return;
2412
+ }
2413
+
2414
+ // check for iframe launch
2415
+ if (t.isInIframe && t.options.newWindowUrl !== '') {
2416
+ t.pause();
2417
+ //window.open(t.options.newWindowUrl, t.id, 'width=' + t.width + ',height=' + t.height + ',resizable=yes,scrollbars=no,status=no,toolbar=no');
2418
+ var url = t.options.newWindowCallback(this);
2419
+ if (url !== '') {
2420
+ window.open(url, t.id, 'top=0,left=0,width=' + screen.availWidth + ',height=' + screen.availHeight + ',resizable=yes,scrollbars=no,status=no,toolbar=no');
2421
+ }
2422
+ return;
2423
+ }
2424
+
2425
+ // full window code
2426
+
2427
+
2428
 
2429
+ // make full size
2430
+ t.container
2431
+ .addClass('mejs-container-fullscreen')
2432
+ .width('100%')
2433
+ .height('100%');
2434
+ //.css({position: 'fixed', left: 0, top: 0, right: 0, bottom: 0, overflow: 'hidden', width: '100%', height: '100%', 'z-index': 1000});
2435
+ setTimeout(function() {
2436
+ t.container.css({width: '100%', height: '100%'});
2437
+ }, 500);
2438
+ //console.log('fullscreen', t.container.width());
2439
+
2440
+ if (t.pluginType === 'native') {
2441
+ t.$media
2442
+ .width('100%')
2443
+ .height('100%');
2444
+ } else {
2445
+ t.container.find('object embed')
2446
+ .width('100%')
2447
+ .height('100%');
2448
+ t.media.setVideoSize($(window).width(),$(window).height());
2449
+ }
2450
+
2451
+ t.layers.children('div')
2452
+ .width('100%')
2453
+ .height('100%');
2454
+
2455
+ if (t.fullscreenBtn) {
2456
+ t.fullscreenBtn
2457
+ .removeClass('mejs-fullscreen')
2458
+ .addClass('mejs-unfullscreen');
2459
+ }
2460
 
2461
+ t.setControlsSize();
2462
+ t.isFullScreen = true;
2463
+ },
2464
+
2465
+ exitFullScreen: function() {
2466
+
2467
+ var t = this;
2468
+
2469
+ // firefox can't adjust plugins
2470
+ if (t.media.pluginType !== 'native' && mejs.MediaFeatures.isFirefox) {
2471
+ t.media.setFullscreen(false);
2472
+ //player.isFullScreen = false;
2473
+ return;
2474
+ }
2475
+
2476
+ // come outo of native fullscreen
2477
+ if (mejs.MediaFeatures.hasTrueNativeFullScreen && (mejs.MediaFeatures.isFullScreen() || t.isFullScreen)) {
2478
+ mejs.MediaFeatures.cancelFullScreen();
2479
+ }
2480
 
2481
+ // restore scroll bars to document
2482
+ document.documentElement.style.overflow = docStyleOverflow;
2483
+
2484
+ t.container
2485
+ .removeClass('mejs-container-fullscreen')
2486
+ .width(normalWidth)
2487
+ .height(normalHeight)
2488
+ .css('z-index', 1);
2489
+ //.css({position: '', left: '', top: '', right: '', bottom: '', overflow: 'inherit', width: normalWidth + 'px', height: normalHeight + 'px', 'z-index': 1});
2490
+
2491
+ if (t.pluginType === 'native') {
2492
+ t.$media
2493
+ .width(normalWidth)
2494
+ .height(normalHeight);
2495
+ } else {
2496
+ t.container.find('object embed')
2497
+ .width(normalWidth)
2498
+ .height(normalHeight);
2499
+
2500
+ t.media.setVideoSize(normalWidth, normalHeight);
2501
+ }
2502
 
2503
+ t.layers.children('div')
2504
+ .width(normalWidth)
2505
+ .height(normalHeight);
 
 
 
2506
 
2507
+ t.fullscreenBtn
2508
+ .removeClass('mejs-unfullscreen')
2509
+ .addClass('mejs-fullscreen');
 
 
2510
 
2511
+ t.setControlsSize();
2512
+ t.isFullScreen = false;
2513
+ }
2514
+ });
2515
 
2516
  })(mejs.$);
2517
  (function($) {
2529
  });
2530
 
2531
  $.extend(MediaElementPlayer.prototype, {
2532
+
2533
+ hasChapters: false,
2534
 
2535
  buildtracks: function(player, controls, layers, media) {
2536
  if (!player.isVideo)
2550
  player.captionsText = player.captions.find('.mejs-captions-text');
2551
  player.captionsButton =
2552
  $('<div class="mejs-button mejs-captions-button">'+
2553
+ '<button type="button" aria-controls="' + this.id + '" title="Captions/Subtitles"></button>'+
2554
  '<div class="mejs-captions-selector">'+
2555
  '<ul>'+
2556
  '<li>'+
2559
  '</li>' +
2560
  '</ul>'+
2561
  '</div>'+
2562
+ '</div>')
2563
  .appendTo(controls)
2564
+
2565
+ // hover
2566
+ .hover(function() {
2567
+ $(this).find('.mejs-captions-selector').css('visibility','visible');
2568
+ }, function() {
2569
+ $(this).find('.mejs-captions-selector').css('visibility','hidden');
2570
+ })
2571
+
2572
  // handle clicks to the language radio buttons
2573
  .delegate('input[type=radio]','click',function() {
2574
  lang = this.value;
2647
  player.container.hover(
2648
  function () {
2649
  // chapters
2650
+ if (player.hasChapters) {
2651
+ player.chapters.css('visibility','visible');
2652
+ player.chapters.fadeIn(200);
2653
+ }
2654
  },
2655
  function () {
2656
+ if (player.hasChapters && !media.paused) {
2657
  player.chapters.fadeOut(200, function() {
2658
  $(this).css('visibility','hidden');
2659
  $(this).css('display','block');
2839
  for (i=0; i<t.tracks.length; i++) {
2840
  if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) {
2841
  t.drawChapters(t.tracks[i]);
2842
+ t.hasChapters = true;
2843
  break;
2844
  }
2845
  }
2973
  Adapted from: http://www.delphiki.com/html5/playr
2974
  */
2975
  mejs.TrackFormatParser = {
2976
+ // match start "chapter-" (or anythingelse)
2977
+ pattern_identifier: /^([a-zA-z]+-)?[0-9]+$/,
2978
+ pattern_timecode: /^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
2979
 
2980
  split2: function (text, regex) {
2981
  // normal version for compliant browsers
2995
  if (this.pattern_identifier.exec(lines[i])){
2996
  // skip to the next line where the start --> end time code should be
2997
  i++;
2998
+ timecode = this.pattern_timecode.exec(lines[i]);
2999
+
3000
  if (timecode && i<lines.length){
3001
  i++;
3002
  // grab all the (possibly multi-line) text that follows
3134
 
3135
  })(mejs.$);
3136
 
3137
+ /*
3138
+ * ContextMenu Plugin
3139
+ *
3140
+ *
3141
+ */
3142
+
3143
+ (function($) {
3144
+
3145
+ $.extend(mejs.MepDefaults,
3146
+ contextMenuItems = [
3147
+ // demo of a fullscreen option
3148
+ {
3149
+ render: function(player) {
3150
+
3151
+ // check for fullscreen plugin
3152
+ if (typeof player.enterFullScreen == 'undefined')
3153
+ return null;
3154
+
3155
+ if (player.isFullScreen) {
3156
+ return "Turn off Fullscreen";
3157
+ } else {
3158
+ return "Go Fullscreen";
3159
+ }
3160
+ },
3161
+ click: function(player) {
3162
+ if (player.isFullScreen) {
3163
+ player.exitFullScreen();
3164
+ } else {
3165
+ player.enterFullScreen();
3166
+ }
3167
+ }
3168
+ }
3169
+ ,
3170
+ // demo of a mute/unmute button
3171
+ {
3172
+ render: function(player) {
3173
+ if (player.media.muted) {
3174
+ return "Unmute";
3175
+ } else {
3176
+ return "Mute";
3177
+ }
3178
+ },
3179
+ click: function(player) {
3180
+ if (player.media.muted) {
3181
+ player.setMuted(false);
3182
+ } else {
3183
+ player.setMuted(true);
3184
+ }
3185
+ }
3186
+ },
3187
+ // separator
3188
+ {
3189
+ isSeparator: true
3190
+ }
3191
+ ,
3192
+ // demo of simple download video
3193
+ {
3194
+ render: function(player) {
3195
+ return "Download Video";
3196
+ },
3197
+ click: function(player) {
3198
+ window.location.href = player.media.currentSrc;
3199
+ }
3200
+ }
3201
+ ]
3202
+ );
3203
+
3204
+
3205
+ $.extend(MediaElementPlayer.prototype, {
3206
+ buildcontextmenu: function(player, controls, layers, media) {
3207
+
3208
+ // create context menu
3209
+ player.contextMenu = $('<div class="mejs-contextmenu"></div>')
3210
+ .appendTo($('body'))
3211
+ .hide();
3212
+
3213
+ // create events for showing context menu
3214
+ player.container.bind('contextmenu', function(e) {
3215
+ if (player.isContextMenuEnabled) {
3216
+ e.preventDefault();
3217
+ player.renderContextMenu(e.clientX-1, e.clientY-1);
3218
+ return false;
3219
+ }
3220
+ });
3221
+ player.container.bind('click', function() {
3222
+ player.contextMenu.hide();
3223
+ });
3224
+ player.contextMenu.bind('mouseleave', function() {
3225
+
3226
+ //console.log('context hover out');
3227
+ player.startContextMenuTimer();
3228
+
3229
+ });
3230
+ },
3231
+
3232
+ isContextMenuEnabled: true,
3233
+ enableContextMenu: function() {
3234
+ this.isContextMenuEnabled = true;
3235
+ },
3236
+ disableContextMenu: function() {
3237
+ this.isContextMenuEnabled = false;
3238
+ },
3239
+
3240
+ contextMenuTimeout: null,
3241
+ startContextMenuTimer: function() {
3242
+ //console.log('startContextMenuTimer');
3243
+
3244
+ var t = this;
3245
+
3246
+ t.killContextMenuTimer();
3247
+
3248
+ t.contextMenuTimer = setTimeout(function() {
3249
+ t.hideContextMenu();
3250
+ t.killContextMenuTimer();
3251
+ }, 750);
3252
+ },
3253
+ killContextMenuTimer: function() {
3254
+ var timer = this.contextMenuTimer;
3255
+
3256
+ //console.log('killContextMenuTimer', timer);
3257
+
3258
+ if (timer != null) {
3259
+ clearTimeout(timer);
3260
+ delete timer;
3261
+ timer = null;
3262
+ }
3263
+ },
3264
+
3265
+ hideContextMenu: function() {
3266
+ this.contextMenu.hide();
3267
+ },
3268
+
3269
+ renderContextMenu: function(x,y) {
3270
+
3271
+ // alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly
3272
+ var t = this,
3273
+ html = '',
3274
+ items = t.options.contextMenuItems;
3275
+
3276
+ for (var i=0, il=items.length; i<il; i++) {
3277
+
3278
+ if (items[i].isSeparator) {
3279
+ html += '<div class="mejs-contextmenu-separator"></div>';
3280
+ } else {
3281
+
3282
+ var rendered = items[i].render(t);
3283
+
3284
+ // render can return null if the item doesn't need to be used at the moment
3285
+ if (rendered != null) {
3286
+ html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>';
3287
+ }
3288
+ }
3289
+ }
3290
+
3291
+ // position and show the context menu
3292
+ t.contextMenu
3293
+ .empty()
3294
+ .append($(html))
3295
+ .css({top:y, left:x})
3296
+ .show();
3297
+
3298
+ // bind events
3299
+ t.contextMenu.find('.mejs-contextmenu-item').each(function() {
3300
+
3301
+ // which one is this?
3302
+ var $dom = $(this),
3303
+ itemIndex = parseInt( $dom.data('itemindex'), 10 ),
3304
+ item = t.options.contextMenuItems[itemIndex];
3305
+
3306
+ // bind extra functionality?
3307
+ if (typeof item.show != 'undefined')
3308
+ item.show( $dom , t);
3309
+
3310
+ // bind click action
3311
+ $dom.click(function() {
3312
+ // perform click action
3313
+ if (typeof item.click != 'undefined')
3314
+ item.click(t);
3315
+
3316
+ // close
3317
+ t.contextMenu.hide();
3318
+ });
3319
+ });
3320
+
3321
+ // stop the controls from hiding
3322
+ setTimeout(function() {
3323
+ t.killControlsTimer('rev3');
3324
+ }, 100);
3325
+
3326
+ }
3327
+ });
3328
+
3329
+ })(mejs.$);
3330
 
mediaelement/mediaelement-and-player.min.js CHANGED
@@ -10,37 +10,41 @@
10
  * Copyright 2010-2011, John Dyer (http://j.hn)
11
  * Dual licensed under the MIT or GPL Version 2 licenses.
12
  *
13
- */var mejs=mejs||{};mejs.version="2.1.7";mejs.meIndex=0;mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg"]}]};
14
- mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",f,g=document.getElementsByTagName("script");b<g.length;b++){f=g[b].src;for(c=0;c<a.length;c++){e=a[c];if(f.indexOf(e)>-1){d=f.substring(0,
15
- f.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b){a=Math.round(a);var c,d=Math.floor(a/60);if(d>=60){c=Math.floor(d/60);d%=60}c=c===undefined?"00":c>=10?c:"0"+c;d=d>=10?d:"0"+d;a=Math.floor(a%60);a=a>=10?a:"0"+a;return(c>0||b===true?c+":":"")+d+":"+a},timeCodeToSeconds:function(a){a=a.split(":");return a[0]*60*60+a[1]*60+parseFloat(a[2].replace(",","."))}};
16
- mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],f;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
17
- !(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(f=new ActiveXObject(c))e=d(f)}catch(g){}return e}};
 
18
  mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
19
- mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,f,g){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[f]+=g;e[f]-=g};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
20
- if(mejs.PluginDetector.ua.match(/android 2\.[12]/)!==null)HTMLMediaElement.canPlayType=function(a){return a.match(/video\/(mp4|m4v)/gi)!==null?"probably":""};
21
- mejs.MediaFeatures={init:function(){var a=mejs.PluginDetector.nav,b=mejs.PluginDetector.ua.toLowerCase(),c,d=["source","track","audio","video"];this.isiPad=b.match(/ipad/i)!==null;this.isiPhone=b.match(/iphone/i)!==null;this.isAndroid=b.match(/android/i)!==null;this.isIE=a.appName.toLowerCase().indexOf("microsoft")!=-1;this.isChrome=b.match(/chrome/gi)!==null;for(a=0;a<d.length;a++)c=document.createElement(d[a]);this.hasNativeFullScreen=typeof c.webkitEnterFullScreen!=="undefined";if(this.isChrome)this.hasNativeFullScreen=
22
- false;if(this.hasNativeFullScreen&&b.match(/mac os x 10_5/i))this.hasNativeFullScreen=false}};mejs.MediaFeatures.init();
23
- mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){if(typeof a=="string")this.src=a;else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}};mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
 
 
24
  mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginApi.loadMedia();this.paused=false}},pause:function(){if(this.pluginApi!=null){this.pluginApi.pauseMedia();this.paused=
25
  true}},stop:function(){if(this.pluginApi!=null){this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return true}return false},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=
26
  a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){this.pluginApi.setMuted(a);this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=
27
- a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen(a)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},
28
- dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}}};
29
  mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id);b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,
30
  c)},fireEvent:function(a,b,c){var d,e;a=this.pluginMediaElements[a];a.ended=false;a.paused=true;b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}};
31
- mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,timerRate:250,success:function(){},error:function(){}};
32
  mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
33
- mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase()=="video",f=typeof d.canPlayType!="undefined",g={method:"",url:""},k=d.getAttribute("poster"),h=d.getAttribute("autoplay"),l=d.getAttribute("preload"),j=d.getAttribute("controls"),n;for(n in b)c[n]=b[n];k=typeof k=="undefined"||k===null?"":k;l=typeof l=="undefined"||l===null||l==="false"?"none":l;h=!(typeof h=="undefined"||h===null||h==="false");
34
- j=!(typeof j=="undefined"||j===null||j==="false");g=this.determinePlayback(d,c,e,f);if(g.method=="native")return this.updateNative(d,c,h,l,g);else if(g.method!=="")return this.createPlugin(d,c,e,g.method,g.url!==null?mejs.Utility.absolutizeUrl(g.url):"",k,h,l,j);else this.createErrorMessage(d,c,g.url!==null?mejs.Utility.absolutizeUrl(g.url):"",k)},determinePlayback:function(a,b,c,d){var e=[],f,g,k={method:"",url:""},h=a.getAttribute("src"),l,j;if(h=="undefined"||h==""||h===null)h=null;if(typeof b.type!=
35
- "undefined"&&b.type!=="")e.push({type:b.type,url:h});else if(h!==null){g=this.checkType(h,a.getAttribute("type"),c);e.push({type:g,url:h})}else for(f=0;f<a.childNodes.length;f++){g=a.childNodes[f];if(g.nodeType==1&&g.tagName.toLowerCase()=="source"){h=g.getAttribute("src");g=this.checkType(h,g.getAttribute("type"),c);e.push({type:g,url:h})}}if(d&&(b.mode==="auto"||b.mode==="native"))for(f=0;f<e.length;f++)if(a.canPlayType(e[f].type).replace(/no/,"")!==""||a.canPlayType(e[f].type.replace(/mp3/,"mpeg")).replace(/no/,
36
- "")!==""){k.method="native";k.url=e[f].url;return k}if(b.mode==="auto"||b.mode==="shim")for(f=0;f<e.length;f++){g=e[f].type;for(a=0;a<b.plugins.length;a++){h=b.plugins[a];l=mejs.plugins[h];for(c=0;c<l.length;c++){j=l[c];if(mejs.PluginDetector.hasPluginVersion(h,j.version))for(d=0;d<j.types.length;d++)if(g==j.types[d]){k.method=h;k.url=e[f].url;return k}}}}if(k.method==="")k.url=e[0].url;return k},checkType:function(a,b,c){if(a&&!b){a=a.substring(a.lastIndexOf(".")+1);return(c?"video":"audio")+"/"+
37
- a}else return b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},createErrorMessage:function(a,b,c,d){var e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=a.width+"px";e.style.height=a.height+"px"}catch(f){}e.innerHTML=d!==""?'<a href="'+c+'"><img src="'+d+'" /></a>':'<a href="'+c+'"><span>Download File</span></a>';a.parentNode.insertBefore(e,a);a.style.display="none";b.error(a)},createPlugin:function(a,b,c,d,e,f,g,k,h){var l=f=1,j="me_"+d+"_"+mejs.meIndex++,n=new mejs.PluginMediaElement(j,
38
- d,e),o=document.createElement("div"),m;for(m=a.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode);break}m=m.parentNode}if(c){f=b.videoWidth>0?b.videoWidth:a.getAttribute("width")!==null?a.getAttribute("width"):b.defaultVideoWidth;l=b.videoHeight>0?b.videoHeight:a.getAttribute("height")!==null?a.getAttribute("height"):b.defaultVideoHeight}else if(b.enablePluginDebug){f=320;l=240}n.success=b.success;
39
- mejs.MediaPluginBridge.registerPluginElement(j,n,a);o.className="me-plugin";a.parentNode.insertBefore(o,a);c=["id="+j,"isvideo="+(c?"true":"false"),"autoplay="+(g?"true":"false"),"preload="+k,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+l];if(e!==null)d=="flash"?c.push("file="+mejs.Utility.encodeUrl(e)):c.push("file="+e);b.enablePluginDebug&&c.push("debug=true");b.enablePluginSmoothing&&c.push("smoothing=true");h&&c.push("controls=true");switch(d){case "silverlight":o.innerHTML=
40
- '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+j+'" name="'+j+'" width="'+f+'" height="'+l+'"><param name="initParams" value="'+c.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){d=document.createElement("div");
41
- o.appendChild(d);d.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+j+'" width="'+f+'" height="'+l+'"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+c.join("&amp;")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else o.innerHTML=
42
- '<embed id="'+j+'" name="'+j+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+c.join("&")+'" width="'+f+'" height="'+l+'"></embed>'}a.style.display="none";return n},updateNative:function(a,b){for(var c in mejs.HtmlMediaElement)a[c]=mejs.HtmlMediaElement[c];b.success(a,a);return a}};
43
- window.mejs=mejs;window.MediaElement=mejs.MediaElement;
 
44
 
45
  /*!
46
  * MediaElementPlayer
@@ -53,52 +57,68 @@ window.mejs=mejs;window.MediaElement=mejs.MediaElement;
53
  * Dual licensed under the MIT or GPL Version 2 licenses.
54
  *
55
  */if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
56
- (function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,audioWidth:400,audioHeight:30,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,alwaysShowControls:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"]};mejs.mepIndex=0;mejs.MediaElementPlayer=function(a,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,c);this.options=f.extend({},mejs.MepDefaults,
57
- c);this.$media=this.$node=f(a);this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;this.isVideo=this.media.tagName.toLowerCase()==="video";this.init();return this};mejs.MediaElementPlayer.prototype={init:function(){var a=this,c=mejs.MediaFeatures,b=f.extend(true,{},a.options,{success:function(d,e){a.meReady(d,e)},error:function(d){a.handleError(d)}});if(c.isiPad||c.isiPhone){a.$media.attr("controls","controls");a.$media.removeAttr("poster");
58
- if(c.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(c.isAndroid){if(a.isVideo){if(a.$media.find("source").length>0)a.media.src=a.$media.find('source[src$="mp4"]').attr("src");a.$media.click(function(){a.media.play()})}}else{a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=f('<div id="'+a.id+'" class="mejs-container"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media);
59
- a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");if(a.isVideo){a.width=a.options.videoWidth>0?a.options.videoWidth:a.$media[0].getAttribute("width")!==null?a.$media.attr("width"):a.options.defaultVideoWidth;a.height=a.options.videoHeight>0?a.options.videoHeight:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"):a.options.defaultVideoHeight}else{a.width=a.options.audioWidth;a.height=a.options.audioHeight}a.setPlayerSize(a.width,
60
- a.height);b.pluginWidth=a.height;b.pluginHeight=a.width}mejs.MediaElement(a.$media[0],b)},meReady:function(a,c){var b=this,d=mejs.MediaFeatures,e;if(!this.created){this.created=true;b.media=a;b.domNode=c;if(!d.isiPhone&&!d.isAndroid&&!d.isiPad){b.buildposter(b,b.controls,b.layers,b.media);b.buildoverlays(b,b.controls,b.layers,b.media);b.findTracks();for(e in b.options.features){d=b.options.features[e];if(b["build"+d])try{b["build"+d](b,b.controls,b.layers,b.media)}catch(g){}}b.setPlayerSize(b.width,
61
- b.height);b.setControlsSize();if(b.isVideo){b.container.bind("mouseenter",function(){if(!b.options.alwaysShowControls){b.controls.css("visibility","visible");b.controls.stop(true,true).fadeIn(200)}}).bind("mouseleave",function(){!b.media.paused&&!b.options.alwaysShowControls&&b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});b.domNode.getAttribute("autoplay")!==null&&!b.options.alwaysShowControls&&b.controls.css("visibility","hidden");
62
- b.options.enableAutosize&&b.media.addEventListener("loadedmetadata",function(h){if(b.options.videoHeight<=0&&b.domNode.getAttribute("height")===null&&!isNaN(h.target.videoHeight)){b.setPlayerSize(h.target.videoWidth,h.target.videoHeight);b.setControlsSize();b.media.setVideoSize(h.target.videoWidth,h.target.videoHeight)}},false)}b.media.addEventListener("ended",function(){b.media.setCurrentTime(0);b.media.pause();b.setProgressRail&&b.setProgressRail();b.setCurrentRail&&b.setCurrentRail();if(b.options.loop)b.media.play();
63
- else b.options.alwaysShowControls||b.controls.css("visibility","visible")},true);b.media.addEventListener("loadedmetadata",function(){b.updateDuration&&b.updateDuration();b.updateCurrent&&b.updateCurrent();b.setControlsSize()},true);setTimeout(function(){b.setControlsSize();b.setPlayerSize(b.width,b.height)},50)}b.options.success&&b.options.success(b.media,b.domNode)}},handleError:function(a){this.options.error&&this.options.error(a)},setPlayerSize:function(a,c){this.width=parseInt(a,10);this.height=
64
- parseInt(c,10);this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)},setControlsSize:function(){var a=0,c=0,b=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");others=b.siblings();others.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});c=this.controls.width()-a-(b.outerWidth(true)-
65
- b.outerWidth(false));b.width(c);d.width(c-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,c,b,d){var e=f('<div class="mejs-poster mejs-layer"><img /></div>').appendTo(b);c=a.$media.attr("poster");b=e.find("img").width(a.width).height(a.height);if(a.options.poster!="")b.attr("src",a.options.poster);else c!==""&&c!=null?b.attr("src",c):e.remove();d.addEventListener("play",function(){e.hide()},false)},buildoverlays:function(a,
66
- c,b,d){if(a.isVideo){var e=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(b),g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(b),h=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(b).click(function(){d.paused?d.play():d.pause()});d.addEventListener("play",function(){h.hide();g.hide()},false);d.addEventListener("pause",
67
- function(){h.show()},false);d.addEventListener("loadstart",function(){mejs.MediaFeatures.isChrome&&d.getAttribute("preload")==="none"||e.show()},false);d.addEventListener("canplay",function(){e.hide()},false);d.addEventListener("error",function(){e.hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")},false)}},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[];c.each(function(){a.tracks.push({srclang:f(this).attr("srclang").toLowerCase(),src:f(this).attr("src"),
68
- kind:f(this).attr("kind"),entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize();this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},
69
- setSrc:function(a){this.media.setSrc(a)}};if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(this,a)})};window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
70
- (function(f){MediaElementPlayer.prototype.buildplaypause=function(a,c,b,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" type="button"><button type="button"></button></div>').appendTo(c).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",
71
- function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})(mejs.$);
72
- (function(f){MediaElementPlayer.prototype.buildstop=function(a,c,b,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button"></button></div>').appendTo(c).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);c.find(".mejs-time-current").width("0px");c.find(".mejs-time-handle").css("left","0px");c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));b.find(".mejs-poster").show()}})}})(mejs.$);
73
- (function(f){MediaElementPlayer.prototype.buildprogress=function(a,c,b,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(c);var e=c.find(".mejs-time-total");b=c.find(".mejs-time-loaded");var g=c.find(".mejs-time-current"),
74
- h=c.find(".mejs-time-handle"),j=c.find(".mejs-time-float"),l=c.find(".mejs-time-float-current"),m=function(k){k=k.pageX;var n=e.offset(),q=e.outerWidth(),p=0;p=0;if(k>n.left&&k<=q+n.left&&d.duration){p=(k-n.left)/q;p=p<=0.02?0:p*d.duration;o&&d.setCurrentTime(p);j.css("left",k-n.left);l.html(mejs.Utility.secondsToTimeCode(p))}},o=false,i=false;e.bind("mousedown",function(k){o=true;m(k);return false});c.find(".mejs-time-rail").bind("mouseenter",function(){i=true}).bind("mouseleave",function(){i=false});
75
- f(document).bind("mouseup",function(){o=false}).bind("mousemove",function(k){if(o||i)m(k)});d.addEventListener("progress",function(k){a.setProgressRail(k);a.setCurrentRail(k)},false);d.addEventListener("timeupdate",function(k){a.setProgressRail(k);a.setCurrentRail(k)},false);this.loaded=b;this.total=e;this.current=g;this.handle=h};MediaElementPlayer.prototype.setProgressRail=function(a){var c=a!=undefined?a.target:this.media,b=null;if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=
76
- c.buffered.end(0)/c.duration;else if(c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined)b=c.bufferedBytes/c.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)b=a.loaded/a.total;if(b!==null){b=Math.min(1,Math.max(0,b));this.loaded&&this.total&&this.loaded.width(this.total.width()*b)}};MediaElementPlayer.prototype.setCurrentRail=function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=this.total.width()*this.media.currentTime/this.media.duration,
77
- c=a-this.handle.outerWidth(true)/2;this.current.width(a);this.handle.css("left",c)}}})(mejs.$);
78
- (function(f){MediaElementPlayer.prototype.buildcurrent=function(a,c,b,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+"00:00</span></div>").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)};MediaElementPlayer.prototype.buildduration=function(a,c,b,d){if(c.children().last().find(".mejs-currenttime").length>0)f(' <span> | </span> <span class="mejs-duration">'+(a.options.alwaysShowHours?
79
- "00:":"")+"00:00</span>").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(a.options.alwaysShowHours?"00:":"")+"00:00</span></div>").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},false)};MediaElementPlayer.prototype.updateCurrent=function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime|
80
- 0,this.options.alwaysShowHours||this.media.duration>3600))};MediaElementPlayer.prototype.updateDuration=function(){this.media.duration&&this.durationD&&this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours))}})(mejs.$);
81
- (function(f){MediaElementPlayer.prototype.buildvolume=function(a,c,b,d){var e=f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(c);c=e.find(".mejs-volume-slider");var g=e.find(".mejs-volume-total"),h=e.find(".mejs-volume-current"),j=e.find(".mejs-volume-handle"),l=function(i){i=g.height()-g.height()*
82
- i;j.css("top",i-j.height()/2);h.height(g.height()-i+parseInt(g.css("top").replace(/px/,""),10));h.css("top",i)},m=function(i){var k=g.height(),n=g.offset(),q=parseInt(g.css("top").replace(/px/,""),10);i=i.pageY-n.top;n=(k-i)/k;if(i<0)i=0;else if(i>k)i=k;j.css("top",i-j.height()/2+q);h.height(k-i);h.css("top",i+q);if(n==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}n=Math.max(0,n);n=Math.min(n,1);d.setVolume(n)},
83
- o=false;c.bind("mousedown",function(i){m(i);o=true;return false});f(document).bind("mouseup",function(){o=false}).bind("mousemove",function(i){o&&m(i)});e.find("button").click(function(){if(d.muted){d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute");l(1)}else{d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute");l(0)}});d.addEventListener("volumechange",function(i){o||l(i.target.volume)},true);l(a.options.startVolume);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}})(mejs.$);
84
- (function(f){MediaElementPlayer.prototype.buildfullscreen=function(a,c,b,d){if(a.isVideo){var e=0,g=0,h=a.container,j=f('<div class="mejs-button mejs-fullscreen-button"><button type="button"></button></div>').appendTo(c).click(function(){l(mejs.MediaFeatures.hasNativeFullScreen?!d.webkitDisplayingFullscreen:!d.isFullScreen)}),l=function(m){switch(d.pluginType){case "flash":case "silverlight":d.setFullscreen(m);break;case "native":if(mejs.MediaFeatures.hasNativeFullScreen)if(m){d.webkitEnterFullScreen();
85
- d.isFullScreen=true}else{d.webkitExitFullScreen();d.isFullScreen=false}else if(m){e=a.$media.height();g=a.$media.width();h.addClass("mejs-container-fullscreen").width("100%").height("100%").css("z-index",1E3);a.$media.width("100%").height("100%");b.children("div").width("100%").height("100%");j.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();d.isFullScreen=true}else{h.removeClass("mejs-container-fullscreen").width(g).height(e).css("z-index",1);a.$media.width(g).height(e);
86
- b.children("div").width(g).height(e);j.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");a.setControlsSize();d.isFullScreen=false}}};f(document).bind("keydown",function(m){d.isFullScreen&&m.keyCode==27&&l(false)})}}})(mejs.$);
87
- (function(f){f.extend(mejs.MepDefaults,{startLanguage:"",translations:[],translationSelector:false,googleApiKey:""});f.extend(MediaElementPlayer.prototype,{buildtracks:function(a,c,b,d){if(a.isVideo)if(a.tracks.length!=0){var e,g="";a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(b).hide();a.captions=f('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>').prependTo(b).hide();a.captionsText=a.captions.find(".mejs-captions-text");
88
- a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" ></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></button>').appendTo(c).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(e=0;e<a.tracks.length;e++)if(a.tracks[e].srclang==lang){a.selectedTrack=
89
- a.tracks[e];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("mouseenter",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=
90
- false;if(a.tracks.length>0&&a.options.translations.length>0)for(e=0;e<a.options.translations.length;e++)a.tracks.push({srclang:a.options.translations[e].toLowerCase(),src:null,kind:"subtitles",entries:[],isLoaded:false,isTranslation:true});for(e=0;e<a.tracks.length;e++)a.tracks[e].kind=="subtitles"&&a.addTrackButton(a.tracks[e].srclang,a.tracks[e].isTranslation);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},false);d.addEventListener("loadedmetadata",function(){a.displayChapters()},
91
- false);a.container.hover(function(){a.chapters.css("visibility","visible");a.chapters.fadeIn(200)},function(){d.paused||a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden");if(a.options.translationSelector){for(e in mejs.language.codes)g+='<option value="'+e+'">'+mejs.language.codes[e]+"</option>";a.container.find(".mejs-captions-selector ul").before(f('<select class="mejs-captions-translations"><option value="">--Add Translation--</option>'+
92
- g+"</select>"));a.container.find(".mejs-captions-translations").change(function(){lang=f(this).val();if(lang!=""){a.tracks.push({srclang:lang,src:null,entries:[],isLoaded:false,isTranslation:true});if(!a.isLoadingTrack){a.trackToLoad--;a.addTrackButton(lang,true);a.options.startLanguage=lang;a.loadNextTrack()}}})}}},loadNextTrack:function(){this.trackToLoad++;if(this.trackToLoad<this.tracks.length){this.isLoadingTrack=true;this.loadTrack(this.trackToLoad)}else this.isLoadingTrack=false},loadTrack:function(a){var c=
93
- this,b=c.tracks[a],d=function(){b.isLoaded=true;c.enableTrackButton(b.srclang);c.loadNextTrack()};b.isTranslation?mejs.TrackFormatParser.translateTrackText(c.tracks[0].entries,c.tracks[0].srclang,b.srclang,c.options.googleApiKey,function(e){b.entries=e;d()}):f.ajax({url:b.src,success:function(e){b.entries=mejs.TrackFormatParser.parse(e);d();b.kind=="chapters"&&c.media.duration>0&&c.drawChapters(b)},error:function(){c.loadNextTrack()}})},enableTrackButton:function(a){this.captionsButton.find("input[value="+
94
- a+"]").prop("disabled",false).siblings("label").html(mejs.language.codes[a]||a);this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,c){var b=mejs.language.codes[a]||a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+b+(c?" (translating)":" (loading)")+"</label></li>"));this.adjustLanguageBox();
95
- this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,c=this.selectedTrack;if(c!=null&&c.isLoaded)for(a=0;a<c.entries.times.length;a++)if(this.media.currentTime>=c.entries.times[a].start&&
96
- this.media.currentTime<=c.entries.times[a].stop){this.captionsText.html(c.entries.text[a]);this.captions.show();return}this.captions.hide()}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);break}},drawChapters:function(a){var c=this,b,d,e=d=0;c.chapters.empty();for(b=0;b<a.entries.times.length;b++){d=a.entries.times[b].stop-a.entries.times[b].start;d=Math.floor(d/c.media.duration*100);
97
- if(d+e>100||b==a.entries.times.length-1&&d+e<100)d=100-e;c.chapters.append(f('<div class="mejs-chapter" rel="'+a.entries.times[b].start+'" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+(b==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[b]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[b].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(a.entries.times[b].stop)+"</span></div></div>"));
98
- e+=d}c.chapters.find("div.mejs-chapter").click(function(){c.media.setCurrentTime(parseFloat(f(this).attr("rel")));c.media.paused&&c.media.play()});c.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",
99
- iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{3})?)(.*)$/,
100
- split2:function(a,c){return a.split(c)},parse:function(a){var c=0;a=this.split2(a,/\r?\n/);for(var b={text:[],times:[]},d,e;c<a.length;c++)if(this.pattern_identifier.exec(a[c])){c++;if((d=this.pattern_timecode.exec(a[c]))&&c<a.length){c++;e=a[c];for(c++;a[c]!==""&&c<a.length;){e=e+"\n"+a[c];c++}b.text.push(e);b.times.push({start:mejs.Utility.timeCodeToSeconds(d[1]),stop:mejs.Utility.timeCodeToSeconds(d[3]),settings:d[5]})}}return b},translateTrackText:function(a,c,b,d,e){var g={text:[],times:[]},
101
- h,j;this.translateText(a.text.join(" <a></a>"),c,b,d,function(l){h=l.split("<a></a>");for(j=0;j<a.text.length;j++){g.text[j]=h[j];g.times[j]={start:a.times[j].start,stop:a.times[j].stop,settings:a.times[j].settings}}e(g)})},translateText:function(a,c,b,d,e){for(var g,h=[],j,l="",m=function(){if(h.length>0){j=h.shift();mejs.TrackFormatParser.translateChunk(j,c,b,d,function(o){if(o!="undefined")l+=o;m()})}else e(l)};a.length>0;)if(a.length>1E3){g=a.lastIndexOf(".",1E3);h.push(a.substring(0,g));a=a.substring(g+
102
- 1)}else{h.push(a);a=""}m()},translateChunk:function(a,c,b,d,e){a={q:a,langpair:c+"|"+b,v:"1.0"};if(d!==""&&d!==null)a.key=d;f.ajax({url:"https://ajax.googleapis.com/ajax/services/language/translate",data:a,type:"GET",dataType:"jsonp",success:function(g){e(g.responseData.translatedText)},error:function(){e(null)}})}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,c){var b=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(c.test(d)){b.push(d.replace(c,""));d=""}}b.push(d);
103
- return b}})(mejs.$);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
10
  * Copyright 2010-2011, John Dyer (http://j.hn)
11
  * Dual licensed under the MIT or GPL Version 2 licenses.
12
  *
13
+ */var mejs=mejs||{};mejs.version="2.2.5";mejs.meIndex=0;mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg"]}]};
14
+ mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script");b<f.length;b++){g=f[b].src;for(c=0;c<a.length;c++){e=a[c];if(g.indexOf(e)>-1){d=g.substring(0,
15
+ g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0]);var e=parseInt(a[1]),
16
+ g=parseInt(a[2]),f=0,j=0;if(c)f=parseInt(a[3])/d;return j=b*3600+e*60+g+f}};
17
+ mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
18
+ !(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}};
19
  mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
20
+ mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
21
+ mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isGecko=d.match(/gecko/gi)!==
22
+ null;a.isWebkit=d.match(/webkit/gi)!==null;for(c=0;c<g.length;c++)e=document.createElement(g[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined";a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||a.hasMozNativeFullScreen;if(this.isChrome)a.hasSemiNativeFullScreen=
23
+ false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen;else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(f){if(a.hasWebkitNativeFullScreen)f.webkitRequestFullScreen();else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();
24
+ else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();
25
+ mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}};
26
+ mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
27
  mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginApi.loadMedia();this.paused=false}},pause:function(){if(this.pluginApi!=null){this.pluginApi.pauseMedia();this.paused=
28
  true}},stop:function(){if(this.pluginApi!=null){this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return true}return false},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=
29
  a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){this.pluginApi.setMuted(a);this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=
30
+ a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.setFullscreen(true)},enterFullScreen:function(){this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=
31
+ [];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}}};
32
  mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id);b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,
33
  c)},fireEvent:function(a,b,c){var d,e;a=this.pluginMediaElements[a];a.ended=false;a.paused=true;b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}};
34
+ mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,timerRate:250,startVolume:0.8,success:function(){},error:function(){}};
35
  mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
36
+ mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var j=d.getAttribute("autoplay"),h=d.getAttribute("preload"),l=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=f=="undefined"||f==""||f===null?null:f;e=typeof e=="undefined"||e===null?"":e;h=typeof h=="undefined"||h===null||h==="false"?"none":
37
+ h;j=!(typeof j=="undefined"||j===null||j==="false");l=!(typeof l=="undefined"||l===null||l==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},true)}return this.updateNative(k,c,j,h)}else if(k.method!=="")return this.createPlugin(k,c,e,j,h,l);else this.createErrorMessage(k,c,e)},determinePlayback:function(a,
38
+ b,c,d,e){var g=[],f,j,h={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},l,k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){j=this.formatType(e,a.getAttribute("type"));g.push({type:j,url:e})}else for(f=0;f<a.childNodes.length;f++){j=a.childNodes[f];if(j.nodeType==1&&j.tagName.toLowerCase()=="source"){e=j.getAttribute("src");j=this.formatType(e,
39
+ j.getAttribute("type"));g.push({type:j,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/,
40
+ "")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){h.method="native";h.url=g[f].url;break}if(h.method==="native"){if(h.url!==null)a.src=h.url;return h}}if(b.mode==="auto"||b.mode==="shim")for(f=0;f<g.length;f++){j=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];l=mejs.plugins[e];for(c=0;c<l.length;c++){k=l[c];if(mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(j==k.types[d]){h.method=e;h.url=g[f].url;return h}}}}if(h.method===
41
+ "")h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+a},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!==""?'<a href="'+
42
+ a.url+'"><img src="'+c+'" /></a>':'<a href="'+a.url+'"><span>Download File</span></a>';d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,j=1,h="me_"+a.method+"_"+mejs.meIndex++,l=new mejs.PluginMediaElement(h,a.method,a.url),k=document.createElement("div"),m;for(m=c.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode);break}m=
43
+ m.parentNode}if(a.isVideo){f=b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;j=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);j=mejs.Utility.encodeUrl(j)}else if(b.enablePluginDebug){f=320;j=240}l.success=b.success;mejs.MediaPluginBridge.registerPluginElement(h,l,c);k.className="me-plugin";c.parentNode.insertBefore(k,c);d=["id="+h,"isvideo="+(a.isVideo?"true":
44
+ "false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+j];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");switch(a.method){case "silverlight":k.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+h+'" name="'+
45
+ h+'" width="'+f+'" height="'+j+'"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+
46
+ h+'" width="'+f+'" height="'+j+'"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&amp;")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML='<embed id="'+h+'" name="'+h+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+
47
+ b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+j+'"></embed>'}c.style.display="none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};window.mejs=mejs;window.MediaElement=mejs.MediaElement;
48
 
49
  /*!
50
  * MediaElementPlayer
57
  * Dual licensed under the MIT or GPL Version 2 licenses.
58
  *
59
  */if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
60
+ (function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,audioWidth:400,audioHeight:30,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:true};mejs.mepIndex=0;mejs.MediaElementPlayer=
61
+ function(a,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,c);this.$media=this.$node=f(a);this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;this.options=f.extend({},mejs.MepDefaults,c);this.init();return this};mejs.MediaElementPlayer.prototype={init:function(){var a=this,c=mejs.MediaFeatures,b=f.extend(true,{},a.options,{success:function(e,h){a.meReady(e,h)},error:function(e){a.handleError(e)}}),
62
+ d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(c.isiPad&&a.options.iPadUseNativeControls||c.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls","controls");a.$media.removeAttr("poster");if(c.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(c.isAndroid&&a.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=
63
+ f('<div id="'+a.id+'" class="mejs-container"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media);if(c.isiPad||c.isiPhone){c=a.$media.clone();a.container.find(".mejs-mediaelement").append(c);a.$media.remove();a.$node=a.$media=c;a.node=a.media=c[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");
64
+ a.layers=a.container.find(".mejs-layers");if(a.isVideo){a.width=a.options.videoWidth>0?a.options.videoWidth:a.$media[0].getAttribute("width")!==null?a.$media.attr("width"):a.options.defaultVideoWidth;a.height=a.options.videoHeight>0?a.options.videoHeight:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"):a.options.defaultVideoHeight}else{a.width=a.options.audioWidth;a.height=a.options.audioHeight}a.setPlayerSize(a.width,a.height);b.pluginWidth=a.height;b.pluginHeight=a.width}mejs.MediaElement(a.$media[0],
65
+ b)},controlsAreVisible:true,showControls:function(a){var c=this;a=typeof a=="undefined"||a;if(!c.controlsAreVisible){if(a){c.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){c.controlsAreVisible=true});c.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){c.controlsAreVisible=true})}else{c.controls.css("visibility","visible").css("display","block");c.container.find(".mejs-control").css("visibility","visible").css("display","block");
66
+ c.controlsAreVisible=true}c.setControlsSize()}},hideControls:function(a){var c=this;a=typeof a=="undefined"||a;if(c.controlsAreVisible)if(a){c.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");c.controlsAreVisible=false});c.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block")})}else{c.controls.css("visibility","hidden").css("display","block");c.container.find(".mejs-control").css("visibility",
67
+ "hidden").css("display","block");c.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(a){var c=this;a=typeof a!="undefined"?a:500;c.killControlsTimer("start");c.controlsTimer=setTimeout(function(){c.hideControls();c.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);
68
+ this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,c){var b=this,d=mejs.MediaFeatures,e=c.getAttribute("autoplay");e=!(typeof e=="undefined"||e===null||e==="false");var h;if(!b.created){b.created=true;b.media=a;b.domNode=c;if(!(d.isAndroid&&b.options.AndroidUseNativeControls)&&!(d.isiPad&&b.options.iPadUseNativeControls)&&!(d.isiPhone&&b.options.iPhoneUseNativeControls)){b.buildposter(b,b.controls,b.layers,b.media);b.buildoverlays(b,
69
+ b.controls,b.layers,b.media);b.findTracks();for(h in b.options.features){d=b.options.features[h];if(b["build"+d])try{b["build"+d](b,b.controls,b.layers,b.media)}catch(j){}}b.container.trigger("controlsready");b.setPlayerSize(b.width,b.height);b.setControlsSize();if(b.isVideo){b.media.pluginType=="native"?b.$media.click(function(){a.paused?a.play():a.pause()}):f(b.media.pluginElement).click(function(){a.paused?a.play():a.pause()});b.container.bind("mouseenter mouseover",function(){if(b.controlsEnabled)if(!b.options.alwaysShowControls){b.killControlsTimer("enter");
70
+ b.showControls();b.startControlsTimer(2500)}}).bind("mousemove",function(){if(b.controlsEnabled){b.controlsAreVisible||b.showControls();b.startControlsTimer(2500)}}).bind("mouseleave",function(){b.controlsEnabled&&!b.media.paused&&!b.options.alwaysShowControls&&b.startControlsTimer(1E3)});e&&!b.options.alwaysShowControls&&b.hideControls();b.options.enableAutosize&&b.media.addEventListener("loadedmetadata",function(i){if(b.options.videoHeight<=0&&b.domNode.getAttribute("height")===null&&!isNaN(i.target.videoHeight)){b.setPlayerSize(i.target.videoWidth,
71
+ i.target.videoHeight);b.setControlsSize();b.media.setVideoSize(i.target.videoWidth,i.target.videoHeight)}},false)}b.media.addEventListener("ended",function(){b.media.setCurrentTime(0);b.media.pause();b.setProgressRail&&b.setProgressRail();b.setCurrentRail&&b.setCurrentRail();if(b.options.loop)b.media.play();else!b.options.alwaysShowControls&&b.controlsEnabled&&b.showControls()},true);b.media.addEventListener("loadedmetadata",function(){b.updateDuration&&b.updateDuration();b.updateCurrent&&b.updateCurrent();
72
+ b.setPlayerSize(b.width,b.height);b.setControlsSize()},true);setTimeout(function(){b.setPlayerSize(b.width,b.height);b.setControlsSize()},50);f(window).resize(function(){b.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||b.setPlayerSize(b.width,b.height);b.setControlsSize()})}if(e&&a.pluginType=="native"){a.load();a.play()}b.options.success&&b.options.success(b.media,b.domNode,b)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},
73
+ setPlayerSize:function(){if(this.height.toString().indexOf("%")>0){var a=this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth,c=this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.options.defaultVideoHeight,b=this.container.parent().width();a=parseInt(b*c/a,10);if(this.container.parent()[0].tagName.toLowerCase()==="body"){b=f(window).width();a=f(window).height()}this.container.width(b).height(a);this.$media.width("100%").height("100%");
74
+ this.container.find("object embed").width("100%").height("100%");this.media.setVideoSize&&this.media.setVideoSize(b,a);this.layers.children(".mejs-layer").width("100%").height("100%")}else{this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,c=0,b=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");
75
+ others=b.siblings();others.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});c=this.controls.width()-a-(b.outerWidth(true)-b.outerWidth(false));b.width(c);d.width(c-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,c,b,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(b);c=a.$media.attr("poster");if(a.options.poster!=="")c=a.options.poster;c!==""&&c!=null?
76
+ this.setPoster(c):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var c=this.container.find(".mejs-poster"),b=c.find("img");if(b.length==0)b=f('<img width="100%" height="100%" />').appendTo(c);b.attr("src",a)},buildoverlays:function(a,c,b,d){if(a.isVideo){var e=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(b),h=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(b),
77
+ j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(b).click(function(){d.paused?d.play():d.pause()});if(mejs.MediaFeatures.isiOS||mejs.MediaFeatures.isAndroid){j.remove();e.remove()}d.addEventListener("play",function(){j.hide();h.hide()},false);d.addEventListener("pause",function(){j.show()},false);d.addEventListener("loadeddata",function(){e.show()},false);d.addEventListener("canplay",function(){e.hide()},false);d.addEventListener("error",
78
+ function(){e.hide();h.show();h.find("mejs-overlay-error").html("Error loading this resource")},false)}},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[];c.each(function(){a.tracks.push({srclang:f(this).attr("srclang").toLowerCase(),src:f(this).attr("src"),kind:f(this).attr("kind"),entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize();this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},
79
+ load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)}};if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(this,a)})};window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
80
+ (function(f){f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,c,b,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="Play/Pause"></button></div>').appendTo(c).click(function(h){h.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},
81
+ false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
82
+ (function(f){f.extend(MediaElementPlayer.prototype,{buildstop:function(a,c,b,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="Stop"></button></div>').appendTo(c).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);c.find(".mejs-time-current").width("0px");c.find(".mejs-time-handle").css("left","0px");c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));
83
+ b.find(".mejs-poster").show()}})}})})(mejs.$);
84
+ (function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,c,b,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(c);var e=c.find(".mejs-time-total");b=c.find(".mejs-time-loaded");var h=c.find(".mejs-time-current"),
85
+ j=c.find(".mejs-time-handle"),i=c.find(".mejs-time-float"),k=c.find(".mejs-time-float-current"),n=function(g){g=g.pageX;var m=e.offset(),q=e.outerWidth(),o=0;o=0;if(g>m.left&&g<=q+m.left&&d.duration){o=(g-m.left)/q;o=o<=0.02?0:o*d.duration;l&&d.setCurrentTime(o);i.css("left",g-m.left);k.html(mejs.Utility.secondsToTimeCode(o))}},l=false,r=false;e.bind("mousedown",function(g){if(g.which===1){l=true;n(g);return false}});c.find(".mejs-time-total").bind("mouseenter",function(){r=true}).bind("mouseleave",
86
+ function(){r=false});f(document).bind("mouseup",function(){l=false}).bind("mousemove",function(g){if(l||r)n(g)});d.addEventListener("progress",function(g){a.setProgressRail(g);a.setCurrentRail(g)},false);d.addEventListener("timeupdate",function(g){a.setProgressRail(g);a.setCurrentRail(g)},false);this.loaded=b;this.total=e;this.current=h;this.handle=j},setProgressRail:function(a){var c=a!=undefined?a.target:this.media,b=null;if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=c.buffered.end(0)/
87
+ c.duration;else if(c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined)b=c.bufferedBytes/c.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)b=a.loaded/a.total;if(b!==null){b=Math.min(1,Math.max(0,b));this.loaded&&this.total&&this.loaded.width(this.total.width()*b)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=this.total.width()*this.media.currentTime/this.media.duration,c=a-this.handle.outerWidth(true)/
88
+ 2;this.current.width(a);this.handle.css("left",c)}}})})(mejs.$);
89
+ (function(f){f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,c,b,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,c,b,d){if(c.children().last().find(".mejs-currenttime").length>0)f(' <span> | </span> <span class="mejs-duration">'+
90
+ (a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span>").appendTo(c.find(".mejs-time"));else{c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(c)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},
91
+ false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$);
92
+ (function(f){f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,c,b,d){var e=f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+this.id+'" title="Mute/Unmute"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(c),h=e.find(".mejs-volume-slider"),j=e.find(".mejs-volume-total"),i=e.find(".mejs-volume-current"),k=e.find(".mejs-volume-handle"),
93
+ n=function(g){if(h.is(":visible")){var m=j.height(),q=j.position();g=m-m*g;k.css("top",q.top+g-k.height()/2);i.height(m-g);i.css("top",q.top+g)}else{h.show();n(g);h.hide()}},l=function(g){var m=j.height(),q=j.offset(),o=parseInt(j.css("top").replace(/px/,""),10);g=g.pageY-q.top;var p=(m-g)/m;if(q.top!=0){p=Math.max(0,p);p=Math.min(p,1);if(g<0)g=0;else if(g>m)g=m;k.css("top",g-k.height()/2+o);i.height(m-g);i.css("top",g+o);if(p==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);
94
+ e.removeClass("mejs-unmute").addClass("mejs-mute")}p=Math.max(0,p);p=Math.min(p,1);d.setVolume(p)}},r=false;e.hover(function(){h.show()},function(){h.hide()});h.bind("mousedown",function(g){l(g);r=true;return false});f(document).bind("mouseup",function(){r=false}).bind("mousemove",function(g){r&&l(g)});e.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(g){if(!r)if(d.muted){n(0);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{n(g.target.volume);
95
+ e.removeClass("mejs-unmute").addClass("mejs-mute")}},true);n(a.options.startVolume);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}})})(mejs.$);
96
+ (function(f){f.extend(mejs.MepDefaults,{forcePluginFullScreen:false,newWindowCallback:function(){return""}});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(a,c){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;mejs.MediaFeatures.hasTrueNativeFullScreen&&a.container.bind("webkitfullscreenchange",function(){mejs.MediaFeatures.isFullScreen()?a.setControlsSize():a.exitFullScreen()});var b=this,d=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+
97
+ b.id+'" title="Fullscreen"></button></div>').appendTo(c).click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||a.isFullScreen?a.exitFullScreen():a.enterFullScreen()});a.fullscreenBtn=d;f(document).bind("keydown",function(e){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&e.keyCode==27)a.exitFullScreen()})}},enterFullScreen:function(){var a=this;if(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isGecko||
98
+ a.options.forcePluginFullScreen))a.media.setFullscreen(true);else{docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width();if(mejs.MediaFeatures.hasTrueNativeFullScreen)mejs.MediaFeatures.requestFullScreen(a.container[0]);else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe&&a.options.newWindowUrl!==""){a.pause();var c=a.options.newWindowCallback(this);
99
+ c!==""&&window.open(c,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}else{a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){a.container.css({width:"100%",height:"100%"})},500);if(a.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find("object embed").width("100%").height("100%");a.media.setVideoSize(f(window).width(),f(window).height())}a.layers.children("div").width("100%").height("100%");
100
+ a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}}},exitFullScreen:function(){if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow=docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight).css("z-index",
101
+ 1);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=false}}})})(mejs.$);
102
+ (function(f){f.extend(mejs.MepDefaults,{startLanguage:"",translations:[],translationSelector:false,googleApiKey:""});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,c,b,d){if(a.isVideo)if(a.tracks.length!=0){var e,h="";a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(b).hide();a.captions=f('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>').prependTo(b).hide();
103
+ a.captionsText=a.captions.find(".mejs-captions-text");a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="Captions/Subtitles"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(c).hover(function(){f(this).find(".mejs-captions-selector").css("visibility",
104
+ "visible")},function(){f(this).find(".mejs-captions-selector").css("visibility","hidden")}).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(e=0;e<a.tracks.length;e++)if(a.tracks[e].srclang==lang){a.selectedTrack=a.tracks[e];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("mouseenter",
105
+ function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;if(a.tracks.length>0&&a.options.translations.length>0)for(e=0;e<a.options.translations.length;e++)a.tracks.push({srclang:a.options.translations[e].toLowerCase(),src:null,kind:"subtitles",entries:[],isLoaded:false,
106
+ isTranslation:true});for(e=0;e<a.tracks.length;e++)a.tracks[e].kind=="subtitles"&&a.addTrackButton(a.tracks[e].srclang,a.tracks[e].isTranslation);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},false);d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility","visible");a.chapters.fadeIn(200)}},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility",
107
+ "hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden");if(a.options.translationSelector){for(e in mejs.language.codes)h+='<option value="'+e+'">'+mejs.language.codes[e]+"</option>";a.container.find(".mejs-captions-selector ul").before(f('<select class="mejs-captions-translations"><option value="">--Add Translation--</option>'+h+"</select>"));a.container.find(".mejs-captions-translations").change(function(){lang=f(this).val();if(lang!=
108
+ ""){a.tracks.push({srclang:lang,src:null,entries:[],isLoaded:false,isTranslation:true});if(!a.isLoadingTrack){a.trackToLoad--;a.addTrackButton(lang,true);a.options.startLanguage=lang;a.loadNextTrack()}}})}}},loadNextTrack:function(){this.trackToLoad++;if(this.trackToLoad<this.tracks.length){this.isLoadingTrack=true;this.loadTrack(this.trackToLoad)}else this.isLoadingTrack=false},loadTrack:function(a){var c=this,b=c.tracks[a],d=function(){b.isLoaded=true;c.enableTrackButton(b.srclang);c.loadNextTrack()};
109
+ b.isTranslation?mejs.TrackFormatParser.translateTrackText(c.tracks[0].entries,c.tracks[0].srclang,b.srclang,c.options.googleApiKey,function(e){b.entries=e;d()}):f.ajax({url:b.src,success:function(e){b.entries=mejs.TrackFormatParser.parse(e);d();b.kind=="chapters"&&c.media.duration>0&&c.drawChapters(b)},error:function(){c.loadNextTrack()}})},enableTrackButton:function(a){this.captionsButton.find("input[value="+a+"]").prop("disabled",false).siblings("label").html(mejs.language.codes[a]||a);this.options.startLanguage==
110
+ a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,c){var b=mejs.language.codes[a]||a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+b+(c?" (translating)":" (loading)")+"</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+
111
+ this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,c=this.selectedTrack;if(c!=null&&c.isLoaded)for(a=0;a<c.entries.times.length;a++)if(this.media.currentTime>=c.entries.times[a].start&&this.media.currentTime<=c.entries.times[a].stop){this.captionsText.html(c.entries.text[a]);this.captions.show();return}this.captions.hide()}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind==
112
+ "chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var c=this,b,d,e=d=0;c.chapters.empty();for(b=0;b<a.entries.times.length;b++){d=a.entries.times[b].stop-a.entries.times[b].start;d=Math.floor(d/c.media.duration*100);if(d+e>100||b==a.entries.times.length-1&&d+e<100)d=100-e;c.chapters.append(f('<div class="mejs-chapter" rel="'+a.entries.times[b].start+'" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+
113
+ (b==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[b]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[b].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(a.entries.times[b].stop)+"</span></div></div>"));e+=d}c.chapters.find("div.mejs-chapter").click(function(){c.media.setCurrentTime(parseFloat(f(this).attr("rel")));c.media.paused&&c.media.play()});c.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",
114
+ ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",
115
+ fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,split2:function(a,c){return a.split(c)},parse:function(a){var c=0;a=this.split2(a,
116
+ /\r?\n/);for(var b={text:[],times:[]},d,e;c<a.length;c++)if(this.pattern_identifier.exec(a[c])){c++;if((d=this.pattern_timecode.exec(a[c]))&&c<a.length){c++;e=a[c];for(c++;a[c]!==""&&c<a.length;){e=e+"\n"+a[c];c++}b.text.push(e);b.times.push({start:mejs.Utility.timeCodeToSeconds(d[1]),stop:mejs.Utility.timeCodeToSeconds(d[3]),settings:d[5]})}}return b},translateTrackText:function(a,c,b,d,e){var h={text:[],times:[]},j,i;this.translateText(a.text.join(" <a></a>"),c,b,d,function(k){j=k.split("<a></a>");
117
+ for(i=0;i<a.text.length;i++){h.text[i]=j[i];h.times[i]={start:a.times[i].start,stop:a.times[i].stop,settings:a.times[i].settings}}e(h)})},translateText:function(a,c,b,d,e){for(var h,j=[],i,k="",n=function(){if(j.length>0){i=j.shift();mejs.TrackFormatParser.translateChunk(i,c,b,d,function(l){if(l!="undefined")k+=l;n()})}else e(k)};a.length>0;)if(a.length>1E3){h=a.lastIndexOf(".",1E3);j.push(a.substring(0,h));a=a.substring(h+1)}else{j.push(a);a=""}n()},translateChunk:function(a,c,b,d,e){a={q:a,langpair:c+
118
+ "|"+b,v:"1.0"};if(d!==""&&d!==null)a.key=d;f.ajax({url:"https://ajax.googleapis.com/ajax/services/language/translate",data:a,type:"GET",dataType:"jsonp",success:function(h){e(h.responseData.translatedText)},error:function(){e(null)}})}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,c){var b=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(c.test(d)){b.push(d.replace(c,""));d=""}}b.push(d);return b}})(mejs.$);
119
+ (function(f){f.extend(mejs.MepDefaults,contextMenuItems=[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]);
120
+ f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(c){if(a.isContextMenuEnabled){c.preventDefault();a.renderContextMenu(c.clientX-1,c.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled=
121
+ true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,c){for(var b=this,d="",e=b.options.contextMenuItems,h=0,j=e.length;h<
122
+ j;h++)if(e[h].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var i=e[h].render(b);if(i!=null)d+='<div class="mejs-contextmenu-item" data-itemindex="'+h+'" id="element-'+Math.random()*1E6+'">'+i+"</div>"}b.contextMenu.empty().append(f(d)).css({top:c,left:a}).show();b.contextMenu.find(".mejs-contextmenu-item").each(function(){var k=f(this),n=parseInt(k.data("itemindex"),10),l=b.options.contextMenuItems[n];typeof l.show!="undefined"&&l.show(k,b);k.click(function(){typeof l.click!=
123
+ "undefined"&&l.click(b);b.contextMenu.hide()})});setTimeout(function(){b.killControlsTimer("rev3")},100)}})})(mejs.$);
124
 
mediaelement/mediaelementplayer.css CHANGED
@@ -4,6 +4,15 @@
4
  font-family: Helvetica, Arial;
5
  }
6
 
 
 
 
 
 
 
 
 
 
7
  .mejs-container-fullscreen {
8
  position: fixed;
9
  left: 0;
@@ -11,6 +20,7 @@
11
  right: 0;
12
  bottom: 0;
13
  overflow: hidden;
 
14
  }
15
  .mejs-container-fullscreen .mejs-mediaelement,
16
  .mejs-container-fullscreen video {
@@ -28,6 +38,8 @@
28
  position: absolute;
29
  top: 0;
30
  left: 0;
 
 
31
  }
32
  .mejs-poster {
33
  position: absolute;
@@ -124,6 +136,12 @@
124
  border: 0;
125
  background: transparent url(controls.png) 0 0 no-repeat;
126
  }
 
 
 
 
 
 
127
  /* End: CONTROL BAR */
128
 
129
  /* Start: Time (current / duration) */
@@ -235,7 +253,7 @@
235
  text-align: center;
236
  color: #111;
237
  }
238
- .mejs-controls .mejs-time-rail:hover .mejs-time-float {
239
  visibility: visible;
240
  }
241
  .mejs-controls .mejs-time-rail .mejs-time-float-current {
@@ -317,9 +335,11 @@
317
  -moz-border-radius: 0 0 4px 4px ;
318
  border-radius: 0 0 4px 4px ;
319
  }
 
320
  .mejs-controls .mejs-volume-button:hover .mejs-volume-slider {
321
  display: block;
322
  }
 
323
 
324
  .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total {
325
  position: absolute;
@@ -387,9 +407,11 @@
387
  -moz-border-radius: 0;
388
  border-radius: 0;
389
  }
 
390
  .mejs-controls .mejs-captions-button:hover .mejs-captions-selector {
391
  visibility: visible;
392
  }
 
393
 
394
  .mejs-controls .mejs-captions-button .mejs-captions-selector ul {
395
  margin: 0;
@@ -566,4 +588,36 @@
566
  .mejs-controls .mejs-picturecontrols-button{
567
  background-position: -96px 0;
568
  }
569
- /* End: picture controls */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  font-family: Helvetica, Arial;
5
  }
6
 
7
+ .mejs-embed, .mejs-embed body {
8
+ width: 100%;
9
+ height: 100%;
10
+ margin: 0;
11
+ padding: 0;
12
+ background: #000;
13
+ overflow: hidden;
14
+ }
15
+
16
  .mejs-container-fullscreen {
17
  position: fixed;
18
  left: 0;
20
  right: 0;
21
  bottom: 0;
22
  overflow: hidden;
23
+ z-index: 1000;
24
  }
25
  .mejs-container-fullscreen .mejs-mediaelement,
26
  .mejs-container-fullscreen video {
38
  position: absolute;
39
  top: 0;
40
  left: 0;
41
+ width: 100%;
42
+ height: 100%;
43
  }
44
  .mejs-poster {
45
  position: absolute;
136
  border: 0;
137
  background: transparent url(controls.png) 0 0 no-repeat;
138
  }
139
+
140
+ /* :focus for accessibility */
141
+ .mejs-controls .mejs-button button:focus {
142
+ outline: solid 1px yellow;
143
+ }
144
+
145
  /* End: CONTROL BAR */
146
 
147
  /* Start: Time (current / duration) */
253
  text-align: center;
254
  color: #111;
255
  }
256
+ .mejs-controls .mejs-time-total:hover .mejs-time-float {
257
  visibility: visible;
258
  }
259
  .mejs-controls .mejs-time-rail .mejs-time-float-current {
335
  -moz-border-radius: 0 0 4px 4px ;
336
  border-radius: 0 0 4px 4px ;
337
  }
338
+ /*
339
  .mejs-controls .mejs-volume-button:hover .mejs-volume-slider {
340
  display: block;
341
  }
342
+ */
343
 
344
  .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total {
345
  position: absolute;
407
  -moz-border-radius: 0;
408
  border-radius: 0;
409
  }
410
+ /*
411
  .mejs-controls .mejs-captions-button:hover .mejs-captions-selector {
412
  visibility: visible;
413
  }
414
+ */
415
 
416
  .mejs-controls .mejs-captions-button .mejs-captions-selector ul {
417
  margin: 0;
588
  .mejs-controls .mejs-picturecontrols-button{
589
  background-position: -96px 0;
590
  }
591
+ /* End: picture controls */
592
+
593
+
594
+ /* context menu */
595
+ .mejs-contextmenu {
596
+ position: absolute;
597
+ width: 150px;
598
+ padding: 10px;
599
+ border-radius: 4px;
600
+ top: 0;
601
+ left: 0;
602
+ background: #fff;
603
+ border: solid 1px #999;
604
+ z-index: 1001; /* make sure it shows on fullscreen */
605
+ }
606
+ .mejs-contextmenu .mejs-contextmenu-separator {
607
+ height: 1px;
608
+ font-size: 0;
609
+ margin: 5px 6px;
610
+ background: #333;
611
+ }
612
+
613
+ .mejs-contextmenu .mejs-contextmenu-item {
614
+ font-family: Helvetica, Arial;
615
+ font-size: 12px;
616
+ padding: 4px 6px;
617
+ cursor: pointer;
618
+ color: #333;
619
+ }
620
+ .mejs-contextmenu .mejs-contextmenu-item:hover {
621
+ background: #2C7C91;
622
+ color: #fff;
623
+ }
mediaelement/mediaelementplayer.min.css CHANGED
@@ -1 +1 @@
1
- .mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%;}.mejs-background{position:absolute;top:0;left:0;}.mejs-mediaelement{position:absolute;top:0;left:0;}.mejs-poster{position:absolute;top:0;left:0;}.mejs-overlay{position:absolute;top:0;left:0;}.mejs-overlay-play{cursor:pointer;}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.png) top left no-repeat;}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px;}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9),rgba(0,0,0,0.9));}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) center center no-repeat;}.mejs-container .mejs-controls{position:absolute;background:none;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%;}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;background:0;font-family:Helvetica,Arial;border:0;}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.png) 0 0 no-repeat;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;padding:auto 4px;}.mejs-container .mejs-controls .mejs-time span{font-size:11px;color:#fff;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#1E1E1E,endColorstr=#3C3C3C);}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#2C7C91,endColorstr=#4EB7D4);width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{width:0;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#FFFFFF,endColorstr=#C8C8C8);}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{visibility:hidden;position:absolute;display:block;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111;}.mejs-controls .mejs-time-rail:hover .mejs-time-float{visibility:visible;}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button:hover .mejs-volume-slider{display:block;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button:hover .mejs-captions-selector{visibility:visible;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.mejs-clear{clear:both;}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}
1
+ .mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden;}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000;}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%;}.mejs-background{position:absolute;top:0;left:0;}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%;}.mejs-poster{position:absolute;top:0;left:0;}.mejs-overlay{position:absolute;top:0;left:0;}.mejs-overlay-play{cursor:pointer;}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.png) top left no-repeat;}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px;}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9),rgba(0,0,0,0.9));}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) center center no-repeat;}.mejs-container .mejs-controls{position:absolute;background:none;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%;}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;background:0;font-family:Helvetica,Arial;border:0;}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.png) 0 0 no-repeat;}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;padding:auto 4px;}.mejs-container .mejs-controls .mejs-time span{font-size:11px;color:#fff;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#1E1E1E,endColorstr=#3C3C3C);}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#2C7C91,endColorstr=#4EB7D4);width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{width:0;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#FFFFFF,endColorstr=#C8C8C8);}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{visibility:hidden;position:absolute;display:block;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111;}.mejs-controls .mejs-time-total:hover .mejs-time-float{visibility:visible;}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.mejs-clear{clear:both;}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://mediaelementjs.com/
4
  Tags: html5, video, audio, player, flash, mp4, mp3, ogg, webm, wmv, captions, subtitles, websrt, srt, accessible, Silverlight, javascript,
5
  Requires at least: 2.8
6
  Tested up to: 3.2
7
- Stable tag: 2.1.7
8
 
9
  MediaElement.js is an HTML5 video and audio player with Flash fallback and captions. Supports IE, Firefox, Opera, Safari, Chrome and iPhone, iPad, Android.
10
 
@@ -156,6 +156,11 @@ View <a href="http://mediaelementjs.com/">MediaElementjs.com</a> for more inform
156
 
157
  == Changelog ==
158
 
 
 
 
 
 
159
  = 2.1.7 =
160
  * Skin selector (default, WMP, TED)
161
  * Audio height and width
4
  Tags: html5, video, audio, player, flash, mp4, mp3, ogg, webm, wmv, captions, subtitles, websrt, srt, accessible, Silverlight, javascript,
5
  Requires at least: 2.8
6
  Tested up to: 3.2
7
+ Stable tag: 2.2.5
8
 
9
  MediaElement.js is an HTML5 video and audio player with Flash fallback and captions. Supports IE, Firefox, Opera, Safari, Chrome and iPhone, iPad, Android.
10
 
156
 
157
  == Changelog ==
158
 
159
+ = 2.2.5 =
160
+ * Update to 2.2.5 codebase
161
+ * Support for true fullscreen in Chrome and Firefox (in addition to Safari)
162
+ * Support for 100% sizing
163
+
164
  = 2.1.7 =
165
  * Skin selector (default, WMP, TED)
166
  * Audio height and width