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

Version Description

None

Download this release

Release Info

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

Code changes from version 2.1.5 to 2.1.6

mediaelement/background.png DELETED
Binary file
mediaelement/bigplay.png DELETED
Binary file
mediaelement/controls.png DELETED
Binary file
mediaelement/flashmediaelement.swf DELETED
Binary file
mediaelement/loading.gif DELETED
Binary file
mediaelement/mediaelement-and-player.js DELETED
@@ -1,2556 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * HTML5 <video> and <audio> shim and player
4
- * http://mediaelementjs.com/
5
- *
6
- * Creates a JavaScript object that mimics HTML5 MediaElement API
7
- * for browsers that don't understand HTML5 or can't play the provided codec
8
- * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
9
- *
10
- * Copyright 2010, John Dyer (http://johndyer.me)
11
- * Dual licensed under the MIT or GPL Version 2 licenses.
12
- *
13
- */
14
- // Namespace
15
- var mejs = mejs || {};
16
-
17
- // version number
18
- mejs.version = '2.1.5';
19
-
20
- // player number (for missing, same id attr)
21
- mejs.meIndex = 0;
22
-
23
- // media types accepted by plugins
24
- mejs.plugins = {
25
- silverlight: [
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
- };
33
-
34
- /*
35
- Utility methods
36
- */
37
- mejs.Utility = {
38
- encodeUrl: function(url) {
39
- return encodeURIComponent(url); //.replace(/\?/gi,'%3F').replace(/=/gi,'%3D').replace(/&/gi,'%26');
40
- },
41
- escapeHTML: function(s) {
42
- return s.toString().split('&').join('&amp;').split('<').join('&lt;').split('"').join('&quot;');
43
- },
44
- absolutizeUrl: function(url) {
45
- var el = document.createElement('div');
46
- el.innerHTML = '<a href="' + this.escapeHTML(url) + '">x</a>';
47
- return el.firstChild.href;
48
- },
49
- getScriptPath: function(scriptNames) {
50
- var
51
- i = 0,
52
- j,
53
- path = '',
54
- name = '',
55
- script,
56
- scripts = document.getElementsByTagName('script');
57
-
58
- for (; i < scripts.length; i++) {
59
- script = scripts[i].src;
60
- for (j = 0; j < scriptNames.length; j++) {
61
- name = scriptNames[j];
62
- if (script.indexOf(name) > -1) {
63
- path = script.substring(0, script.indexOf(name));
64
- break;
65
- }
66
- }
67
- if (path !== '') {
68
- break;
69
- }
70
- }
71
- return path;
72
- },
73
- secondsToTimeCode: function(seconds,forceHours) {
74
- seconds = Math.round(seconds);
75
- var hours,
76
- minutes = Math.floor(seconds / 60);
77
- if (minutes >= 60) {
78
- hours = Math.floor(minutes / 60);
79
- minutes = minutes % 60;
80
- }
81
- hours = hours === undefined ? "00" : (hours >= 10) ? hours : "0" + hours;
82
- minutes = (minutes >= 10) ? minutes : "0" + minutes;
83
- seconds = Math.floor(seconds % 60);
84
- seconds = (seconds >= 10) ? seconds : "0" + seconds;
85
- return ((hours > 0 || forceHours === true) ? hours + ":" :'') + minutes + ":" + seconds;
86
- },
87
- timeCodeToSeconds: function(timecode){
88
- var tab = timecode.split(':');
89
- return tab[0]*60*60 + tab[1]*60 + parseFloat(tab[2].replace(',','.'));
90
- }
91
- };
92
-
93
-
94
- // Core detector, plugins are added below
95
- mejs.PluginDetector = {
96
-
97
- // main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]);
98
- hasPluginVersion: function(plugin, v) {
99
- var pv = this.plugins[plugin];
100
- v[1] = v[1] || 0;
101
- v[2] = v[2] || 0;
102
- return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
103
- },
104
-
105
- // cached values
106
- nav: window.navigator,
107
- ua: window.navigator.userAgent.toLowerCase(),
108
-
109
- // stored version numbers
110
- plugins: [],
111
-
112
- // runs detectPlugin() and stores the version number
113
- addPlugin: function(p, pluginName, mimeType, activeX, axDetect) {
114
- this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect);
115
- },
116
-
117
- // get the version number from the mimetype (all but IE) or ActiveX (IE)
118
- detectPlugin: function(pluginName, mimeType, activeX, axDetect) {
119
-
120
- var version = [0,0,0],
121
- description,
122
- i,
123
- ax;
124
-
125
- // Firefox, Webkit, Opera
126
- if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') {
127
- description = this.nav.plugins[pluginName].description;
128
- if (description && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) {
129
- version = description.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.');
130
- for (i=0; i<version.length; i++) {
131
- version[i] = parseInt(version[i].match(/\d+/), 10);
132
- }
133
- }
134
- // Internet Explorer / ActiveX
135
- } else if (typeof(window.ActiveXObject) != 'undefined') {
136
- try {
137
- ax = new ActiveXObject(activeX);
138
- if (ax) {
139
- version = axDetect(ax);
140
- }
141
- }
142
- catch (e) { }
143
- }
144
- return version;
145
- }
146
- };
147
-
148
- // Add Flash detection
149
- mejs.PluginDetector.addPlugin('flash','Shockwave Flash','application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash', function(ax) {
150
- // adapted from SWFObject
151
- var version = [],
152
- d = ax.GetVariable("$version");
153
- if (d) {
154
- d = d.split(" ")[1].split(",");
155
- version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
156
- }
157
- return version;
158
- });
159
-
160
- // Add Silverlight detection
161
- mejs.PluginDetector.addPlugin('silverlight','Silverlight Plug-In','application/x-silverlight-2','AgControl.AgControl', function (ax) {
162
- // Silverlight cannot report its version number to IE
163
- // but it does have a isVersionSupported function, so we have to loop through it to get a version number.
164
- // adapted from http://www.silverlightversion.com/
165
- var v = [0,0,0,0],
166
- loopMatch = function(ax, v, i, n) {
167
- while(ax.isVersionSupported(v[0]+ "."+ v[1] + "." + v[2] + "." + v[3])){
168
- v[i]+=n;
169
- }
170
- v[i] -= n;
171
- };
172
- loopMatch(ax, v, 0, 1);
173
- loopMatch(ax, v, 1, 1);
174
- loopMatch(ax, v, 2, 10000); // the third place in the version number is usually 5 digits (4.0.xxxxx)
175
- loopMatch(ax, v, 2, 1000);
176
- loopMatch(ax, v, 2, 100);
177
- loopMatch(ax, v, 2, 10);
178
- loopMatch(ax, v, 2, 1);
179
- loopMatch(ax, v, 3, 1);
180
-
181
- return v;
182
- });
183
- // add adobe acrobat
184
- /*
185
- PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PDF', function (ax) {
186
- var version = [],
187
- d = ax.GetVersions().split(',')[0].split('=')[1].split('.');
188
-
189
- if (d) {
190
- version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
191
- }
192
- return version;
193
- });
194
- */
195
-
196
- // special case for Android which sadly doesn't implement the canPlayType function (always returns '')
197
- if (mejs.PluginDetector.ua.match(/android 2\.[12]/) !== null) {
198
- HTMLMediaElement.canPlayType = function(type) {
199
- return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'probably' : '';
200
- };
201
- }
202
-
203
- // necessary detection (fixes for <IE9)
204
- mejs.MediaFeatures = {
205
- init: function() {
206
- var
207
- nav = mejs.PluginDetector.nav,
208
- ua = mejs.PluginDetector.ua.toLowerCase(),
209
- i,
210
- v,
211
- html5Elements = ['source','track','audio','video'];
212
-
213
- // detect browsers (only the ones that have some kind of quirk we need to work around)
214
- this.isiPad = (ua.match(/ipad/i) !== null);
215
- this.isiPhone = (ua.match(/iphone/i) !== null);
216
- this.isAndroid = (ua.match(/android/i) !== null);
217
- this.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1);
218
- this.isChrome = (ua.match(/chrome/gi) !== null);
219
-
220
- // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
221
- for (i=0; i<html5Elements.length; i++) {
222
- v = document.createElement(html5Elements[i]);
223
- }
224
-
225
- // detect native JavaScript fullscreen (Safari only, Chrome fails)
226
- this.hasNativeFullScreen = (typeof v.webkitEnterFullScreen !== 'undefined');
227
- if (this.isChrome) {
228
- this.hasNativeFullScreen = false;
229
- }
230
- // OS X 10.5 can't do this even if it says it can :(
231
- if (this.hasNativeFullScreen && ua.match(/mac os x 10_5/i)) {
232
- this.hasNativeFullScreen = false;
233
- }
234
- }
235
- };
236
- mejs.MediaFeatures.init();
237
-
238
-
239
- /*
240
- extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below)
241
- */
242
- mejs.HtmlMediaElement = {
243
- pluginType: 'native',
244
- isFullScreen: false,
245
-
246
- setCurrentTime: function (time) {
247
- this.currentTime = time;
248
- },
249
-
250
- setMuted: function (muted) {
251
- this.muted = muted;
252
- },
253
-
254
- setVolume: function (volume) {
255
- this.volume = volume;
256
- },
257
-
258
- // for parity with the plugin versions
259
- stop: function () {
260
- this.pause();
261
- },
262
-
263
- // This can be a url string
264
- // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
265
- setSrc: function (url) {
266
- if (typeof url == 'string') {
267
- this.src = url;
268
- } else {
269
- var i, media;
270
-
271
- for (i=0; i<url.length; i++) {
272
- media = url[i];
273
- if (this.canPlayType(media.type)) {
274
- this.src = media.src;
275
- }
276
- }
277
- }
278
- },
279
-
280
- setVideoSize: function (width, height) {
281
- this.width = width;
282
- this.height = height;
283
- }
284
- };
285
-
286
- /*
287
- Mimics the <video/audio> element by calling Flash's External Interface or Silverlights [ScriptableMember]
288
- */
289
- mejs.PluginMediaElement = function (pluginid, pluginType, mediaUrl) {
290
- this.id = pluginid;
291
- this.pluginType = pluginType;
292
- this.src = mediaUrl;
293
- this.events = {};
294
- };
295
-
296
- // JavaScript values and ExternalInterface methods that match HTML5 video properties methods
297
- // http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html
298
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
299
- mejs.PluginMediaElement.prototype = {
300
-
301
- // special
302
- pluginElement: null,
303
- pluginType: '',
304
- isFullScreen: false,
305
-
306
- // not implemented :(
307
- playbackRate: -1,
308
- defaultPlaybackRate: -1,
309
- seekable: [],
310
- played: [],
311
-
312
- // HTML5 read-only properties
313
- paused: true,
314
- ended: false,
315
- seeking: false,
316
- duration: 0,
317
- error: null,
318
-
319
- // HTML5 get/set properties, but only set (updated by event handlers)
320
- muted: false,
321
- volume: 1,
322
- currentTime: 0,
323
-
324
- // HTML5 methods
325
- play: function () {
326
- if (this.pluginApi != null) {
327
- this.pluginApi.playMedia();
328
- this.paused = false;
329
- }
330
- },
331
- load: function () {
332
- if (this.pluginApi != null) {
333
- this.pluginApi.loadMedia();
334
- this.paused = false;
335
- }
336
- },
337
- pause: function () {
338
- if (this.pluginApi != null) {
339
- this.pluginApi.pauseMedia();
340
- this.paused = true;
341
- }
342
- },
343
- stop: function () {
344
- if (this.pluginApi != null) {
345
- this.pluginApi.stopMedia();
346
- this.paused = true;
347
- }
348
- },
349
- canPlayType: function(type) {
350
- var i,
351
- j,
352
- pluginInfo,
353
- pluginVersions = mejs.plugins[this.pluginType];
354
-
355
- for (i=0; i<pluginVersions.length; i++) {
356
- pluginInfo = pluginVersions[i];
357
-
358
- // test if user has the correct plugin version
359
- if (mejs.PluginDetector.hasPluginVersion(this.pluginType, pluginInfo.version)) {
360
-
361
- // test for plugin playback types
362
- for (j=0; j<pluginInfo.types.length; j++) {
363
- // find plugin that can play the type
364
- if (type == pluginInfo.types[j]) {
365
- return true;
366
- }
367
- }
368
- }
369
- }
370
-
371
- return false;
372
- },
373
-
374
- // custom methods since not all JavaScript implementations support get/set
375
-
376
- // This can be a url string
377
- // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
378
- setSrc: function (url) {
379
- if (typeof url == 'string') {
380
- this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(url));
381
- this.src = mejs.Utility.absolutizeUrl(url);
382
- } else {
383
- var i, media;
384
-
385
- for (i=0; i<url.length; i++) {
386
- media = url[i];
387
- if (this.canPlayType(media.type)) {
388
- this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(media.src));
389
- this.src = mejs.Utility.absolutizeUrl(url);
390
- }
391
- }
392
- }
393
-
394
- },
395
- setCurrentTime: function (time) {
396
- if (this.pluginApi != null) {
397
- this.pluginApi.setCurrentTime(time);
398
- this.currentTime = time;
399
- }
400
- },
401
- setVolume: function (volume) {
402
- if (this.pluginApi != null) {
403
- this.pluginApi.setVolume(volume);
404
- this.volume = volume;
405
- }
406
- },
407
- setMuted: function (muted) {
408
- if (this.pluginApi != null) {
409
- this.pluginApi.setMuted(muted);
410
- this.muted = muted;
411
- }
412
- },
413
-
414
- // additional non-HTML5 methods
415
- setVideoSize: function (width, height) {
416
- if ( this.pluginElement.style) {
417
- this.pluginElement.style.width = width + 'px';
418
- this.pluginElement.style.height = height + 'px';
419
- }
420
- if (this.pluginApi != null) {
421
- this.pluginApi.setVideoSize(width, height);
422
- }
423
- },
424
-
425
- setFullscreen: function (fullscreen) {
426
- if (this.pluginApi != null) {
427
- this.pluginApi.setFullscreen(fullscreen);
428
- }
429
- },
430
-
431
- // start: fake events
432
- addEventListener: function (eventName, callback, bubble) {
433
- this.events[eventName] = this.events[eventName] || [];
434
- this.events[eventName].push(callback);
435
- },
436
- removeEventListener: function (eventName, callback) {
437
- if (!eventName) { this.events = {}; return true; }
438
- var callbacks = this.events[eventName];
439
- if (!callbacks) return true;
440
- if (!callback) { this.events[eventName] = []; return true; }
441
- for (i = 0; i < callbacks.length; i++) {
442
- if (callbacks[i] === callback) {
443
- this.events[eventName].splice(i, 1);
444
- return true;
445
- }
446
- }
447
- return false;
448
- },
449
- dispatchEvent: function (eventName) {
450
- var i,
451
- args,
452
- callbacks = this.events[eventName];
453
-
454
- if (callbacks) {
455
- args = Array.prototype.slice.call(arguments, 1);
456
- for (i = 0; i < callbacks.length; i++) {
457
- callbacks[i].apply(null, args);
458
- }
459
- }
460
- }
461
- // end: fake events
462
- };
463
-
464
-
465
- // Handles calls from Flash/Silverlight and reports them as native <video/audio> events and properties
466
- mejs.MediaPluginBridge = {
467
-
468
- pluginMediaElements:{},
469
- htmlMediaElements:{},
470
-
471
- registerPluginElement: function (id, pluginMediaElement, htmlMediaElement) {
472
- this.pluginMediaElements[id] = pluginMediaElement;
473
- this.htmlMediaElements[id] = htmlMediaElement;
474
- },
475
-
476
- // when Flash/Silverlight is ready, it calls out to this method
477
- initPlugin: function (id) {
478
-
479
- var pluginMediaElement = this.pluginMediaElements[id],
480
- htmlMediaElement = this.htmlMediaElements[id];
481
-
482
- // find the javascript bridge
483
- switch (pluginMediaElement.pluginType) {
484
- case "flash":
485
- pluginMediaElement.pluginElement = pluginMediaElement.pluginApi = document.getElementById(id);
486
- break;
487
- case "silverlight":
488
- pluginMediaElement.pluginElement = document.getElementById(pluginMediaElement.id);
489
- pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.MediaElementJS;
490
- break;
491
- }
492
-
493
- if (pluginMediaElement.pluginApi != null && pluginMediaElement.success) {
494
- pluginMediaElement.success(pluginMediaElement, htmlMediaElement);
495
- }
496
- },
497
-
498
- // receives events from Flash/Silverlight and sends them out as HTML5 media events
499
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
500
- fireEvent: function (id, eventName, values) {
501
-
502
- var
503
- e,
504
- i,
505
- bufferedTime,
506
- pluginMediaElement = this.pluginMediaElements[id];
507
-
508
- pluginMediaElement.ended = false;
509
- pluginMediaElement.paused = true;
510
-
511
- // fake event object to mimic real HTML media event.
512
- e = {
513
- type: eventName,
514
- target: pluginMediaElement
515
- };
516
-
517
- // attach all values to element and event object
518
- for (i in values) {
519
- pluginMediaElement[i] = values[i];
520
- e[i] = values[i];
521
- }
522
-
523
- // fake the newer W3C buffered TimeRange (loaded and total have been removed)
524
- bufferedTime = values.bufferedTime || 0;
525
-
526
- e.target.buffered = e.buffered = {
527
- start: function(index) {
528
- return 0;
529
- },
530
- end: function (index) {
531
- return bufferedTime;
532
- },
533
- length: 1
534
- };
535
-
536
- pluginMediaElement.dispatchEvent(e.type, e);
537
- }
538
- };
539
-
540
- /*
541
- Default options
542
- */
543
- mejs.MediaElementDefaults = {
544
- // allows testing on HTML5, flash, silverlight
545
- // auto: attempts to detect what the browser can do
546
- // native: forces HTML5 playback
547
- // shim: disallows HTML5, will attempt either Flash or Silverlight
548
- // none: forces fallback view
549
- mode: 'auto',
550
- // remove or reorder to change plugin priority and availability
551
- plugins: ['flash','silverlight'],
552
- // shows debug errors on screen
553
- enablePluginDebug: false,
554
- // overrides the type specified, useful for dynamic instantiation
555
- type: '',
556
- // path to Flash and Silverlight plugins
557
- pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js']),
558
- // name of flash file
559
- flashName: 'flashmediaelement.swf',
560
- // turns on the smoothing filter in Flash
561
- enablePluginSmoothing: false,
562
- // name of silverlight file
563
- silverlightName: 'silverlightmediaelement.xap',
564
- // default if the <video width> is not specified
565
- defaultVideoWidth: 480,
566
- // default if the <video height> is not specified
567
- defaultVideoHeight: 270,
568
- // overrides <video width>
569
- pluginWidth: -1,
570
- // overrides <video height>
571
- pluginHeight: -1,
572
- // rate in milliseconds for Flash and Silverlight to fire the timeupdate event
573
- // larger number is less accurate, but less strain on plugin->JavaScript bridge
574
- timerRate: 250,
575
- success: function () { },
576
- error: function () { }
577
- };
578
-
579
- /*
580
- Determines if a browser supports the <video> or <audio> element
581
- and returns either the native element or a Flash/Silverlight version that
582
- mimics HTML5 MediaElement
583
- */
584
- mejs.MediaElement = function (el, o) {
585
- return mejs.HtmlMediaElementShim.create(el,o);
586
- };
587
-
588
- mejs.HtmlMediaElementShim = {
589
-
590
- create: function(el, o) {
591
- var
592
- options = mejs.MediaElementDefaults,
593
- htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el,
594
- isVideo = (htmlMediaElement.tagName.toLowerCase() == 'video'),
595
- supportsMediaTag = (typeof(htmlMediaElement.canPlayType) != 'undefined'),
596
- playback = {method:'', url:''},
597
- poster = htmlMediaElement.getAttribute('poster'),
598
- autoplay = htmlMediaElement.getAttribute('autoplay'),
599
- preload = htmlMediaElement.getAttribute('preload'),
600
- controls = htmlMediaElement.getAttribute('controls'),
601
- prop;
602
-
603
- // extend options
604
- for (prop in o) {
605
- options[prop] = o[prop];
606
- }
607
-
608
- // check for real poster
609
- poster = (typeof poster == 'undefined' || poster === null) ? '' : poster;
610
- preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload;
611
- autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false');
612
- controls = !(typeof controls == 'undefined' || controls === null || controls === 'false');
613
-
614
- // test for HTML5 and plugin capabilities
615
- playback = this.determinePlayback(htmlMediaElement, options, isVideo, supportsMediaTag);
616
-
617
- if (playback.method == 'native') {
618
- // add methods to native HTMLMediaElement
619
- return this.updateNative( htmlMediaElement, options, autoplay, preload, playback);
620
- } else if (playback.method !== '') {
621
- // create plugin to mimic HTMLMediaElement
622
- return this.createPlugin( htmlMediaElement, options, isVideo, playback.method, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster, autoplay, preload, controls);
623
- } else {
624
- // boo, no HTML5, no Flash, no Silverlight.
625
- this.createErrorMessage( htmlMediaElement, options, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster );
626
- }
627
- },
628
-
629
- determinePlayback: function(htmlMediaElement, options, isVideo, supportsMediaTag) {
630
- var
631
- mediaFiles = [],
632
- i,
633
- j,
634
- k,
635
- l,
636
- n,
637
- type,
638
- result = { method: '', url: ''},
639
- src = htmlMediaElement.getAttribute('src'),
640
- pluginName,
641
- pluginVersions,
642
- pluginInfo;
643
-
644
- // STEP 1: Get URL and type from <video src> or <source src>
645
-
646
- // supplied type overrides all HTML
647
- if (typeof (options.type) != 'undefined' && options.type !== '') {
648
- mediaFiles.push({type:options.type, url:null});
649
-
650
- // test for src attribute first
651
- } else if (src != 'undefined' && src !== null) {
652
- type = this.checkType(src, htmlMediaElement.getAttribute('type'), isVideo);
653
- mediaFiles.push({type:type, url:src});
654
-
655
- // then test for <source> elements
656
- } else {
657
- // test <source> types to see if they are usable
658
- for (i = 0; i < htmlMediaElement.childNodes.length; i++) {
659
- n = htmlMediaElement.childNodes[i];
660
- if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') {
661
- src = n.getAttribute('src');
662
- type = this.checkType(src, n.getAttribute('type'), isVideo);
663
- mediaFiles.push({type:type, url:src});
664
- }
665
- }
666
- }
667
-
668
- // STEP 2: Test for playback method
669
-
670
- // test for native playback first
671
- if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'native')) {
672
- for (i=0; i<mediaFiles.length; i++) {
673
- // normal check
674
- if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== ''
675
- // special case for Mac/Safari 5.0.3 which answers '' to canPlayType('audio/mp3') but 'maybe' to canPlayType('audio/mpeg')
676
- || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '') {
677
- result.method = 'native';
678
- result.url = mediaFiles[i].url;
679
- return result;
680
- }
681
- }
682
- }
683
-
684
- // if native playback didn't work, then test plugins
685
- if (options.mode === 'auto' || options.mode === 'shim') {
686
- for (i=0; i<mediaFiles.length; i++) {
687
- type = mediaFiles[i].type;
688
-
689
- // test all plugins in order of preference [silverlight, flash]
690
- for (j=0; j<options.plugins.length; j++) {
691
-
692
- pluginName = options.plugins[j];
693
-
694
- // test version of plugin (for future features)
695
- pluginVersions = mejs.plugins[pluginName];
696
- for (k=0; k<pluginVersions.length; k++) {
697
- pluginInfo = pluginVersions[k];
698
-
699
- // test if user has the correct plugin version
700
- if (mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) {
701
-
702
- // test for plugin playback types
703
- for (l=0; l<pluginInfo.types.length; l++) {
704
- // find plugin that can play the type
705
- if (type == pluginInfo.types[l]) {
706
- result.method = pluginName;
707
- result.url = mediaFiles[i].url;
708
- return result;
709
- }
710
- }
711
- }
712
- }
713
- }
714
- }
715
- }
716
-
717
- // what if there's nothing to play? just grab the first available
718
- if (result.method === '') {
719
- result.url = mediaFiles[0].url;
720
- }
721
-
722
- return result;
723
- },
724
-
725
- checkType: function(url, type, isVideo) {
726
- var ext;
727
-
728
- // if no type is supplied, fake it with the extension
729
- if (url && !type) {
730
- ext = url.substring(url.lastIndexOf('.') + 1);
731
- return ((isVideo) ? 'video' : 'audio') + '/' + ext;
732
- } else {
733
- // only return the mime part of the type in case the attribute contains the codec
734
- // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element
735
- // `video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4`
736
-
737
- if (type && ~type.indexOf(';')) {
738
- return type.substr(0, type.indexOf(';'));
739
- } else {
740
- return type;
741
- }
742
- }
743
- },
744
-
745
- createErrorMessage: function(htmlMediaElement, options, downloadUrl, poster) {
746
- var errorContainer = document.createElement('div');
747
- errorContainer.className = 'me-cannotplay';
748
-
749
- try {
750
- errorContainer.style.width = htmlMediaElement.width + 'px';
751
- errorContainer.style.height = htmlMediaElement.height + 'px';
752
- } catch (e) {}
753
-
754
- errorContainer.innerHTML = (poster !== '') ?
755
- '<a href="' + downloadUrl + '"><img src="' + poster + '" /></a>' :
756
- '<a href="' + downloadUrl + '"><span>Download File</span></a>';
757
-
758
- htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
759
- htmlMediaElement.style.display = 'none';
760
-
761
- options.error(htmlMediaElement);
762
- },
763
-
764
- createPlugin:function(htmlMediaElement, options, isVideo, pluginType, mediaUrl, poster, autoplay, preload, controls) {
765
- var width = 1,
766
- height = 1,
767
- pluginid = 'me_' + pluginType + '_' + (mejs.meIndex++),
768
- pluginMediaElement = new mejs.PluginMediaElement(pluginid, pluginType, mediaUrl),
769
- container = document.createElement('div'),
770
- specialIEContainer,
771
- node,
772
- initVars;
773
-
774
- // check for placement inside a <p> tag (sometimes WYSIWYG editors do this)
775
- node = htmlMediaElement.parentNode;
776
- while (node !== null && node.tagName.toLowerCase() != 'body') {
777
- if (node.parentNode.tagName.toLowerCase() == 'p') {
778
- node.parentNode.parentNode.insertBefore(node, node.parentNode);
779
- break;
780
- }
781
- node = node.parentNode;
782
- }
783
-
784
- if (isVideo) {
785
- width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth;
786
- height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight;
787
- } else {
788
- if (options.enablePluginDebug) {
789
- width = 320;
790
- height = 240;
791
- }
792
- }
793
-
794
- // register plugin
795
- pluginMediaElement.success = options.success;
796
- mejs.MediaPluginBridge.registerPluginElement(pluginid, pluginMediaElement, htmlMediaElement);
797
-
798
- // add container (must be added to DOM before inserting HTML for IE)
799
- container.className = 'me-plugin';
800
- htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement);
801
-
802
- // flash/silverlight vars
803
- initVars = [
804
- 'id=' + pluginid,
805
- 'isvideo=' + ((isVideo) ? "true" : "false"),
806
- 'autoplay=' + ((autoplay) ? "true" : "false"),
807
- 'preload=' + preload,
808
- 'width=' + width,
809
- 'startvolume=' + options.startVolume,
810
- 'timerrate=' + options.timerRate,
811
- 'height=' + height];
812
-
813
- if (mediaUrl !== null) {
814
- if (pluginType == 'flash') {
815
- initVars.push('file=' + mejs.Utility.encodeUrl(mediaUrl));
816
- } else {
817
- initVars.push('file=' + mediaUrl);
818
- }
819
- }
820
- if (options.enablePluginDebug) {
821
- initVars.push('debug=true');
822
- }
823
- if (options.enablePluginSmoothing) {
824
- initVars.push('smoothing=true');
825
- }
826
- if (controls) {
827
- initVars.push('controls=true'); // shows controls in the plugin if desired
828
- }
829
-
830
- switch (pluginType) {
831
- case 'silverlight':
832
- container.innerHTML =
833
- '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' +
834
- '<param name="initParams" value="' + initVars.join(',') + '" />' +
835
- '<param name="windowless" value="true" />' +
836
- '<param name="background" value="black" />' +
837
- '<param name="minRuntimeVersion" value="3.0.0.0" />' +
838
- '<param name="autoUpgrade" value="true" />' +
839
- '<param name="source" value="' + options.pluginPath + options.silverlightName + '" />' +
840
- '</object>';
841
- break;
842
-
843
- case 'flash':
844
-
845
- if (mejs.MediaFeatures.isIE) {
846
- specialIEContainer = document.createElement('div');
847
- container.appendChild(specialIEContainer);
848
- specialIEContainer.outerHTML =
849
- '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
850
- 'id="' + pluginid + '" width="' + width + '" height="' + height + '">' +
851
- '<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' +
852
- '<param name="flashvars" value="' + initVars.join('&amp;') + '" />' +
853
- '<param name="quality" value="high" />' +
854
- '<param name="bgcolor" value="#000000" />' +
855
- '<param name="wmode" value="transparent" />' +
856
- '<param name="allowScriptAccess" value="always" />' +
857
- '<param name="allowFullScreen" value="true" />' +
858
- '</object>';
859
-
860
- } else {
861
-
862
- container.innerHTML =
863
- '<embed id="' + pluginid + '" name="' + pluginid + '" ' +
864
- 'play="true" ' +
865
- 'loop="false" ' +
866
- 'quality="high" ' +
867
- 'bgcolor="#000000" ' +
868
- 'wmode="transparent" ' +
869
- 'allowScriptAccess="always" ' +
870
- 'allowFullScreen="true" ' +
871
- 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ' +
872
- 'src="' + options.pluginPath + options.flashName + '" ' +
873
- 'flashvars="' + initVars.join('&') + '" ' +
874
- 'width="' + width + '" ' +
875
- 'height="' + height + '"></embed>';
876
- }
877
- break;
878
- }
879
- // hide original element
880
- htmlMediaElement.style.display = 'none';
881
-
882
- // FYI: options.success will be fired by the MediaPluginBridge
883
-
884
- return pluginMediaElement;
885
- },
886
-
887
- updateNative: function(htmlMediaElement, options, autoplay, preload, playback) {
888
- // add methods to video object to bring it into parity with Flash Object
889
- for (var m in mejs.HtmlMediaElement) {
890
- htmlMediaElement[m] = mejs.HtmlMediaElement[m];
891
- }
892
-
893
-
894
- if (mejs.MediaFeatures.isChrome) {
895
-
896
- // special case to enforce preload attribute (Chrome doesn't respect this)
897
- if (preload === 'none' && !autoplay) {
898
-
899
- // forces the browser to stop loading (note: fails in IE9)
900
- htmlMediaElement.src = '';
901
- htmlMediaElement.load();
902
- htmlMediaElement.canceledPreload = true;
903
-
904
- htmlMediaElement.addEventListener('play',function() {
905
- if (htmlMediaElement.canceledPreload) {
906
- htmlMediaElement.src = playback.url;
907
- htmlMediaElement.load();
908
- htmlMediaElement.play();
909
- htmlMediaElement.canceledPreload = false;
910
- }
911
- }, false);
912
- // for some reason Chrome forgets how to autoplay sometimes.
913
- } else if (autoplay) {
914
- htmlMediaElement.load();
915
- htmlMediaElement.play();
916
- }
917
- }
918
-
919
- // fire success code
920
- options.success(htmlMediaElement, htmlMediaElement);
921
-
922
- return htmlMediaElement;
923
- }
924
- };
925
-
926
- window.mejs = mejs;
927
- window.MediaElement = mejs.MediaElement;
928
-
929
- /*!
930
- * MediaElementPlayer
931
- * http://mediaelementjs.com/
932
- *
933
- * Creates a controller bar for HTML5 <video> add <audio> tags
934
- * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
935
- *
936
- * Copyright 2010, John Dyer (http://johndyer.me)
937
- * Dual licensed under the MIT or GPL Version 2 licenses.
938
- *
939
- */
940
- (function ($) {
941
-
942
- // default player values
943
- mejs.MepDefaults = {
944
- // url to poster (to fix iOS 3.x)
945
- poster: '',
946
- // default if the <video width> is not specified
947
- defaultVideoWidth: 480,
948
- // default if the <video height> is not specified
949
- defaultVideoHeight: 270,
950
- // if set, overrides <video width>
951
- videoWidth: -1,
952
- // if set, overrides <video height>
953
- videoHeight: -1,
954
- // width of audio player
955
- audioWidth: 400,
956
- // height of audio player
957
- audioHeight: 30,
958
- // initial volume when the player starts (overrided by user cookie)
959
- startVolume: 0.8,
960
- // useful for <audio> player loops
961
- loop: false,
962
- // resize to media dimensions
963
- enableAutosize: true,
964
- // forces the hour marker (##:00:00)
965
- alwaysShowHours: false,
966
- // features to show
967
- features: ['playpause','current','progress','duration','tracks','volume','fullscreen']
968
- };
969
-
970
- mejs.mepIndex = 0;
971
-
972
- // wraps a MediaElement object in player controls
973
- mejs.MediaElementPlayer = function($node, o) {
974
- // enforce object, even without "new" (via John Resig)
975
- if ( !(this instanceof mejs.MediaElementPlayer) ) {
976
- return new mejs.MediaElementPlayer($node, o);
977
- }
978
-
979
- var
980
- t = this,
981
- mf = mejs.MediaFeatures;
982
-
983
- // create options
984
- t.options = $.extend({},mejs.MepDefaults,o);
985
- t.$media = t.$node = $($node);
986
-
987
- // these will be reset after the MediaElement.success fires
988
- t.node = t.media = t.$media[0];
989
-
990
- // check for existing player
991
- if (typeof t.node.player != 'undefined') {
992
- return t.node.player;
993
- } else {
994
- // attach player to DOM node for reference
995
- t.node.player = t;
996
- }
997
-
998
- t.isVideo = (t.media.tagName.toLowerCase() === 'video');
999
-
1000
- /* FUTURE WORK = create player without existing <video> or <audio> node
1001
-
1002
- // if not a video or audio tag, then we'll dynamically create it
1003
- if (tagName == 'video' || tagName == 'audio') {
1004
- t.$media = $($node);
1005
- } else if (o.tagName !== '' && o.src !== '') {
1006
- // create a new node
1007
- if (o.mode == 'auto' || o.mode == 'native') {
1008
-
1009
- $media = $(o.tagName);
1010
- if (typeof o.src == 'string') {
1011
- $media.attr('src',o.src);
1012
- } else if (typeof o.src == 'object') {
1013
- // create source nodes
1014
- for (var x in o.src) {
1015
- $media.append($('<source src="' + o.src[x].src + '" type="' + o.src[x].type + '" />'));
1016
- }
1017
- }
1018
- if (o.type != '') {
1019
- $media.attr('type',o.type);
1020
- }
1021
- if (o.poster != '') {
1022
- $media.attr('poster',o.poster);
1023
- }
1024
- if (o.videoWidth > 0) {
1025
- $media.attr('width',o.videoWidth);
1026
- }
1027
- if (o.videoHeight > 0) {
1028
- $media.attr('height',o.videoHeight);
1029
- }
1030
-
1031
- $node.clear();
1032
- $node.append($media);
1033
- t.$media = $media;
1034
- } else if (o.mode == 'shim') {
1035
- $media = $();
1036
- // doesn't want a media node
1037
- // let MediaElement object handle this
1038
- }
1039
- } else {
1040
- // fail?
1041
- return;
1042
- }
1043
- */
1044
-
1045
- t.init();
1046
-
1047
- return t;
1048
- };
1049
-
1050
- // actual player
1051
- mejs.MediaElementPlayer.prototype = {
1052
- init: function() {
1053
-
1054
- var
1055
- t = this,
1056
- mf = mejs.MediaFeatures,
1057
- // options for MediaElement (shim)
1058
- meOptions = $.extend(true, {}, t.options, {
1059
- success: function(media, domNode) { t.meReady(media, domNode); },
1060
- error: function(e) { t.handleError(e);}
1061
- });
1062
-
1063
-
1064
- // use native controls in iPad, iPhone, and Android
1065
- if (mf.isiPad || mf.isiPhone) {
1066
- // add controls and stop
1067
- t.$media.attr('controls', 'controls');
1068
-
1069
- // fix iOS 3 bug
1070
- t.$media.removeAttr('poster');
1071
-
1072
- // override Apple's autoplay override for iPads
1073
- if (mf.isiPad && t.media.getAttribute('autoplay') !== null) {
1074
- t.media.load();
1075
- t.media.play();
1076
- }
1077
-
1078
- } else if (mf.isAndroid) {
1079
-
1080
- if (t.isVideo) {
1081
- // Android fails when there are multiple source elements and the type is specified
1082
- // <video>
1083
- // <source src="file.mp4" type="video/mp4" />
1084
- // <source src="file.webm" type="video/webm" />
1085
- // </video>
1086
- if (t.$media.find('source').length > 0) {
1087
- // find an mp4 and make it the root element source
1088
- t.media.src = t.$media.find('source[src$="mp4"]').attr('src');
1089
- }
1090
-
1091
- // attach a click event to the video and hope Android can play it
1092
- t.$media.click(function() {
1093
- t.media.play();
1094
- });
1095
-
1096
- } else {
1097
- // audio?
1098
- // 2.1 = no support
1099
- // 2.2 = Flash support
1100
- // 2.3 = Native HTML5
1101
- }
1102
-
1103
- } else {
1104
-
1105
- // DESKTOP: use MediaElementPlayer controls
1106
-
1107
- // remove native controls
1108
- t.$media.removeAttr('controls');
1109
-
1110
- // unique ID
1111
- t.id = 'mep_' + mejs.mepIndex++;
1112
-
1113
- // build container
1114
- t.container =
1115
- $('<div id="' + t.id + '" class="mejs-container">'+
1116
- '<div class="mejs-inner">'+
1117
- '<div class="mejs-mediaelement"></div>'+
1118
- '<div class="mejs-layers"></div>'+
1119
- '<div class="mejs-controls"></div>'+
1120
- '<div class="mejs-clear"></div>'+
1121
- '</div>' +
1122
- '</div>')
1123
- .addClass(t.$media[0].className)
1124
- .insertBefore(t.$media);
1125
-
1126
- // move the <video/video> tag into the right spot
1127
- t.container.find('.mejs-mediaelement').append(t.$media);
1128
-
1129
- // find parts
1130
- t.controls = t.container.find('.mejs-controls');
1131
- t.layers = t.container.find('.mejs-layers');
1132
-
1133
- // determine the size
1134
- if (t.isVideo) {
1135
- // priority = videoWidth (forced), width attribute, defaultVideoWidth
1136
- t.width = (t.options.videoWidth > 0) ? t.options.videoWidth : (t.$media[0].getAttribute('width') !== null) ? t.$media.attr('width') : t.options.defaultVideoWidth;
1137
- t.height = (t.options.videoHeight > 0) ? t.options.videoHeight : (t.$media[0].getAttribute('height') !== null) ? t.$media.attr('height') : t.options.defaultVideoHeight;
1138
- } else {
1139
- t.width = t.options.audioWidth;
1140
- t.height = t.options.audioHeight;
1141
- }
1142
-
1143
- // set the size, while we wait for the plugins to load below
1144
- t.setPlayerSize(t.width, t.height);
1145
-
1146
- // create MediaElementShim
1147
- meOptions.pluginWidth = t.height;
1148
- meOptions.pluginHeight = t.width;
1149
- }
1150
-
1151
- // create MediaElement shim
1152
- mejs.MediaElement(t.$media[0], meOptions);
1153
- },
1154
-
1155
- // Sets up all controls and events
1156
- meReady: function(media, domNode) {
1157
-
1158
-
1159
- var t = this,
1160
- mf = mejs.MediaFeatures,
1161
- f,
1162
- feature;
1163
-
1164
- // make sure it can't create itself again if a plugin reloads
1165
- if (this.created)
1166
- return;
1167
- else
1168
- this.created = true;
1169
-
1170
- t.media = media;
1171
- t.domNode = domNode;
1172
-
1173
- if (!mf.isiPhone && !mf.isAndroid && !mf.isiPad) {
1174
-
1175
-
1176
- // two built in features
1177
- t.buildposter(t, t.controls, t.layers, t.media);
1178
- t.buildoverlays(t, t.controls, t.layers, t.media);
1179
-
1180
- // grab for use by feautres
1181
- t.findTracks();
1182
-
1183
- // add user-defined features/controls
1184
- for (f in t.options.features) {
1185
- feature = t.options.features[f];
1186
- if (t['build' + feature]) {
1187
- try {
1188
- t['build' + feature](t, t.controls, t.layers, t.media);
1189
- } catch (e) {
1190
- // TODO: report control error
1191
- //throw e;
1192
- }
1193
- }
1194
- }
1195
-
1196
- // reset all layers and controls
1197
- t.setPlayerSize(t.width, t.height);
1198
- t.setControlsSize();
1199
-
1200
- // controls fade
1201
- if (t.isVideo) {
1202
- // show/hide controls
1203
- t.container
1204
- .bind('mouseenter', function () {
1205
- t.controls.css('visibility','visible');
1206
- t.controls.stop(true, true).fadeIn(200);
1207
- })
1208
- .bind('mouseleave', function () {
1209
- if (!t.media.paused) {
1210
- t.controls.stop(true, true).fadeOut(200, function() {
1211
- $(this).css('visibility','hidden');
1212
- $(this).css('display','block');
1213
- });
1214
- }
1215
- });
1216
-
1217
- // check for autoplay
1218
- if (t.domNode.getAttribute('autoplay') !== null) {
1219
- t.controls.css('visibility','hidden');
1220
- }
1221
-
1222
- // resizer
1223
- if (t.options.enableAutosize) {
1224
- t.media.addEventListener('loadedmetadata', function(e) {
1225
- // if the <video height> was not set and the options.videoHeight was not set
1226
- // then resize to the real dimensions
1227
- if (t.options.videoHeight <= 0 && t.domNode.getAttribute('height') === null && !isNaN(e.target.videoHeight)) {
1228
- t.setPlayerSize(e.target.videoWidth, e.target.videoHeight);
1229
- t.setControlsSize();
1230
- t.media.setVideoSize(e.target.videoWidth, e.target.videoHeight);
1231
- }
1232
- }, false);
1233
- }
1234
- }
1235
-
1236
- // ended for all
1237
- t.media.addEventListener('ended', function (e) {
1238
- t.media.setCurrentTime(0);
1239
- t.media.pause();
1240
-
1241
- if (t.setProgressRail)
1242
- t.setProgressRail();
1243
- if (t.setCurrentRail)
1244
- t.setCurrentRail();
1245
-
1246
- if (t.options.loop) {
1247
- t.media.play();
1248
- } else {
1249
- t.controls.css('visibility','visible');
1250
- }
1251
- }, true);
1252
-
1253
- // resize on the first play
1254
- t.media.addEventListener('loadedmetadata', function(e) {
1255
- if (t.updateDuration) {
1256
- t.updateDuration();
1257
- }
1258
- if (t.updateCurrent) {
1259
- t.updateCurrent();
1260
- }
1261
-
1262
- t.setControlsSize();
1263
- }, true);
1264
-
1265
-
1266
- // webkit has trouble doing this without a delay
1267
- setTimeout(function () {
1268
- t.setControlsSize();
1269
- t.setPlayerSize(t.width, t.height);
1270
- }, 50);
1271
-
1272
- }
1273
-
1274
-
1275
- if (t.options.success) {
1276
- t.options.success(t.media, t.domNode);
1277
- }
1278
- },
1279
-
1280
- handleError: function(e) {
1281
- // Tell user that the file cannot be played
1282
- if (this.options.error) {
1283
- this.options.error(e);
1284
- }
1285
- },
1286
-
1287
- setPlayerSize: function(width,height) {
1288
- var t = this;
1289
-
1290
- // ie9 appears to need this (jQuery bug?)
1291
- t.width = parseInt(width, 10);
1292
- t.height = parseInt(height, 10);
1293
-
1294
- t.container
1295
- .width(t.width)
1296
- .height(t.height);
1297
-
1298
- t.layers.children('.mejs-layer')
1299
- .width(t.width)
1300
- .height(t.height);
1301
- },
1302
-
1303
- setControlsSize: function() {
1304
- var t = this,
1305
- usedWidth = 0,
1306
- railWidth = 0,
1307
- rail = t.controls.find('.mejs-time-rail'),
1308
- total = t.controls.find('.mejs-time-total'),
1309
- current = t.controls.find('.mejs-time-current'),
1310
- loaded = t.controls.find('.mejs-time-loaded');
1311
- others = rail.siblings();
1312
-
1313
- // find the size of all the other controls besides the rail
1314
- others.each(function() {
1315
- if ($(this).css('position') != 'absolute') {
1316
- usedWidth += $(this).outerWidth(true);
1317
- }
1318
- });
1319
- // fit the rail into the remaining space
1320
- railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.outerWidth(false));
1321
-
1322
- // outer area
1323
- rail.width(railWidth);
1324
- // dark space
1325
- total.width(railWidth - (total.outerWidth(true) - total.width()));
1326
-
1327
- if (t.setProgressRail)
1328
- t.setProgressRail();
1329
- if (t.setCurrentRail)
1330
- t.setCurrentRail();
1331
- },
1332
-
1333
-
1334
- buildposter: function(player, controls, layers, media) {
1335
- var poster =
1336
- $('<div class="mejs-poster mejs-layer">'+
1337
- '<img />'+
1338
- '</div>')
1339
- .appendTo(layers),
1340
- posterUrl = player.$media.attr('poster'),
1341
- posterImg = poster.find('img').width(player.width).height(player.height);
1342
-
1343
- // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
1344
- if (player.options.poster != '') {
1345
- posterImg.attr('src',player.options.poster);
1346
- // second, try the real poster
1347
- } else if (posterUrl !== '' && posterUrl != null) {
1348
- posterImg.attr('src',posterUrl);
1349
- } else {
1350
- poster.remove();
1351
- }
1352
-
1353
- media.addEventListener('play',function() {
1354
- poster.hide();
1355
- }, false);
1356
- },
1357
-
1358
- buildoverlays: function(player, controls, layers, media) {
1359
- if (!player.isVideo)
1360
- return;
1361
-
1362
- var
1363
- loading =
1364
- $('<div class="mejs-overlay mejs-layer">'+
1365
- '<div class="mejs-overlay-loading"><span></span></div>'+
1366
- '</div>')
1367
- .hide() // start out hidden
1368
- .appendTo(layers),
1369
- error =
1370
- $('<div class="mejs-overlay mejs-layer">'+
1371
- '<div class="mejs-overlay-error"></div>'+
1372
- '</div>')
1373
- .hide() // start out hidden
1374
- .appendTo(layers),
1375
-
1376
- // this needs to come last so it's on top
1377
- bigPlay =
1378
- $('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+
1379
- '<div class="mejs-overlay-button"></div>'+
1380
- '</div>')
1381
- .appendTo(layers)
1382
- .click(function() {
1383
- if (media.paused) {
1384
- media.play();
1385
- } else {
1386
- media.pause();
1387
- }
1388
- });
1389
-
1390
-
1391
- // show/hide big play button
1392
- media.addEventListener('play',function() {
1393
- bigPlay.hide();
1394
- error.hide();
1395
- }, false);
1396
- media.addEventListener('pause',function() {
1397
- bigPlay.show();
1398
- }, false);
1399
-
1400
- // show/hide loading
1401
- media.addEventListener('loadstart',function() {
1402
- loading.show();
1403
- }, false);
1404
- media.addEventListener('canplay',function() {
1405
- loading.hide();
1406
- }, false);
1407
-
1408
- // error handling
1409
- media.addEventListener('error',function() {
1410
- loading.hide();
1411
- error.show();
1412
- error.find('mejs-overlay-error').html("Error loading this resource");
1413
- }, false);
1414
- },
1415
-
1416
- findTracks: function() {
1417
- var t = this,
1418
- tracktags = t.$media.find('track');
1419
-
1420
- // store for use by plugins
1421
- t.tracks = [];
1422
- tracktags.each(function() {
1423
- t.tracks.push({
1424
- srclang: $(this).attr('srclang').toLowerCase(),
1425
- src: $(this).attr('src'),
1426
- kind: $(this).attr('kind'),
1427
- entries: [],
1428
- isLoaded: false
1429
- });
1430
- });
1431
- },
1432
- changeSkin: function(className) {
1433
- this.container[0].className = 'mejs-container ' + className;
1434
- this.setPlayerSize();
1435
- this.setControlsSize();
1436
- },
1437
- play: function() {
1438
- this.media.play();
1439
- },
1440
- pause: function() {
1441
- this.media.pause();
1442
- },
1443
- load: function() {
1444
- this.media.load();
1445
- },
1446
- setMuted: function(muted) {
1447
- this.media.setMuted(muted);
1448
- },
1449
- setCurrentTime: function(time) {
1450
- this.media.setCurrentTime(time);
1451
- },
1452
- getCurrentTime: function() {
1453
- return this.media.currentTime;
1454
- },
1455
- setVolume: function(volume) {
1456
- this.media.setVolume(volume);
1457
- },
1458
- getVolume: function() {
1459
- return this.media.volume;
1460
- },
1461
- setSrc: function(src) {
1462
- this.media.setSrc(src);
1463
- }
1464
- };
1465
-
1466
- // turn into jQuery plugin
1467
- jQuery.fn.mediaelementplayer = function (options) {
1468
- return this.each(function () {
1469
- new mejs.MediaElementPlayer($(this), options);
1470
- });
1471
- };
1472
-
1473
- // push out to window
1474
- window.MediaElementPlayer = mejs.MediaElementPlayer;
1475
-
1476
- })(jQuery);
1477
-
1478
- (function($) {
1479
- // PLAY/pause BUTTON
1480
- MediaElementPlayer.prototype.buildplaypause = function(player, controls, layers, media) {
1481
- var play =
1482
- $('<div class="mejs-button mejs-playpause-button mejs-play">' +
1483
- '<span></span>' +
1484
- '</div>')
1485
- .appendTo(controls)
1486
- .click(function() {
1487
- if (media.paused) {
1488
- media.play();
1489
- } else {
1490
- media.pause();
1491
- }
1492
- });
1493
-
1494
- media.addEventListener('play',function() {
1495
- play.removeClass('mejs-play').addClass('mejs-pause');
1496
- }, false);
1497
- media.addEventListener('playing',function() {
1498
- play.removeClass('mejs-play').addClass('mejs-pause');
1499
- }, false);
1500
-
1501
-
1502
- media.addEventListener('pause',function() {
1503
- play.removeClass('mejs-pause').addClass('mejs-play');
1504
- }, false);
1505
- media.addEventListener('paused',function() {
1506
- play.removeClass('mejs-pause').addClass('mejs-play');
1507
- }, false);
1508
-
1509
-
1510
-
1511
- }
1512
- })(jQuery);
1513
- (function($) {
1514
- // STOP BUTTON
1515
- MediaElementPlayer.prototype.buildstop = function(player, controls, layers, media) {
1516
- var stop =
1517
- $('<div class="mejs-button mejs-stop-button mejs-stop">' +
1518
- '<span></span>' +
1519
- '</div>')
1520
- .appendTo(controls)
1521
- .click(function() {
1522
- if (!media.paused) {
1523
- media.pause();
1524
- }
1525
- if (media.currentTime > 0) {
1526
- media.setCurrentTime(0);
1527
- controls.find('.mejs-time-current').width('0px');
1528
- controls.find('.mejs-time-handle').css('left', '0px');
1529
- controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
1530
- controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
1531
- layers.find('.mejs-poster').show();
1532
- }
1533
- });
1534
- }
1535
- })(jQuery);
1536
- (function($) {
1537
- // progress/loaded bar
1538
- MediaElementPlayer.prototype.buildprogress = function(player, controls, layers, media) {
1539
-
1540
- $('<div class="mejs-time-rail">'+
1541
- '<span class="mejs-time-total">'+
1542
- '<span class="mejs-time-loaded"></span>'+
1543
- '<span class="mejs-time-current"></span>'+
1544
- '<span class="mejs-time-handle"></span>'+
1545
- '<span class="mejs-time-float">' +
1546
- '<span class="mejs-time-float-current">00:00</span>' +
1547
- '<span class="mejs-time-float-corner"></span>' +
1548
- '</span>'+
1549
- '</span>'+
1550
- '</div>')
1551
- .appendTo(controls);
1552
-
1553
- var
1554
- t = this,
1555
- total = controls.find('.mejs-time-total'),
1556
- loaded = controls.find('.mejs-time-loaded'),
1557
- current = controls.find('.mejs-time-current'),
1558
- handle = controls.find('.mejs-time-handle'),
1559
- timefloat = controls.find('.mejs-time-float'),
1560
- timefloatcurrent = controls.find('.mejs-time-float-current'),
1561
- handleMouseMove = function (e) {
1562
- // mouse position relative to the object
1563
- var x = e.pageX,
1564
- offset = total.offset(),
1565
- width = total.outerWidth(),
1566
- percentage = 0,
1567
- newTime = 0;
1568
-
1569
-
1570
- if (x > offset.left && x <= width + offset.left && media.duration) {
1571
- percentage = ((x - offset.left) / width);
1572
- newTime = (percentage <= 0.02) ? 0 : percentage * media.duration;
1573
-
1574
- // seek to where the mouse is
1575
- if (mouseIsDown) {
1576
- media.setCurrentTime(newTime);
1577
- }
1578
-
1579
- // position floating time box
1580
- var pos = x - offset.left;
1581
- timefloat.css('left', pos);
1582
- timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime) );
1583
- }
1584
- },
1585
- mouseIsDown = false,
1586
- mouseIsOver = false;
1587
-
1588
- // handle clicks
1589
- //controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove);
1590
- total
1591
- .bind('mousedown', function (e) {
1592
- mouseIsDown = true;
1593
- handleMouseMove(e);
1594
- return false;
1595
- });
1596
-
1597
- controls.find('.mejs-time-rail')
1598
- .bind('mouseenter', function(e) {
1599
- mouseIsOver = true;
1600
- })
1601
- .bind('mouseleave',function(e) {
1602
- mouseIsOver = false;
1603
- });
1604
-
1605
- $(document)
1606
- .bind('mouseup', function (e) {
1607
- mouseIsDown = false;
1608
- //handleMouseMove(e);
1609
- })
1610
- .bind('mousemove', function (e) {
1611
- if (mouseIsDown || mouseIsOver) {
1612
- handleMouseMove(e);
1613
- }
1614
- });
1615
-
1616
- // loading
1617
- media.addEventListener('progress', function (e) {
1618
- player.setProgressRail(e);
1619
- player.setCurrentRail(e);
1620
- }, false);
1621
-
1622
- // current time
1623
- media.addEventListener('timeupdate', function(e) {
1624
- player.setProgressRail(e);
1625
- player.setCurrentRail(e);
1626
- }, false);
1627
-
1628
-
1629
- // store for later use
1630
- t.loaded = loaded;
1631
- t.total = total;
1632
- t.current = current;
1633
- t.handle = handle;
1634
- }
1635
- MediaElementPlayer.prototype.setProgressRail = function(e) {
1636
-
1637
- var
1638
- t = this,
1639
- target = (e != undefined) ? e.target : t.media,
1640
- percent = null;
1641
-
1642
- // newest HTML5 spec has buffered array (FF4, Webkit)
1643
- if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
1644
- // TODO: account for a real array with multiple values (only Firefox 4 has this so far)
1645
- percent = target.buffered.end(0) / target.duration;
1646
- }
1647
- // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
1648
- // to be anything other than 0. If the byte count is available we use this instead.
1649
- // Browsers that support the else if do not seem to have the bufferedBytes value and
1650
- // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
1651
- else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
1652
- percent = target.bufferedBytes / target.bytesTotal;
1653
- }
1654
- // Firefox 3 with an Ogg file seems to go this way
1655
- else if (e && e.lengthComputable && e.total != 0) {
1656
- percent = e.loaded/e.total;
1657
- }
1658
-
1659
- // finally update the progress bar
1660
- if (percent !== null) {
1661
- percent = Math.min(1, Math.max(0, percent));
1662
- // update loaded bar
1663
- t.loaded.width(t.total.width() * percent);
1664
- }
1665
- }
1666
- MediaElementPlayer.prototype.setCurrentRail = function() {
1667
-
1668
- var t = this;
1669
-
1670
- if (t.media.currentTime != undefined && t.media.duration) {
1671
-
1672
- // update bar and handle
1673
- var
1674
- newWidth = t.total.width() * t.media.currentTime / t.media.duration,
1675
- handlePos = newWidth - (t.handle.outerWidth(true) / 2);
1676
-
1677
- t.current.width(newWidth);
1678
- t.handle.css('left', handlePos);
1679
- }
1680
-
1681
- }
1682
-
1683
- })(jQuery);
1684
- (function($) {
1685
- // current and duration 00:00 / 00:00
1686
- MediaElementPlayer.prototype.buildcurrent = function(player, controls, layers, media) {
1687
- var t = this;
1688
-
1689
- $('<div class="mejs-time">'+
1690
- '<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>'+
1691
- '</div>')
1692
- .appendTo(controls);
1693
-
1694
- t.currenttime = t.controls.find('.mejs-currenttime');
1695
-
1696
- media.addEventListener('timeupdate',function() {
1697
- player.updateCurrent();
1698
- }, false);
1699
- };
1700
-
1701
- MediaElementPlayer.prototype.buildduration = function(player, controls, layers, media) {
1702
- var t = this;
1703
-
1704
- if (controls.children().last().find('.mejs-currenttime').length > 0) {
1705
- $(' <span> | </span> '+
1706
- '<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>')
1707
- .appendTo(controls.find('.mejs-time'));
1708
- } else {
1709
-
1710
- $('<div class="mejs-time">'+
1711
- '<span class="mejs-duration">' + (player.options.alwaysShowHours ? '00:' : '') + '00:00</span>'+
1712
- '</div>')
1713
- .appendTo(controls);
1714
- }
1715
-
1716
- t.durationD = t.controls.find('.mejs-duration');
1717
-
1718
- media.addEventListener('timeupdate',function() {
1719
- player.updateDuration();
1720
- }, false);
1721
- };
1722
-
1723
- MediaElementPlayer.prototype.updateCurrent = function() {
1724
- var t = this;
1725
-
1726
- if (t.currenttime) {
1727
- t.currenttime.html(mejs.Utility.secondsToTimeCode(t.media.currentTime | 0, t.options.alwaysShowHours || t.media.duration > 3600 ));
1728
- }
1729
- }
1730
- MediaElementPlayer.prototype.updateDuration = function() {
1731
- var t = this;
1732
-
1733
- if (t.media.duration && t.durationD) {
1734
- t.durationD.html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours));
1735
- }
1736
- };
1737
-
1738
- })(jQuery);
1739
- (function($) {
1740
- MediaElementPlayer.prototype.buildvolume = function(player, controls, layers, media) {
1741
- var mute =
1742
- $('<div class="mejs-button mejs-volume-button mejs-mute">'+
1743
- '<span></span>'+
1744
- '<div class="mejs-volume-slider">'+ // outer background
1745
- '<div class="mejs-volume-total"></div>'+ // line background
1746
- '<div class="mejs-volume-current"></div>'+ // current volume
1747
- '<div class="mejs-volume-handle"></div>'+ // handle
1748
- '</div>'+
1749
- '</div>')
1750
- .appendTo(controls),
1751
- volumeSlider = mute.find('.mejs-volume-slider'),
1752
- volumeTotal = mute.find('.mejs-volume-total'),
1753
- volumeCurrent = mute.find('.mejs-volume-current'),
1754
- volumeHandle = mute.find('.mejs-volume-handle'),
1755
-
1756
- positionVolumeHandle = function(volume) {
1757
-
1758
- var
1759
- top = volumeTotal.height() - (volumeTotal.height() * volume);
1760
-
1761
- // handle
1762
- volumeHandle.css('top', top - (volumeHandle.height() / 2));
1763
-
1764
- // show the current visibility
1765
- volumeCurrent.height(volumeTotal.height() - top + parseInt(volumeTotal.css('top').replace(/px/,''),10));
1766
- volumeCurrent.css('top', top);
1767
- },
1768
- handleVolumeMove = function(e) {
1769
- var
1770
- railHeight = volumeTotal.height(),
1771
- totalOffset = volumeTotal.offset(),
1772
- totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
1773
- newY = e.pageY - totalOffset.top,
1774
- volume = (railHeight - newY) / railHeight
1775
-
1776
- // TODO: handle vertical and horizontal CSS
1777
- // only allow it to move within the rail
1778
- if (newY < 0)
1779
- newY = 0;
1780
- else if (newY > railHeight)
1781
- newY = railHeight;
1782
-
1783
- // move the handle to match the mouse
1784
- volumeHandle.css('top', newY - (volumeHandle.height() / 2) + totalTop );
1785
-
1786
- // show the current visibility
1787
- volumeCurrent.height(railHeight-newY);
1788
- volumeCurrent.css('top',newY+totalTop);
1789
-
1790
- // set mute status
1791
- if (volume == 0) {
1792
- media.setMuted(true);
1793
- mute.removeClass('mejs-mute').addClass('mejs-unmute');
1794
- } else {
1795
- media.setMuted(false);
1796
- mute.removeClass('mejs-unmute').addClass('mejs-mute');
1797
- }
1798
-
1799
- volume = Math.max(0,volume);
1800
- volume = Math.min(volume,1);
1801
-
1802
- // set the volume
1803
- media.setVolume(volume);
1804
- },
1805
- mouseIsDown = false;
1806
-
1807
- // SLIDER
1808
- volumeSlider
1809
- .bind('mousedown', function (e) {
1810
- handleVolumeMove(e);
1811
- mouseIsDown = true;
1812
- return false;
1813
- });
1814
- $(document)
1815
- .bind('mouseup', function (e) {
1816
- mouseIsDown = false;
1817
- })
1818
- .bind('mousemove', function (e) {
1819
- if (mouseIsDown) {
1820
- handleVolumeMove(e);
1821
- }
1822
- });
1823
-
1824
-
1825
- // MUTE button
1826
- mute.find('span').click(function() {
1827
- if (media.muted) {
1828
- media.setMuted(false);
1829
- mute.removeClass('mejs-unmute').addClass('mejs-mute');
1830
- positionVolumeHandle(1);
1831
- } else {
1832
- media.setMuted(true);
1833
- mute.removeClass('mejs-mute').addClass('mejs-unmute');
1834
- positionVolumeHandle(0);
1835
- }
1836
- });
1837
-
1838
- // listen for volume change events from other sources
1839
- media.addEventListener('volumechange', function(e) {
1840
- if (!mouseIsDown) {
1841
- positionVolumeHandle(e.target.volume);
1842
- }
1843
- }, true);
1844
-
1845
- // set initial volume
1846
- //player.options.startVolume = Math.min(Math.max(0,player.options.startVolume),1);
1847
- positionVolumeHandle(player.options.startVolume);
1848
- media.setVolume(player.options.startVolume);
1849
- }
1850
-
1851
- })(jQuery);
1852
- (function($) {
1853
- MediaElementPlayer.prototype.buildfullscreen = function(player, controls, layers, media) {
1854
-
1855
- if (!player.isVideo)
1856
- return;
1857
-
1858
- var
1859
- normalHeight = 0,
1860
- normalWidth = 0,
1861
- container = player.container,
1862
- fullscreenBtn =
1863
- $('<div class="mejs-button mejs-fullscreen-button"><span></span></div>')
1864
- .appendTo(controls)
1865
- .click(function() {
1866
- var goFullscreen = (mejs.MediaFeatures.hasNativeFullScreen) ?
1867
- !media.webkitDisplayingFullscreen :
1868
- !media.isFullScreen;
1869
- setFullScreen(goFullscreen);
1870
- }),
1871
- setFullScreen = function(goFullScreen) {
1872
- switch (media.pluginType) {
1873
- case 'flash':
1874
- case 'silverlight':
1875
- media.setFullscreen(goFullScreen);
1876
- break;
1877
- case 'native':
1878
-
1879
- if (mejs.MediaFeatures.hasNativeFullScreen) {
1880
- if (goFullScreen) {
1881
- media.webkitEnterFullScreen();
1882
- media.isFullScreen = true;
1883
- } else {
1884
- media.webkitExitFullScreen();
1885
- media.isFullScreen = false;
1886
- }
1887
- } else {
1888
- if (goFullScreen) {
1889
-
1890
- // store
1891
- normalHeight = player.$media.height();
1892
- normalWidth = player.$media.width();
1893
-
1894
- // make full size
1895
- container
1896
- .addClass('mejs-container-fullscreen')
1897
- .width('100%')
1898
- .height('100%')
1899
- .css('z-index', 1000);
1900
-
1901
- player.$media
1902
- .width('100%')
1903
- .height('100%');
1904
-
1905
-
1906
- layers.children('div')
1907
- .width('100%')
1908
- .height('100%');
1909
-
1910
- fullscreenBtn
1911
- .removeClass('mejs-fullscreen')
1912
- .addClass('mejs-unfullscreen');
1913
-
1914
- player.setControlsSize();
1915
- media.isFullScreen = true;
1916
- } else {
1917
-
1918
- container
1919
- .removeClass('mejs-container-fullscreen')
1920
- .width(normalWidth)
1921
- .height(normalHeight)
1922
- .css('z-index', 1);
1923
-
1924
- player.$media
1925
- .width(normalWidth)
1926
- .height(normalHeight);
1927
-
1928
- layers.children('div')
1929
- .width(normalWidth)
1930
- .height(normalHeight);
1931
-
1932
- fullscreenBtn
1933
- .removeClass('mejs-unfullscreen')
1934
- .addClass('mejs-fullscreen');
1935
-
1936
- player.setControlsSize();
1937
- media.isFullScreen = false;
1938
- }
1939
- }
1940
- }
1941
- };
1942
-
1943
- $(document).bind('keydown',function (e) {
1944
- if (media.isFullScreen && e.keyCode == 27) {
1945
- setFullScreen(false);
1946
- }
1947
- });
1948
-
1949
- }
1950
-
1951
-
1952
- })(jQuery);
1953
- (function($) {
1954
-
1955
- // add extra default options
1956
- $.extend(mejs.MepDefaults, {
1957
- // this will automatically turn on a <track>
1958
- startLanguage: '',
1959
- // a list of languages to auto-translate via Google
1960
- translations: [],
1961
- // a dropdownlist of automatic translations
1962
- translationSelector: false,
1963
- // key for tranlsations
1964
- googleApiKey: ''
1965
- });
1966
-
1967
- $.extend(MediaElementPlayer.prototype, {
1968
-
1969
- buildtracks: function(player, controls, layers, media) {
1970
- if (!player.isVideo)
1971
- return;
1972
-
1973
- if (player.tracks.length == 0)
1974
- return;
1975
-
1976
- var i, options = '';
1977
-
1978
- player.chapters =
1979
- $('<div class="mejs-chapters mejs-layer"></div>')
1980
- .prependTo(layers).hide();
1981
- player.captions =
1982
- $('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>')
1983
- .prependTo(layers).hide();
1984
- player.captionsText = player.captions.find('.mejs-captions-text');
1985
- player.captionsButton =
1986
- $('<div class="mejs-button mejs-captions-button">'+
1987
- '<span></span>'+
1988
- '<div class="mejs-captions-selector">'+
1989
- '<ul>'+
1990
- '<li>'+
1991
- '<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' +
1992
- '<label for="' + player.id + '_captions_none">None</label>'+
1993
- '</li>' +
1994
- '</ul>'+
1995
- '</div>'+
1996
- '</div>')
1997
- .appendTo(controls)
1998
- // handle clicks to the language radio buttons
1999
- .delegate('input[type=radio]','click',function() {
2000
- lang = this.value;
2001
-
2002
- if (lang == 'none') {
2003
- player.selectedTrack = null;
2004
- } else {
2005
- for (i=0; i<player.tracks.length; i++) {
2006
- if (player.tracks[i].srclang == lang) {
2007
- player.selectedTrack = player.tracks[i];
2008
- player.captions.attr('lang', player.selectedTrack.srclang);
2009
- player.displayCaptions();
2010
- break;
2011
- }
2012
- }
2013
- }
2014
- });
2015
- //.bind('mouseenter', function() {
2016
- // player.captionsButton.find('.mejs-captions-selector').css('visibility','visible')
2017
- //});
2018
- // move with controls
2019
- player.container
2020
- .bind('mouseenter', function () {
2021
- // push captions above controls
2022
- player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover');
2023
-
2024
- })
2025
- .bind('mouseleave', function () {
2026
- if (!media.paused) {
2027
- // move back to normal place
2028
- player.container.find('.mejs-captions-position').removeClass('mejs-captions-position-hover');
2029
- }
2030
- });
2031
-
2032
-
2033
-
2034
-
2035
- player.trackToLoad = -1;
2036
- player.selectedTrack = null;
2037
- player.isLoadingTrack = false;
2038
-
2039
- // add user-defined translations
2040
- if (player.tracks.length > 0 && player.options.translations.length > 0) {
2041
- for (i=0; i<player.options.translations.length; i++) {
2042
- player.tracks.push({
2043
- srclang: player.options.translations[i].toLowerCase(),
2044
- src: null,
2045
- kind: 'subtitles',
2046
- entries: [],
2047
- isLoaded: false,
2048
- isTranslation: true
2049
- });
2050
- }
2051
- }
2052
-
2053
- // add to list
2054
- for (i=0; i<player.tracks.length; i++) {
2055
- if (player.tracks[i].kind == 'subtitles') {
2056
- player.addTrackButton(player.tracks[i].srclang, player.tracks[i].isTranslation);
2057
- }
2058
- }
2059
-
2060
- player.loadNextTrack();
2061
-
2062
-
2063
- media.addEventListener('timeupdate',function(e) {
2064
- player.displayCaptions();
2065
- }, false);
2066
-
2067
- media.addEventListener('loadedmetadata', function(e) {
2068
- player.displayChapters();
2069
- }, false);
2070
-
2071
- player.container.hover(
2072
- function () {
2073
- // chapters
2074
- player.chapters.css('visibility','visible');
2075
- player.chapters.fadeIn(200);
2076
- },
2077
- function () {
2078
- if (!media.paused) {
2079
- player.chapters.fadeOut(200, function() {
2080
- $(this).css('visibility','hidden');
2081
- $(this).css('display','block');
2082
- });
2083
- }
2084
- });
2085
-
2086
- // check for autoplay
2087
- if (player.node.getAttribute('autoplay') !== null) {
2088
- player.chapters.css('visibility','hidden');
2089
- }
2090
-
2091
- // auto selector
2092
- if (player.options.translationSelector) {
2093
- for (i in mejs.language.codes) {
2094
- options += '<option value="' + i + '">' + mejs.language.codes[i] + '</option>';
2095
- }
2096
- player.container.find('.mejs-captions-selector ul').before($(
2097
- '<select class="mejs-captions-translations">' +
2098
- '<option value="">--Add Translation--</option>' +
2099
- options +
2100
- '</select>'
2101
- ));
2102
- // add clicks
2103
- player.container.find('.mejs-captions-translations').change(function() {
2104
- var
2105
- option = $(this);
2106
- lang = option.val();
2107
- // add this language to the tracks list
2108
- if (lang != '') {
2109
- player.tracks.push({
2110
- srclang: lang,
2111
- src: null,
2112
- entries: [],
2113
- isLoaded: false,
2114
- isTranslation: true
2115
- });
2116
-
2117
- if (!player.isLoadingTrack) {
2118
- player.trackToLoad--;
2119
- player.addTrackButton(lang,true);
2120
- player.options.startLanguage = lang;
2121
- player.loadNextTrack();
2122
- }
2123
- }
2124
- });
2125
- }
2126
-
2127
- },
2128
-
2129
- loadNextTrack: function() {
2130
- var t = this;
2131
-
2132
- t.trackToLoad++;
2133
- if (t.trackToLoad < t.tracks.length) {
2134
- t.isLoadingTrack = true;
2135
- t.loadTrack(t.trackToLoad);
2136
- } else {
2137
- // add done?
2138
- t.isLoadingTrack = false;
2139
- }
2140
- },
2141
-
2142
- loadTrack: function(index){
2143
- var
2144
- t = this,
2145
- track = t.tracks[index],
2146
- after = function() {
2147
-
2148
- track.isLoaded = true;
2149
-
2150
- // create button
2151
- //t.addTrackButton(track.srclang);
2152
- t.enableTrackButton(track.srclang);
2153
-
2154
- t.loadNextTrack();
2155
-
2156
- };
2157
-
2158
- if (track.isTranslation) {
2159
-
2160
- // translate the first track
2161
- mejs.TrackFormatParser.translateTrackText(t.tracks[0].entries, t.tracks[0].srclang, track.srclang, t.options.googleApiKey, function(newOne) {
2162
-
2163
- // store the new translation
2164
- track.entries = newOne;
2165
-
2166
- after();
2167
- });
2168
-
2169
- } else {
2170
- $.ajax({
2171
- url: track.src,
2172
- success: function(d) {
2173
-
2174
- // parse the loaded file
2175
- track.entries = mejs.TrackFormatParser.parse(d);
2176
- after();
2177
-
2178
- if (track.kind == 'chapters' && t.media.duration > 0) {
2179
- t.drawChapters(track);
2180
- }
2181
- },
2182
- error: function() {
2183
- t.loadNextTrack();
2184
- }
2185
- });
2186
- }
2187
- },
2188
-
2189
- enableTrackButton: function(lang) {
2190
- var t = this;
2191
-
2192
- t.captionsButton
2193
- .find('input[value=' + lang + ']')
2194
- .attr('disabled','')
2195
- .siblings('label')
2196
- .html( mejs.language.codes[lang] || lang );
2197
-
2198
- // auto select
2199
- if (t.options.startLanguage == lang) {
2200
- $('#' + t.id + '_captions_' + lang).click();
2201
- }
2202
-
2203
- t.adjustLanguageBox();
2204
- },
2205
-
2206
- addTrackButton: function(lang, isTranslation) {
2207
- var t = this,
2208
- l = mejs.language.codes[lang] || lang;
2209
-
2210
- t.captionsButton.find('ul').append(
2211
- $('<li>'+
2212
- '<input type="radio" name="' + t.id + '_captions" id="' + t.id + '_captions_' + lang + '" value="' + lang + '" disabled="disabled" />' +
2213
- '<label for="' + t.id + '_captions_' + lang + '">' + l + ((isTranslation) ? ' (translating)' : ' (loading)') + '</label>'+
2214
- '</li>')
2215
- );
2216
-
2217
- t.adjustLanguageBox();
2218
-
2219
- // remove this from the dropdownlist (if it exists)
2220
- t.container.find('.mejs-captions-translations option[value=' + lang + ']').remove();
2221
- },
2222
-
2223
- adjustLanguageBox:function() {
2224
- var t = this;
2225
- // adjust the size of the outer box
2226
- t.captionsButton.find('.mejs-captions-selector').height(
2227
- t.captionsButton.find('.mejs-captions-selector ul').outerHeight(true) +
2228
- t.captionsButton.find('.mejs-captions-translations').outerHeight(true)
2229
- );
2230
- },
2231
-
2232
- displayCaptions: function() {
2233
-
2234
- if (typeof this.tracks == 'undefined')
2235
- return;
2236
-
2237
- var
2238
- t = this,
2239
- i,
2240
- track = t.selectedTrack;
2241
-
2242
- if (track != null && track.isLoaded) {
2243
- for (i=0; i<track.entries.times.length; i++) {
2244
- if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop){
2245
- t.captionsText.html(track.entries.text[i]);
2246
- t.captions.show();
2247
- return; // exit out if one is visible;
2248
- }
2249
- }
2250
- t.captions.hide();
2251
- } else {
2252
- t.captions.hide();
2253
- }
2254
- },
2255
-
2256
- displayChapters: function() {
2257
- var
2258
- t = this,
2259
- i;
2260
-
2261
- for (i=0; i<t.tracks.length; i++) {
2262
- if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) {
2263
- t.drawChapters(t.tracks[i]);
2264
- break;
2265
- }
2266
- }
2267
- },
2268
-
2269
- drawChapters: function(chapters) {
2270
- var
2271
- t = this,
2272
- i,
2273
- dur,
2274
- //width,
2275
- //left,
2276
- percent = 0,
2277
- usedPercent = 0;
2278
-
2279
- t.chapters.empty();
2280
-
2281
- for (i=0; i<chapters.entries.times.length; i++) {
2282
- dur = chapters.entries.times[i].stop - chapters.entries.times[i].start;
2283
- percent = Math.floor(dur / t.media.duration * 100);
2284
- if (percent + usedPercent > 100 || // too large
2285
- i == chapters.entries.times.length-1 && percent + usedPercent < 100) // not going to fill it in
2286
- {
2287
- percent = 100 - usedPercent;
2288
- }
2289
- //width = Math.floor(t.width * dur / t.media.duration);
2290
- //left = Math.floor(t.width * chapters.entries.times[i].start / t.media.duration);
2291
- //if (left + width > t.width) {
2292
- // width = t.width - left;
2293
- //}
2294
-
2295
- t.chapters.append( $(
2296
- '<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' +
2297
- '<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' +
2298
- '<span class="ch-title">' + chapters.entries.text[i] + '</span>' +
2299
- '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start) + '&ndash;' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop) + '</span>' +
2300
- '</div>' +
2301
- '</div>'));
2302
- usedPercent += percent;
2303
- }
2304
-
2305
- t.chapters.find('div.mejs-chapter').click(function() {
2306
- t.media.setCurrentTime( parseFloat( $(this).attr('rel') ) );
2307
- if (t.media.paused) {
2308
- t.media.play();
2309
- }
2310
- });
2311
-
2312
- t.chapters.show();
2313
- }
2314
- });
2315
-
2316
-
2317
-
2318
- mejs.language = {
2319
- codes: {
2320
- af:'Afrikaans',
2321
- sq:'Albanian',
2322
- ar:'Arabic',
2323
- be:'Belarusian',
2324
- bg:'Bulgarian',
2325
- ca:'Catalan',
2326
- zh:'Chinese',
2327
- 'zh-cn':'Chinese Simplified',
2328
- 'zh-tw':'Chinese Traditional',
2329
- hr:'Croatian',
2330
- cs:'Czech',
2331
- da:'Danish',
2332
- nl:'Dutch',
2333
- en:'English',
2334
- et:'Estonian',
2335
- tl:'Filipino',
2336
- fi:'Finnish',
2337
- fr:'French',
2338
- gl:'Galician',
2339
- de:'German',
2340
- el:'Greek',
2341
- ht:'Haitian Creole',
2342
- iw:'Hebrew',
2343
- hi:'Hindi',
2344
- hu:'Hungarian',
2345
- is:'Icelandic',
2346
- id:'Indonesian',
2347
- ga:'Irish',
2348
- it:'Italian',
2349
- ja:'Japanese',
2350
- ko:'Korean',
2351
- lv:'Latvian',
2352
- lt:'Lithuanian',
2353
- mk:'Macedonian',
2354
- ms:'Malay',
2355
- mt:'Maltese',
2356
- no:'Norwegian',
2357
- fa:'Persian',
2358
- pl:'Polish',
2359
- pt:'Portuguese',
2360
- //'pt-pt':'Portuguese (Portugal)',
2361
- ro:'Romanian',
2362
- ru:'Russian',
2363
- sr:'Serbian',
2364
- sk:'Slovak',
2365
- sl:'Slovenian',
2366
- es:'Spanish',
2367
- sw:'Swahili',
2368
- sv:'Swedish',
2369
- tl:'Tagalog',
2370
- th:'Thai',
2371
- tr:'Turkish',
2372
- uk:'Ukrainian',
2373
- vi:'Vietnamese',
2374
- cy:'Welsh',
2375
- yi:'Yiddish'
2376
- }
2377
- };
2378
-
2379
- /*
2380
- Parses WebVVT format which should be formatted as
2381
- ================================
2382
- WEBVTT
2383
-
2384
- 1
2385
- 00:00:01,1 --> 00:00:05,000
2386
- A line of text
2387
-
2388
- 2
2389
- 00:01:15,1 --> 00:02:05,000
2390
- A second line of text
2391
-
2392
- ===============================
2393
-
2394
- Adapted from: http://www.delphiki.com/html5/playr
2395
- */
2396
- mejs.TrackFormatParser = {
2397
- pattern_identifier: /^[0-9]+$/,
2398
- 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})?)(.*)$/,
2399
-
2400
- split2: function (text, regex) {
2401
- // normal version for compliant browsers
2402
- // see below for IE fix
2403
- return text.split(regex);
2404
- },
2405
- parse: function(trackText) {
2406
- var
2407
- i = 0,
2408
- lines = this.split2(trackText, /\r?\n/),
2409
- entries = {text:[], times:[]},
2410
- timecode,
2411
- text;
2412
-
2413
- for(; i<lines.length; i++) {
2414
- // check for the line number
2415
- if (this.pattern_identifier.exec(lines[i])){
2416
- // skip to the next line where the start --> end time code should be
2417
- i++;
2418
- timecode = this.pattern_timecode.exec(lines[i]);
2419
- if (timecode && i<lines.length){
2420
- i++;
2421
- // grab all the (possibly multi-line) text that follows
2422
- text = lines[i];
2423
- i++;
2424
- while(lines[i] !== '' && i<lines.length){
2425
- text = text + '\n' + lines[i];
2426
- i++;
2427
- }
2428
-
2429
- // Text is in a different array so I can use .join
2430
- entries.text.push(text);
2431
- entries.times.push(
2432
- {
2433
- start: mejs.Utility.timeCodeToSeconds(timecode[1]),
2434
- stop: mejs.Utility.timeCodeToSeconds(timecode[3]),
2435
- settings: timecode[5]
2436
- });
2437
- }
2438
- }
2439
- }
2440
-
2441
- return entries;
2442
- },
2443
-
2444
- translateTrackText: function(trackData, fromLang, toLang, googleApiKey, callback) {
2445
-
2446
- var
2447
- entries = {text:[], times:[]},
2448
- lines,
2449
- i
2450
-
2451
- this.translateText( trackData.text.join(' <a></a>'), fromLang, toLang, googleApiKey, function(result) {
2452
- // split on separators
2453
- lines = result.split('<a></a>');
2454
-
2455
- // create new entries
2456
- for (i=0;i<trackData.text.length; i++) {
2457
- // add translated line
2458
- entries.text[i] = lines[i];
2459
- // copy existing times
2460
- entries.times[i] = {
2461
- start: trackData.times[i].start,
2462
- stop: trackData.times[i].stop,
2463
- settings: trackData.times[i].settings
2464
- };
2465
- }
2466
-
2467
- callback(entries);
2468
- });
2469
- },
2470
-
2471
- translateText: function(text, fromLang, toLang, googleApiKey, callback) {
2472
-
2473
- var
2474
- separatorIndex,
2475
- chunks = [],
2476
- chunk,
2477
- maxlength = 1000,
2478
- result = '',
2479
- nextChunk= function() {
2480
- if (chunks.length > 0) {
2481
- chunk = chunks.shift();
2482
- mejs.TrackFormatParser.translateChunk(chunk, fromLang, toLang, googleApiKey, function(r) {
2483
- if (r != 'undefined') {
2484
- result += r;
2485
- }
2486
- nextChunk();
2487
- });
2488
- } else {
2489
- callback(result);
2490
- }
2491
- };
2492
-
2493
- // split into chunks
2494
- while (text.length > 0) {
2495
- if (text.length > maxlength) {
2496
- separatorIndex = text.lastIndexOf('.', maxlength);
2497
- chunks.push(text.substring(0, separatorIndex));
2498
- text = text.substring(separatorIndex+1);
2499
- } else {
2500
- chunks.push(text);
2501
- text = '';
2502
- }
2503
- }
2504
-
2505
- // start handling the chunks
2506
- nextChunk();
2507
- },
2508
- translateChunk: function(text, fromLang, toLang, googleApiKey, callback) {
2509
-
2510
- var data = {
2511
- q: text,
2512
- langpair: fromLang + '|' + toLang,
2513
- v: '1.0'
2514
- };
2515
- if (googleApiKey !== '' && googleApiKey !== null) {
2516
- data.key = googleApiKey;
2517
- }
2518
-
2519
- $.ajax({
2520
- url: 'https://ajax.googleapis.com/ajax/services/language/translate', // 'https://www.google.com/uds/Gtranslate', //'https://ajax.googleapis.com/ajax/services/language/translate', //
2521
- data: data,
2522
- type: 'GET',
2523
- dataType: 'jsonp',
2524
- success: function(d) {
2525
- callback(d.responseData.translatedText);
2526
- },
2527
- error: function(e) {
2528
- callback(null);
2529
- }
2530
- });
2531
- }
2532
- };
2533
- // test for browsers with bad String.split method.
2534
- if ('x\n\ny'.split(/\n/gi).length != 3) {
2535
- // add super slow IE8 and below version
2536
- mejs.TrackFormatParser.split2 = function(text, regex) {
2537
- var
2538
- parts = [],
2539
- chunk = '',
2540
- i;
2541
-
2542
- for (i=0; i<text.length; i++) {
2543
- chunk += text.substring(i,i+1);
2544
- if (regex.test(chunk)) {
2545
- parts.push(chunk.replace(regex, ''));
2546
- chunk = '';
2547
- }
2548
- }
2549
- parts.push(chunk);
2550
- return parts;
2551
- }
2552
- }
2553
-
2554
-
2555
- })(jQuery);
2556
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mediaelement/mediaelement-and-player.min.js DELETED
@@ -1,102 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * HTML5 <video> and <audio> shim and player
4
- * http://mediaelementjs.com/
5
- *
6
- * Creates a JavaScript object that mimics HTML5 MediaElement API
7
- * for browsers that don't understand HTML5 or can't play the provided codec
8
- * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
9
- *
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.5";mejs.meIndex=0;mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg"]}]};
14
- mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",f,g=document.getElementsByTagName("script");b<g.length;b++){f=g[b].src;for(c=0;c<a.length;c++){e=a[c];if(f.indexOf(e)>-1){d=f.substring(0,
15
- f.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b){a=Math.round(a);var c,d=Math.floor(a/60);if(d>=60){c=Math.floor(d/60);d%=60}c=c===undefined?"00":c>=10?c:"0"+c;d=d>=10?d:"0"+d;a=Math.floor(a%60);a=a>=10?a:"0"+a;return(c>0||b===true?c+":":"")+d+":"+a},timeCodeToSeconds:function(a){a=a.split(":");return a[0]*60*60+a[1]*60+parseFloat(a[2].replace(",","."))}};
16
- mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],f;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
17
- !(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(f=new ActiveXObject(c))e=d(f)}catch(g){}return e}};
18
- mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
19
- mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,f,g){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[f]+=g;e[f]-=g};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
20
- if(mejs.PluginDetector.ua.match(/android 2\.[12]/)!==null)HTMLMediaElement.canPlayType=function(a){return a.match(/video\/(mp4|m4v)/gi)!==null?"probably":""};
21
- mejs.MediaFeatures={init:function(){var a=mejs.PluginDetector.nav,b=mejs.PluginDetector.ua.toLowerCase(),c,d=["source","track","audio","video"];this.isiPad=b.match(/ipad/i)!==null;this.isiPhone=b.match(/iphone/i)!==null;this.isAndroid=b.match(/android/i)!==null;this.isIE=a.appName.toLowerCase().indexOf("microsoft")!=-1;this.isChrome=b.match(/chrome/gi)!==null;for(a=0;a<d.length;a++)c=document.createElement(d[a]);this.hasNativeFullScreen=typeof c.webkitEnterFullScreen!=="undefined";if(this.isChrome)this.hasNativeFullScreen=
22
- false;if(this.hasNativeFullScreen&&b.match(/mac os x 10_5/i))this.hasNativeFullScreen=false}};mejs.MediaFeatures.init();
23
- mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){if(typeof a=="string")this.src=a;else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}};mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
24
- mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginApi.loadMedia();this.paused=false}},pause:function(){if(this.pluginApi!=null){this.pluginApi.pauseMedia();this.paused=
25
- true}},stop:function(){if(this.pluginApi!=null){this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return true}return false},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=
26
- a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){this.pluginApi.setMuted(a);this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=
27
- a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen(a)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},
28
- dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}}};
29
- mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id);b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,
30
- c)},fireEvent:function(a,b,c){var d,e;a=this.pluginMediaElements[a];a.ended=false;a.paused=true;b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}};
31
- mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,timerRate:250,success:function(){},error:function(){}};
32
- mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
33
- mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase()=="video",f=typeof d.canPlayType!="undefined",g={method:"",url:""},k=d.getAttribute("poster"),h=d.getAttribute("autoplay"),l=d.getAttribute("preload"),j=d.getAttribute("controls"),n;for(n in b)c[n]=b[n];k=typeof k=="undefined"||k===null?"":k;l=typeof l=="undefined"||l===null||l==="false"?"none":l;h=!(typeof h=="undefined"||h===null||h==="false");
34
- j=!(typeof j=="undefined"||j===null||j==="false");g=this.determinePlayback(d,c,e,f);if(g.method=="native")return this.updateNative(d,c,h,l,g);else if(g.method!=="")return this.createPlugin(d,c,e,g.method,g.url!==null?mejs.Utility.absolutizeUrl(g.url):"",k,h,l,j);else this.createErrorMessage(d,c,g.url!==null?mejs.Utility.absolutizeUrl(g.url):"",k)},determinePlayback:function(a,b,c,d){var e=[],f,g,k={method:"",url:""},h=a.getAttribute("src"),l,j;if(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,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+l];if(e!==null)d=="flash"?c.push("file="+mejs.Utility.encodeUrl(e)):c.push("file="+e);b.enablePluginDebug&&c.push("debug=true");b.enablePluginSmoothing&&c.push("smoothing=true");h&&c.push("controls=true");switch(d){case "silverlight":o.innerHTML='<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("&amp;")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else o.innerHTML='<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
47
- * http://mediaelementjs.com/
48
- *
49
- * Creates a controller bar for HTML5 <video> add <audio> tags
50
- * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
51
- *
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,alwaysShowHours:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"]};mejs.mepIndex=0;mejs.MediaElementPlayer=function(a,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,c);this.options=f.extend({},mejs.MepDefaults,c);this.$media=this.$node=
56
- f(a);this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;this.isVideo=this.media.tagName.toLowerCase()==="video";this.init();return this};mejs.MediaElementPlayer.prototype={init:function(){var a=this,c=mejs.MediaFeatures,b=f.extend(true,{},a.options,{success:function(d,e){a.meReady(d,e)},error:function(d){a.handleError(d)}});if(c.isiPad||c.isiPhone){a.$media.attr("controls","controls");a.$media.removeAttr("poster");if(c.isiPad&&
57
- a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(c.isAndroid){if(a.isVideo){if(a.$media.find("source").length>0)a.media.src=a.$media.find('source[src$="mp4"]').attr("src");a.$media.click(function(){a.media.play()})}}else{a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=f('<div id="'+a.id+'" class="mejs-container"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media);
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(h){if(b.options.videoHeight<=
61
- 0&&b.domNode.getAttribute("height")===null&&!isNaN(h.target.videoHeight)){b.setPlayerSize(h.target.videoWidth,h.target.videoHeight);b.setControlsSize();b.media.setVideoSize(h.target.videoWidth,h.target.videoHeight)}},false)}b.media.addEventListener("ended",function(){b.media.setCurrentTime(0);b.media.pause();b.setProgressRail&&b.setProgressRail();b.setCurrentRail&&b.setCurrentRail();b.options.loop?b.media.play():b.controls.css("visibility","visible")},true);b.media.addEventListener("loadedmetadata",
62
- function(){b.updateDuration&&b.updateDuration();b.updateCurrent&&b.updateCurrent();b.setControlsSize()},true);setTimeout(function(){b.setControlsSize();b.setPlayerSize(b.width,b.height)},50)}b.options.success&&b.options.success(b.media,b.domNode)}},handleError:function(a){this.options.error&&this.options.error(a)},setPlayerSize:function(a,c){this.width=parseInt(a,10);this.height=parseInt(c,10);this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)},
63
- setControlsSize:function(){var a=0,c=0,b=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");others=b.siblings();others.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});c=this.controls.width()-a-(b.outerWidth(true)-b.outerWidth(false));b.width(c);d.width(c-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},
64
- buildposter:function(a,c,b,d){var e=f('<div class="mejs-poster mejs-layer"><img /></div>').appendTo(b);c=a.$media.attr("poster");b=e.find("img").width(a.width).height(a.height);if(a.options.poster!="")b.attr("src",a.options.poster);else c!==""&&c!=null?b.attr("src",c):e.remove();d.addEventListener("play",function(){e.hide()},false)},buildoverlays:function(a,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),
65
- g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(b),h=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(b).click(function(){d.paused?d.play():d.pause()});d.addEventListener("play",function(){h.hide();g.hide()},false);d.addEventListener("pause",function(){h.show()},false);d.addEventListener("loadstart",function(){e.show()},false);d.addEventListener("canplay",function(){e.hide()},
66
- false);d.addEventListener("error",function(){e.hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")},false)}},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[];c.each(function(){a.tracks.push({srclang:f(this).attr("srclang").toLowerCase(),src:f(this).attr("src"),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()},
67
- pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)}};jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(f(this),a)})};window.MediaElementPlayer=
68
- mejs.MediaElementPlayer})(jQuery);
69
- (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")},false);
70
- d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})(jQuery);
71
- (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);
72
- (function(f){MediaElementPlayer.prototype.buildprogress=function(a,c,b,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(c);var e=c.find(".mejs-time-total");b=c.find(".mejs-time-loaded");var g=c.find(".mejs-time-current"),
73
- h=c.find(".mejs-time-handle"),j=c.find(".mejs-time-float"),l=c.find(".mejs-time-float-current"),m=function(k){k=k.pageX;var n=e.offset(),q=e.outerWidth(),p=0;p=0;if(k>n.left&&k<=q+n.left&&d.duration){p=(k-n.left)/q;p=p<=0.02?0:p*d.duration;o&&d.setCurrentTime(p);j.css("left",k-n.left);l.html(mejs.Utility.secondsToTimeCode(p))}},o=false,i=false;e.bind("mousedown",function(k){o=true;m(k);return false});c.find(".mejs-time-rail").bind("mouseenter",function(){i=true}).bind("mouseleave",function(){i=false});
74
- f(document).bind("mouseup",function(){o=false}).bind("mousemove",function(k){if(o||i)m(k)});d.addEventListener("progress",function(k){a.setProgressRail(k);a.setCurrentRail(k)},false);d.addEventListener("timeupdate",function(k){a.setProgressRail(k);a.setCurrentRail(k)},false);this.loaded=b;this.total=e;this.current=g;this.handle=h};MediaElementPlayer.prototype.setProgressRail=function(a){var c=a!=undefined?a.target:this.media,b=null;if(c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration)b=
75
- c.buffered.end(0)/c.duration;else if(c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined)b=c.bufferedBytes/c.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)b=a.loaded/a.total;if(b!==null){b=Math.min(1,Math.max(0,b));this.loaded.width(this.total.width()*b)}};MediaElementPlayer.prototype.setCurrentRail=function(){if(this.media.currentTime!=undefined&&this.media.duration){var a=this.total.width()*this.media.currentTime/this.media.duration,c=a-this.handle.outerWidth(true)/2;this.current.width(a);
76
- this.handle.css("left",c)}}})(jQuery);
77
- (function(f){MediaElementPlayer.prototype.buildcurrent=function(a,c,b,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+"00:00</span></div>").appendTo(c);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)};MediaElementPlayer.prototype.buildduration=function(a,c,b,d){c.children().last().find(".mejs-currenttime").length>0?f(' <span> | </span> <span class="mejs-duration">'+(a.options.alwaysShowHours?
78
- "00:":"")+"00:00</span>").appendTo(c.find(".mejs-time")):f('<div class="mejs-time"><span class="mejs-duration">'+(a.options.alwaysShowHours?"00:":"")+"00:00</span></div>").appendTo(c);this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},false)};MediaElementPlayer.prototype.updateCurrent=function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime|0,this.options.alwaysShowHours||this.media.duration>
79
- 3600))};MediaElementPlayer.prototype.updateDuration=function(){this.media.duration&&this.durationD&&this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours))}})(jQuery);
80
- (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"),h=e.find(".mejs-volume-current"),j=e.find(".mejs-volume-handle"),l=function(i){i=g.height()-g.height()*i;j.css("top",
81
- i-j.height()/2);h.height(g.height()-i+parseInt(g.css("top").replace(/px/,""),10));h.css("top",i)},m=function(i){var k=g.height(),n=g.offset(),q=parseInt(g.css("top").replace(/px/,""),10);i=i.pageY-n.top;n=(k-i)/k;if(i<0)i=0;else if(i>k)i=k;j.css("top",i-j.height()/2+q);h.height(k-i);h.css("top",i+q);if(n==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}n=Math.max(0,n);n=Math.min(n,1);d.setVolume(n)},o=
82
- false;c.bind("mousedown",function(i){m(i);o=true;return false});f(document).bind("mouseup",function(){o=false}).bind("mousemove",function(i){o&&m(i)});e.find("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(i){o||l(i.target.volume)},true);l(a.options.startVolume);d.setVolume(a.options.startVolume)}})(jQuery);
83
- (function(f){MediaElementPlayer.prototype.buildfullscreen=function(a,c,b,d){if(a.isVideo){var e=0,g=0,h=a.container,j=f('<div class="mejs-button mejs-fullscreen-button"><span></span></div>').appendTo(c).click(function(){l(mejs.MediaFeatures.hasNativeFullScreen?!d.webkitDisplayingFullscreen:!d.isFullScreen)}),l=function(m){switch(d.pluginType){case "flash":case "silverlight":d.setFullscreen(m);break;case "native":if(mejs.MediaFeatures.hasNativeFullScreen)if(m){d.webkitEnterFullScreen();d.isFullScreen=
84
- true}else{d.webkitExitFullScreen();d.isFullScreen=false}else if(m){e=a.$media.height();g=a.$media.width();h.addClass("mejs-container-fullscreen").width("100%").height("100%").css("z-index",1E3);a.$media.width("100%").height("100%");b.children("div").width("100%").height("100%");j.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();d.isFullScreen=true}else{h.removeClass("mejs-container-fullscreen").width(g).height(e).css("z-index",1);a.$media.width(g).height(e);b.children("div").width(g).height(e);
85
- j.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");a.setControlsSize();d.isFullScreen=false}}};f(document).bind("keydown",function(m){d.isFullScreen&&m.keyCode==27&&l(false)})}}})(jQuery);
86
- (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");
87
- 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];
88
- 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(),
89
- 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",
90
- "hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden");if(a.options.translationSelector){for(e in mejs.language.codes)g+='<option value="'+e+'">'+mejs.language.codes[e]+"</option>";a.container.find(".mejs-captions-selector ul").before(f('<select class="mejs-captions-translations"><option value="">--Add Translation--</option>'+g+"</select>"));a.container.find(".mejs-captions-translations").change(function(){lang=f(this).val();if(lang!=
91
- ""){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()};
92
- b.isTranslation?mejs.TrackFormatParser.translateTrackText(c.tracks[0].entries,c.tracks[0].srclang,b.srclang,c.options.googleApiKey,function(e){b.entries=e;d()}):f.ajax({url:b.src,success:function(e){b.entries=mejs.TrackFormatParser.parse(e);d();b.kind=="chapters"&&c.media.duration>0&&c.drawChapters(b)},error:function(){c.loadNextTrack()}})},enableTrackButton:function(a){this.captionsButton.find("input[value="+a+"]").attr("disabled","").siblings("label").html(mejs.language.codes[a]||a);this.options.startLanguage==
93
- a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,c){var b=mejs.language.codes[a]||a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+b+(c?" (translating)":" (loading)")+"</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+
94
- 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==
95
- "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==
96
- a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[b]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[b].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(a.entries.times[b].stop)+"</span></div></div>"));e+=d}c.chapters.find("div.mejs-chapter").click(function(){c.media.setCurrentTime(parseFloat(f(this).attr("rel")));c.media.paused&&c.media.play()});c.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",
97
- 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",
98
- pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{3})?)(.*)$/,split2:function(a,c){return a.split(c)},parse:function(a){var c=0;a=this.split2(a,/\r?\n/);for(var b={text:[],
99
- times:[]},d,e;c<a.length;c++)if(this.pattern_identifier.exec(a[c])){c++;if((d=this.pattern_timecode.exec(a[c]))&&c<a.length){c++;e=a[c];for(c++;a[c]!==""&&c<a.length;){e=e+"\n"+a[c];c++}b.text.push(e);b.times.push({start:mejs.Utility.timeCodeToSeconds(d[1]),stop:mejs.Utility.timeCodeToSeconds(d[3]),settings:d[5]})}}return b},translateTrackText:function(a,c,b,d,e){var g={text:[],times:[]},h,j;this.translateText(a.text.join(" <a></a>"),c,b,d,function(l){h=l.split("<a></a>");for(j=0;j<a.text.length;j++){g.text[j]=
100
- h[j];g.times[j]={start:a.times[j].start,stop:a.times[j].stop,settings:a.times[j].settings}}e(g)})},translateText:function(a,c,b,d,e){for(var g,h=[],j,l="",m=function(){if(h.length>0){j=h.shift();mejs.TrackFormatParser.translateChunk(j,c,b,d,function(o){if(o!="undefined")l+=o;m()})}else e(l)};a.length>0;)if(a.length>1E3){g=a.lastIndexOf(".",1E3);h.push(a.substring(0,g));a=a.substring(g+1)}else{h.push(a);a=""}m()},translateChunk:function(a,c,b,d,e){a={q:a,langpair:c+"|"+b,v:"1.0"};if(d!==""&&d!==null)a.key=
101
- d;f.ajax({url:"https://ajax.googleapis.com/ajax/services/language/translate",data:a,type:"GET",dataType:"jsonp",success:function(g){e(g.responseData.translatedText)},error:function(){e(null)}})}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,c){var b=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(c.test(d)){b.push(d.replace(c,""));d=""}}b.push(d);return b}})(jQuery);
102
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mediaelement/mediaelementplayer.css DELETED
@@ -1,563 +0,0 @@
1
- .mejs-container {
2
- position: relative;
3
- background: #000;
4
- font-family: Helvetica, Arial;
5
- }
6
-
7
- .mejs-container-fullscreen {
8
- position: fixed;
9
- left: 0;
10
- top: 0;
11
- right: 0;
12
- bottom: 0;
13
- overflow: hidden;
14
- }
15
- .mejs-container-fullscreen .mejs-mediaelement,
16
- .mejs-container-fullscreen video {
17
- width: 100%;
18
- height: 100%;
19
- }
20
-
21
- /* Start: LAYERS */
22
- .mejs-background {
23
- position: absolute;
24
- top: 0;
25
- left: 0;
26
- }
27
- .mejs-mediaelement {
28
- position: absolute;
29
- top: 0;
30
- left: 0;
31
- }
32
- .mejs-poster {
33
- position: absolute;
34
- top: 0;
35
- left: 0;
36
- }
37
- .mejs-overlay {
38
- position: absolute;
39
- top: 0;
40
- left: 0;
41
- }
42
- .mejs-overlay-play {
43
- cursor: pointer;
44
- }
45
- .mejs-overlay-button {
46
- position: absolute;
47
- top: 50%;
48
- left: 50%;
49
- width: 100px;
50
- height: 100px;
51
- margin: -50px 0 0 -50px;
52
- background: url(bigplay.png) top left no-repeat;
53
- }
54
- .mejs-overlay:hover .mejs-overlay-button{
55
- background-position: 0 -100px ;
56
- }
57
- .mejs-overlay-loading {
58
- position: absolute;
59
- top: 50%;
60
- left: 50%;
61
- width: 80px;
62
- height: 80px;
63
- margin: -40px 0 0 -40px;
64
- background: #333;
65
- background: url(background.png);
66
- background: rgba(0, 0, 0, 0.9);
67
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(50,50,50,0.9)), to(rgba(0,0,0,0.9)));
68
- background: -moz-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));
69
- background: linear-gradient(rgba(50,50,50,0.9), rgba(0,0,0,0.9));
70
- }
71
- .mejs-overlay-loading span {
72
- display:block;
73
- width: 80px;
74
- height: 80px;
75
- background: transparent url(loading.gif) center center no-repeat;
76
- }
77
-
78
- /* End: LAYERS */
79
-
80
- /* Start: CONTROL BAR */
81
- .mejs-container .mejs-controls {
82
- position: absolute;
83
- background: none;
84
- list-style-type: none;
85
- margin: 0;
86
- padding: 0;
87
- bottom: 0;
88
- left: 0;
89
- background: url(background.png);
90
- background: rgba(0, 0, 0, 0.7);
91
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7)));
92
- background: -moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
93
- background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));
94
- height: 30px;
95
- width: 100%;
96
- }
97
- .mejs-container .mejs-controls div {
98
- list-style-type: none;
99
- background-image: none;
100
- display: block;
101
- float: left;
102
- margin: 0;
103
- padding: 0;
104
- width: 26px;
105
- height: 26px;
106
- font-size: 11px;
107
- line-height: 11px;
108
- font-family: Helvetica, Arial;
109
- }
110
- .mejs-controls .mejs-button span {
111
- cursor: pointer;
112
- display: block;
113
- font-size: 0px;
114
- line-height: 0;
115
- text-decoration: none;
116
- margin: 7px 5px;
117
- height: 16px;
118
- width: 16px;
119
- background: transparent url(controls.png) 0 0 no-repeat;
120
- }
121
- /* End: CONTROL BAR */
122
-
123
- /* Start: Time (current / duration) */
124
- .mejs-container .mejs-controls .mejs-time {
125
- color: #fff;
126
- display: block;
127
- height: 17px;
128
- width: auto;
129
- padding: 8px 3px 0 3px ;
130
- overflow: hidden;
131
- text-align: center;
132
- padding: auto 4px;
133
- }
134
- .mejs-container .mejs-controls .mejs-time span {
135
- font-size: 11px;
136
- color: #fff;
137
- line-height: 12px;
138
- display: block;
139
- float: left;
140
- margin: 1px 2px 0 0;
141
- width: auto;
142
- }
143
- /* End: Time (current / duration) */
144
-
145
-
146
- /* Start: Play/pause */
147
- .mejs-controls .mejs-play span {
148
- background-position:0 0;
149
- }
150
- .mejs-controls .mejs-pause span {
151
- background-position:0 -16px;
152
- }
153
- /* End: Play/pause */
154
-
155
-
156
- /* Stop */
157
- .mejs-controls .mejs-stop span {
158
- background-position: -112px 0;
159
- }
160
- /* End: Play/pause */
161
-
162
- /* Start: Progress bar */
163
- .mejs-controls div.mejs-time-rail {
164
- width: 200px;
165
- padding-top: 5px;
166
- }
167
- .mejs-controls .mejs-time-rail span {
168
- display: block;
169
- position: absolute;
170
- width: 180px;
171
- height: 10px;
172
- -webkit-border-radius: 2px;
173
- -moz-border-radius: 2px;
174
- border-radius: 2px;
175
- cursor: pointer;
176
- }
177
- .mejs-controls .mejs-time-rail .mejs-time-total {
178
- margin: 5px;
179
- background: #333;
180
- background: rgba(50,50,50,0.8);
181
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8)));
182
- background: -moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));
183
- background: linear-gradient(rgba(30,30,30,0.8), rgba(60,60,60,0.8));
184
- filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#1E1E1E,endColorstr=#3C3C3C);
185
- }
186
- .mejs-controls .mejs-time-rail .mejs-time-loaded {
187
- background: #3caac8;
188
- background: rgba(60,170,200,0.8);
189
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(44,124,145,0.8)), to(rgba(78,183,212,0.8)));
190
- background: -moz-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));
191
- background: linear-gradient(rgba(44,124,145,0.8), rgba(78,183,212,0.8));
192
- filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#2C7C91,endColorstr=#4EB7D4);
193
- width: 0;
194
- }
195
- .mejs-controls .mejs-time-rail .mejs-time-current {
196
- width: 0;
197
- background: #fff;
198
- background: rgba(255,255,255,0.8);
199
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8)));
200
- background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
201
- filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#FFFFFF,endColorstr=#C8C8C8);
202
- }
203
-
204
- .mejs-controls .mejs-time-rail .mejs-time-handle {
205
- display: none;
206
- position: absolute;
207
- margin: 0;
208
- width: 10px;
209
- background: #fff;
210
- -webkit-border-radius: 5px;
211
- -moz-border-radius: 5px;
212
- border-radius: 5px;
213
- cursor: pointer;
214
- border: solid 2px #333;
215
- top: -2px;
216
- text-align: center;
217
- }
218
-
219
- .mejs-controls .mejs-time-rail .mejs-time-float {
220
- visibility: hidden;
221
- position: absolute;
222
- display: block;
223
- background: #eee;
224
- width: 36px;
225
- height: 17px;
226
- border: solid 1px #333;
227
- top: -26px;
228
- margin-left: -18px;
229
- text-align: center;
230
- color: #111;
231
- }
232
- .mejs-controls .mejs-time-rail:hover .mejs-time-float {
233
- visibility: visible;
234
- }
235
- .mejs-controls .mejs-time-rail .mejs-time-float-current {
236
- margin: 2px;
237
- width: 30px;
238
- display: block;
239
- text-align: center;
240
- left: 0;
241
- }
242
- .mejs-controls .mejs-time-rail .mejs-time-float-corner {
243
- position: absolute;
244
- display: block;
245
- width: 0;
246
- height: 0;
247
- line-height: 0;
248
- border: solid 5px #eee;
249
- border-color: #eee transparent transparent transparent;
250
- -webkit-border-radius: 0;
251
- -moz-border-radius: 0;
252
- border-radius: 0;
253
- top: 15px;
254
- left: 13px;
255
-
256
- }
257
-
258
-
259
-
260
-
261
- /*
262
- .mejs-controls .mejs-time-rail:hover .mejs-time-handle {
263
- visibility:visible;
264
- }
265
- */
266
- /* End: Progress bar */
267
-
268
- /* Start: Fullscreen */
269
- .mejs-controls .mejs-fullscreen-button span {
270
- background-position:-32px 0;
271
- }
272
- .mejs-controls .mejs-unfullscreen span {
273
- background-position:-32px -16px;
274
- }
275
- /* End: Fullscreen */
276
-
277
-
278
- /* Start: Mute/Volume */
279
- .mejs-controls .mejs-volume-button {
280
- }
281
-
282
- .mejs-controls .mejs-mute span {
283
- background-position:-16px -16px;
284
- }
285
-
286
- .mejs-controls .mejs-unmute span {
287
- background-position:-16px 0;
288
- }
289
-
290
- .mejs-controls .mejs-volume-button {
291
- position: relative;
292
- }
293
-
294
- .mejs-controls .mejs-volume-button .mejs-volume-slider {
295
- display: none;
296
- height: 115px;
297
- width: 25px;
298
- background: url(background.png);
299
- background: rgba(50, 50, 50, 0.7);
300
- -webkit-border-radius: 0;
301
- -moz-border-radius: 0;
302
- border-radius: 0;
303
- top: -115px;
304
- left: 0;
305
- z-index: 1;
306
- position: absolute;
307
- margin: 0;
308
- }
309
- .mejs-controls .mejs-volume-button:hover {
310
- -webkit-border-radius: 0 0 4px 4px ;
311
- -moz-border-radius: 0 0 4px 4px ;
312
- border-radius: 0 0 4px 4px ;
313
- }
314
- .mejs-controls .mejs-volume-button:hover .mejs-volume-slider {
315
- display: block;
316
- }
317
-
318
- .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total {
319
- position: absolute;
320
- left: 11px;
321
- top: 8px;
322
- width: 2px;
323
- height: 100px;
324
- background: #ddd;
325
- background: rgba(255, 255, 255, 0.5);
326
- margin: 0;
327
- }
328
-
329
- .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current {
330
- position: absolute;
331
- left: 11px;
332
- top: 8px;
333
- width: 2px;
334
- height: 100px;
335
- background: #ddd;
336
- background: rgba(255, 255, 255, 0.9);
337
- margin: 0;
338
- }
339
-
340
- .mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle {
341
- position: absolute;
342
- left: 4px;
343
- top: -3px;
344
- width: 16px;
345
- height: 6px;
346
- background: #ddd;
347
- background: rgba(255, 255, 255, 0.9);
348
- cursor: N-resize;
349
- -webkit-border-radius: 1px;
350
- -moz-border-radius: 1px;
351
- border-radius: 1px;
352
- margin: 0;
353
- }
354
-
355
- /* End: Mute/Volume */
356
-
357
-
358
-
359
-
360
- /* Start: TRACK (Captions and Chapters) */
361
- .mejs-controls .mejs-captions-button {
362
- position: relative;
363
- }
364
-
365
- .mejs-controls .mejs-captions-button span {
366
- background-position:-48px 0;
367
- }
368
- .mejs-controls .mejs-captions-button .mejs-captions-selector {
369
- visibility: hidden;
370
- position: absolute;
371
- bottom: 26px;
372
- right: -10px;
373
- width: 130px;
374
- height: 100px;
375
- background: url(background.png);
376
- background: rgba(50,50,50,0.7);
377
- border: solid 1px transparent;
378
- padding: 10px;
379
- overflow: hidden;
380
- -webkit-border-radius: 0;
381
- -moz-border-radius: 0;
382
- border-radius: 0;
383
- }
384
- .mejs-controls .mejs-captions-button:hover .mejs-captions-selector {
385
- visibility: visible;
386
- }
387
-
388
- .mejs-controls .mejs-captions-button .mejs-captions-selector ul {
389
- margin: 0;
390
- padding: 0;
391
- display: block;
392
- list-style-type: none !important;
393
- overflow: hidden;
394
- }
395
- .mejs-controls .mejs-captions-button .mejs-captions-selector ul li{
396
- margin: 0 0 6px 0;
397
- padding: 0;
398
- list-style-type: none !important;
399
- display:block;
400
- color: #fff;
401
- overflow: hidden;
402
- }
403
- .mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{
404
- clear: both;
405
- float: left;
406
- margin: 3px 3px 0px 5px;
407
- }
408
- .mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{
409
- width: 100px;
410
- float: left;
411
- padding: 4px 0 0 0;
412
- line-height: 15px;
413
- font-family: helvetica, arial;
414
- font-size: 10px;
415
- }
416
-
417
- .mejs-controls .mejs-captions-button .mejs-captions-translations {
418
- font-size: 10px;
419
- margin: 0 0 5px 0;
420
- }
421
-
422
-
423
- .mejs-chapters {
424
- position: absolute;
425
- top: 0;
426
- left: 0;
427
- -xborder-right: solid 1px #fff;
428
- width: 10000px;
429
- }
430
- .mejs-chapters .mejs-chapter {
431
- position: absolute;
432
- float: left;
433
- background: #222;
434
- background: rgba(0, 0, 0, 0.7);
435
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7)));
436
- background: -moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
437
- background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));
438
- filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232,endColorstr=#000000);
439
- overflow: hidden;
440
- border: 0;
441
- }
442
- .mejs-chapters .mejs-chapter .mejs-chapter-block {
443
- font-size: 11px;
444
- color: #fff;
445
- padding: 5px;
446
- display: block;
447
- border-right: solid 1px #333;
448
- border-bottom: solid 1px #333;
449
- cursor: pointer;
450
- }
451
- .mejs-chapters .mejs-chapter .mejs-chapter-block-last {
452
- border-right: none;
453
- }
454
-
455
- .mejs-chapters .mejs-chapter .mejs-chapter-block:hover {
456
- /*background: #333;*/
457
- background: #666;
458
- background: rgba(102,102,102, 0.7);
459
- background: -webkit-gradient(linear, left top, left bottom, from(rgba(102,102,102,0.7)), to(rgba(50,50,50,0.6)));
460
- background: -moz-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));
461
- filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666,endColorstr=#323232);
462
- }
463
- .mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{
464
- font-size: 12px;
465
- font-weight: bold;
466
- display: block;
467
- white-space:nowrap;
468
- text-overflow: ellipsis;
469
- margin: 0 0 3px 0;
470
- line-height: 12px;
471
- }
472
- .mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{
473
- font-size: 12px;
474
- line-height: 12px;
475
- margin: 3px 0 4px 0;
476
- display: block;
477
- white-space:nowrap;
478
- text-overflow: ellipsis;
479
- }
480
-
481
-
482
- .mejs-captions-layer {
483
- position: absolute;
484
- bottom: 0;
485
- left: 0;
486
- text-align:center;
487
- /*font-weight: bold;*/
488
- line-height: 22px;
489
- font-size: 12px;
490
- color: #fff;
491
- }
492
- .mejs-captions-layer a {
493
- color: #fff;
494
- text-decoration: underline;
495
- }
496
- .mejs-captions-layer[lang=ar] {
497
- font-size: 20px;
498
- font-weight: normal;
499
- }
500
-
501
- .mejs-captions-position {
502
- position: absolute;
503
- width: 100%;
504
- bottom: 15px;
505
- left: 0;
506
- }
507
-
508
- .mejs-captions-position-hover {
509
- bottom: 45px;
510
- }
511
-
512
- .mejs-captions-text {
513
- padding: 3px 5px;
514
- background: url(background.png);
515
- background: rgba(20, 20, 20, 0.8);
516
-
517
- }
518
- /* End: TRACK (Captions and Chapters) */
519
-
520
-
521
-
522
- .mejs-clear {
523
- clear: both;
524
- }
525
-
526
- /* Start: ERROR */
527
- .me-cannotplay {
528
- }
529
- .me-cannotplay a {
530
- color: #fff;
531
- font-weight: bold;
532
- }
533
- .me-cannotplay span {
534
- padding: 15px;
535
- display: block;
536
- }
537
- /* End: ERROR */
538
-
539
-
540
- /* Start: Loop */
541
- .mejs-controls .mejs-loop-off span{
542
- background-position: -64px -16px;
543
- }
544
- .mejs-controls .mejs-loop-on span {
545
- background-position: -64px 0;
546
- }
547
- /* End: Loop */
548
-
549
- /* Start: backlight */
550
- .mejs-controls .mejs-backlight-off span{
551
- background-position: -80px -16px;
552
- }
553
- .mejs-controls .mejs-backlight-on span {
554
- background-position: -80px 0;
555
- }
556
- /* End: backlight */
557
-
558
-
559
- /* Start: picture controls */
560
- .mejs-controls .mejs-picturecontrols-button{
561
- background-position: -96px 0;
562
- }
563
- /* End: picture controls */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mediaelement/mediaelementplayer.min.css DELETED
@@ -1 +0,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 DELETED
Binary file