Version Description
None
Download this release
Release Info
Developer | johndyer |
Plugin | MediaElement.js – HTML5 Video & Audio Player |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.2
- mediaelement-js-wp.php +3 -3
- mediaelement/flashmediaelement.swf +0 -0
- mediaelement/mediaelement-and-player.js +291 -224
- mediaelement/mediaelement-and-player.min.js +51 -47
- mediaelement/mediaelementplayer.css +1 -0
- mediaelement/mediaelementplayer.min.css +1 -1
- mediaelement/silverlightmediaelement.xap +0 -0
- readme.txt +3 -3
mediaelement-js-wp.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* @package MediaElementJS
|
4 |
-
* @version 2.1.
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: MediaElementJS - HTML5 Audio and Video
|
8 |
Plugin URI: http://mediaelementjs.com/
|
9 |
-
Description:
|
10 |
Author: John Dyer
|
11 |
-
Version: 2.1.
|
12 |
Author URI: http://johndyer.me/
|
13 |
License: GPLv3, MIT
|
14 |
*/
|
1 |
<?php
|
2 |
/**
|
3 |
* @package MediaElementJS
|
4 |
+
* @version 2.1.2
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: MediaElementJS - HTML5 Audio and Video
|
8 |
Plugin URI: http://mediaelementjs.com/
|
9 |
+
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
|
10 |
Author: John Dyer
|
11 |
+
Version: 2.1.2
|
12 |
Author URI: http://johndyer.me/
|
13 |
License: GPLv3, MIT
|
14 |
*/
|
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.
|
19 |
|
20 |
// player number (for missing, same id attr)
|
21 |
mejs.meIndex = 0;
|
@@ -26,7 +26,7 @@ mejs.plugins = {
|
|
26 |
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
|
27 |
],
|
28 |
flash: [
|
29 |
-
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','audio/flv','audio/mp3','audio/m4a','audio/mpeg']}
|
30 |
//,{version: [11,0], types: ['video/webm']} // for future reference
|
31 |
]
|
32 |
};
|
@@ -184,7 +184,7 @@ PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PD
|
|
184 |
*/
|
185 |
|
186 |
// special case for Android which sadly doesn't implement the canPlayType function (always returns '')
|
187 |
-
if (mejs.PluginDetector.ua.match(/
|
188 |
HTMLMediaElement.canPlayType = function(type) {
|
189 |
return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'probably' : '';
|
190 |
};
|
@@ -195,17 +195,17 @@ mejs.MediaFeatures = {
|
|
195 |
init: function() {
|
196 |
var
|
197 |
nav = mejs.PluginDetector.nav,
|
198 |
-
ua = mejs.PluginDetector.ua,
|
199 |
i,
|
200 |
v,
|
201 |
html5Elements = ['source','track','audio','video'];
|
202 |
|
203 |
// detect browsers (only the ones that have some kind of quirk we need to work around)
|
204 |
-
this.isiPad = (ua.match(/
|
205 |
-
this.isiPhone = (ua.match(/
|
206 |
-
this.isAndroid = (ua.match(/
|
207 |
-
this.isIE = (nav.appName.indexOf("
|
208 |
-
this.isChrome = (ua.match(/
|
209 |
|
210 |
// create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
|
211 |
for (i=0; i<html5Elements.length; i++) {
|
@@ -227,6 +227,7 @@ extension methods to <video> or <audio> object to bring it into parity with Plug
|
|
227 |
*/
|
228 |
mejs.HtmlMediaElement = {
|
229 |
pluginType: 'native',
|
|
|
230 |
|
231 |
setCurrentTime: function (time) {
|
232 |
this.currentTime = time;
|
@@ -286,6 +287,7 @@ mejs.PluginMediaElement.prototype = {
|
|
286 |
// special
|
287 |
pluginElement: null,
|
288 |
pluginType: '',
|
|
|
289 |
|
290 |
// not implemented :(
|
291 |
playbackRate: -1,
|
@@ -417,6 +419,19 @@ mejs.PluginMediaElement.prototype = {
|
|
417 |
this.events[eventName] = this.events[eventName] || [];
|
418 |
this.events[eventName].push(callback);
|
419 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
dispatchEvent: function (eventName) {
|
421 |
var i,
|
422 |
args,
|
@@ -553,7 +568,7 @@ and returns either the native element or a Flash/Silverlight version that
|
|
553 |
mimics HTML5 MediaElement
|
554 |
*/
|
555 |
mejs.MediaElement = function (el, o) {
|
556 |
-
mejs.HtmlMediaElementShim.create(el,o);
|
557 |
};
|
558 |
|
559 |
mejs.HtmlMediaElementShim = {
|
@@ -587,10 +602,10 @@ mejs.HtmlMediaElementShim = {
|
|
587 |
|
588 |
if (playback.method == 'native') {
|
589 |
// add methods to native HTMLMediaElement
|
590 |
-
this.updateNative( htmlMediaElement, options, autoplay, preload, playback);
|
591 |
} else if (playback.method !== '') {
|
592 |
// create plugin to mimic HTMLMediaElement
|
593 |
-
this.createPlugin( htmlMediaElement, options, isVideo, playback.method, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster, autoplay, preload, controls);
|
594 |
} else {
|
595 |
// boo, no HTML5, no Flash, no Silverlight.
|
596 |
this.createErrorMessage( htmlMediaElement, options, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster );
|
@@ -839,7 +854,8 @@ mejs.HtmlMediaElementShim = {
|
|
839 |
'allowScriptAccess="always" ' +
|
840 |
'allowFullScreen="true" ' +
|
841 |
'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ' +
|
842 |
-
'src="' + options.pluginPath + options.flashName + '
|
|
|
843 |
'width="' + width + '" ' +
|
844 |
'height="' + height + '"></embed>';
|
845 |
}
|
@@ -849,6 +865,8 @@ mejs.HtmlMediaElementShim = {
|
|
849 |
htmlMediaElement.style.display = 'none';
|
850 |
|
851 |
// FYI: options.success will be fired by the MediaPluginBridge
|
|
|
|
|
852 |
},
|
853 |
|
854 |
updateNative: function(htmlMediaElement, options, autoplay, preload, playback) {
|
@@ -885,6 +903,8 @@ mejs.HtmlMediaElementShim = {
|
|
885 |
|
886 |
// fire success code
|
887 |
options.success(htmlMediaElement, htmlMediaElement);
|
|
|
|
|
888 |
}
|
889 |
};
|
890 |
|
@@ -947,17 +967,19 @@ window.MediaElement = mejs.MediaElement;
|
|
947 |
t.options = $.extend({},mejs.MepDefaults,o);
|
948 |
t.$media = t.$node = $($node);
|
949 |
|
|
|
|
|
|
|
950 |
// check for existing player
|
951 |
-
if (
|
952 |
-
return
|
953 |
} else {
|
954 |
// attach player to DOM node for reference
|
955 |
-
|
956 |
}
|
957 |
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
/* FUTURE WORK = create player without existing <video> or <audio> node
|
962 |
|
963 |
// if not a video or audio tag, then we'll dynamically create it
|
@@ -1002,54 +1024,7 @@ window.MediaElement = mejs.MediaElement;
|
|
1002 |
return;
|
1003 |
}
|
1004 |
*/
|
1005 |
-
|
1006 |
-
if (mf.isiPad || mf.isiPhone) {
|
1007 |
-
// add controls and stop
|
1008 |
-
t.$media.attr('controls', 'controls');
|
1009 |
-
|
1010 |
-
// fix iOS 3 bug
|
1011 |
-
t.$media.removeAttr('poster');
|
1012 |
-
|
1013 |
-
// override Apple's autoplay override for iPads
|
1014 |
-
if (mf.isiPad && t.$media[0].getAttribute('autoplay') !== null) {
|
1015 |
-
t.$media[0].load();
|
1016 |
-
t.$media[0].play();
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
// don't do the rest
|
1020 |
-
return;
|
1021 |
-
} else if (mf.isAndroid) {
|
1022 |
-
|
1023 |
-
if (t.isVideo) {
|
1024 |
-
// Android fails when there are multiple types
|
1025 |
-
// <video>
|
1026 |
-
// <source src="file.mp4" type="video/mp4" />
|
1027 |
-
// <source src="file.webm" type="video/webm" />
|
1028 |
-
// </video>
|
1029 |
-
if (t.$media.find('source').length > 0) {
|
1030 |
-
// find an mp4 and make it the root element source
|
1031 |
-
t.$media[0].src = t.$media.find('source[src$="mp4"]').attr('src');
|
1032 |
-
}
|
1033 |
-
|
1034 |
-
// attach a click event to the video and hope Android can play it
|
1035 |
-
t.$media.click(function() {
|
1036 |
-
t.$media[0].play();
|
1037 |
-
});
|
1038 |
-
|
1039 |
-
return;
|
1040 |
-
} else {
|
1041 |
-
// audio?
|
1042 |
-
// 2.1 = no support
|
1043 |
-
// 2.2 = Flash support
|
1044 |
-
// 2.3 = Native HTML5
|
1045 |
-
}
|
1046 |
-
|
1047 |
-
} else {
|
1048 |
-
|
1049 |
-
// remove native controls and use MEJS
|
1050 |
-
t.$media.removeAttr('controls');
|
1051 |
-
}
|
1052 |
-
|
1053 |
t.init();
|
1054 |
|
1055 |
return t;
|
@@ -1061,57 +1036,111 @@ window.MediaElement = mejs.MediaElement;
|
|
1061 |
|
1062 |
var
|
1063 |
t = this,
|
|
|
|
|
1064 |
meOptions = $.extend(true, {}, t.options, {
|
1065 |
success: function(media, domNode) { t.meReady(media, domNode); },
|
1066 |
error: function(e) { t.handleError(e);}
|
1067 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
1068 |
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
// build container
|
1073 |
-
t.container =
|
1074 |
-
$('<div id="' + t.id + '" class="mejs-container">'+
|
1075 |
-
'<div class="mejs-inner">'+
|
1076 |
-
'<div class="mejs-mediaelement"></div>'+
|
1077 |
-
'<div class="mejs-layers"></div>'+
|
1078 |
-
'<div class="mejs-controls"></div>'+
|
1079 |
-
'<div class="mejs-clear"></div>'+
|
1080 |
-
'</div>' +
|
1081 |
-
'</div>')
|
1082 |
-
.addClass(t.$media[0].className)
|
1083 |
-
.insertBefore(t.$media);
|
1084 |
|
1085 |
-
|
1086 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1087 |
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
|
1092 |
-
// determine the size
|
1093 |
-
if (t.isVideo) {
|
1094 |
-
// priority = videoWidth (forced), width attribute, defaultVideoWidth
|
1095 |
-
t.width = (t.options.videoWidth > 0) ? t.options.videoWidth : (t.$media[0].getAttribute('width') !== null) ? t.$media.attr('width') : t.options.defaultVideoWidth;
|
1096 |
-
t.height = (t.options.videoHeight > 0) ? t.options.videoHeight : (t.$media[0].getAttribute('height') !== null) ? t.$media.attr('height') : t.options.defaultVideoHeight;
|
1097 |
} else {
|
1098 |
-
t.width = t.options.audioWidth;
|
1099 |
-
t.height = t.options.audioHeight;
|
1100 |
-
}
|
1101 |
|
1102 |
-
|
1103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1104 |
|
1105 |
-
// create
|
1106 |
-
meOptions.pluginWidth = t.height;
|
1107 |
-
meOptions.pluginHeight = t.width;
|
1108 |
mejs.MediaElement(t.$media[0], meOptions);
|
1109 |
},
|
1110 |
|
1111 |
// Sets up all controls and events
|
1112 |
-
meReady: function(media, domNode) {
|
1113 |
-
|
|
|
1114 |
var t = this,
|
|
|
1115 |
f,
|
1116 |
feature;
|
1117 |
|
@@ -1119,83 +1148,98 @@ window.MediaElement = mejs.MediaElement;
|
|
1119 |
if (this.created)
|
1120 |
return;
|
1121 |
else
|
1122 |
-
this.created = true;
|
1123 |
|
1124 |
t.media = media;
|
1125 |
t.domNode = domNode;
|
|
|
|
|
|
|
1126 |
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
|
|
1142 |
}
|
1143 |
}
|
1144 |
-
}
|
1145 |
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
|
|
|
|
|
|
|
|
|
|
1166 |
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
|
|
1178 |
}
|
1179 |
-
}
|
1180 |
-
|
1181 |
-
// ended for all
|
1182 |
-
t.media.addEventListener('ended', function (e) {
|
1183 |
-
t.media.setCurrentTime(0);
|
1184 |
-
t.media.pause();
|
1185 |
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
t.
|
1190 |
-
|
1191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1192 |
|
1193 |
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
|
|
|
|
1199 |
|
1200 |
|
1201 |
if (t.options.success) {
|
@@ -1232,6 +1276,8 @@ window.MediaElement = mejs.MediaElement;
|
|
1232 |
railWidth = 0,
|
1233 |
rail = t.controls.find('.mejs-time-rail'),
|
1234 |
total = t.controls.find('.mejs-time-total'),
|
|
|
|
|
1235 |
others = rail.siblings();
|
1236 |
|
1237 |
// find the size of all the other controls besides the rail
|
@@ -1243,8 +1289,15 @@ window.MediaElement = mejs.MediaElement;
|
|
1243 |
// fit the rail into the remaining space
|
1244 |
railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.outerWidth(false));
|
1245 |
|
|
|
1246 |
rail.width(railWidth);
|
|
|
1247 |
total.width(railWidth - (total.outerWidth(true) - total.width()));
|
|
|
|
|
|
|
|
|
|
|
1248 |
},
|
1249 |
|
1250 |
|
@@ -1255,7 +1308,7 @@ window.MediaElement = mejs.MediaElement;
|
|
1255 |
'</div>')
|
1256 |
.appendTo(layers),
|
1257 |
posterUrl = player.$media.attr('poster'),
|
1258 |
-
posterImg = poster.find('img').width(player.width).height(
|
1259 |
|
1260 |
// prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
|
1261 |
if (player.options.poster != '') {
|
@@ -1473,54 +1526,6 @@ window.MediaElement = mejs.MediaElement;
|
|
1473 |
handle = controls.find('.mejs-time-handle'),
|
1474 |
timefloat = controls.find('.mejs-time-float'),
|
1475 |
timefloatcurrent = controls.find('.mejs-time-float-current'),
|
1476 |
-
setProgress = function(e) {
|
1477 |
-
if (!e) {
|
1478 |
-
return;
|
1479 |
-
}
|
1480 |
-
|
1481 |
-
var
|
1482 |
-
target = e.target,
|
1483 |
-
percent = null;
|
1484 |
-
|
1485 |
-
// newest HTML5 spec has buffered array (FF4, Webkit)
|
1486 |
-
if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
|
1487 |
-
// TODO: account for a real array with multiple values (only Firefox 4 has this so far)
|
1488 |
-
percent = target.buffered.end(0) / target.duration;
|
1489 |
-
}
|
1490 |
-
// Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
|
1491 |
-
// to be anything other than 0. If the byte count is available we use this instead.
|
1492 |
-
// Browsers that support the else if do not seem to have the bufferedBytes value and
|
1493 |
-
// should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
|
1494 |
-
else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
|
1495 |
-
percent = target.bufferedBytes / target.bytesTotal;
|
1496 |
-
}
|
1497 |
-
// Firefox 3 with an Ogg file seems to go this way
|
1498 |
-
else if (e.lengthComputable && e.total != 0) {
|
1499 |
-
percent = e.loaded/e.total;
|
1500 |
-
}
|
1501 |
-
|
1502 |
-
// finally update the progress bar
|
1503 |
-
if (percent !== null) {
|
1504 |
-
percent = Math.min(1, Math.max(0, percent));
|
1505 |
-
// update loaded bar
|
1506 |
-
loaded.width(total.width() * percent);
|
1507 |
-
}
|
1508 |
-
},
|
1509 |
-
setCurrentTime = function(e) {
|
1510 |
-
|
1511 |
-
if (media.currentTime && media.duration) {
|
1512 |
-
|
1513 |
-
// update bar and handle
|
1514 |
-
var
|
1515 |
-
newWidth = total.width() * media.currentTime / media.duration,
|
1516 |
-
handlePos = newWidth - (handle.outerWidth(true) / 2);
|
1517 |
-
|
1518 |
-
current.width(newWidth);
|
1519 |
-
handle.css('left', handlePos);
|
1520 |
-
|
1521 |
-
}
|
1522 |
-
|
1523 |
-
},
|
1524 |
handleMouseMove = function (e) {
|
1525 |
// mouse position relative to the object
|
1526 |
var x = e.pageX,
|
@@ -1578,15 +1583,67 @@ window.MediaElement = mejs.MediaElement;
|
|
1578 |
|
1579 |
// loading
|
1580 |
media.addEventListener('progress', function (e) {
|
1581 |
-
|
1582 |
}, false);
|
1583 |
|
1584 |
// current time
|
1585 |
media.addEventListener('timeupdate', function(e) {
|
1586 |
-
|
1587 |
-
|
1588 |
}, false);
|
1589 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1590 |
|
1591 |
})(jQuery);
|
1592 |
(function($) {
|
@@ -1744,8 +1801,7 @@ window.MediaElement = mejs.MediaElement;
|
|
1744 |
if (!player.isVideo)
|
1745 |
return;
|
1746 |
|
1747 |
-
var
|
1748 |
-
isFullScreen = false,
|
1749 |
normalHeight = 0,
|
1750 |
normalWidth = 0,
|
1751 |
container = player.container,
|
@@ -1753,7 +1809,10 @@ window.MediaElement = mejs.MediaElement;
|
|
1753 |
$('<div class="mejs-button mejs-fullscreen-button"><span></span></div>')
|
1754 |
.appendTo(controls)
|
1755 |
.click(function() {
|
1756 |
-
|
|
|
|
|
|
|
1757 |
}),
|
1758 |
setFullScreen = function(goFullScreen) {
|
1759 |
switch (media.pluginType) {
|
@@ -1766,8 +1825,10 @@ window.MediaElement = mejs.MediaElement;
|
|
1766 |
if (mejs.MediaFeatures.hasNativeFullScreen) {
|
1767 |
if (goFullScreen) {
|
1768 |
media.webkitEnterFullScreen();
|
|
|
1769 |
} else {
|
1770 |
media.webkitExitFullScreen();
|
|
|
1771 |
}
|
1772 |
} else {
|
1773 |
if (goFullScreen) {
|
@@ -1797,6 +1858,7 @@ window.MediaElement = mejs.MediaElement;
|
|
1797 |
.addClass('mejs-unfullscreen');
|
1798 |
|
1799 |
player.setControlsSize();
|
|
|
1800 |
} else {
|
1801 |
|
1802 |
container
|
@@ -1818,14 +1880,14 @@ window.MediaElement = mejs.MediaElement;
|
|
1818 |
.addClass('mejs-fullscreen');
|
1819 |
|
1820 |
player.setControlsSize();
|
|
|
1821 |
}
|
1822 |
}
|
1823 |
-
}
|
1824 |
-
isFullScreen = goFullScreen;
|
1825 |
};
|
1826 |
|
1827 |
$(document).bind('keydown',function (e) {
|
1828 |
-
if (isFullScreen && e.keyCode == 27) {
|
1829 |
setFullScreen(false);
|
1830 |
}
|
1831 |
});
|
@@ -1966,6 +2028,11 @@ window.MediaElement = mejs.MediaElement;
|
|
1966 |
});
|
1967 |
}
|
1968 |
});
|
|
|
|
|
|
|
|
|
|
|
1969 |
|
1970 |
// auto selector
|
1971 |
if (player.options.translationSelector) {
|
15 |
var mejs = mejs || {};
|
16 |
|
17 |
// version number
|
18 |
+
mejs.version = '2.1.2';
|
19 |
|
20 |
// player number (for missing, same id attr)
|
21 |
mejs.meIndex = 0;
|
26 |
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
|
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 |
};
|
184 |
*/
|
185 |
|
186 |
// special case for Android which sadly doesn't implement the canPlayType function (always returns '')
|
187 |
+
if (mejs.PluginDetector.ua.match(/android 2\.[12]/) !== null) {
|
188 |
HTMLMediaElement.canPlayType = function(type) {
|
189 |
return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'probably' : '';
|
190 |
};
|
195 |
init: function() {
|
196 |
var
|
197 |
nav = mejs.PluginDetector.nav,
|
198 |
+
ua = mejs.PluginDetector.ua.toLowerCase(),
|
199 |
i,
|
200 |
v,
|
201 |
html5Elements = ['source','track','audio','video'];
|
202 |
|
203 |
// detect browsers (only the ones that have some kind of quirk we need to work around)
|
204 |
+
this.isiPad = (ua.match(/ipad/i) !== null);
|
205 |
+
this.isiPhone = (ua.match(/iphone/i) !== null);
|
206 |
+
this.isAndroid = (ua.match(/android/i) !== null);
|
207 |
+
this.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1);
|
208 |
+
this.isChrome = (ua.match(/chrome/gi) !== null);
|
209 |
|
210 |
// create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
|
211 |
for (i=0; i<html5Elements.length; i++) {
|
227 |
*/
|
228 |
mejs.HtmlMediaElement = {
|
229 |
pluginType: 'native',
|
230 |
+
isFullScreen: false,
|
231 |
|
232 |
setCurrentTime: function (time) {
|
233 |
this.currentTime = time;
|
287 |
// special
|
288 |
pluginElement: null,
|
289 |
pluginType: '',
|
290 |
+
isFullScreen: false,
|
291 |
|
292 |
// not implemented :(
|
293 |
playbackRate: -1,
|
419 |
this.events[eventName] = this.events[eventName] || [];
|
420 |
this.events[eventName].push(callback);
|
421 |
},
|
422 |
+
removeEventListener: function (eventName, callback) {
|
423 |
+
if (!eventName) { this.events = {}; return true; }
|
424 |
+
var callbacks = this.events[eventName];
|
425 |
+
if (!callbacks) return true;
|
426 |
+
if (!callback) { this.events[eventName] = []; return true; }
|
427 |
+
for (i = 0; i < callbacks.length; i++) {
|
428 |
+
if (callbacks[i] === callback) {
|
429 |
+
this.events[eventName].splice(i, 1);
|
430 |
+
return true;
|
431 |
+
}
|
432 |
+
}
|
433 |
+
return false;
|
434 |
+
},
|
435 |
dispatchEvent: function (eventName) {
|
436 |
var i,
|
437 |
args,
|
568 |
mimics HTML5 MediaElement
|
569 |
*/
|
570 |
mejs.MediaElement = function (el, o) {
|
571 |
+
return mejs.HtmlMediaElementShim.create(el,o);
|
572 |
};
|
573 |
|
574 |
mejs.HtmlMediaElementShim = {
|
602 |
|
603 |
if (playback.method == 'native') {
|
604 |
// add methods to native HTMLMediaElement
|
605 |
+
return this.updateNative( htmlMediaElement, options, autoplay, preload, playback);
|
606 |
} else if (playback.method !== '') {
|
607 |
// create plugin to mimic HTMLMediaElement
|
608 |
+
return this.createPlugin( htmlMediaElement, options, isVideo, playback.method, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster, autoplay, preload, controls);
|
609 |
} else {
|
610 |
// boo, no HTML5, no Flash, no Silverlight.
|
611 |
this.createErrorMessage( htmlMediaElement, options, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster );
|
854 |
'allowScriptAccess="always" ' +
|
855 |
'allowFullScreen="true" ' +
|
856 |
'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ' +
|
857 |
+
'src="' + options.pluginPath + options.flashName + '" ' +
|
858 |
+
'flashvars="' + initVars.join('&') + '" ' +
|
859 |
'width="' + width + '" ' +
|
860 |
'height="' + height + '"></embed>';
|
861 |
}
|
865 |
htmlMediaElement.style.display = 'none';
|
866 |
|
867 |
// FYI: options.success will be fired by the MediaPluginBridge
|
868 |
+
|
869 |
+
return pluginMediaElement;
|
870 |
},
|
871 |
|
872 |
updateNative: function(htmlMediaElement, options, autoplay, preload, playback) {
|
903 |
|
904 |
// fire success code
|
905 |
options.success(htmlMediaElement, htmlMediaElement);
|
906 |
+
|
907 |
+
return htmlMediaElement;
|
908 |
}
|
909 |
};
|
910 |
|
967 |
t.options = $.extend({},mejs.MepDefaults,o);
|
968 |
t.$media = t.$node = $($node);
|
969 |
|
970 |
+
// these will be reset after the MediaElement.success fires
|
971 |
+
t.node = t.media = t.$media[0];
|
972 |
+
|
973 |
// check for existing player
|
974 |
+
if (typeof t.node.player != 'undefined') {
|
975 |
+
return t.node.player;
|
976 |
} else {
|
977 |
// attach player to DOM node for reference
|
978 |
+
t.node.player = t;
|
979 |
}
|
980 |
|
981 |
+
t.isVideo = (t.media.tagName.toLowerCase() === 'video');
|
982 |
+
|
|
|
983 |
/* FUTURE WORK = create player without existing <video> or <audio> node
|
984 |
|
985 |
// if not a video or audio tag, then we'll dynamically create it
|
1024 |
return;
|
1025 |
}
|
1026 |
*/
|
1027 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1028 |
t.init();
|
1029 |
|
1030 |
return t;
|
1036 |
|
1037 |
var
|
1038 |
t = this,
|
1039 |
+
mf = mejs.MediaFeatures,
|
1040 |
+
// options for MediaElement (shim)
|
1041 |
meOptions = $.extend(true, {}, t.options, {
|
1042 |
success: function(media, domNode) { t.meReady(media, domNode); },
|
1043 |
error: function(e) { t.handleError(e);}
|
1044 |
});
|
1045 |
+
|
1046 |
+
|
1047 |
+
// use native controls in iPad, iPhone, and Android
|
1048 |
+
if (mf.isiPad || mf.isiPhone) {
|
1049 |
+
// add controls and stop
|
1050 |
+
t.$media.attr('controls', 'controls');
|
1051 |
|
1052 |
+
// fix iOS 3 bug
|
1053 |
+
t.$media.removeAttr('poster');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1054 |
|
1055 |
+
// override Apple's autoplay override for iPads
|
1056 |
+
if (mf.isiPad && t.media.getAttribute('autoplay') !== null) {
|
1057 |
+
t.media.load();
|
1058 |
+
t.media.play();
|
1059 |
+
}
|
1060 |
+
|
1061 |
+
} else if (mf.isAndroid) {
|
1062 |
+
|
1063 |
+
if (t.isVideo) {
|
1064 |
+
// Android fails when there are multiple source elements and the type is specified
|
1065 |
+
// <video>
|
1066 |
+
// <source src="file.mp4" type="video/mp4" />
|
1067 |
+
// <source src="file.webm" type="video/webm" />
|
1068 |
+
// </video>
|
1069 |
+
if (t.$media.find('source').length > 0) {
|
1070 |
+
// find an mp4 and make it the root element source
|
1071 |
+
t.media.src = t.$media.find('source[src$="mp4"]').attr('src');
|
1072 |
+
}
|
1073 |
|
1074 |
+
// attach a click event to the video and hope Android can play it
|
1075 |
+
t.$media.click(function() {
|
1076 |
+
t.media.play();
|
1077 |
+
});
|
1078 |
+
|
1079 |
+
} else {
|
1080 |
+
// audio?
|
1081 |
+
// 2.1 = no support
|
1082 |
+
// 2.2 = Flash support
|
1083 |
+
// 2.3 = Native HTML5
|
1084 |
+
}
|
1085 |
|
|
|
|
|
|
|
|
|
|
|
1086 |
} else {
|
|
|
|
|
|
|
1087 |
|
1088 |
+
// DESKTOP: use MediaElementPlayer controls
|
1089 |
+
|
1090 |
+
// remove native controls
|
1091 |
+
t.$media.removeAttr('controls');
|
1092 |
+
|
1093 |
+
// unique ID
|
1094 |
+
t.id = 'mep_' + mejs.mepIndex++;
|
1095 |
+
|
1096 |
+
// build container
|
1097 |
+
t.container =
|
1098 |
+
$('<div id="' + t.id + '" class="mejs-container">'+
|
1099 |
+
'<div class="mejs-inner">'+
|
1100 |
+
'<div class="mejs-mediaelement"></div>'+
|
1101 |
+
'<div class="mejs-layers"></div>'+
|
1102 |
+
'<div class="mejs-controls"></div>'+
|
1103 |
+
'<div class="mejs-clear"></div>'+
|
1104 |
+
'</div>' +
|
1105 |
+
'</div>')
|
1106 |
+
.addClass(t.$media[0].className)
|
1107 |
+
.insertBefore(t.$media);
|
1108 |
+
|
1109 |
+
// move the <video/video> tag into the right spot
|
1110 |
+
t.container.find('.mejs-mediaelement').append(t.$media);
|
1111 |
+
|
1112 |
+
// find parts
|
1113 |
+
t.controls = t.container.find('.mejs-controls');
|
1114 |
+
t.layers = t.container.find('.mejs-layers');
|
1115 |
+
|
1116 |
+
// determine the size
|
1117 |
+
if (t.isVideo) {
|
1118 |
+
// priority = videoWidth (forced), width attribute, defaultVideoWidth
|
1119 |
+
t.width = (t.options.videoWidth > 0) ? t.options.videoWidth : (t.$media[0].getAttribute('width') !== null) ? t.$media.attr('width') : t.options.defaultVideoWidth;
|
1120 |
+
t.height = (t.options.videoHeight > 0) ? t.options.videoHeight : (t.$media[0].getAttribute('height') !== null) ? t.$media.attr('height') : t.options.defaultVideoHeight;
|
1121 |
+
} else {
|
1122 |
+
t.width = t.options.audioWidth;
|
1123 |
+
t.height = t.options.audioHeight;
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
// set the size, while we wait for the plugins to load below
|
1127 |
+
t.setPlayerSize(t.width, t.height);
|
1128 |
+
|
1129 |
+
// create MediaElementShim
|
1130 |
+
meOptions.pluginWidth = t.height;
|
1131 |
+
meOptions.pluginHeight = t.width;
|
1132 |
+
}
|
1133 |
|
1134 |
+
// create MediaElement shim
|
|
|
|
|
1135 |
mejs.MediaElement(t.$media[0], meOptions);
|
1136 |
},
|
1137 |
|
1138 |
// Sets up all controls and events
|
1139 |
+
meReady: function(media, domNode) {
|
1140 |
+
|
1141 |
+
|
1142 |
var t = this,
|
1143 |
+
mf = mejs.MediaFeatures,
|
1144 |
f,
|
1145 |
feature;
|
1146 |
|
1148 |
if (this.created)
|
1149 |
return;
|
1150 |
else
|
1151 |
+
this.created = true;
|
1152 |
|
1153 |
t.media = media;
|
1154 |
t.domNode = domNode;
|
1155 |
+
|
1156 |
+
if (!mf.isiPhone && !mf.isAndroid && !mf.isiPad) {
|
1157 |
+
|
1158 |
|
1159 |
+
// two built in features
|
1160 |
+
t.buildposter(t, t.controls, t.layers, t.media);
|
1161 |
+
t.buildoverlays(t, t.controls, t.layers, t.media);
|
1162 |
+
|
1163 |
+
// grab for use by feautres
|
1164 |
+
t.findTracks();
|
1165 |
+
|
1166 |
+
// add user-defined features/controls
|
1167 |
+
for (f in t.options.features) {
|
1168 |
+
feature = t.options.features[f];
|
1169 |
+
if (t['build' + feature]) {
|
1170 |
+
try {
|
1171 |
+
t['build' + feature](t, t.controls, t.layers, t.media);
|
1172 |
+
} catch (e) {
|
1173 |
+
// TODO: report control error
|
1174 |
+
}
|
1175 |
}
|
1176 |
}
|
|
|
1177 |
|
1178 |
+
// reset all layers and controls
|
1179 |
+
t.setPlayerSize(t.width, t.height);
|
1180 |
+
t.setControlsSize();
|
1181 |
|
1182 |
+
// controls fade
|
1183 |
+
if (t.isVideo) {
|
1184 |
+
// show/hide controls
|
1185 |
+
t.container
|
1186 |
+
.bind('mouseenter', function () {
|
1187 |
+
t.controls.css('visibility','visible');
|
1188 |
+
t.controls.stop(true, true).fadeIn(200);
|
1189 |
+
})
|
1190 |
+
.bind('mouseleave', function () {
|
1191 |
+
if (!t.media.paused) {
|
1192 |
+
t.controls.stop(true, true).fadeOut(200, function() {
|
1193 |
+
$(this).css('visibility','hidden');
|
1194 |
+
$(this).css('display','block');
|
1195 |
+
});
|
1196 |
+
}
|
1197 |
+
});
|
1198 |
+
|
1199 |
+
// check for autoplay
|
1200 |
+
if (t.domNode.getAttribute('autoplay') !== null) {
|
1201 |
+
t.controls.css('visibility','hidden');
|
1202 |
+
}
|
1203 |
|
1204 |
+
// resizer
|
1205 |
+
if (t.options.enableAutosize) {
|
1206 |
+
t.media.addEventListener('loadedmetadata', function(e) {
|
1207 |
+
// if the <video height> was not set and the options.videoHeight was not set
|
1208 |
+
// then resize to the real dimensions
|
1209 |
+
if (t.options.videoHeight <= 0 && t.domNode.getAttribute('height') === null && !isNaN(e.target.videoHeight)) {
|
1210 |
+
t.setPlayerSize(e.target.videoWidth, e.target.videoHeight);
|
1211 |
+
t.setControlsSize();
|
1212 |
+
t.media.setVideoSize(e.target.videoWidth, e.target.videoHeight);
|
1213 |
+
}
|
1214 |
+
}, false);
|
1215 |
+
}
|
1216 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1217 |
|
1218 |
+
// ended for all
|
1219 |
+
t.media.addEventListener('ended', function (e) {
|
1220 |
+
t.media.setCurrentTime(0);
|
1221 |
+
t.media.pause();
|
1222 |
+
|
1223 |
+
if (t.setProgressRail)
|
1224 |
+
t.setProgressRail();
|
1225 |
+
if (t.setCurrentRail)
|
1226 |
+
t.setCurrentRail();
|
1227 |
+
|
1228 |
+
if (t.options.loop) {
|
1229 |
+
t.media.play();
|
1230 |
+
} else {
|
1231 |
+
t.controls.css('visibility','visible');
|
1232 |
+
}
|
1233 |
+
}, true);
|
1234 |
|
1235 |
|
1236 |
+
// webkit has trouble doing this without a delay
|
1237 |
+
setTimeout(function () {
|
1238 |
+
t.setControlsSize();
|
1239 |
+
t.setPlayerSize(t.width, t.height);
|
1240 |
+
}, 50);
|
1241 |
+
|
1242 |
+
}
|
1243 |
|
1244 |
|
1245 |
if (t.options.success) {
|
1276 |
railWidth = 0,
|
1277 |
rail = t.controls.find('.mejs-time-rail'),
|
1278 |
total = t.controls.find('.mejs-time-total'),
|
1279 |
+
current = t.controls.find('.mejs-time-current'),
|
1280 |
+
loaded = t.controls.find('.mejs-time-loaded');
|
1281 |
others = rail.siblings();
|
1282 |
|
1283 |
// find the size of all the other controls besides the rail
|
1289 |
// fit the rail into the remaining space
|
1290 |
railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.outerWidth(false));
|
1291 |
|
1292 |
+
// outer area
|
1293 |
rail.width(railWidth);
|
1294 |
+
// dark space
|
1295 |
total.width(railWidth - (total.outerWidth(true) - total.width()));
|
1296 |
+
|
1297 |
+
if (t.setProgressRail)
|
1298 |
+
t.setProgressRail();
|
1299 |
+
if (t.setCurrentRail)
|
1300 |
+
t.setCurrentRail();
|
1301 |
},
|
1302 |
|
1303 |
|
1308 |
'</div>')
|
1309 |
.appendTo(layers),
|
1310 |
posterUrl = player.$media.attr('poster'),
|
1311 |
+
posterImg = poster.find('img').width(player.width).height(player.height);
|
1312 |
|
1313 |
// prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
|
1314 |
if (player.options.poster != '') {
|
1526 |
handle = controls.find('.mejs-time-handle'),
|
1527 |
timefloat = controls.find('.mejs-time-float'),
|
1528 |
timefloatcurrent = controls.find('.mejs-time-float-current'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1529 |
handleMouseMove = function (e) {
|
1530 |
// mouse position relative to the object
|
1531 |
var x = e.pageX,
|
1583 |
|
1584 |
// loading
|
1585 |
media.addEventListener('progress', function (e) {
|
1586 |
+
player.setCurrentRail(e);
|
1587 |
}, false);
|
1588 |
|
1589 |
// current time
|
1590 |
media.addEventListener('timeupdate', function(e) {
|
1591 |
+
player.setProgressRail(e);
|
1592 |
+
player.setCurrentRail(e);
|
1593 |
}, false);
|
1594 |
}
|
1595 |
+
MediaElementPlayer.prototype.setProgressRail = function(e) {
|
1596 |
+
|
1597 |
+
var
|
1598 |
+
t = this,
|
1599 |
+
target = (e != undefined) ? e.target : t.media,
|
1600 |
+
percent = null,
|
1601 |
+
loaded = t.controls.find('.mejs-time-loaded'),
|
1602 |
+
total = t.controls.find('.mejs-time-total');
|
1603 |
+
|
1604 |
+
// newest HTML5 spec has buffered array (FF4, Webkit)
|
1605 |
+
if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
|
1606 |
+
// TODO: account for a real array with multiple values (only Firefox 4 has this so far)
|
1607 |
+
percent = target.buffered.end(0) / target.duration;
|
1608 |
+
}
|
1609 |
+
// Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
|
1610 |
+
// to be anything other than 0. If the byte count is available we use this instead.
|
1611 |
+
// Browsers that support the else if do not seem to have the bufferedBytes value and
|
1612 |
+
// should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
|
1613 |
+
else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
|
1614 |
+
percent = target.bufferedBytes / target.bytesTotal;
|
1615 |
+
}
|
1616 |
+
// Firefox 3 with an Ogg file seems to go this way
|
1617 |
+
else if (e && e.lengthComputable && e.total != 0) {
|
1618 |
+
percent = e.loaded/e.total;
|
1619 |
+
}
|
1620 |
+
|
1621 |
+
// finally update the progress bar
|
1622 |
+
if (percent !== null) {
|
1623 |
+
percent = Math.min(1, Math.max(0, percent));
|
1624 |
+
// update loaded bar
|
1625 |
+
loaded.width(total.width() * percent);
|
1626 |
+
}
|
1627 |
+
}
|
1628 |
+
MediaElementPlayer.prototype.setCurrentRail = function() {
|
1629 |
+
|
1630 |
+
var t = this,
|
1631 |
+
handle = t.controls.find('.mejs-time-handle'),
|
1632 |
+
current = t.controls.find('.mejs-time-current'),
|
1633 |
+
total = t.controls.find('.mejs-time-total');
|
1634 |
+
|
1635 |
+
if (t.media.currentTime != undefined && t.media.duration) {
|
1636 |
+
|
1637 |
+
// update bar and handle
|
1638 |
+
var
|
1639 |
+
newWidth = total.width() * t.media.currentTime / t.media.duration,
|
1640 |
+
handlePos = newWidth - (handle.outerWidth(true) / 2);
|
1641 |
+
|
1642 |
+
current.width(newWidth);
|
1643 |
+
handle.css('left', handlePos);
|
1644 |
+
}
|
1645 |
+
|
1646 |
+
}
|
1647 |
|
1648 |
})(jQuery);
|
1649 |
(function($) {
|
1801 |
if (!player.isVideo)
|
1802 |
return;
|
1803 |
|
1804 |
+
var
|
|
|
1805 |
normalHeight = 0,
|
1806 |
normalWidth = 0,
|
1807 |
container = player.container,
|
1809 |
$('<div class="mejs-button mejs-fullscreen-button"><span></span></div>')
|
1810 |
.appendTo(controls)
|
1811 |
.click(function() {
|
1812 |
+
var goFullscreen = (mejs.MediaFeatures.hasNativeFullScreen) ?
|
1813 |
+
!media.webkitDisplayingFullscreen :
|
1814 |
+
!media.isFullScreen;
|
1815 |
+
setFullScreen(goFullscreen);
|
1816 |
}),
|
1817 |
setFullScreen = function(goFullScreen) {
|
1818 |
switch (media.pluginType) {
|
1825 |
if (mejs.MediaFeatures.hasNativeFullScreen) {
|
1826 |
if (goFullScreen) {
|
1827 |
media.webkitEnterFullScreen();
|
1828 |
+
media.isFullScreen = true;
|
1829 |
} else {
|
1830 |
media.webkitExitFullScreen();
|
1831 |
+
media.isFullScreen = false;
|
1832 |
}
|
1833 |
} else {
|
1834 |
if (goFullScreen) {
|
1858 |
.addClass('mejs-unfullscreen');
|
1859 |
|
1860 |
player.setControlsSize();
|
1861 |
+
media.isFullScreen = true;
|
1862 |
} else {
|
1863 |
|
1864 |
container
|
1880 |
.addClass('mejs-fullscreen');
|
1881 |
|
1882 |
player.setControlsSize();
|
1883 |
+
media.isFullScreen = false;
|
1884 |
}
|
1885 |
}
|
1886 |
+
}
|
|
|
1887 |
};
|
1888 |
|
1889 |
$(document).bind('keydown',function (e) {
|
1890 |
+
if (media.isFullScreen && e.keyCode == 27) {
|
1891 |
setFullScreen(false);
|
1892 |
}
|
1893 |
});
|
2028 |
});
|
2029 |
}
|
2030 |
});
|
2031 |
+
|
2032 |
+
// check for autoplay
|
2033 |
+
if (media.getAttribute('autoplay') !== null) {
|
2034 |
+
player.chapters.css('visibility','hidden');
|
2035 |
+
}
|
2036 |
|
2037 |
// auto selector
|
2038 |
if (player.options.translationSelector) {
|
mediaelement/mediaelement-and-player.min.js
CHANGED
@@ -10,36 +10,37 @@
|
|
10 |
* Copyright 2010, John Dyer (http://johndyer.me)
|
11 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
*
|
13 |
-
*/var mejs=mejs||{};mejs.version="2.1.
|
14 |
mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.split("&").join("&").split("<").join("<").split('"').join(""")},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){a=Math.round(a);var b=Math.floor(a/60);b=b>=10?b:"0"+b;a=Math.floor(a%60);a=a>=10?a:"0"+a;return b+":"+a}};
|
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(/
|
21 |
-
mejs.MediaFeatures={init:function(){var a=mejs.PluginDetector.nav,b=mejs.PluginDetector.ua,c,d=["source","track","audio","video"];this.isiPad=b.match(/
|
22 |
-
mejs.MediaFeatures.init();mejs.HtmlMediaElement={pluginType:"native",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}};
|
23 |
mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
|
24 |
-
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",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 |
-
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 |
-
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 |
-
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)},
|
|
|
28 |
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,
|
29 |
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)}};
|
30 |
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(){}};
|
31 |
-
mejs.MediaElement=function(a,b){mejs.HtmlMediaElementShim.create(a,b)};
|
32 |
-
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:""},
|
33 |
-
|
34 |
-
"undefined"&&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/,"")!==""){
|
35 |
-
e[f].url;return
|
36 |
-
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,
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
b.pluginPath+b.flashName+"
|
42 |
-
window.MediaElement=mejs.MediaElement;
|
43 |
|
44 |
/*!
|
45 |
* MediaElementPlayer
|
@@ -51,46 +52,49 @@ window.MediaElement=mejs.MediaElement;
|
|
51 |
* Copyright 2010, John Dyer (http://johndyer.me)
|
52 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
53 |
*
|
54 |
-
*/(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,audioWidth:400,audioHeight:30,startVolume:0.8,loop:false,enableAutosize:true,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);
|
55 |
-
|
56 |
-
|
57 |
-
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,
|
58 |
-
a.height;
|
59 |
-
"visible");b.controls.stop(true,true).fadeIn(200)}).bind("mouseleave",function(){b.media.paused||b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});b.
|
60 |
-
|
61 |
-
this.layers.children("div.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");
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
66 |
(function(f){MediaElementPlayer.prototype.buildplaypause=function(a,c,b,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play"><span></span></div>').appendTo(c).click(function(){d.paused?d.play():d.pause()});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",function(){e.removeClass("mejs-pause").addClass("mejs-play")},
|
67 |
false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})(jQuery);
|
68 |
(function(f){MediaElementPlayer.prototype.buildstop=function(a,c,b,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><span></span></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()}})}})(jQuery);
|
69 |
-
(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")
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
73 |
(function(f){MediaElementPlayer.prototype.buildcurrent=function(a,c,b,d){f('<div class="mejs-time"><span class="mejs-currenttime">00:00</span></div>').appendTo(c);d.addEventListener("timeupdate",function(){d.currentTime&&c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(d.currentTime))},false)};MediaElementPlayer.prototype.buildduration=function(a,c,b,d){c.children().last().find(".mejs-currenttime").length>0?f(' <span> | </span> <span class="mejs-duration">00:00</span>').appendTo(c.find(".mejs-time")):
|
74 |
f('<div class="mejs-time"><span class="mejs-duration">00:00</span></div>').appendTo(c);d.addEventListener("timeupdate",function(){d.duration&&c.find(".mejs-duration").html(mejs.Utility.secondsToTimeCode(d.duration))},false)}})(jQuery);
|
75 |
-
(function(f){MediaElementPlayer.prototype.buildvolume=function(a,c,b,d){var e=f('<div class="mejs-button mejs-volume-button mejs-mute"><span></span><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"),
|
76 |
-
|
77 |
-
false;c.bind("mousedown",function(
|
78 |
-
(function(f){MediaElementPlayer.prototype.buildfullscreen=function(a,c,b,d){if(a.isVideo){var e=
|
79 |
-
1E3);a.$media.width("100%").height("100%");b.children("div").width("100%").height("100%");
|
|
|
80 |
(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");
|
81 |
a.captionsButton=f('<div class="mejs-button mejs-captions-button"><span></span><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).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];
|
82 |
a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});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=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(),
|
83 |
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()},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",
|
84 |
-
"hidden");f(this).css("display","block")})});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>'+g+"</select>"));a.container.find(".mejs-captions-translations").change(function(){lang=f(this).val();if(lang!=
|
85 |
-
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()};
|
86 |
-
b.srclang,c.options.googleApiKey,function(e){b.entries=e;d()}):f.ajax({url:b.src,success:function(e){b.entries=mejs.SrtParser.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+"]").attr("disabled","").siblings("label").html(mejs.language.codes[a]||a);this.options.startLanguage==a&&f("#"+
|
87 |
-
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)+
|
88 |
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==
|
89 |
"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);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==
|
90 |
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)+"–"+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",ar:"Arabic",
|
91 |
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",fa:"Persian",
|
92 |
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.SrtParser={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})?)(.*)$/,timecodeToSeconds:function(a){a=a.split(":");return a[0]*60*60+a[1]*60+parseFloat(a[2].replace(",","."))},split2:function(a,
|
93 |
-
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:this.timecodeToSeconds(d[1]),stop:this.timecodeToSeconds(d[3]),settings:d[5]})}}return b},translateSrt:function(a,c,b,d,e){var g={text:[],times:[]},
|
94 |
-
c,b,d,function(
|
95 |
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.SrtParser.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}})(jQuery);
|
96 |
|
10 |
* Copyright 2010, John Dyer (http://johndyer.me)
|
11 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
*
|
13 |
+
*/var mejs=mejs||{};mejs.version="2.1.2";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.split("&").join("&").split("<").join("<").split('"').join(""")},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){a=Math.round(a);var b=Math.floor(a/60);b=b>=10?b:"0"+b;a=Math.floor(a%60);a=a>=10?a:"0"+a;return b+":"+a}};
|
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}};mejs.MediaFeatures.init();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}};
|
23 |
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(typeof b.type!="undefined"&&b.type!=="")e.push({type:b.type,
|
35 |
+
url:null});else if(h!="undefined"&&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/,"")!==""){k.method=
|
36 |
+
"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")+"/"+a}else return b&&~b.indexOf(";")?
|
37 |
+
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,d,e),o=document.createElement("div"),
|
38 |
+
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;mejs.MediaPluginBridge.registerPluginElement(j,
|
39 |
+
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,"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='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+
|
40 |
+
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");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="'+
|
41 |
+
j+'" width="'+f+'" height="'+l+'"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+c.join("&")+'" /><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='<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="'+
|
42 |
+
b.pluginPath+b.flashName+'" flashvars="'+c.join("&")+'" width="'+f+'" height="'+l+'"></embed>'}a.style.display="none";return n},updateNative:function(a,b,c,d,e){for(var f in mejs.HtmlMediaElement)a[f]=mejs.HtmlMediaElement[f];if(mejs.MediaFeatures.isChrome)if(d==="none"&&!c){a.src="";a.load();a.canceledPreload=true;a.addEventListener("play",function(){if(a.canceledPreload){a.src=e.url;a.load();a.play();a.canceledPreload=false}},false)}else if(c){a.load();a.play()}b.success(a,a);return a}};
|
43 |
+
window.mejs=mejs;window.MediaElement=mejs.MediaElement;
|
44 |
|
45 |
/*!
|
46 |
* MediaElementPlayer
|
52 |
* Copyright 2010, John Dyer (http://johndyer.me)
|
53 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
54 |
*
|
55 |
+
*/(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,audioWidth:400,audioHeight:30,startVolume:0.8,loop:false,enableAutosize:true,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,c);this.$media=this.$node=f(a);this.node=
|
56 |
+
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");if(c.isiPad&&a.media.getAttribute("autoplay")!==
|
57 |
+
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);
|
58 |
+
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,
|
59 |
+
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,
|
60 |
+
b.height);b.setControlsSize();if(b.isVideo){b.container.bind("mouseenter",function(){b.controls.css("visibility","visible");b.controls.stop(true,true).fadeIn(200)}).bind("mouseleave",function(){b.media.paused||b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});b.domNode.getAttribute("autoplay")!==null&&b.controls.css("visibility","hidden");b.options.enableAutosize&&b.media.addEventListener("loadedmetadata",function(i){if(b.options.videoHeight<=
|
61 |
+
0&&b.domNode.getAttribute("height")===null&&!isNaN(i.target.videoHeight)){b.setPlayerSize(i.target.videoWidth,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();b.options.loop?b.media.play():b.controls.css("visibility","visible")},true);setTimeout(function(){b.setControlsSize();
|
62 |
+
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=parseInt(c,10);this.container.width(this.width).height(this.height);this.layers.children("div.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");
|
63 |
+
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)-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);
|
64 |
+
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,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),i=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(b).click(function(){d.paused?
|
65 |
+
d.play():d.pause()});d.addEventListener("play",function(){i.hide();g.hide()},false);d.addEventListener("pause",function(){i.show()},false);d.addEventListener("loadstart",function(){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(),
|
66 |
+
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()},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)},
|
67 |
+
getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)}};jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(f(this),a)})};window.MediaElementPlayer=mejs.MediaElementPlayer})(jQuery);
|
68 |
(function(f){MediaElementPlayer.prototype.buildplaypause=function(a,c,b,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play"><span></span></div>').appendTo(c).click(function(){d.paused?d.play():d.pause()});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",function(){e.removeClass("mejs-pause").addClass("mejs-play")},
|
69 |
false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})(jQuery);
|
70 |
(function(f){MediaElementPlayer.prototype.buildstop=function(a,c,b,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><span></span></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()}})}})(jQuery);
|
71 |
+
(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");c.find(".mejs-time-loaded");c.find(".mejs-time-current");c.find(".mejs-time-handle");
|
72 |
+
var g=c.find(".mejs-time-float"),i=c.find(".mejs-time-float-current"),k=function(j){j=j.pageX;var h=e.offset(),o=e.outerWidth(),m=0;m=0;if(j>h.left&&j<=o+h.left&&d.duration){m=(j-h.left)/o;m=m<=0.02?0:m*d.duration;l&&d.setCurrentTime(m);g.css("left",j-h.left);i.html(mejs.Utility.secondsToTimeCode(m))}},l=false,n=false;e.bind("mousedown",function(j){l=true;k(j);return false});c.find(".mejs-time-rail").bind("mouseenter",function(){n=true}).bind("mouseleave",function(){n=false});f(document).bind("mouseup",
|
73 |
+
function(){l=false}).bind("mousemove",function(j){if(l||n)k(j)});d.addEventListener("progress",function(j){a.setCurrentRail(j)},false);d.addEventListener("timeupdate",function(j){a.setProgressRail(j);a.setCurrentRail(j)},false)};MediaElementPlayer.prototype.setProgressRail=function(a){var c=a!=undefined?a.target:this.media,b=null,d=this.controls.find(".mejs-time-loaded"),e=this.controls.find(".mejs-time-total");if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=c.buffered.end(0)/
|
74 |
+
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));d.width(e.width()*b)}};MediaElementPlayer.prototype.setCurrentRail=function(){var a=this.controls.find(".mejs-time-handle"),c=this.controls.find(".mejs-time-current"),b=this.controls.find(".mejs-time-total");if(this.media.currentTime!=undefined&&this.media.duration){b=b.width()*
|
75 |
+
this.media.currentTime/this.media.duration;var d=b-a.outerWidth(true)/2;c.width(b);a.css("left",d)}}})(jQuery);
|
76 |
(function(f){MediaElementPlayer.prototype.buildcurrent=function(a,c,b,d){f('<div class="mejs-time"><span class="mejs-currenttime">00:00</span></div>').appendTo(c);d.addEventListener("timeupdate",function(){d.currentTime&&c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(d.currentTime))},false)};MediaElementPlayer.prototype.buildduration=function(a,c,b,d){c.children().last().find(".mejs-currenttime").length>0?f(' <span> | </span> <span class="mejs-duration">00:00</span>').appendTo(c.find(".mejs-time")):
|
77 |
f('<div class="mejs-time"><span class="mejs-duration">00:00</span></div>').appendTo(c);d.addEventListener("timeupdate",function(){d.duration&&c.find(".mejs-duration").html(mejs.Utility.secondsToTimeCode(d.duration))},false)}})(jQuery);
|
78 |
+
(function(f){MediaElementPlayer.prototype.buildvolume=function(a,c,b,d){var e=f('<div class="mejs-button mejs-volume-button mejs-mute"><span></span><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"),i=e.find(".mejs-volume-current"),k=e.find(".mejs-volume-handle"),l=function(h){h=g.height()-g.height()*h;k.css("top",
|
79 |
+
h-k.height()/2);i.height(g.height()-h+parseInt(g.css("top").replace(/px/,""),10));i.css("top",h)},n=function(h){var o=g.height(),m=g.offset(),p=parseInt(g.css("top").replace(/px/,""),10);h=h.pageY-m.top;m=(o-h)/o;if(h<0)h=0;else if(h>o)h=o;k.css("top",h-k.height()/2+p);i.height(o-h);i.css("top",h+p);if(m==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}m=Math.max(0,m);m=Math.min(m,1);d.setVolume(m)},j=
|
80 |
+
false;c.bind("mousedown",function(h){n(h);j=true;return false});f(document).bind("mouseup",function(){j=false}).bind("mousemove",function(h){j&&n(h)});e.find("span").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(h){j||l(h.target.volume)},true);l(a.options.startVolume);d.setVolume(a.options.startVolume)}})(jQuery);
|
81 |
+
(function(f){MediaElementPlayer.prototype.buildfullscreen=function(a,c,b,d){if(a.isVideo){var e=0,g=0,i=a.container,k=f('<div class="mejs-button mejs-fullscreen-button"><span></span></div>').appendTo(c).click(function(){l(mejs.MediaFeatures.hasNativeFullScreen?!d.webkitDisplayingFullscreen:!d.isFullScreen)}),l=function(n){switch(d.pluginType){case "flash":case "silverlight":d.setFullscreen(n);break;case "native":if(mejs.MediaFeatures.hasNativeFullScreen)if(n){d.webkitEnterFullScreen();d.isFullScreen=
|
82 |
+
true}else{d.webkitExitFullScreen();d.isFullScreen=false}else if(n){e=a.$media.height();g=a.$media.width();i.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%");k.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();d.isFullScreen=true}else{i.removeClass("mejs-container-fullscreen").width(g).height(e).css("z-index",1);a.$media.width(g).height(e);b.children("div").width(g).height(e);
|
83 |
+
k.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");a.setControlsSize();d.isFullScreen=false}}};f(document).bind("keydown",function(n){d.isFullScreen&&n.keyCode==27&&l(false)})}}})(jQuery);
|
84 |
(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");
|
85 |
a.captionsButton=f('<div class="mejs-button mejs-captions-button"><span></span><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).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];
|
86 |
a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});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=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(),
|
87 |
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()},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",
|
88 |
+
"hidden");f(this).css("display","block")})});d.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>'+g+"</select>"));a.container.find(".mejs-captions-translations").change(function(){lang=f(this).val();if(lang!=
|
89 |
+
""){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()};
|
90 |
+
b.isTranslation?mejs.SrtParser.translateSrt(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.SrtParser.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+"]").attr("disabled","").siblings("label").html(mejs.language.codes[a]||a);this.options.startLanguage==a&&f("#"+
|
91 |
+
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)+
|
92 |
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==
|
93 |
"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);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==
|
94 |
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)+"–"+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",ar:"Arabic",
|
95 |
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",fa:"Persian",
|
96 |
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.SrtParser={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})?)(.*)$/,timecodeToSeconds:function(a){a=a.split(":");return a[0]*60*60+a[1]*60+parseFloat(a[2].replace(",","."))},split2:function(a,
|
97 |
+
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:this.timecodeToSeconds(d[1]),stop:this.timecodeToSeconds(d[3]),settings:d[5]})}}return b},translateSrt:function(a,c,b,d,e){var g={text:[],times:[]},i,k;this.translateText(a.text.join(" <a></a>"),
|
98 |
+
c,b,d,function(l){i=l.split("<a></a>");for(k=0;k<a.text.length;k++){g.text[k]=i[k];g.times[k]={start:a.times[k].start,stop:a.times[k].stop,settings:a.times[k].settings}}e(g)})},translateText:function(a,c,b,d,e){for(var g,i=[],k,l="",n=function(){if(i.length>0){k=i.shift();mejs.SrtParser.translateChunk(k,c,b,d,function(j){if(j!="undefined")l+=j;n()})}else e(l)};a.length>0;)if(a.length>1E3){g=a.lastIndexOf(".",1E3);i.push(a.substring(0,g));a=a.substring(g+1)}else{i.push(a);a=""}n()},translateChunk:function(a,
|
99 |
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.SrtParser.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}})(jQuery);
|
100 |
|
mediaelement/mediaelementplayer.css
CHANGED
@@ -502,6 +502,7 @@
|
|
502 |
position: absolute;
|
503 |
width: 100%;
|
504 |
bottom: 15px;
|
|
|
505 |
}
|
506 |
|
507 |
.mejs-captions-position-hover {
|
502 |
position: absolute;
|
503 |
width: 100%;
|
504 |
bottom: 15px;
|
505 |
+
left: 0;
|
506 |
}
|
507 |
|
508 |
.mejs-captions-position-hover {
|
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;font-family:Helvetica,Arial;}.mejs-controls .mejs-button span{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;height:16px;width:16px;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 span{background-position:0 0;}.mejs-controls .mejs-pause span{background-position:0 -16px;}.mejs-controls .mejs-stop span{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 span{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen span{background-position:-32px -16px;}.mejs-controls .mejs-mute span{background-position:-16px -16px;}.mejs-controls .mejs-unmute span{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 span{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;}.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 span{background-position:-64px -16px;}.mejs-controls .mejs-loop-on span{background-position:-64px 0;}.mejs-controls .mejs-backlight-off span{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on span{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-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;font-family:Helvetica,Arial;}.mejs-controls .mejs-button span{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;height:16px;width:16px;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 span{background-position:0 0;}.mejs-controls .mejs-pause span{background-position:0 -16px;}.mejs-controls .mejs-stop span{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 span{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen span{background-position:-32px -16px;}.mejs-controls .mejs-mute span{background-position:-16px -16px;}.mejs-controls .mejs-unmute span{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 span{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 span{background-position:-64px -16px;}.mejs-controls .mejs-loop-on span{background-position:-64px 0;}.mejs-controls .mejs-backlight-off span{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on span{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}
|
mediaelement/silverlightmediaelement.xap
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -3,14 +3,14 @@ Contributors: johndyer
|
|
3 |
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.
|
7 |
-
Stable tag: 2.1.
|
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 |
|
11 |
== Description ==
|
12 |
|
13 |
-
|
14 |
Supports MP4, OGG, WebM, WMV, MP3, WAV, WMA files as well as captions with WebSRT files.
|
15 |
|
16 |
Check out <a href="http://mediaelementjs.com/">mediaElementjs.com</a> for more information and examples.
|
3 |
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.1
|
7 |
+
Stable tag: 2.1.2
|
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 |
|
11 |
== Description ==
|
12 |
|
13 |
+
Video and audio plugin for WordPress built on the MediaElement.js HTML5 media player library. Provides Flash or Silverlight fallback players for non-HTML5 browsers. Supports iPhone, iPad, and Andriod.
|
14 |
Supports MP4, OGG, WebM, WMV, MP3, WAV, WMA files as well as captions with WebSRT files.
|
15 |
|
16 |
Check out <a href="http://mediaelementjs.com/">mediaElementjs.com</a> for more information and examples.
|