Version Description
None
Download this release
Release Info
Developer | johndyer |
Plugin | MediaElement.js – HTML5 Video & Audio Player |
Version | 2.5.0 |
Comparing to | |
See all releases |
Code changes from version 2.9.1 to 2.5.0
- mediaelement-js-wp.php +113 -95
- mediaelement/controls.png +0 -0
- mediaelement/flashmediaelement.swf +0 -0
- mediaelement/mediaelement-and-player.js +163 -472
- mediaelement/mediaelement-and-player.min.js +79 -88
- mediaelement/mediaelement.js +0 -1517
- mediaelement/mediaelement.min.js +0 -59
- mediaelement/mediaelementplayer.css +34 -205
- mediaelement/mediaelementplayer.js +0 -2743
- mediaelement/mediaelementplayer.min.css +1 -1
- mediaelement/mediaelementplayer.min.js +0 -88
- mediaelement/silverlightmediaelement.xap +0 -0
- readme.txt +2 -6
mediaelement-js-wp.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* @package MediaElementJS
|
4 |
-
* @version 2.
|
5 |
*/
|
6 |
|
7 |
/*
|
@@ -9,7 +9,7 @@ Plugin Name: MediaElement.js - HTML5 Audio and Video
|
|
9 |
Plugin URI: http://mediaelementjs.com/
|
10 |
Description: Video and audio plugin for WordPress built on MediaElement.js HTML5 video and audio player library. Embeds media in your post or page using HTML5 with Flash or Silverlight fallback support for non-HTML5 browsers. Video support: MP4, Ogg, WebM, WMV. Audio support: MP3, WMA, WAV
|
11 |
Author: John Dyer
|
12 |
-
Version: 2.
|
13 |
Author URI: http://j.hn/
|
14 |
License: GPLv3, MIT
|
15 |
*/
|
@@ -19,14 +19,12 @@ Adapted from: http://videojs.com/ plugin
|
|
19 |
*/
|
20 |
|
21 |
$mediaElementPlayerIndex = 1;
|
22 |
-
define('MEDIAELEMENTJS_DIR', plugin_dir_url(__FILE__).'mediaelement/');
|
23 |
|
24 |
/* Runs when plugin is activated */
|
25 |
register_activation_hook(__FILE__,'mejs_install');
|
26 |
|
27 |
function mejs_install() {
|
28 |
add_option('mep_video_skin', '');
|
29 |
-
add_option('mep_script_on_demand', false);
|
30 |
|
31 |
add_option('mep_default_video_height', 270);
|
32 |
add_option('mep_default_video_width', 480);
|
@@ -41,7 +39,6 @@ function mejs_install() {
|
|
41 |
register_deactivation_hook( __FILE__, 'mejs_remove' );
|
42 |
function mejs_remove() {
|
43 |
delete_option('mep_video_skin');
|
44 |
-
delete_option('mep_script_on_demand');
|
45 |
|
46 |
delete_option('mep_default_video_height');
|
47 |
delete_option('mep_default_video_width');
|
@@ -68,7 +65,6 @@ function mejs_create_menu() {
|
|
68 |
function mejs_register_settings() {
|
69 |
//register our settings
|
70 |
register_setting( 'mep_settings', 'mep_video_skin' );
|
71 |
-
register_setting( 'mep_settings', 'mep_script_on_demand' );
|
72 |
|
73 |
register_setting( 'mep_settings', 'mep_default_video_height' );
|
74 |
register_setting( 'mep_settings', 'mep_default_video_width' );
|
@@ -90,18 +86,6 @@ function mejs_settings_page() {
|
|
90 |
<form method="post" action="options.php">
|
91 |
<?php wp_nonce_field('update-options'); ?>
|
92 |
|
93 |
-
<h3 class="title"><span>General Settings</span></h3>
|
94 |
-
|
95 |
-
<table class="form-table">
|
96 |
-
<tr valign="top">
|
97 |
-
<th scope="row">
|
98 |
-
<label for="mep_script_on_demand">Load Script on Demand (requires WP 3.3)</label>
|
99 |
-
</th>
|
100 |
-
<td >
|
101 |
-
<input name="mep_script_on_demand" type="checkbox" id="mep_script_on_demand" <?php echo (get_option('mep_script_on_demand') == true ? "checked" : "") ?> />
|
102 |
-
</td>
|
103 |
-
</tr>
|
104 |
-
</table>
|
105 |
|
106 |
<h3 class="title"><span>Video Settings</span></h3>
|
107 |
|
@@ -175,7 +159,7 @@ function mejs_settings_page() {
|
|
175 |
</table>
|
176 |
|
177 |
<input type="hidden" name="action" value="update" />
|
178 |
-
<input type="hidden" name="page_options" value="mep_default_video_width,mep_default_video_height,mep_default_video_type,mep_default_audio_type,mep_default_audio_width,mep_default_audio_height,mep_video_skin
|
179 |
|
180 |
<p>
|
181 |
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
@@ -191,21 +175,17 @@ function mejs_settings_page() {
|
|
191 |
}
|
192 |
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
// This is now handled by calling wp_enqueue_script inside the mejs_media_shortcode function by default. This means that MediaElement.js's JavaScript will only be called as needed
|
197 |
-
if (!get_option('mep_script_on_demand')) {
|
198 |
function mejs_add_scripts(){
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
}
|
204 |
add_action('wp_print_scripts', 'mejs_add_scripts');
|
205 |
-
}
|
206 |
|
207 |
-
//
|
208 |
-
// still always enqueued so it happens in the <head> tag
|
209 |
function mejs_add_styles(){
|
210 |
if (!is_admin()){
|
211 |
// the style
|
@@ -218,20 +198,42 @@ function mejs_add_styles(){
|
|
218 |
}
|
219 |
add_action('wp_print_styles', 'mejs_add_styles');
|
220 |
|
221 |
-
function
|
|
|
222 |
|
|
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
global $mediaElementPlayerIndex;
|
230 |
-
$dir =
|
231 |
-
$attributes = array();
|
232 |
-
$sources = array();
|
233 |
-
$options = array();
|
234 |
-
$flash_src = '';
|
235 |
|
236 |
extract(shortcode_atts(array(
|
237 |
'src' => '',
|
@@ -262,12 +264,12 @@ function mejs_media_shortcode($tagName, $atts){
|
|
262 |
), $atts));
|
263 |
|
264 |
if ($type) {
|
265 |
-
$
|
266 |
}
|
267 |
|
268 |
/*
|
269 |
if ($src) {
|
270 |
-
$
|
271 |
$flash_src = htmlspecialchars($src);
|
272 |
}
|
273 |
*/
|
@@ -276,7 +278,7 @@ function mejs_media_shortcode($tagName, $atts){
|
|
276 |
|
277 |
// does it have an extension?
|
278 |
if (substr($src, strlen($src)-4, 1)=='.') {
|
279 |
-
$
|
280 |
$flash_src = htmlspecialchars($src);
|
281 |
} else {
|
282 |
|
@@ -340,97 +342,113 @@ function mejs_media_shortcode($tagName, $atts){
|
|
340 |
}
|
341 |
}
|
342 |
|
343 |
-
|
|
|
344 |
if ($mp4) {
|
345 |
-
$
|
346 |
$flash_src = htmlspecialchars($mp4);
|
347 |
}
|
|
|
348 |
if ($mp3) {
|
349 |
-
$
|
350 |
$flash_src = htmlspecialchars($mp3);
|
351 |
-
}
|
|
|
352 |
if ($webm) {
|
353 |
-
$
|
354 |
}
|
|
|
355 |
if ($ogg) {
|
356 |
-
$
|
357 |
}
|
|
|
358 |
if ($flv) {
|
359 |
-
$
|
360 |
-
}
|
|
|
361 |
if ($wmv) {
|
362 |
-
$
|
363 |
}
|
|
|
|
|
364 |
if ($captions) {
|
365 |
-
$
|
366 |
}
|
367 |
|
368 |
-
// <audio|video> attributes
|
369 |
if ($width && $tagName == 'video') {
|
370 |
-
$
|
371 |
}
|
|
|
372 |
if ($height && $tagName == 'video') {
|
373 |
-
$
|
374 |
}
|
|
|
375 |
if ($poster) {
|
376 |
-
$
|
377 |
}
|
|
|
378 |
if ($preload) {
|
379 |
-
$
|
380 |
}
|
|
|
381 |
if ($autoplay) {
|
382 |
-
$
|
383 |
}
|
384 |
|
385 |
-
// MEJS JavaScript options
|
386 |
if ($loop) {
|
387 |
-
$
|
388 |
}
|
389 |
|
390 |
-
// CONTROLS
|
391 |
-
$controls_option
|
392 |
-
if ($progress == 'true')
|
393 |
-
$controls_option
|
394 |
-
|
395 |
-
|
396 |
-
if ($
|
397 |
-
$controls_option
|
398 |
-
|
399 |
-
if ($
|
400 |
-
$controls_option
|
401 |
-
|
402 |
-
$controls_option[] = '"tracks"';
|
403 |
-
if ($fullscreen == 'true') {
|
404 |
-
$controls_option[] = '"fullscreen"';
|
405 |
-
}
|
406 |
-
$options[] = '"features":[' . implode(',', $controls_option) . ']';
|
407 |
|
408 |
-
//
|
|
|
409 |
if ($tagName == 'audio') {
|
410 |
-
$
|
411 |
-
$options[] = '"audioHeight":'.$height;
|
412 |
}
|
413 |
|
414 |
-
//
|
415 |
-
$
|
416 |
-
if ($skin != '') {
|
417 |
-
$
|
418 |
}
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
{$
|
429 |
<object width="{$width}" height="{$height}" type="application/x-shockwave-flash" data="{$dir}flashmediaelement.swf">
|
430 |
<param name="movie" value="{$dir}flashmediaelement.swf" />
|
431 |
<param name="flashvars" value="controls=true&file={$flash_src}" />
|
432 |
</object>
|
433 |
</{$tagName}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
_end_;
|
435 |
|
436 |
$mediaElementPlayerIndex++;
|
1 |
<?php
|
2 |
/**
|
3 |
* @package MediaElementJS
|
4 |
+
* @version 2.5.0
|
5 |
*/
|
6 |
|
7 |
/*
|
9 |
Plugin URI: http://mediaelementjs.com/
|
10 |
Description: Video and audio plugin for WordPress built on MediaElement.js HTML5 video and audio player library. Embeds media in your post or page using HTML5 with Flash or Silverlight fallback support for non-HTML5 browsers. Video support: MP4, Ogg, WebM, WMV. Audio support: MP3, WMA, WAV
|
11 |
Author: John Dyer
|
12 |
+
Version: 2.5.0
|
13 |
Author URI: http://j.hn/
|
14 |
License: GPLv3, MIT
|
15 |
*/
|
19 |
*/
|
20 |
|
21 |
$mediaElementPlayerIndex = 1;
|
|
|
22 |
|
23 |
/* Runs when plugin is activated */
|
24 |
register_activation_hook(__FILE__,'mejs_install');
|
25 |
|
26 |
function mejs_install() {
|
27 |
add_option('mep_video_skin', '');
|
|
|
28 |
|
29 |
add_option('mep_default_video_height', 270);
|
30 |
add_option('mep_default_video_width', 480);
|
39 |
register_deactivation_hook( __FILE__, 'mejs_remove' );
|
40 |
function mejs_remove() {
|
41 |
delete_option('mep_video_skin');
|
|
|
42 |
|
43 |
delete_option('mep_default_video_height');
|
44 |
delete_option('mep_default_video_width');
|
65 |
function mejs_register_settings() {
|
66 |
//register our settings
|
67 |
register_setting( 'mep_settings', 'mep_video_skin' );
|
|
|
68 |
|
69 |
register_setting( 'mep_settings', 'mep_default_video_height' );
|
70 |
register_setting( 'mep_settings', 'mep_default_video_width' );
|
86 |
<form method="post" action="options.php">
|
87 |
<?php wp_nonce_field('update-options'); ?>
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
<h3 class="title"><span>Video Settings</span></h3>
|
91 |
|
159 |
</table>
|
160 |
|
161 |
<input type="hidden" name="action" value="update" />
|
162 |
+
<input type="hidden" name="page_options" value="mep_default_video_width,mep_default_video_height,mep_default_video_type,mep_default_audio_type,mep_default_audio_width,mep_default_audio_height,mep_video_skin" />
|
163 |
|
164 |
<p>
|
165 |
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
175 |
}
|
176 |
|
177 |
|
178 |
+
define('MEDIAELEMENTJS_DIR', WP_PLUGIN_URL.'/media-element-html5-video-and-audio-player/mediaelement/');
|
179 |
+
// Javascript
|
|
|
|
|
180 |
function mejs_add_scripts(){
|
181 |
+
if (!is_admin()){
|
182 |
+
// the scripts
|
183 |
+
wp_enqueue_script("mediaelementjs-scripts", MEDIAELEMENTJS_DIR ."mediaelement-and-player.min.js", array('jquery'), "2.1.3", false);
|
184 |
+
}
|
185 |
}
|
186 |
add_action('wp_print_scripts', 'mejs_add_scripts');
|
|
|
187 |
|
188 |
+
// css
|
|
|
189 |
function mejs_add_styles(){
|
190 |
if (!is_admin()){
|
191 |
// the style
|
198 |
}
|
199 |
add_action('wp_print_styles', 'mejs_add_styles');
|
200 |
|
201 |
+
function mejs_add_header(){
|
202 |
+
/*
|
203 |
|
204 |
+
$dir = WP_PLUGIN_URL.'/media-element-html5-video-and-audio-player/mediaelement/';
|
205 |
|
206 |
+
echo <<<_end_
|
207 |
+
<link rel="stylesheet" href="{$dir}mediaelementplayer.min.css" type="text/css" />
|
208 |
+
<script src="{$dir}mediaelement-and-player.min.js" type="text/javascript"></script>
|
209 |
+
_end_;
|
210 |
+
*/
|
211 |
+
|
212 |
+
}
|
213 |
+
|
214 |
+
// If this happens in the <head> tag it fails in iOS. Boo.
|
215 |
+
function mejs_add_footer(){
|
216 |
+
/*
|
217 |
+
$defaultVideoWidth = get_option('mep_default_video_width');
|
218 |
+
$defaultVideoHeight = get_option('mep_default_video_height');
|
219 |
+
|
220 |
+
echo <<<_end_
|
221 |
+
<script type="text/javascript">
|
222 |
+
jQuery(document).ready(function($) {
|
223 |
+
$('video[class=mep],audio[class=mep]').mediaelementplayer({defaultVideoWidth:{$defaultVideoWidth},defaultVideoHeight:{$defaultVideoHeight}});
|
224 |
+
});
|
225 |
+
</script>
|
226 |
+
_end_;
|
227 |
+
*/
|
228 |
+
}
|
229 |
+
|
230 |
+
add_action('wp_head','mejs_add_header');
|
231 |
+
add_action('wp_footer','mejs_add_footer');
|
232 |
+
|
233 |
+
function mejs_media_shortcode($tagName, $atts){
|
234 |
|
235 |
global $mediaElementPlayerIndex;
|
236 |
+
$dir = WP_PLUGIN_URL.'/media-element-html5-video-and-audio-player/mediaelement/';
|
|
|
|
|
|
|
|
|
237 |
|
238 |
extract(shortcode_atts(array(
|
239 |
'src' => '',
|
264 |
), $atts));
|
265 |
|
266 |
if ($type) {
|
267 |
+
$type_attribute = 'type="'.$type.'"';
|
268 |
}
|
269 |
|
270 |
/*
|
271 |
if ($src) {
|
272 |
+
$src_attribute = 'src="'.htmlspecialchars($src).'"';
|
273 |
$flash_src = htmlspecialchars($src);
|
274 |
}
|
275 |
*/
|
278 |
|
279 |
// does it have an extension?
|
280 |
if (substr($src, strlen($src)-4, 1)=='.') {
|
281 |
+
$src_attribute = 'src="'.htmlspecialchars($src).'"';
|
282 |
$flash_src = htmlspecialchars($src);
|
283 |
} else {
|
284 |
|
342 |
}
|
343 |
}
|
344 |
|
345 |
+
|
346 |
+
|
347 |
if ($mp4) {
|
348 |
+
$mp4_source = '<source src="'.htmlspecialchars($mp4).'" type="'.$tagName.'/mp4" />';
|
349 |
$flash_src = htmlspecialchars($mp4);
|
350 |
}
|
351 |
+
|
352 |
if ($mp3) {
|
353 |
+
$mp3_source = '<source src="'.htmlspecialchars($mp3).'" type="'.$tagName.'/mp3" />';
|
354 |
$flash_src = htmlspecialchars($mp3);
|
355 |
+
}
|
356 |
+
|
357 |
if ($webm) {
|
358 |
+
$webm_source = '<source src="'.htmlspecialchars($webm).'" type="'.$tagName.'/webm" />';
|
359 |
}
|
360 |
+
|
361 |
if ($ogg) {
|
362 |
+
$ogg_source = '<source src="'.htmlspecialchars($ogg).'" type="'.$tagName.'/ogg" />';
|
363 |
}
|
364 |
+
|
365 |
if ($flv) {
|
366 |
+
$flv_source = '<source src="'.htmlspecialchars($flv).'" type="'.$tagName.'/flv" />';
|
367 |
+
}
|
368 |
+
|
369 |
if ($wmv) {
|
370 |
+
$wmv_source = '<source src="'.htmlspecialchars($wmv).'" type="'.$tagName.'/wmv" />';
|
371 |
}
|
372 |
+
|
373 |
+
|
374 |
if ($captions) {
|
375 |
+
$captions_source = '<track src="'.$captions.'" kind="subtitles" srclang="'.$captionslang.'" />';
|
376 |
}
|
377 |
|
|
|
378 |
if ($width && $tagName == 'video') {
|
379 |
+
$width_attribute = 'width="'.$width.'"';
|
380 |
}
|
381 |
+
|
382 |
if ($height && $tagName == 'video') {
|
383 |
+
$height_attribute = 'height="'.$height.'"';
|
384 |
}
|
385 |
+
|
386 |
if ($poster) {
|
387 |
+
$poster_attribute = 'poster="'.htmlspecialchars($poster).'"';
|
388 |
}
|
389 |
+
|
390 |
if ($preload) {
|
391 |
+
$preload_attribute = 'preload="'.$preload.'"';
|
392 |
}
|
393 |
+
|
394 |
if ($autoplay) {
|
395 |
+
$autoplay_attribute = 'autoplay="'.$autoplay.'"';
|
396 |
}
|
397 |
|
|
|
398 |
if ($loop) {
|
399 |
+
$loop_option = ', loop: ' . $loop;
|
400 |
}
|
401 |
|
402 |
+
// CONTROLS
|
403 |
+
$controls_option = ",features: ['playpause'";
|
404 |
+
if ($progress == 'true')
|
405 |
+
$controls_option .= ",'current','progress'";
|
406 |
+
if ($duration == 'true')
|
407 |
+
$controls_option .= ",'duration'";
|
408 |
+
if ($volume == 'true')
|
409 |
+
$controls_option .= ",'volume'";
|
410 |
+
$controls_option .= ",'tracks'";
|
411 |
+
if ($fullscreen == 'true')
|
412 |
+
$controls_option .= ",'fullscreen'";
|
413 |
+
$controls_option .= "]";
|
|
|
|
|
|
|
|
|
|
|
414 |
|
415 |
+
// AUDIO SIZE
|
416 |
+
$audio_size = '';
|
417 |
if ($tagName == 'audio') {
|
418 |
+
$audio_size = ',audioWidth:'.$width.',audioHeight:'.$height;
|
|
|
419 |
}
|
420 |
|
421 |
+
// VIDEO class (skin)
|
422 |
+
$video_skin_attribute = '';
|
423 |
+
if ($skin != '' && $tagName == 'video') {
|
424 |
+
$video_skin_attribute = 'class="mejs-'.$skin.'"';
|
425 |
}
|
426 |
+
|
427 |
+
$mediahtml .= <<<_end_
|
428 |
+
<{$tagName} id="wp_mep_{$mediaElementPlayerIndex}" {$src_attribute} {$type_attribute} {$width_attribute} {$height_attribute} {$poster_attribute} controls="controls" {$preload_attribute} {$autoplay_attribute} $video_skin_attribute>
|
429 |
+
{$mp4_source}
|
430 |
+
{$mp3_source}
|
431 |
+
{$webm_source}
|
432 |
+
{$flv_source}
|
433 |
+
{$wmv_source}
|
434 |
+
{$ogg_source}
|
435 |
+
{$captions_source}
|
436 |
<object width="{$width}" height="{$height}" type="application/x-shockwave-flash" data="{$dir}flashmediaelement.swf">
|
437 |
<param name="movie" value="{$dir}flashmediaelement.swf" />
|
438 |
<param name="flashvars" value="controls=true&file={$flash_src}" />
|
439 |
</object>
|
440 |
</{$tagName}>
|
441 |
+
<script type="text/javascript">
|
442 |
+
jQuery(document).ready(function($) {
|
443 |
+
$('#wp_mep_$mediaElementPlayerIndex').mediaelementplayer({
|
444 |
+
m:1
|
445 |
+
{$loop_option}
|
446 |
+
{$controls_option}
|
447 |
+
{$audio_size}
|
448 |
+
});
|
449 |
+
});
|
450 |
+
</script>
|
451 |
+
|
452 |
_end_;
|
453 |
|
454 |
$mediaElementPlayerIndex++;
|
mediaelement/controls.png
CHANGED
Binary file
|
mediaelement/flashmediaelement.swf
CHANGED
Binary file
|
mediaelement/mediaelement-and-player.js
CHANGED
@@ -7,7 +7,7 @@
|
|
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-
|
11 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
*
|
13 |
*/
|
@@ -15,7 +15,7 @@
|
|
15 |
var mejs = mejs || {};
|
16 |
|
17 |
// version number
|
18 |
-
mejs.version = '2.
|
19 |
|
20 |
// player number (for missing, same id attr)
|
21 |
mejs.meIndex = 0;
|
@@ -26,11 +26,11 @@ mejs.plugins = {
|
|
26 |
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
|
27 |
],
|
28 |
flash: [
|
29 |
-
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg'
|
30 |
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
|
31 |
],
|
32 |
youtube: [
|
33 |
-
{version: null, types: ['video/youtube'
|
34 |
],
|
35 |
vimeo: [
|
36 |
{version: null, types: ['video/vimeo']}
|
@@ -59,13 +59,11 @@ mejs.Utility = {
|
|
59 |
path = '',
|
60 |
name = '',
|
61 |
script,
|
62 |
-
scripts = document.getElementsByTagName('script')
|
63 |
-
il = scripts.length,
|
64 |
-
jl = scriptNames.length;
|
65 |
|
66 |
-
for (; i <
|
67 |
script = scripts[i].src;
|
68 |
-
for (j = 0; j <
|
69 |
name = scriptNames[j];
|
70 |
if (script.indexOf(name) > -1) {
|
71 |
path = script.substring(0, script.indexOf(name));
|
@@ -278,7 +276,6 @@ mejs.MediaFeatures = {
|
|
278 |
t.isFirefox = (ua.match(/firefox/gi) !== null);
|
279 |
t.isWebkit = (ua.match(/webkit/gi) !== null);
|
280 |
t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit;
|
281 |
-
t.isOpera = (ua.match(/opera/gi) !== null);
|
282 |
t.hasTouch = ('ontouchstart' in window);
|
283 |
|
284 |
// create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
|
@@ -438,7 +435,6 @@ mejs.PluginMediaElement.prototype = {
|
|
438 |
seeking: false,
|
439 |
duration: 0,
|
440 |
error: null,
|
441 |
-
tagName: '',
|
442 |
|
443 |
// HTML5 get/set properties, but only set (updated by event handlers)
|
444 |
muted: false,
|
@@ -513,9 +509,9 @@ mejs.PluginMediaElement.prototype = {
|
|
513 |
return false;
|
514 |
},
|
515 |
|
516 |
-
positionFullscreenButton: function(x,y
|
517 |
if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) {
|
518 |
-
this.pluginApi.positionFullscreenButton(x,y
|
519 |
}
|
520 |
},
|
521 |
|
@@ -653,24 +649,6 @@ mejs.PluginMediaElement.prototype = {
|
|
653 |
},
|
654 |
// end: fake events
|
655 |
|
656 |
-
// fake DOM attribute methods
|
657 |
-
attributes: {},
|
658 |
-
hasAttribute: function(name){
|
659 |
-
return (name in this.attributes);
|
660 |
-
},
|
661 |
-
removeAttribute: function(name){
|
662 |
-
delete this.attributes[name];
|
663 |
-
},
|
664 |
-
getAttribute: function(name){
|
665 |
-
if (this.hasAttribute(name)) {
|
666 |
-
return this.attributes[name];
|
667 |
-
}
|
668 |
-
return '';
|
669 |
-
},
|
670 |
-
setAttribute: function(name, value){
|
671 |
-
this.attributes[name] = value;
|
672 |
-
},
|
673 |
-
|
674 |
remove: function() {
|
675 |
mejs.Utility.removeSwf(this.pluginElement.id);
|
676 |
}
|
@@ -785,8 +763,6 @@ mejs.MediaElementDefaults = {
|
|
785 |
pluginWidth: -1,
|
786 |
// overrides <video height>
|
787 |
pluginHeight: -1,
|
788 |
-
// additional plugin variables in 'key=value' form
|
789 |
-
pluginVars: [],
|
790 |
// rate in milliseconds for Flash and Silverlight to fire the timeupdate event
|
791 |
// larger number is less accurate, but less strain on plugin->JavaScript bridge
|
792 |
timerRate: 250,
|
@@ -1042,7 +1018,7 @@ mejs.HtmlMediaElementShim = {
|
|
1042 |
} catch (e) {}
|
1043 |
|
1044 |
errorContainer.innerHTML = (poster !== '') ?
|
1045 |
-
'<a href="' + playback.url + '"><img src="' + poster + '"
|
1046 |
'<a href="' + playback.url + '"><span>Download File</span></a>';
|
1047 |
|
1048 |
htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
|
@@ -1063,17 +1039,6 @@ mejs.HtmlMediaElementShim = {
|
|
1063 |
node,
|
1064 |
initVars;
|
1065 |
|
1066 |
-
// copy tagName from html media element
|
1067 |
-
pluginMediaElement.tagName = htmlMediaElement.tagName
|
1068 |
-
|
1069 |
-
// copy attributes from html media element to plugin media element
|
1070 |
-
for (var i = 0; i < htmlMediaElement.attributes.length; i++) {
|
1071 |
-
var attribute = htmlMediaElement.attributes[i];
|
1072 |
-
if (attribute.specified == true) {
|
1073 |
-
pluginMediaElement.setAttribute(attribute.name, attribute.value);
|
1074 |
-
}
|
1075 |
-
}
|
1076 |
-
|
1077 |
// check for placement inside a <p> tag (sometimes WYSIWYG editors do this)
|
1078 |
node = htmlMediaElement.parentNode;
|
1079 |
while (node !== null && node.tagName.toLowerCase() != 'body') {
|
@@ -1140,9 +1105,6 @@ mejs.HtmlMediaElementShim = {
|
|
1140 |
if (controls) {
|
1141 |
initVars.push('controls=true'); // shows controls in the plugin if desired
|
1142 |
}
|
1143 |
-
if (options.pluginVars) {
|
1144 |
-
initVars = initVars.concat(options.pluginVars);
|
1145 |
-
}
|
1146 |
|
1147 |
switch (playback.method) {
|
1148 |
case 'silverlight':
|
@@ -1393,7 +1355,6 @@ mejs.YouTubeApi = {
|
|
1393 |
|
1394 |
iFrameReady: function() {
|
1395 |
|
1396 |
-
this.isLoaded = true;
|
1397 |
this.isIframeLoaded = true;
|
1398 |
|
1399 |
while (this.iframeQueue.length > 0) {
|
@@ -1523,7 +1484,7 @@ window.MediaElement = mejs.MediaElement;
|
|
1523 |
* Creates a controller bar for HTML5 <video> add <audio> tags
|
1524 |
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
|
1525 |
*
|
1526 |
-
* Copyright 2010-
|
1527 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
1528 |
*
|
1529 |
*/
|
@@ -1574,9 +1535,9 @@ if (typeof jQuery != 'undefined') {
|
|
1574 |
alwaysShowControls: false,
|
1575 |
// force iPad's native controls
|
1576 |
iPadUseNativeControls: false,
|
1577 |
-
// force
|
1578 |
iPhoneUseNativeControls: false,
|
1579 |
-
// force
|
1580 |
AndroidUseNativeControls: false,
|
1581 |
// features to show
|
1582 |
features: ['playpause','current','progress','duration','tracks','volume','fullscreen'],
|
@@ -1631,7 +1592,7 @@ if (typeof jQuery != 'undefined') {
|
|
1631 |
}
|
1632 |
|
1633 |
// 5%
|
1634 |
-
var newTime = Math.
|
1635 |
media.setCurrentTime(newTime);
|
1636 |
}
|
1637 |
}
|
@@ -1649,7 +1610,7 @@ if (typeof jQuery != 'undefined') {
|
|
1649 |
}
|
1650 |
|
1651 |
// 5%
|
1652 |
-
var newTime = Math.
|
1653 |
media.setCurrentTime(newTime);
|
1654 |
}
|
1655 |
}
|
@@ -1747,8 +1708,7 @@ if (typeof jQuery != 'undefined') {
|
|
1747 |
t.$media.attr('controls', 'controls');
|
1748 |
|
1749 |
// attempt to fix iOS 3 bug
|
1750 |
-
|
1751 |
-
// no Issue found on iOS3 -ttroxell
|
1752 |
|
1753 |
// override Apple's autoplay override for iPads
|
1754 |
if (mf.isiPad && t.media.getAttribute('autoplay') !== null) {
|
@@ -2228,14 +2188,7 @@ if (typeof jQuery != 'undefined') {
|
|
2228 |
|
2229 |
setPlayerSize: function(width,height) {
|
2230 |
var t = this;
|
2231 |
-
|
2232 |
-
if (typeof width != 'undefined')
|
2233 |
-
t.width = width;
|
2234 |
-
|
2235 |
-
if (typeof height != 'undefined')
|
2236 |
-
t.height = height;
|
2237 |
-
|
2238 |
-
// detect 100% mode
|
2239 |
if (t.height.toString().indexOf('%') > 0) {
|
2240 |
|
2241 |
// do we have the native dimensions yet?
|
@@ -2296,7 +2249,7 @@ if (typeof jQuery != 'undefined') {
|
|
2296 |
rail = t.controls.find('.mejs-time-rail'),
|
2297 |
total = t.controls.find('.mejs-time-total'),
|
2298 |
current = t.controls.find('.mejs-time-current'),
|
2299 |
-
loaded = t.controls.find('.mejs-time-loaded')
|
2300 |
others = rail.siblings();
|
2301 |
|
2302 |
|
@@ -2318,7 +2271,7 @@ if (typeof jQuery != 'undefined') {
|
|
2318 |
});
|
2319 |
|
2320 |
// fit the rail into the remaining space
|
2321 |
-
railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.
|
2322 |
}
|
2323 |
|
2324 |
// outer area
|
@@ -2386,7 +2339,8 @@ if (typeof jQuery != 'undefined') {
|
|
2386 |
'<div class="mejs-overlay-error"></div>'+
|
2387 |
'</div>')
|
2388 |
.hide() // start out hidden
|
2389 |
-
.appendTo(layers),
|
|
|
2390 |
// this needs to come last so it's on top
|
2391 |
bigPlay =
|
2392 |
$('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+
|
@@ -2413,26 +2367,14 @@ if (typeof jQuery != 'undefined') {
|
|
2413 |
media.addEventListener('play',function() {
|
2414 |
bigPlay.hide();
|
2415 |
loading.hide();
|
2416 |
-
controls.find('.mejs-time-buffering').hide();
|
2417 |
error.hide();
|
2418 |
}, false);
|
2419 |
|
2420 |
media.addEventListener('playing', function() {
|
2421 |
bigPlay.hide();
|
2422 |
loading.hide();
|
2423 |
-
controls.find('.mejs-time-buffering').hide();
|
2424 |
error.hide();
|
2425 |
}, false);
|
2426 |
-
|
2427 |
-
media.addEventListener('seeking', function() {
|
2428 |
-
loading.show();
|
2429 |
-
controls.find('.mejs-time-buffering').show();
|
2430 |
-
}, false);
|
2431 |
-
|
2432 |
-
media.addEventListener('seeked', function() {
|
2433 |
-
loading.hide();
|
2434 |
-
controls.find('.mejs-time-buffering').hide();
|
2435 |
-
}, false);
|
2436 |
|
2437 |
media.addEventListener('pause',function() {
|
2438 |
if (!mejs.MediaFeatures.isiPhone) {
|
@@ -2442,7 +2384,6 @@ if (typeof jQuery != 'undefined') {
|
|
2442 |
|
2443 |
media.addEventListener('waiting', function() {
|
2444 |
loading.show();
|
2445 |
-
controls.find('.mejs-time-buffering').show();
|
2446 |
}, false);
|
2447 |
|
2448 |
|
@@ -2453,17 +2394,14 @@ if (typeof jQuery != 'undefined') {
|
|
2453 |
// return;
|
2454 |
|
2455 |
loading.show();
|
2456 |
-
controls.find('.mejs-time-buffering').show();
|
2457 |
}, false);
|
2458 |
media.addEventListener('canplay',function() {
|
2459 |
loading.hide();
|
2460 |
-
controls.find('.mejs-time-buffering').hide();
|
2461 |
}, false);
|
2462 |
|
2463 |
// error handling
|
2464 |
media.addEventListener('error',function() {
|
2465 |
loading.hide();
|
2466 |
-
controls.find('.mejs-time-buffering').hide();
|
2467 |
error.show();
|
2468 |
error.find('mejs-overlay-error').html("Error loading this resource");
|
2469 |
}, false);
|
@@ -2510,15 +2448,12 @@ if (typeof jQuery != 'undefined') {
|
|
2510 |
|
2511 |
// store for use by plugins
|
2512 |
t.tracks = [];
|
2513 |
-
tracktags.each(function(
|
2514 |
-
|
2515 |
-
track = $(track);
|
2516 |
-
|
2517 |
t.tracks.push({
|
2518 |
-
srclang:
|
2519 |
-
src:
|
2520 |
-
kind:
|
2521 |
-
label:
|
2522 |
entries: [],
|
2523 |
isLoaded: false
|
2524 |
});
|
@@ -2526,7 +2461,7 @@ if (typeof jQuery != 'undefined') {
|
|
2526 |
},
|
2527 |
changeSkin: function(className) {
|
2528 |
this.container[0].className = 'mejs-container ' + className;
|
2529 |
-
this.setPlayerSize(
|
2530 |
this.setControlsSize();
|
2531 |
},
|
2532 |
play: function() {
|
@@ -2561,7 +2496,7 @@ if (typeof jQuery != 'undefined') {
|
|
2561 |
|
2562 |
if (t.media.pluginType == 'flash') {
|
2563 |
t.media.remove();
|
2564 |
-
} else if (t.media.
|
2565 |
t.media.prop('controls', true);
|
2566 |
}
|
2567 |
|
@@ -2591,8 +2526,7 @@ if (typeof jQuery != 'undefined') {
|
|
2591 |
// push out to window
|
2592 |
window.MediaElementPlayer = mejs.MediaElementPlayer;
|
2593 |
|
2594 |
-
})(mejs.$);
|
2595 |
-
|
2596 |
(function($) {
|
2597 |
|
2598 |
$.extend(mejs.MepDefaults, {
|
@@ -2651,7 +2585,7 @@ if (typeof jQuery != 'undefined') {
|
|
2651 |
var t = this,
|
2652 |
stop =
|
2653 |
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
|
2654 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '
|
2655 |
'</div>')
|
2656 |
.appendTo(controls)
|
2657 |
.click(function() {
|
@@ -2678,7 +2612,6 @@ if (typeof jQuery != 'undefined') {
|
|
2678 |
|
2679 |
$('<div class="mejs-time-rail">'+
|
2680 |
'<span class="mejs-time-total">'+
|
2681 |
-
'<span class="mejs-time-buffering"></span>'+
|
2682 |
'<span class="mejs-time-loaded"></span>'+
|
2683 |
'<span class="mejs-time-current"></span>'+
|
2684 |
'<span class="mejs-time-handle"></span>'+
|
@@ -2689,7 +2622,6 @@ if (typeof jQuery != 'undefined') {
|
|
2689 |
'</span>'+
|
2690 |
'</div>')
|
2691 |
.appendTo(controls);
|
2692 |
-
controls.find('.mejs-time-buffering').hide();
|
2693 |
|
2694 |
var
|
2695 |
t = this,
|
@@ -2737,32 +2669,31 @@ if (typeof jQuery != 'undefined') {
|
|
2737 |
if (e.which === 1) {
|
2738 |
mouseIsDown = true;
|
2739 |
handleMouseMove(e);
|
2740 |
-
$(document)
|
2741 |
-
.bind('mousemove.dur', function(e) {
|
2742 |
-
handleMouseMove(e);
|
2743 |
-
})
|
2744 |
-
.bind('mouseup.dur', function (e) {
|
2745 |
-
mouseIsDown = false;
|
2746 |
-
timefloat.hide();
|
2747 |
-
$(document).unbind('.dur');
|
2748 |
-
});
|
2749 |
return false;
|
2750 |
-
}
|
2751 |
-
})
|
|
|
|
|
2752 |
.bind('mouseenter', function(e) {
|
2753 |
mouseIsOver = true;
|
2754 |
-
$(document).bind('mousemove.dur', function(e) {
|
2755 |
-
handleMouseMove(e);
|
2756 |
-
});
|
2757 |
if (!mejs.MediaFeatures.hasTouch) {
|
2758 |
timefloat.show();
|
2759 |
}
|
2760 |
})
|
2761 |
.bind('mouseleave',function(e) {
|
2762 |
mouseIsOver = false;
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2766 |
}
|
2767 |
});
|
2768 |
|
@@ -2842,8 +2773,7 @@ if (typeof jQuery != 'undefined') {
|
|
2842 |
|
2843 |
// options
|
2844 |
$.extend(mejs.MepDefaults, {
|
2845 |
-
duration: -1
|
2846 |
-
timeAndDurationSeparator: ' <span> | </span> '
|
2847 |
});
|
2848 |
|
2849 |
|
@@ -2870,7 +2800,7 @@ if (typeof jQuery != 'undefined') {
|
|
2870 |
var t = this;
|
2871 |
|
2872 |
if (controls.children().last().find('.mejs-currenttime').length > 0) {
|
2873 |
-
$(
|
2874 |
'<span class="mejs-duration">' +
|
2875 |
(t.options.duration > 0 ?
|
2876 |
mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :
|
@@ -2923,36 +2853,18 @@ if (typeof jQuery != 'undefined') {
|
|
2923 |
|
2924 |
$.extend(mejs.MepDefaults, {
|
2925 |
muteText: 'Mute Toggle',
|
2926 |
-
hideVolumeOnTouchDevices: true
|
2927 |
-
|
2928 |
-
audioVolume: 'horizontal',
|
2929 |
-
videoVolume: 'vertical'
|
2930 |
});
|
2931 |
|
2932 |
$.extend(MediaElementPlayer.prototype, {
|
2933 |
buildvolume: function(player, controls, layers, media) {
|
2934 |
-
|
2935 |
// Android and iOS don't support volume controls
|
2936 |
if (mejs.MediaFeatures.hasTouch && this.options.hideVolumeOnTouchDevices)
|
2937 |
return;
|
2938 |
|
2939 |
var t = this,
|
2940 |
-
|
2941 |
-
mute = (mode == 'horizontal') ?
|
2942 |
-
|
2943 |
-
// horizontal version
|
2944 |
-
$('<div class="mejs-button mejs-volume-button mejs-mute">'+
|
2945 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
|
2946 |
-
'</div>' +
|
2947 |
-
'<div class="mejs-horizontal-volume-slider">'+ // outer background
|
2948 |
-
'<div class="mejs-horizontal-volume-total"></div>'+ // line background
|
2949 |
-
'<div class="mejs-horizontal-volume-current"></div>'+ // current volume
|
2950 |
-
'<div class="mejs-horizontal-volume-handle"></div>'+ // handle
|
2951 |
-
'</div>'
|
2952 |
-
)
|
2953 |
-
.appendTo(controls) :
|
2954 |
-
|
2955 |
-
// vertical version
|
2956 |
$('<div class="mejs-button mejs-volume-button mejs-mute">'+
|
2957 |
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
|
2958 |
'<div class="mejs-volume-slider">'+ // outer background
|
@@ -2961,118 +2873,89 @@ if (typeof jQuery != 'undefined') {
|
|
2961 |
'<div class="mejs-volume-handle"></div>'+ // handle
|
2962 |
'</div>'+
|
2963 |
'</div>')
|
2964 |
-
|
2965 |
-
volumeSlider =
|
2966 |
-
volumeTotal =
|
2967 |
-
volumeCurrent =
|
2968 |
-
volumeHandle =
|
2969 |
|
2970 |
-
positionVolumeHandle = function(volume
|
2971 |
|
2972 |
-
if (!volumeSlider.is(':visible')
|
2973 |
volumeSlider.show();
|
2974 |
-
positionVolumeHandle(volume
|
2975 |
volumeSlider.hide()
|
2976 |
return;
|
2977 |
}
|
2978 |
-
|
2979 |
-
// correct to 0-1
|
2980 |
-
volume = Math.max(0,volume);
|
2981 |
-
volume = Math.min(volume,1);
|
2982 |
-
|
2983 |
-
// ajust mute button style
|
2984 |
-
if (volume == 0) {
|
2985 |
-
mute.removeClass('mejs-mute').addClass('mejs-unmute');
|
2986 |
-
} else {
|
2987 |
-
mute.removeClass('mejs-unmute').addClass('mejs-mute');
|
2988 |
-
}
|
2989 |
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
|
|
2993 |
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
// top/left of full size volume slider background
|
2998 |
-
totalPosition = volumeTotal.position(),
|
2999 |
-
|
3000 |
-
// the new top position based on the current volume
|
3001 |
-
// 70% volume on 100px height == top:30px
|
3002 |
-
newTop = totalHeight - (totalHeight * volume);
|
3003 |
-
|
3004 |
-
// handle
|
3005 |
-
volumeHandle.css('top', totalPosition.top + newTop - (volumeHandle.height() / 2));
|
3006 |
-
|
3007 |
-
// show the current visibility
|
3008 |
-
volumeCurrent.height(totalHeight - newTop );
|
3009 |
-
volumeCurrent.css('top', totalPosition.top + newTop);
|
3010 |
-
} else {
|
3011 |
-
var
|
3012 |
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
volumeHandle.css('left', totalPosition.left + newLeft - (volumeHandle.width() / 2));
|
3024 |
-
|
3025 |
-
// rezize the current part of the volume bar
|
3026 |
-
volumeCurrent.width( newLeft );
|
3027 |
-
}
|
3028 |
},
|
3029 |
handleVolumeMove = function(e) {
|
3030 |
-
|
3031 |
-
|
3032 |
-
totalOffset = volumeTotal.offset()
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
var
|
3038 |
-
railHeight = volumeTotal.height(),
|
3039 |
-
totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
|
3040 |
-
newY = e.pageY - totalOffset.top;
|
3041 |
-
|
3042 |
-
volume = (railHeight - newY) / railHeight;
|
3043 |
-
|
3044 |
-
// the controls just hide themselves (usually when mouse moves too far up)
|
3045 |
-
if (totalOffset.top == 0 || totalOffset.left == 0)
|
3046 |
-
return;
|
3047 |
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
|
3052 |
-
|
3053 |
-
volume = newX / railWidth;
|
3054 |
-
}
|
3055 |
-
|
3056 |
-
// ensure the volume isn't outside 0-1
|
3057 |
volume = Math.max(0,volume);
|
3058 |
-
volume = Math.min(volume,1);
|
3059 |
-
|
3060 |
-
//
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3064 |
if (volume == 0) {
|
3065 |
media.setMuted(true);
|
|
|
3066 |
} else {
|
3067 |
media.setMuted(false);
|
|
|
3068 |
}
|
3069 |
-
|
|
|
|
|
|
|
|
|
|
|
3070 |
},
|
3071 |
mouseIsDown = false,
|
3072 |
mouseIsOver = false;
|
3073 |
|
3074 |
// SLIDER
|
3075 |
-
|
3076 |
mute
|
3077 |
.hover(function() {
|
3078 |
volumeSlider.show();
|
@@ -3080,7 +2963,7 @@ if (typeof jQuery != 'undefined') {
|
|
3080 |
}, function() {
|
3081 |
mouseIsOver = false;
|
3082 |
|
3083 |
-
if (!mouseIsDown
|
3084 |
volumeSlider.hide();
|
3085 |
}
|
3086 |
});
|
@@ -3091,27 +2974,31 @@ if (typeof jQuery != 'undefined') {
|
|
3091 |
})
|
3092 |
.bind('mousedown', function (e) {
|
3093 |
handleVolumeMove(e);
|
3094 |
-
$(document)
|
3095 |
-
.bind('mousemove.vol', function(e) {
|
3096 |
-
handleVolumeMove(e);
|
3097 |
-
})
|
3098 |
-
.bind('mouseup.vol', function () {
|
3099 |
-
mouseIsDown = false;
|
3100 |
-
$(document).unbind('.vol');
|
3101 |
-
|
3102 |
-
if (!mouseIsOver && mode == 'vertical') {
|
3103 |
-
volumeSlider.hide();
|
3104 |
-
}
|
3105 |
-
});
|
3106 |
mouseIsDown = true;
|
3107 |
|
3108 |
return false;
|
3109 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3110 |
|
3111 |
|
3112 |
// MUTE button
|
3113 |
mute.find('button').click(function() {
|
|
|
3114 |
media.setMuted( !media.muted );
|
|
|
3115 |
});
|
3116 |
|
3117 |
// listen for volume change events from other sources
|
@@ -3127,14 +3014,13 @@ if (typeof jQuery != 'undefined') {
|
|
3127 |
}
|
3128 |
}, false);
|
3129 |
|
3130 |
-
|
3131 |
-
|
3132 |
-
|
3133 |
-
|
3134 |
-
|
3135 |
-
|
3136 |
-
|
3137 |
-
}
|
3138 |
}
|
3139 |
}
|
3140 |
});
|
@@ -3144,7 +3030,7 @@ if (typeof jQuery != 'undefined') {
|
|
3144 |
(function($) {
|
3145 |
|
3146 |
$.extend(mejs.MepDefaults, {
|
3147 |
-
usePluginFullScreen:
|
3148 |
newWindowCallback: function() { return '';},
|
3149 |
fullscreenText: 'Fullscreen'
|
3150 |
});
|
@@ -3169,16 +3055,7 @@ if (typeof jQuery != 'undefined') {
|
|
3169 |
// native events
|
3170 |
if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
3171 |
|
3172 |
-
|
3173 |
-
var target = null;
|
3174 |
-
|
3175 |
-
if (mejs.MediaFeatures.hasMozNativeFullScreen) {
|
3176 |
-
target = $(document);
|
3177 |
-
} else {
|
3178 |
-
target = player.container;
|
3179 |
-
}
|
3180 |
-
|
3181 |
-
target.bind(mejs.MediaFeatures.fullScreenEventName, function(e) {
|
3182 |
//player.container.bind('webkitfullscreenchange', function(e) {
|
3183 |
|
3184 |
|
@@ -3219,179 +3096,35 @@ if (typeof jQuery != 'undefined') {
|
|
3219 |
|
3220 |
} else {
|
3221 |
|
3222 |
-
var hideTimeout = null
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
documentElement = document.documentElement,
|
3227 |
-
getComputedStyle = window.getComputedStyle,
|
3228 |
-
supports;
|
3229 |
-
if(!('pointerEvents' in element.style)){
|
3230 |
-
return false;
|
3231 |
-
}
|
3232 |
-
element.style.pointerEvents = 'auto';
|
3233 |
-
element.style.pointerEvents = 'x';
|
3234 |
-
documentElement.appendChild(element);
|
3235 |
-
supports = getComputedStyle &&
|
3236 |
-
getComputedStyle(element, '').pointerEvents === 'auto';
|
3237 |
-
documentElement.removeChild(element);
|
3238 |
-
return !!supports;
|
3239 |
-
})();
|
3240 |
-
|
3241 |
-
console.log('supportsPointerEvents', supportsPointerEvents);
|
3242 |
-
|
3243 |
-
if (supportsPointerEvents && !mejs.MediaFeatures.isOpera) { // opera doesn't allow this :(
|
3244 |
-
|
3245 |
-
// allows clicking through the fullscreen button and controls down directly to Flash
|
3246 |
-
|
3247 |
-
/*
|
3248 |
-
When a user puts his mouse over the fullscreen button, the controls are disabled
|
3249 |
-
So we put a div over the video and another one on iether side of the fullscreen button
|
3250 |
-
that caputre mouse movement
|
3251 |
-
and restore the controls once the mouse moves outside of the fullscreen button
|
3252 |
-
*/
|
3253 |
-
|
3254 |
-
var fullscreenIsDisabled = false,
|
3255 |
-
restoreControls = function() {
|
3256 |
-
if (fullscreenIsDisabled) {
|
3257 |
-
// hide the hovers
|
3258 |
-
videoHoverDiv.hide();
|
3259 |
-
controlsLeftHoverDiv.hide();
|
3260 |
-
controlsRightHoverDiv.hide();
|
3261 |
-
|
3262 |
-
// restore the control bar
|
3263 |
-
fullscreenBtn.css('pointer-events', '');
|
3264 |
-
t.controls.css('pointer-events', '');
|
3265 |
-
|
3266 |
-
// store for later
|
3267 |
-
fullscreenIsDisabled = false;
|
3268 |
-
}
|
3269 |
-
},
|
3270 |
-
videoHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
|
3271 |
-
controlsLeftHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
|
3272 |
-
controlsRightHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
|
3273 |
-
positionHoverDivs = function() {
|
3274 |
-
var style = {position: 'absolute', top: 0, left: 0}; //, backgroundColor: '#f00'};
|
3275 |
-
videoHoverDiv.css(style);
|
3276 |
-
controlsLeftHoverDiv.css(style);
|
3277 |
-
controlsRightHoverDiv.css(style);
|
3278 |
-
|
3279 |
-
// over video, but not controls
|
3280 |
-
videoHoverDiv
|
3281 |
-
.width( t.container.width() )
|
3282 |
-
.height( t.container.height() - t.controls.height() );
|
3283 |
-
|
3284 |
-
// over controls, but not the fullscreen button
|
3285 |
-
var fullScreenBtnOffset = fullscreenBtn.offset().left - t.container.offset().left;
|
3286 |
-
fullScreenBtnWidth = fullscreenBtn.outerWidth(true);
|
3287 |
-
|
3288 |
-
controlsLeftHoverDiv
|
3289 |
-
.width( fullScreenBtnOffset )
|
3290 |
-
.height( t.controls.height() )
|
3291 |
-
.css({top: t.container.height() - t.controls.height()});
|
3292 |
-
|
3293 |
-
// after the fullscreen button
|
3294 |
-
controlsRightHoverDiv
|
3295 |
-
.width( t.container.width() - fullScreenBtnOffset - fullScreenBtnWidth )
|
3296 |
-
.height( t.controls.height() )
|
3297 |
-
.css({top: t.container.height() - t.controls.height(),
|
3298 |
-
left: fullScreenBtnOffset + fullScreenBtnWidth});
|
3299 |
-
};
|
3300 |
-
|
3301 |
-
$(document).resize(function() {
|
3302 |
-
positionHoverDivs();
|
3303 |
-
});
|
3304 |
-
|
3305 |
-
// on hover, kill the fullscreen button's HTML handling, allowing clicks down to Flash
|
3306 |
-
fullscreenBtn
|
3307 |
-
.mouseover(function() {
|
3308 |
-
|
3309 |
-
if (!t.isFullScreen) {
|
3310 |
-
|
3311 |
-
var buttonPos = fullscreenBtn.offset(),
|
3312 |
-
containerPos = player.container.offset();
|
3313 |
-
|
3314 |
-
// move the button in Flash into place
|
3315 |
-
media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, false);
|
3316 |
-
|
3317 |
-
// allows click through
|
3318 |
-
fullscreenBtn.css('pointer-events', 'none');
|
3319 |
-
t.controls.css('pointer-events', 'none');
|
3320 |
-
|
3321 |
-
// show the divs that will restore things
|
3322 |
-
videoHoverDiv.show();
|
3323 |
-
controlsRightHoverDiv.show();
|
3324 |
-
controlsLeftHoverDiv.show();
|
3325 |
-
positionHoverDivs();
|
3326 |
-
|
3327 |
-
fullscreenIsDisabled = true;
|
3328 |
-
}
|
3329 |
|
3330 |
-
|
3331 |
-
|
3332 |
-
|
3333 |
-
|
3334 |
-
restoreControls();
|
3335 |
-
});
|
3336 |
-
|
3337 |
-
|
3338 |
-
// the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events
|
3339 |
-
// so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button
|
3340 |
-
/*
|
3341 |
-
$(document).mousemove(function(e) {
|
3342 |
|
3343 |
-
|
3344 |
-
|
3345 |
-
|
3346 |
-
var fullscreenBtnPos = fullscreenBtn.offset();
|
3347 |
|
3348 |
-
|
3349 |
-
if (e.pageY < fullscreenBtnPos.top || e.pageY > fullscreenBtnPos.top + fullscreenBtn.outerHeight(true) ||
|
3350 |
-
e.pageX < fullscreenBtnPos.left || e.pageX > fullscreenBtnPos.left + fullscreenBtn.outerWidth(true)
|
3351 |
-
) {
|
3352 |
-
|
3353 |
-
fullscreenBtn.css('pointer-events', '');
|
3354 |
-
t.controls.css('pointer-events', '');
|
3355 |
-
|
3356 |
-
fullscreenIsDisabled = false;
|
3357 |
-
}
|
3358 |
-
}
|
3359 |
-
});
|
3360 |
-
*/
|
3361 |
|
|
|
|
|
3362 |
|
3363 |
-
|
3364 |
-
|
3365 |
-
|
3366 |
-
|
3367 |
-
fullscreenBtn
|
3368 |
-
.mouseover(function() {
|
3369 |
-
|
3370 |
-
if (hideTimeout !== null) {
|
3371 |
-
clearTimeout(hideTimeout);
|
3372 |
-
delete hideTimeout;
|
3373 |
-
}
|
3374 |
-
|
3375 |
-
var buttonPos = fullscreenBtn.offset(),
|
3376 |
-
containerPos = player.container.offset();
|
3377 |
-
|
3378 |
-
media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, true);
|
3379 |
|
3380 |
-
|
3381 |
-
|
|
|
3382 |
|
3383 |
-
|
3384 |
-
|
3385 |
-
delete hideTimeout;
|
3386 |
-
}
|
3387 |
-
|
3388 |
-
hideTimeout = setTimeout(function() {
|
3389 |
-
media.hideFullscreenButton();
|
3390 |
-
}, 1500);
|
3391 |
-
|
3392 |
-
|
3393 |
-
});
|
3394 |
-
}
|
3395 |
}
|
3396 |
|
3397 |
player.fullscreenBtn = fullscreenBtn;
|
@@ -3430,27 +3163,6 @@ if (typeof jQuery != 'undefined') {
|
|
3430 |
mejs.MediaFeatures.requestFullScreen(t.container[0]);
|
3431 |
//return;
|
3432 |
|
3433 |
-
if (t.isInIframe) {
|
3434 |
-
// sometimes exiting from fullscreen doesn't work
|
3435 |
-
// notably in Chrome <iframe>. Fixed in version 17
|
3436 |
-
setTimeout(function checkFullscreen() {
|
3437 |
-
|
3438 |
-
if (t.isNativeFullScreen) {
|
3439 |
-
|
3440 |
-
// check if the video is suddenly not really fullscreen
|
3441 |
-
if ($(window).width() !== screen.width) {
|
3442 |
-
// manually exit
|
3443 |
-
t.exitFullScreen();
|
3444 |
-
} else {
|
3445 |
-
// test again
|
3446 |
-
setTimeout(checkFullscreen, 500);
|
3447 |
-
}
|
3448 |
-
}
|
3449 |
-
|
3450 |
-
|
3451 |
-
}, 500);
|
3452 |
-
}
|
3453 |
-
|
3454 |
} else if (mejs.MediaFeatures.hasSemiNativeFullScreen) {
|
3455 |
t.media.webkitEnterFullscreen();
|
3456 |
return;
|
@@ -3700,7 +3412,7 @@ if (typeof jQuery != 'undefined') {
|
|
3700 |
// chapters
|
3701 |
if (player.hasChapters) {
|
3702 |
player.chapters.css('visibility','visible');
|
3703 |
-
player.chapters.fadeIn(200)
|
3704 |
}
|
3705 |
},
|
3706 |
function () {
|
@@ -3841,7 +3553,7 @@ if (typeof jQuery != 'undefined') {
|
|
3841 |
for (i=0; i<track.entries.times.length; i++) {
|
3842 |
if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop){
|
3843 |
t.captionsText.html(track.entries.text[i]);
|
3844 |
-
t.captions.show()
|
3845 |
return; // exit out if one is visible;
|
3846 |
}
|
3847 |
}
|
@@ -4042,27 +3754,6 @@ if (typeof jQuery != 'undefined') {
|
|
4042 |
return entries;
|
4043 |
}
|
4044 |
};
|
4045 |
-
|
4046 |
-
// test for browsers with bad String.split method.
|
4047 |
-
if ('x\n\ny'.split(/\n/gi).length != 3) {
|
4048 |
-
// add super slow IE8 and below version
|
4049 |
-
mejs.TrackFormatParser.split2 = function(text, regex) {
|
4050 |
-
var
|
4051 |
-
parts = [],
|
4052 |
-
chunk = '',
|
4053 |
-
i;
|
4054 |
-
|
4055 |
-
for (i=0; i<text.length; i++) {
|
4056 |
-
chunk += text.substring(i,i+1);
|
4057 |
-
if (regex.test(chunk)) {
|
4058 |
-
parts.push(chunk.replace(regex, ''));
|
4059 |
-
chunk = '';
|
4060 |
-
}
|
4061 |
-
}
|
4062 |
-
parts.push(chunk);
|
4063 |
-
return parts;
|
4064 |
-
}
|
4065 |
-
}
|
4066 |
|
4067 |
})(mejs.$);
|
4068 |
|
@@ -4075,7 +3766,7 @@ if (typeof jQuery != 'undefined') {
|
|
4075 |
(function($) {
|
4076 |
|
4077 |
$.extend(mejs.MepDefaults,
|
4078 |
-
|
4079 |
// demo of a fullscreen option
|
4080 |
{
|
4081 |
render: function(player) {
|
@@ -4130,7 +3821,7 @@ $.extend(mejs.MepDefaults,
|
|
4130 |
window.location.href = player.media.currentSrc;
|
4131 |
}
|
4132 |
}
|
4133 |
-
]
|
4134 |
);
|
4135 |
|
4136 |
|
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-2011, John Dyer (http://j.hn)
|
11 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
*
|
13 |
*/
|
15 |
var mejs = mejs || {};
|
16 |
|
17 |
// version number
|
18 |
+
mejs.version = '2.5.0';
|
19 |
|
20 |
// player number (for missing, same id attr)
|
21 |
mejs.meIndex = 0;
|
26 |
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
|
27 |
],
|
28 |
flash: [
|
29 |
+
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg']}
|
30 |
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
|
31 |
],
|
32 |
youtube: [
|
33 |
+
{version: null, types: ['video/youtube']}
|
34 |
],
|
35 |
vimeo: [
|
36 |
{version: null, types: ['video/vimeo']}
|
59 |
path = '',
|
60 |
name = '',
|
61 |
script,
|
62 |
+
scripts = document.getElementsByTagName('script');
|
|
|
|
|
63 |
|
64 |
+
for (; i < scripts.length; i++) {
|
65 |
script = scripts[i].src;
|
66 |
+
for (j = 0; j < scriptNames.length; j++) {
|
67 |
name = scriptNames[j];
|
68 |
if (script.indexOf(name) > -1) {
|
69 |
path = script.substring(0, script.indexOf(name));
|
276 |
t.isFirefox = (ua.match(/firefox/gi) !== null);
|
277 |
t.isWebkit = (ua.match(/webkit/gi) !== null);
|
278 |
t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit;
|
|
|
279 |
t.hasTouch = ('ontouchstart' in window);
|
280 |
|
281 |
// create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
|
435 |
seeking: false,
|
436 |
duration: 0,
|
437 |
error: null,
|
|
|
438 |
|
439 |
// HTML5 get/set properties, but only set (updated by event handlers)
|
440 |
muted: false,
|
509 |
return false;
|
510 |
},
|
511 |
|
512 |
+
positionFullscreenButton: function(x,y) {
|
513 |
if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) {
|
514 |
+
this.pluginApi.positionFullscreenButton(x,y);
|
515 |
}
|
516 |
},
|
517 |
|
649 |
},
|
650 |
// end: fake events
|
651 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
652 |
remove: function() {
|
653 |
mejs.Utility.removeSwf(this.pluginElement.id);
|
654 |
}
|
763 |
pluginWidth: -1,
|
764 |
// overrides <video height>
|
765 |
pluginHeight: -1,
|
|
|
|
|
766 |
// rate in milliseconds for Flash and Silverlight to fire the timeupdate event
|
767 |
// larger number is less accurate, but less strain on plugin->JavaScript bridge
|
768 |
timerRate: 250,
|
1018 |
} catch (e) {}
|
1019 |
|
1020 |
errorContainer.innerHTML = (poster !== '') ?
|
1021 |
+
'<a href="' + playback.url + '"><img src="' + poster + '" /></a>' :
|
1022 |
'<a href="' + playback.url + '"><span>Download File</span></a>';
|
1023 |
|
1024 |
htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
|
1039 |
node,
|
1040 |
initVars;
|
1041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
// check for placement inside a <p> tag (sometimes WYSIWYG editors do this)
|
1043 |
node = htmlMediaElement.parentNode;
|
1044 |
while (node !== null && node.tagName.toLowerCase() != 'body') {
|
1105 |
if (controls) {
|
1106 |
initVars.push('controls=true'); // shows controls in the plugin if desired
|
1107 |
}
|
|
|
|
|
|
|
1108 |
|
1109 |
switch (playback.method) {
|
1110 |
case 'silverlight':
|
1355 |
|
1356 |
iFrameReady: function() {
|
1357 |
|
|
|
1358 |
this.isIframeLoaded = true;
|
1359 |
|
1360 |
while (this.iframeQueue.length > 0) {
|
1484 |
* Creates a controller bar for HTML5 <video> add <audio> tags
|
1485 |
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
|
1486 |
*
|
1487 |
+
* Copyright 2010-2011, John Dyer (http://j.hn/)
|
1488 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
1489 |
*
|
1490 |
*/
|
1535 |
alwaysShowControls: false,
|
1536 |
// force iPad's native controls
|
1537 |
iPadUseNativeControls: false,
|
1538 |
+
// force iPad's native controls
|
1539 |
iPhoneUseNativeControls: false,
|
1540 |
+
// force iPad's native controls
|
1541 |
AndroidUseNativeControls: false,
|
1542 |
// features to show
|
1543 |
features: ['playpause','current','progress','duration','tracks','volume','fullscreen'],
|
1592 |
}
|
1593 |
|
1594 |
// 5%
|
1595 |
+
var newTime = Math.min(media.currentTime - (media.duration * 0.05), media.duration);
|
1596 |
media.setCurrentTime(newTime);
|
1597 |
}
|
1598 |
}
|
1610 |
}
|
1611 |
|
1612 |
// 5%
|
1613 |
+
var newTime = Math.max(media.currentTime + (media.duration * 0.05), 0);
|
1614 |
media.setCurrentTime(newTime);
|
1615 |
}
|
1616 |
}
|
1708 |
t.$media.attr('controls', 'controls');
|
1709 |
|
1710 |
// attempt to fix iOS 3 bug
|
1711 |
+
t.$media.removeAttr('poster');
|
|
|
1712 |
|
1713 |
// override Apple's autoplay override for iPads
|
1714 |
if (mf.isiPad && t.media.getAttribute('autoplay') !== null) {
|
2188 |
|
2189 |
setPlayerSize: function(width,height) {
|
2190 |
var t = this;
|
2191 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2192 |
if (t.height.toString().indexOf('%') > 0) {
|
2193 |
|
2194 |
// do we have the native dimensions yet?
|
2249 |
rail = t.controls.find('.mejs-time-rail'),
|
2250 |
total = t.controls.find('.mejs-time-total'),
|
2251 |
current = t.controls.find('.mejs-time-current'),
|
2252 |
+
loaded = t.controls.find('.mejs-time-loaded');
|
2253 |
others = rail.siblings();
|
2254 |
|
2255 |
|
2271 |
});
|
2272 |
|
2273 |
// fit the rail into the remaining space
|
2274 |
+
railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.outerWidth(false));
|
2275 |
}
|
2276 |
|
2277 |
// outer area
|
2339 |
'<div class="mejs-overlay-error"></div>'+
|
2340 |
'</div>')
|
2341 |
.hide() // start out hidden
|
2342 |
+
.appendTo(layers),
|
2343 |
+
|
2344 |
// this needs to come last so it's on top
|
2345 |
bigPlay =
|
2346 |
$('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+
|
2367 |
media.addEventListener('play',function() {
|
2368 |
bigPlay.hide();
|
2369 |
loading.hide();
|
|
|
2370 |
error.hide();
|
2371 |
}, false);
|
2372 |
|
2373 |
media.addEventListener('playing', function() {
|
2374 |
bigPlay.hide();
|
2375 |
loading.hide();
|
|
|
2376 |
error.hide();
|
2377 |
}, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2378 |
|
2379 |
media.addEventListener('pause',function() {
|
2380 |
if (!mejs.MediaFeatures.isiPhone) {
|
2384 |
|
2385 |
media.addEventListener('waiting', function() {
|
2386 |
loading.show();
|
|
|
2387 |
}, false);
|
2388 |
|
2389 |
|
2394 |
// return;
|
2395 |
|
2396 |
loading.show();
|
|
|
2397 |
}, false);
|
2398 |
media.addEventListener('canplay',function() {
|
2399 |
loading.hide();
|
|
|
2400 |
}, false);
|
2401 |
|
2402 |
// error handling
|
2403 |
media.addEventListener('error',function() {
|
2404 |
loading.hide();
|
|
|
2405 |
error.show();
|
2406 |
error.find('mejs-overlay-error').html("Error loading this resource");
|
2407 |
}, false);
|
2448 |
|
2449 |
// store for use by plugins
|
2450 |
t.tracks = [];
|
2451 |
+
tracktags.each(function() {
|
|
|
|
|
|
|
2452 |
t.tracks.push({
|
2453 |
+
srclang: $(this).attr('srclang').toLowerCase(),
|
2454 |
+
src: $(this).attr('src'),
|
2455 |
+
kind: $(this).attr('kind'),
|
2456 |
+
label: $(this).attr('label'),
|
2457 |
entries: [],
|
2458 |
isLoaded: false
|
2459 |
});
|
2461 |
},
|
2462 |
changeSkin: function(className) {
|
2463 |
this.container[0].className = 'mejs-container ' + className;
|
2464 |
+
this.setPlayerSize();
|
2465 |
this.setControlsSize();
|
2466 |
},
|
2467 |
play: function() {
|
2496 |
|
2497 |
if (t.media.pluginType == 'flash') {
|
2498 |
t.media.remove();
|
2499 |
+
} else if (t.media.pluginTyp == 'native') {
|
2500 |
t.media.prop('controls', true);
|
2501 |
}
|
2502 |
|
2526 |
// push out to window
|
2527 |
window.MediaElementPlayer = mejs.MediaElementPlayer;
|
2528 |
|
2529 |
+
})(mejs.$);
|
|
|
2530 |
(function($) {
|
2531 |
|
2532 |
$.extend(mejs.MepDefaults, {
|
2585 |
var t = this,
|
2586 |
stop =
|
2587 |
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
|
2588 |
+
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '></button>' +
|
2589 |
'</div>')
|
2590 |
.appendTo(controls)
|
2591 |
.click(function() {
|
2612 |
|
2613 |
$('<div class="mejs-time-rail">'+
|
2614 |
'<span class="mejs-time-total">'+
|
|
|
2615 |
'<span class="mejs-time-loaded"></span>'+
|
2616 |
'<span class="mejs-time-current"></span>'+
|
2617 |
'<span class="mejs-time-handle"></span>'+
|
2622 |
'</span>'+
|
2623 |
'</div>')
|
2624 |
.appendTo(controls);
|
|
|
2625 |
|
2626 |
var
|
2627 |
t = this,
|
2669 |
if (e.which === 1) {
|
2670 |
mouseIsDown = true;
|
2671 |
handleMouseMove(e);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2672 |
return false;
|
2673 |
+
}
|
2674 |
+
});
|
2675 |
+
|
2676 |
+
controls.find('.mejs-time-total')
|
2677 |
.bind('mouseenter', function(e) {
|
2678 |
mouseIsOver = true;
|
|
|
|
|
|
|
2679 |
if (!mejs.MediaFeatures.hasTouch) {
|
2680 |
timefloat.show();
|
2681 |
}
|
2682 |
})
|
2683 |
.bind('mouseleave',function(e) {
|
2684 |
mouseIsOver = false;
|
2685 |
+
timefloat.hide();
|
2686 |
+
});
|
2687 |
+
|
2688 |
+
$(document)
|
2689 |
+
.bind('mouseup', function (e) {
|
2690 |
+
mouseIsDown = false;
|
2691 |
+
timefloat.hide();
|
2692 |
+
//handleMouseMove(e);
|
2693 |
+
})
|
2694 |
+
.bind('mousemove', function (e) {
|
2695 |
+
if (mouseIsDown || mouseIsOver) {
|
2696 |
+
handleMouseMove(e);
|
2697 |
}
|
2698 |
});
|
2699 |
|
2773 |
|
2774 |
// options
|
2775 |
$.extend(mejs.MepDefaults, {
|
2776 |
+
duration: -1
|
|
|
2777 |
});
|
2778 |
|
2779 |
|
2800 |
var t = this;
|
2801 |
|
2802 |
if (controls.children().last().find('.mejs-currenttime').length > 0) {
|
2803 |
+
$(' <span> | </span> '+
|
2804 |
'<span class="mejs-duration">' +
|
2805 |
(t.options.duration > 0 ?
|
2806 |
mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :
|
2853 |
|
2854 |
$.extend(mejs.MepDefaults, {
|
2855 |
muteText: 'Mute Toggle',
|
2856 |
+
hideVolumeOnTouchDevices: true
|
|
|
|
|
|
|
2857 |
});
|
2858 |
|
2859 |
$.extend(MediaElementPlayer.prototype, {
|
2860 |
buildvolume: function(player, controls, layers, media) {
|
2861 |
+
|
2862 |
// Android and iOS don't support volume controls
|
2863 |
if (mejs.MediaFeatures.hasTouch && this.options.hideVolumeOnTouchDevices)
|
2864 |
return;
|
2865 |
|
2866 |
var t = this,
|
2867 |
+
mute =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2868 |
$('<div class="mejs-button mejs-volume-button mejs-mute">'+
|
2869 |
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
|
2870 |
'<div class="mejs-volume-slider">'+ // outer background
|
2873 |
'<div class="mejs-volume-handle"></div>'+ // handle
|
2874 |
'</div>'+
|
2875 |
'</div>')
|
2876 |
+
.appendTo(controls),
|
2877 |
+
volumeSlider = mute.find('.mejs-volume-slider'),
|
2878 |
+
volumeTotal = mute.find('.mejs-volume-total'),
|
2879 |
+
volumeCurrent = mute.find('.mejs-volume-current'),
|
2880 |
+
volumeHandle = mute.find('.mejs-volume-handle'),
|
2881 |
|
2882 |
+
positionVolumeHandle = function(volume) {
|
2883 |
|
2884 |
+
if (!volumeSlider.is(':visible')) {
|
2885 |
volumeSlider.show();
|
2886 |
+
positionVolumeHandle(volume);
|
2887 |
volumeSlider.hide()
|
2888 |
return;
|
2889 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2890 |
|
2891 |
+
var
|
2892 |
+
|
2893 |
+
// height of the full size volume slider background
|
2894 |
+
totalHeight = volumeTotal.height(),
|
2895 |
|
2896 |
+
// top/left of full size volume slider background
|
2897 |
+
totalPosition = volumeTotal.position(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2898 |
|
2899 |
+
// the new top position based on the current volume
|
2900 |
+
// 70% volume on 100px height == top:30px
|
2901 |
+
newTop = totalHeight - (totalHeight * volume);
|
2902 |
+
|
2903 |
+
// handle
|
2904 |
+
volumeHandle.css('top', totalPosition.top + newTop - (volumeHandle.height() / 2));
|
2905 |
+
|
2906 |
+
// show the current visibility
|
2907 |
+
volumeCurrent.height(totalHeight - newTop );
|
2908 |
+
volumeCurrent.css('top', totalPosition.top + newTop);
|
|
|
|
|
|
|
|
|
|
|
2909 |
},
|
2910 |
handleVolumeMove = function(e) {
|
2911 |
+
var
|
2912 |
+
railHeight = volumeTotal.height(),
|
2913 |
+
totalOffset = volumeTotal.offset(),
|
2914 |
+
totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
|
2915 |
+
newY = e.pageY - totalOffset.top,
|
2916 |
+
volume = (railHeight - newY) / railHeight
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2917 |
|
2918 |
+
// the controls just hide themselves (usually when mouse moves too far up)
|
2919 |
+
if (totalOffset.top == 0)
|
2920 |
+
return;
|
2921 |
+
|
2922 |
+
// 0-1
|
|
|
|
|
|
|
|
|
2923 |
volume = Math.max(0,volume);
|
2924 |
+
volume = Math.min(volume,1);
|
2925 |
+
|
2926 |
+
// TODO: handle vertical and horizontal CSS
|
2927 |
+
// only allow it to move within the rail
|
2928 |
+
if (newY < 0)
|
2929 |
+
newY = 0;
|
2930 |
+
else if (newY > railHeight)
|
2931 |
+
newY = railHeight;
|
2932 |
+
|
2933 |
+
// move the handle to match the mouse
|
2934 |
+
volumeHandle.css('top', newY - (volumeHandle.height() / 2) + totalTop );
|
2935 |
+
|
2936 |
+
// show the current visibility
|
2937 |
+
volumeCurrent.height(railHeight-newY);
|
2938 |
+
volumeCurrent.css('top',newY+totalTop);
|
2939 |
+
|
2940 |
+
// set mute status
|
2941 |
if (volume == 0) {
|
2942 |
media.setMuted(true);
|
2943 |
+
mute.removeClass('mejs-mute').addClass('mejs-unmute');
|
2944 |
} else {
|
2945 |
media.setMuted(false);
|
2946 |
+
mute.removeClass('mejs-unmute').addClass('mejs-mute');
|
2947 |
}
|
2948 |
+
|
2949 |
+
volume = Math.max(0,volume);
|
2950 |
+
volume = Math.min(volume,1);
|
2951 |
+
|
2952 |
+
// set the volume
|
2953 |
+
media.setVolume(volume);
|
2954 |
},
|
2955 |
mouseIsDown = false,
|
2956 |
mouseIsOver = false;
|
2957 |
|
2958 |
// SLIDER
|
|
|
2959 |
mute
|
2960 |
.hover(function() {
|
2961 |
volumeSlider.show();
|
2963 |
}, function() {
|
2964 |
mouseIsOver = false;
|
2965 |
|
2966 |
+
if (!mouseIsDown) {
|
2967 |
volumeSlider.hide();
|
2968 |
}
|
2969 |
});
|
2974 |
})
|
2975 |
.bind('mousedown', function (e) {
|
2976 |
handleVolumeMove(e);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2977 |
mouseIsDown = true;
|
2978 |
|
2979 |
return false;
|
2980 |
});
|
2981 |
+
|
2982 |
+
$(document)
|
2983 |
+
.bind('mouseup', function (e) {
|
2984 |
+
mouseIsDown = false;
|
2985 |
+
|
2986 |
+
if (!mouseIsOver) {
|
2987 |
+
volumeSlider.hide();
|
2988 |
+
}
|
2989 |
+
})
|
2990 |
+
.bind('mousemove', function (e) {
|
2991 |
+
if (mouseIsDown) {
|
2992 |
+
handleVolumeMove(e);
|
2993 |
+
}
|
2994 |
+
});
|
2995 |
|
2996 |
|
2997 |
// MUTE button
|
2998 |
mute.find('button').click(function() {
|
2999 |
+
|
3000 |
media.setMuted( !media.muted );
|
3001 |
+
|
3002 |
});
|
3003 |
|
3004 |
// listen for volume change events from other sources
|
3014 |
}
|
3015 |
}, false);
|
3016 |
|
3017 |
+
// set initial volume
|
3018 |
+
//console.log('init volume',player.options.startVolume);
|
3019 |
+
positionVolumeHandle(player.options.startVolume);
|
3020 |
+
|
3021 |
+
// shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements
|
3022 |
+
if (media.pluginType === 'native') {
|
3023 |
+
media.setVolume(player.options.startVolume);
|
|
|
3024 |
}
|
3025 |
}
|
3026 |
});
|
3030 |
(function($) {
|
3031 |
|
3032 |
$.extend(mejs.MepDefaults, {
|
3033 |
+
usePluginFullScreen: false,
|
3034 |
newWindowCallback: function() { return '';},
|
3035 |
fullscreenText: 'Fullscreen'
|
3036 |
});
|
3055 |
// native events
|
3056 |
if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
3057 |
|
3058 |
+
player.container.bind(mejs.MediaFeatures.fullScreenEventName, function(e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3059 |
//player.container.bind('webkitfullscreenchange', function(e) {
|
3060 |
|
3061 |
|
3096 |
|
3097 |
} else {
|
3098 |
|
3099 |
+
var hideTimeout = null;
|
3100 |
+
|
3101 |
+
fullscreenBtn
|
3102 |
+
.mouseover(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3103 |
|
3104 |
+
if (hideTimeout !== null) {
|
3105 |
+
clearTimeout(hideTimeout);
|
3106 |
+
delete hideTimeout;
|
3107 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3108 |
|
3109 |
+
var buttonPos = fullscreenBtn.offset(),
|
3110 |
+
containerPos = player.container.offset();
|
|
|
|
|
3111 |
|
3112 |
+
media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3113 |
|
3114 |
+
})
|
3115 |
+
.mouseout(function() {
|
3116 |
|
3117 |
+
if (hideTimeout !== null) {
|
3118 |
+
clearTimeout(hideTimeout);
|
3119 |
+
delete hideTimeout;
|
3120 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3121 |
|
3122 |
+
hideTimeout = setTimeout(function() {
|
3123 |
+
media.hideFullscreenButton();
|
3124 |
+
}, 1500);
|
3125 |
|
3126 |
+
|
3127 |
+
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3128 |
}
|
3129 |
|
3130 |
player.fullscreenBtn = fullscreenBtn;
|
3163 |
mejs.MediaFeatures.requestFullScreen(t.container[0]);
|
3164 |
//return;
|
3165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3166 |
} else if (mejs.MediaFeatures.hasSemiNativeFullScreen) {
|
3167 |
t.media.webkitEnterFullscreen();
|
3168 |
return;
|
3412 |
// chapters
|
3413 |
if (player.hasChapters) {
|
3414 |
player.chapters.css('visibility','visible');
|
3415 |
+
player.chapters.fadeIn(200);
|
3416 |
}
|
3417 |
},
|
3418 |
function () {
|
3553 |
for (i=0; i<track.entries.times.length; i++) {
|
3554 |
if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop){
|
3555 |
t.captionsText.html(track.entries.text[i]);
|
3556 |
+
t.captions.show();
|
3557 |
return; // exit out if one is visible;
|
3558 |
}
|
3559 |
}
|
3754 |
return entries;
|
3755 |
}
|
3756 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3757 |
|
3758 |
})(mejs.$);
|
3759 |
|
3766 |
(function($) {
|
3767 |
|
3768 |
$.extend(mejs.MepDefaults,
|
3769 |
+
contextMenuItems = [
|
3770 |
// demo of a fullscreen option
|
3771 |
{
|
3772 |
render: function(player) {
|
3821 |
window.location.href = player.media.currentSrc;
|
3822 |
}
|
3823 |
}
|
3824 |
+
]
|
3825 |
);
|
3826 |
|
3827 |
|
mediaelement/mediaelement-and-player.min.js
CHANGED
@@ -7,53 +7,52 @@
|
|
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-
|
11 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
*
|
13 |
-
*/var mejs=mejs||{};mejs.version="2.
|
14 |
-
mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script")
|
15 |
-
|
16 |
-
10)
|
17 |
mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
|
18 |
!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}};
|
19 |
mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
|
20 |
mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
|
21 |
mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!==
|
22 |
-
null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.
|
23 |
-
a.
|
24 |
else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();
|
25 |
mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}};
|
26 |
mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
|
27 |
-
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,
|
28 |
-
|
29 |
-
positionFullscreenButton:function(a,b
|
30 |
this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a);
|
31 |
this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&
|
32 |
-
this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},
|
33 |
-
hasAttribute:function(a){return a in this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a))return this.attributes[a];return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}};
|
34 |
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];if(b){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,
|
35 |
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)}};
|
36 |
-
mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],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,
|
37 |
-
|
38 |
mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var j=d.getAttribute("autoplay"),h=d.getAttribute("preload"),l=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;h=typeof h=="undefined"||h===null||h==="false"?
|
39 |
"none":h;j=!(typeof j=="undefined"||j===null||j==="false");l=!(typeof l=="undefined"||l===null||l==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,j,h)}else if(k.method!=="")return this.createPlugin(k,c,e,j,h,l);else{this.createErrorMessage(k,c,e);return this}},
|
40 |
determinePlayback:function(a,b,c,d,e){var g=[],f,j,h={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},l,k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){j=this.formatType(e,a.getAttribute("type"));g.push({type:j,url:e})}else for(f=0;f<a.childNodes.length;f++){j=a.childNodes[f];if(j.nodeType==1&&j.tagName.toLowerCase()=="source"){e=j.getAttribute("src");
|
41 |
j=this.formatType(e,j.getAttribute("type"));g.push({type:j,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/,
|
42 |
"")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){h.method="native";h.url=g[f].url;break}if(h.method==="native"){if(h.url!==null)a.src=h.url;return h}}if(b.mode==="auto"||b.mode==="shim")for(f=0;f<g.length;f++){j=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];l=mejs.plugins[e];for(c=0;c<l.length;c++){k=l[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(j==k.types[d]){h.method=e;h.url=g[f].url;return h}}}}if(h.method===
|
43 |
""&&g.length>0)h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+a},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!==
|
44 |
-
""?'<a href="'+a.url+'"><img src="'+c+'"
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
'<embed id="'+h+'" name="'+h+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+j+'"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:l,pluginId:h,videoId:b,
|
50 |
height:j,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":console.log("vimeoid");l.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<object width="'+f+'" height="'+j+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="api=1" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+
|
51 |
l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="//vimeo.com/moogaloop.swf?api=1&clip_id='+l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+f+'" height="'+j+'"></embed></object>'}c.style.display=
|
52 |
"none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
|
53 |
mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,
|
54 |
{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused;
|
55 |
-
c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=
|
56 |
-
|
57 |
'<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; "><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e,
|
58 |
c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b,
|
59 |
c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement;
|
@@ -65,85 +64,77 @@ c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function
|
|
65 |
* Creates a controller bar for HTML5 <video> add <audio> tags
|
66 |
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
|
67 |
*
|
68 |
-
* Copyright 2010-
|
69 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
70 |
*
|
71 |
*/if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
|
72 |
(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks",
|
73 |
-
"volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-0.1,0))}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.
|
74 |
-
228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.
|
75 |
this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);mejs.players.push(this);this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}),
|
76 |
-
d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls","controls");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=
|
77 |
-
a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);
|
78 |
-
a.
|
79 |
-
a.options["default"+b+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.height;c.pluginHeight=a.width}mejs.MediaElement(a.$media[0],c)},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility",
|
80 |
-
"visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)if(a){b.controls.stop(true,
|
81 |
-
"block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!=
|
82 |
-
this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,
|
83 |
-
!(d.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(g in c.options.features){d=
|
84 |
-
|
85 |
-
function(){c.controlsEnabled
|
86 |
-
function(){for(var h=0,
|
87 |
-
function(){c.
|
88 |
-
a.pluginType=="native"){a.load();a.play()}if(c.options.success)typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();
|
89 |
-
|
90 |
-
this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");
|
91 |
-
c.width())}c.width(b);d.width(b-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);
|
92 |
-
0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a)},buildoverlays:function(a,b,c,d){if(a.isVideo){var e=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
|
99 |
(function(f){f.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);
|
100 |
d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
|
101 |
-
(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+
|
102 |
b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-poster").show()}})}})})(mejs.$);
|
103 |
-
(function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
(function(f){f.extend(mejs.MepDefaults,{duration:-1
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
(function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
(function(
|
119 |
-
|
120 |
-
a.
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
e.isFullScreen)&&i.keyCode==27)a.exitFullScreen()})}},enterFullScreen:function(){var a=this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(a.container[0]);a.isInIframe&&
|
125 |
-
setTimeout(function c(){if(a.isNativeFullScreen)f(window).width()!==screen.width?a.exitFullScreen():setTimeout(c,500)},500)}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=a.options.newWindowCallback(this);if(b!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},
|
126 |
-
250);else{a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find("object, embed, iframe").width("100%").height("100%");a.media.setVideoSize(f(window).width(),
|
127 |
-
f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow=
|
128 |
-
docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=
|
129 |
-
false}}})})(mejs.$);
|
130 |
(function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles"});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,b,c,d){if(a.isVideo)if(a.tracks.length!=0){var e;a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).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(c).hide();a.captionsText=a.captions.find(".mejs-captions-text");
|
131 |
a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(b).hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},function(){f(this).find(".mejs-captions-selector").css("visibility",
|
132 |
"hidden")}).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(e=0;e<a.tracks.length;e++)if(a.tracks[e].srclang==lang){a.selectedTrack=a.tracks[e];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("mouseenter",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",
|
133 |
function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(e=0;e<a.tracks.length;e++)a.tracks[e].kind=="subtitles"&&a.addTrackButton(a.tracks[e].srclang,a.tracks[e].label);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},false);d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility",
|
134 |
-
"visible");a.chapters.fadeIn(200)
|
135 |
-
|
136 |
-
a
|
137 |
-
|
138 |
-
this.
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
(function(f){f.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]});
|
145 |
f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled){b.preventDefault();a.renderContextMenu(b.clientX-1,b.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled=
|
146 |
-
true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,b){for(var c=this,d="",e=c.options.contextMenuItems,g=0,
|
147 |
-
|
148 |
"undefined"&&p.click(c);c.contextMenu.hide()})});setTimeout(function(){c.killControlsTimer("rev3")},100)}})})(mejs.$);
|
149 |
|
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-2011, John Dyer (http://j.hn)
|
11 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
*
|
13 |
+
*/var mejs=mejs||{};mejs.version="2.5.0";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"]}],youtube:[{version:null,types:["video/youtube"]}],vimeo:[{version:null,types:["video/vimeo"]}]};
|
14 |
+
mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script");b<f.length;b++){g=f[b].src;for(c=0;c<a.length;c++){e=a[c];if(g.indexOf(e)>-1){d=g.substring(0,
|
15 |
+
g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0],10);var e=parseInt(a[1],
|
16 |
+
10),g=parseInt(a[2],10),f=0,j=0;if(c)f=parseInt(a[3])/d;return j=b*3600+e*60+g+f},removeSwf:function(a){var b=document.getElementById(a);if(b&&b.nodeName=="OBJECT")if(mejs.MediaFeatures.isIE){b.style.display="none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}};
|
17 |
mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
|
18 |
!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}};
|
19 |
mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
|
20 |
mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
|
21 |
mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!==
|
22 |
+
null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.hasTouch="ontouchstart"in window;for(c=0;c<g.length;c++)e=document.createElement(g[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined";a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||a.hasMozNativeFullScreen;
|
23 |
+
a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen;if(a.hasMozNativeFullScreen)a.nativeFullScreenEnabled=e.mozFullScreenEnabled;if(this.isChrome)a.hasSemiNativeFullScreen=false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen;else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(f){if(a.hasWebkitNativeFullScreen)f.webkitRequestFullScreen();
|
24 |
else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();
|
25 |
mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}};
|
26 |
mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
|
27 |
+
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.playVideo():this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginType!="youtube"&&this.pluginApi.loadMedia();this.paused=false}},
|
28 |
+
pause:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia();this.paused=true}},stop:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.stopVideo():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},
|
29 |
+
positionFullscreenButton:function(a,b){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(a,b)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},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=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));
|
30 |
this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a);
|
31 |
this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&
|
32 |
+
this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}};
|
|
|
33 |
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];if(b){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,
|
34 |
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)}};
|
35 |
+
mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,timerRate:250,startVolume:0.8,success:function(){},error:function(){}};
|
36 |
+
mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
|
37 |
mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var j=d.getAttribute("autoplay"),h=d.getAttribute("preload"),l=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;h=typeof h=="undefined"||h===null||h==="false"?
|
38 |
"none":h;j=!(typeof j=="undefined"||j===null||j==="false");l=!(typeof l=="undefined"||l===null||l==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,j,h)}else if(k.method!=="")return this.createPlugin(k,c,e,j,h,l);else{this.createErrorMessage(k,c,e);return this}},
|
39 |
determinePlayback:function(a,b,c,d,e){var g=[],f,j,h={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},l,k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){j=this.formatType(e,a.getAttribute("type"));g.push({type:j,url:e})}else for(f=0;f<a.childNodes.length;f++){j=a.childNodes[f];if(j.nodeType==1&&j.tagName.toLowerCase()=="source"){e=j.getAttribute("src");
|
40 |
j=this.formatType(e,j.getAttribute("type"));g.push({type:j,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/,
|
41 |
"")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){h.method="native";h.url=g[f].url;break}if(h.method==="native"){if(h.url!==null)a.src=h.url;return h}}if(b.mode==="auto"||b.mode==="shim")for(f=0;f<g.length;f++){j=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];l=mejs.plugins[e];for(c=0;c<l.length;c++){k=l[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(j==k.types[d]){h.method=e;h.url=g[f].url;return h}}}}if(h.method===
|
42 |
""&&g.length>0)h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+a},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!==
|
43 |
+
""?'<a href="'+a.url+'"><img src="'+c+'" /></a>':'<a href="'+a.url+'"><span>Download File</span></a>';d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,j=1,h="me_"+a.method+"_"+mejs.meIndex++,l=new mejs.PluginMediaElement(h,a.method,a.url),k=document.createElement("div"),m;for(m=c.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode);
|
44 |
+
break}m=m.parentNode}if(a.isVideo){f=b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;j=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);j=mejs.Utility.encodeUrl(j)}else if(b.enablePluginDebug){f=320;j=240}l.success=b.success;mejs.MediaPluginBridge.registerPluginElement(h,l,c);k.className="me-plugin";k.id=h+"_container";a.isVideo?c.parentNode.insertBefore(k,
|
45 |
+
c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+h,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+j];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");switch(a.method){case "silverlight":k.innerHTML=
|
46 |
+
'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+h+'" name="'+h+'" width="'+f+'" height="'+j+'"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");
|
47 |
+
k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+h+'" width="'+f+'" height="'+j+'"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML=
|
48 |
'<embed id="'+h+'" name="'+h+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+j+'"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:l,pluginId:h,videoId:b,
|
49 |
height:j,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":console.log("vimeoid");l.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<object width="'+f+'" height="'+j+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="api=1" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+
|
50 |
l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="//vimeo.com/moogaloop.swf?api=1&clip_id='+l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+f+'" height="'+j+'"></embed></object>'}c.style.display=
|
51 |
"none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
|
52 |
mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,
|
53 |
{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused;
|
54 |
+
c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b,
|
55 |
+
c="http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");a.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'"><param name="movie" value="'+c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else a.container.innerHTML=
|
56 |
'<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; "><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e,
|
57 |
c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b,
|
58 |
c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement;
|
64 |
* Creates a controller bar for HTML5 <video> add <audio> tags
|
65 |
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
|
66 |
*
|
67 |
+
* Copyright 2010-2011, John Dyer (http://j.hn/)
|
68 |
* Dual licensed under the MIT or GPL Version 2 licenses.
|
69 |
*
|
70 |
*/if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
|
71 |
(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks",
|
72 |
+
"volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-0.1,0))}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.min(b.currentTime-b.duration*0.05,b.duration))}}},
|
73 |
+
{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.max(b.currentTime+b.duration*0.05,0))}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!="undefined")a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players=[];mejs.MediaElementPlayer=function(a,b){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,b);this.$media=this.$node=f(a);
|
74 |
this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);mejs.players.push(this);this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}),
|
75 |
+
d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls","controls");a.$media.removeAttr("poster");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=
|
76 |
+
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);a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);
|
77 |
+
a.$media.remove();a.$node=a.$media=b;a.node=a.media=b[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");b=d.substring(0,1).toUpperCase()+d.substring(1);a.width=a.options[d+"Width"]>0||a.options[d+"Width"].toString().indexOf("%")>-1?a.options[d+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+
|
78 |
+
b+"Width"];a.height=a.options[d+"Height"]>0||a.options[d+"Height"].toString().indexOf("%")>-1?a.options[d+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"):a.options["default"+b+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.height;c.pluginHeight=a.width}mejs.MediaElement(a.$media[0],c)},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility",
|
79 |
+
"visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true});b.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true})}else{b.controls.css("visibility","visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)if(a){b.controls.stop(true,
|
80 |
+
true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");b.controlsAreVisible=false});b.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!=
|
81 |
+
"undefined"?a:1500;b.killControlsTimer("start");b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,
|
82 |
+
b){var c=this,d=mejs.MediaFeatures,e=b.getAttribute("autoplay");e=!(typeof e=="undefined"||e===null||e==="false");var g;if(!c.created){c.created=true;c.media=a;c.domNode=b;if(!(d.isAndroid&&c.options.AndroidUseNativeControls)&&!(d.isiPad&&c.options.iPadUseNativeControls)&&!(d.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(g in c.options.features){d=
|
83 |
+
c.options.features[g];if(c["build"+d])try{c["build"+d](c,c.controls,c.layers,c.media)}catch(j){}}c.container.trigger("controlsready");c.setPlayerSize(c.width,c.height);c.setControlsSize();if(c.isVideo){if(mejs.MediaFeatures.hasTouch)c.$media.bind("touchstart",function(){if(c.controlsAreVisible)c.hideControls(false);else c.controlsEnabled&&c.showControls(false)});else{(c.media.pluginType=="native"?c.$media:f(c.media.pluginElement)).click(function(){a.paused?a.play():a.pause()});c.container.bind("mouseenter mouseover",
|
84 |
+
function(){if(c.controlsEnabled)if(!c.options.alwaysShowControls){c.killControlsTimer("enter");c.showControls();c.startControlsTimer(2500)}}).bind("mousemove",function(){if(c.controlsEnabled){c.controlsAreVisible||c.showControls();c.options.alwaysShowControls||c.startControlsTimer(2500)}}).bind("mouseleave",function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&c.startControlsTimer(1E3)})}e&&!c.options.alwaysShowControls&&c.hideControls();c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",
|
85 |
+
function(h){if(c.options.videoHeight<=0&&c.domNode.getAttribute("height")===null&&!isNaN(h.target.videoHeight)){c.setPlayerSize(h.target.videoWidth,h.target.videoHeight);c.setControlsSize();c.media.setVideoSize(h.target.videoWidth,h.target.videoHeight)}},false)}a.addEventListener("play",function(){for(var h=0,l=mejs.players.length;h<l;h++){var m=mejs.players[h];m.id!=c.id&&c.options.pauseOtherPlayers&&!m.paused&&!m.ended&&m.pause();m.hasFocus=false}c.hasFocus=true},false);c.media.addEventListener("ended",
|
86 |
+
function(){try{c.media.setCurrentTime(0)}catch(h){}c.media.pause();c.setProgressRail&&c.setProgressRail();c.setCurrentRail&&c.setCurrentRail();if(c.options.loop)c.media.play();else!c.options.alwaysShowControls&&c.controlsEnabled&&c.showControls()},false);c.media.addEventListener("loadedmetadata",function(){c.updateDuration&&c.updateDuration();c.updateCurrent&&c.updateCurrent();if(!c.isFullScreen){c.setPlayerSize(c.width,c.height);c.setControlsSize()}},false);setTimeout(function(){c.setPlayerSize(c.width,
|
87 |
+
c.height);c.setControlsSize()},50);f(window).resize(function(){c.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height);c.setControlsSize()});c.media.pluginType=="youtube"&&c.container.find(".mejs-overlay-play").hide()}if(e&&a.pluginType=="native"){a.load();a.play()}if(c.options.success)typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();
|
88 |
+
this.options.error&&this.options.error(a)},setPlayerSize:function(){if(this.height.toString().indexOf("%")>0){var a=this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth,b=this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.options.defaultVideoHeight,c=this.container.parent().width();a=parseInt(c*b/a,10);if(this.container.parent()[0].tagName.toLowerCase()==="body"){c=f(window).width();a=f(window).height()}this.container.width(c).height(a);
|
89 |
+
this.$media.width("100%").height("100%");this.container.find("object, embed, iframe").width("100%").height("100%");this.media.setVideoSize&&this.media.setVideoSize(c,a);this.layers.children(".mejs-layer").width("100%").height("100%")}else{this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");
|
90 |
+
this.controls.find(".mejs-time-loaded");others=c.siblings();if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){others.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});b=this.controls.width()-a-(c.outerWidth(true)-c.outerWidth(false))}c.width(b);d.width(b-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);
|
91 |
+
b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"),c=b.find("img");if(c.length==0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a)},buildoverlays:function(a,b,c,d){if(a.isVideo){var e=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),
|
92 |
+
g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).click(function(){d.paused?d.play():d.pause()});d.addEventListener("play",function(){j.hide();e.hide();g.hide()},false);d.addEventListener("playing",function(){j.hide();e.hide();g.hide()},false);d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||j.show()},false);
|
93 |
+
d.addEventListener("waiting",function(){e.show()},false);d.addEventListener("loadeddata",function(){e.show()},false);d.addEventListener("canplay",function(){e.hide()},false);d.addEventListener("error",function(){e.hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")},false)}},buildkeyboard:function(a,b,c,d){f(document).keydown(function(e){if(a.hasFocus&&a.options.enableKeyboard)for(var g=0,j=a.options.keyActions.length;g<j;g++)for(var h=a.options.keyActions[g],l=0,m=h.keys.length;l<
|
94 |
+
m;l++)if(e.keyCode==h.keys[l]){e.preventDefault();h.action(a,d);return false}return true});f(document).click(function(e){if(f(e.target).closest(".mejs-container").length==0)a.hasFocus=false})},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(){a.tracks.push({srclang:f(this).attr("srclang").toLowerCase(),src:f(this).attr("src"),kind:f(this).attr("kind"),label:f(this).attr("label"),entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className=
|
95 |
+
"mejs-container "+a;this.setPlayerSize();this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){if(this.media.pluginType==
|
96 |
+
"flash")this.media.remove();else this.media.pluginTyp=="native"&&this.media.prop("controls",true);this.isDynamic||this.$node.insertBefore(this.container);this.container.remove()}};if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(this,a)})};f(document).ready(function(){f(".mejs-player").mediaelementplayer()});window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
|
|
|
97 |
(function(f){f.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);
|
98 |
d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
|
99 |
+
(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+"></button></div>").appendTo(b).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);b.find(".mejs-time-current").width("0px");b.find(".mejs-time-handle").css("left","0px");b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));
|
100 |
b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-poster").show()}})}})})(mejs.$);
|
101 |
+
(function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,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(b);var e=b.find(".mejs-time-total");c=b.find(".mejs-time-loaded");var g=b.find(".mejs-time-current"),
|
102 |
+
j=b.find(".mejs-time-handle"),h=b.find(".mejs-time-float"),l=b.find(".mejs-time-float-current"),m=function(k){k=k.pageX;var i=e.offset(),o=e.outerWidth(),n=0;n=0;var s=k-i.left;if(k>i.left&&k<=o+i.left&&d.duration){n=(k-i.left)/o;n=n<=0.02?0:n*d.duration;p&&d.setCurrentTime(n);if(!mejs.MediaFeatures.hasTouch){h.css("left",s);l.html(mejs.Utility.secondsToTimeCode(n));h.show()}}},p=false,r=false;e.bind("mousedown",function(k){if(k.which===1){p=true;m(k);return false}});b.find(".mejs-time-total").bind("mouseenter",
|
103 |
+
function(){r=true;mejs.MediaFeatures.hasTouch||h.show()}).bind("mouseleave",function(){r=false;h.hide()});f(document).bind("mouseup",function(){p=false;h.hide()}).bind("mousemove",function(k){if(p||r)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=c;this.total=e;this.current=g;this.handle=j},setProgressRail:function(a){var b=a!=undefined?a.target:
|
104 |
+
this.media,c=null;if(b&&b.buffered&&b.buffered.length>0&&b.buffered.end&&b.duration)c=b.buffered.end(0)/b.duration;else if(b&&b.bytesTotal!=undefined&&b.bytesTotal>0&&b.bufferedBytes!=undefined)c=b.bufferedBytes/b.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)c=a.loaded/a.total;if(c!==null){c=Math.min(1,Math.max(0,c));this.loaded&&this.total&&this.loaded.width(this.total.width()*c)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=
|
105 |
+
this.total.width()*this.media.currentTime/this.media.duration,b=a-this.handle.outerWidth(true)/2;this.current.width(a);this.handle.css("left",b)}}})})(mejs.$);
|
106 |
+
(function(f){f.extend(mejs.MepDefaults,{duration:-1});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,c,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(b);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,b,c,d){if(b.children().last().find(".mejs-currenttime").length>
|
107 |
+
0)f(' <span> | </span> <span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(b.find(".mejs-time"));else{b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+
|
108 |
+
(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(b)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,
|
109 |
+
this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$);
|
110 |
+
(function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,c,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+this.id+'" title="'+this.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(b),
|
111 |
+
g=e.find(".mejs-volume-slider"),j=e.find(".mejs-volume-total"),h=e.find(".mejs-volume-current"),l=e.find(".mejs-volume-handle"),m=function(i){if(g.is(":visible")){var o=j.height(),n=j.position();i=o-o*i;l.css("top",n.top+i-l.height()/2);h.height(o-i);h.css("top",n.top+i)}else{g.show();m(i);g.hide()}},p=function(i){var o=j.height(),n=j.offset(),s=parseInt(j.css("top").replace(/px/,""),10);i=i.pageY-n.top;var q=(o-i)/o;if(n.top!=0){q=Math.max(0,q);q=Math.min(q,1);if(i<0)i=0;else if(i>o)i=o;l.css("top",
|
112 |
+
i-l.height()/2+s);h.height(o-i);h.css("top",i+s);if(q==0){d.setMuted(true);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{d.setMuted(false);e.removeClass("mejs-unmute").addClass("mejs-mute")}q=Math.max(0,q);q=Math.min(q,1);d.setVolume(q)}},r=false,k=false;e.hover(function(){g.show();k=true},function(){k=false;r||g.hide()});g.bind("mouseover",function(){k=true}).bind("mousedown",function(i){p(i);r=true;return false});f(document).bind("mouseup",function(){r=false;k||g.hide()}).bind("mousemove",
|
113 |
+
function(i){r&&p(i)});e.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(){if(!r)if(d.muted){m(0);e.removeClass("mejs-mute").addClass("mejs-unmute")}else{m(d.volume);e.removeClass("mejs-unmute").addClass("mejs-mute")}},false);m(a.options.startVolume);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}}})})(mejs.$);
|
114 |
+
(function(f){f.extend(mejs.MepDefaults,{usePluginFullScreen:false,newWindowCallback:function(){return""},fullscreenText:"Fullscreen"});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(a,b,c,d){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;mejs.MediaFeatures.hasTrueNativeFullScreen&&a.container.bind(mejs.MediaFeatures.fullScreenEventName,function(){if(mejs.MediaFeatures.isFullScreen()){a.isNativeFullScreen=
|
115 |
+
true;a.setControlsSize()}else{a.isNativeFullScreen=false;a.exitFullScreen()}});var e=this,g=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.fullscreenText+'"></button></div>').appendTo(b);if(e.media.pluginType==="native"||!e.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||a.isFullScreen?a.exitFullScreen():a.enterFullScreen()});
|
116 |
+
else{var j=null;g.mouseover(function(){if(j!==null){clearTimeout(j);delete j}var h=g.offset(),l=a.container.offset();d.positionFullscreenButton(h.left-l.left,h.top-l.top)}).mouseout(function(){if(j!==null){clearTimeout(j);delete j}j=setTimeout(function(){d.hideFullscreenButton()},1500)})}a.fullscreenBtn=g;f(document).bind("keydown",function(h){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||e.isFullScreen)&&h.keyCode==27)a.exitFullScreen()})}},enterFullScreen:function(){var a=
|
117 |
+
this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen)mejs.MediaFeatures.requestFullScreen(a.container[0]);else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=
|
118 |
+
a.options.newWindowCallback(this);if(b!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},250);else{a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");
|
119 |
+
setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find("object, embed, iframe").width("100%").height("100%");a.media.setVideoSize(f(window).width(),f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){if(this.media.pluginType!==
|
120 |
+
"native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow=docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);
|
121 |
+
this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=false}}})})(mejs.$);
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
(function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles"});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,b,c,d){if(a.isVideo)if(a.tracks.length!=0){var e;a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).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(c).hide();a.captionsText=a.captions.find(".mejs-captions-text");
|
123 |
a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(b).hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},function(){f(this).find(".mejs-captions-selector").css("visibility",
|
124 |
"hidden")}).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(e=0;e<a.tracks.length;e++)if(a.tracks[e].srclang==lang){a.selectedTrack=a.tracks[e];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("mouseenter",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",
|
125 |
function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(e=0;e<a.tracks.length;e++)a.tracks[e].kind=="subtitles"&&a.addTrackButton(a.tracks[e].srclang,a.tracks[e].label);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},false);d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility",
|
126 |
+
"visible");a.chapters.fadeIn(200)}},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")}},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 b=this,c=b.tracks[a],d=function(){c.isLoaded=
|
127 |
+
true;b.enableTrackButton(c.srclang,c.label);b.loadNextTrack()};c.isTranslation?mejs.TrackFormatParser.translateTrackText(b.tracks[0].entries,b.tracks[0].srclang,c.srclang,b.options.googleApiKey,function(e){c.entries=e;d()}):f.ajax({url:c.src,success:function(e){c.entries=mejs.TrackFormatParser.parse(e);d();c.kind=="chapters"&&b.media.duration>0&&b.drawChapters(c)},error:function(){b.loadNextTrack()}})},enableTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||a;this.captionsButton.find("input[value="+
|
128 |
+
a+"]").prop("disabled",false).siblings("label").html(b);this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,b){if(b==="")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+" (loading)</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+
|
129 |
+
a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,b=this.selectedTrack;if(b!=null&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&this.media.currentTime<=b.entries.times[a].stop){this.captionsText.html(b.entries.text[a]);
|
130 |
+
this.captions.show();return}this.captions.hide()}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var b=this,c,d,e=d=0;b.chapters.empty();for(c=0;c<a.entries.times.length;c++){d=a.entries.times[c].stop-a.entries.times[c].start;d=Math.floor(d/b.media.duration*100);if(d+e>100||c==a.entries.times.length-1&&d+e<100)d=100-e;b.chapters.append(f('<div class="mejs-chapter" rel="'+
|
131 |
+
a.entries.times[c].start+'" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+(c==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"–"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+"</span></div></div>"));e+=d}b.chapters.find("div.mejs-chapter").click(function(){b.media.setCurrentTime(parseFloat(f(this).attr("rel")));
|
132 |
+
b.media.paused&&b.media.play()});b.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",
|
133 |
+
ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
|
134 |
+
split2:function(a,b){return a.split(b)},parse:function(a){var b=0;a=this.split2(a,/\r?\n/);for(var c={text:[],times:[]},d,e;b<a.length;b++)if(this.pattern_identifier.exec(a[b])){b++;if((d=this.pattern_timecode.exec(a[b]))&&b<a.length){b++;e=a[b];for(b++;a[b]!==""&&b<a.length;){e=e+"\n"+a[b];b++}c.text.push(e);c.times.push({start:mejs.Utility.timeCodeToSeconds(d[1]),stop:mejs.Utility.timeCodeToSeconds(d[3]),settings:d[5]})}}return c}}})(mejs.$);
|
135 |
+
(function(f){f.extend(mejs.MepDefaults,contextMenuItems=[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]);
|
|
|
136 |
f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled){b.preventDefault();a.renderContextMenu(b.clientX-1,b.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled=
|
137 |
+
true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,b){for(var c=this,d="",e=c.options.contextMenuItems,g=0,j=e.length;g<
|
138 |
+
j;g++)if(e[g].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var h=e[g].render(c);if(h!=null)d+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+Math.random()*1E6+'">'+h+"</div>"}c.contextMenu.empty().append(f(d)).css({top:b,left:a}).show();c.contextMenu.find(".mejs-contextmenu-item").each(function(){var l=f(this),m=parseInt(l.data("itemindex"),10),p=c.options.contextMenuItems[m];typeof p.show!="undefined"&&p.show(l,c);l.click(function(){typeof p.click!=
|
139 |
"undefined"&&p.click(c);c.contextMenu.hide()})});setTimeout(function(){c.killControlsTimer("rev3")},100)}})})(mejs.$);
|
140 |
|
mediaelement/mediaelement.js
DELETED
@@ -1,1517 +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-2012, John Dyer (http://j.hn)
|
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.9.1';
|
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', 'video/youtube', 'video/x-youtube']}
|
30 |
-
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
|
31 |
-
],
|
32 |
-
youtube: [
|
33 |
-
{version: null, types: ['video/youtube', 'video/x-youtube']}
|
34 |
-
],
|
35 |
-
vimeo: [
|
36 |
-
{version: null, types: ['video/vimeo']}
|
37 |
-
]
|
38 |
-
};
|
39 |
-
|
40 |
-
/*
|
41 |
-
Utility methods
|
42 |
-
*/
|
43 |
-
mejs.Utility = {
|
44 |
-
encodeUrl: function(url) {
|
45 |
-
return encodeURIComponent(url); //.replace(/\?/gi,'%3F').replace(/=/gi,'%3D').replace(/&/gi,'%26');
|
46 |
-
},
|
47 |
-
escapeHTML: function(s) {
|
48 |
-
return s.toString().split('&').join('&').split('<').join('<').split('"').join('"');
|
49 |
-
},
|
50 |
-
absolutizeUrl: function(url) {
|
51 |
-
var el = document.createElement('div');
|
52 |
-
el.innerHTML = '<a href="' + this.escapeHTML(url) + '">x</a>';
|
53 |
-
return el.firstChild.href;
|
54 |
-
},
|
55 |
-
getScriptPath: function(scriptNames) {
|
56 |
-
var
|
57 |
-
i = 0,
|
58 |
-
j,
|
59 |
-
path = '',
|
60 |
-
name = '',
|
61 |
-
script,
|
62 |
-
scripts = document.getElementsByTagName('script'),
|
63 |
-
il = scripts.length,
|
64 |
-
jl = scriptNames.length;
|
65 |
-
|
66 |
-
for (; i < il; i++) {
|
67 |
-
script = scripts[i].src;
|
68 |
-
for (j = 0; j < jl; j++) {
|
69 |
-
name = scriptNames[j];
|
70 |
-
if (script.indexOf(name) > -1) {
|
71 |
-
path = script.substring(0, script.indexOf(name));
|
72 |
-
break;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
if (path !== '') {
|
76 |
-
break;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
return path;
|
80 |
-
},
|
81 |
-
secondsToTimeCode: function(time, forceHours, showFrameCount, fps) {
|
82 |
-
//add framecount
|
83 |
-
if (typeof showFrameCount == 'undefined') {
|
84 |
-
showFrameCount=false;
|
85 |
-
} else if(typeof fps == 'undefined') {
|
86 |
-
fps = 25;
|
87 |
-
}
|
88 |
-
|
89 |
-
var hours = Math.floor(time / 3600) % 24,
|
90 |
-
minutes = Math.floor(time / 60) % 60,
|
91 |
-
seconds = Math.floor(time % 60),
|
92 |
-
frames = Math.floor(((time % 1)*fps).toFixed(3)),
|
93 |
-
result =
|
94 |
-
( (forceHours || hours > 0) ? (hours < 10 ? '0' + hours : hours) + ':' : '')
|
95 |
-
+ (minutes < 10 ? '0' + minutes : minutes) + ':'
|
96 |
-
+ (seconds < 10 ? '0' + seconds : seconds)
|
97 |
-
+ ((showFrameCount) ? ':' + (frames < 10 ? '0' + frames : frames) : '');
|
98 |
-
|
99 |
-
return result;
|
100 |
-
},
|
101 |
-
|
102 |
-
timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){
|
103 |
-
if (typeof showFrameCount == 'undefined') {
|
104 |
-
showFrameCount=false;
|
105 |
-
} else if(typeof fps == 'undefined') {
|
106 |
-
fps = 25;
|
107 |
-
}
|
108 |
-
|
109 |
-
var tc_array = hh_mm_ss_ff.split(":"),
|
110 |
-
tc_hh = parseInt(tc_array[0], 10),
|
111 |
-
tc_mm = parseInt(tc_array[1], 10),
|
112 |
-
tc_ss = parseInt(tc_array[2], 10),
|
113 |
-
tc_ff = 0,
|
114 |
-
tc_in_seconds = 0;
|
115 |
-
|
116 |
-
if (showFrameCount) {
|
117 |
-
tc_ff = parseInt(tc_array[3])/fps;
|
118 |
-
}
|
119 |
-
|
120 |
-
tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff;
|
121 |
-
|
122 |
-
return tc_in_seconds;
|
123 |
-
},
|
124 |
-
|
125 |
-
/* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */
|
126 |
-
removeSwf: function(id) {
|
127 |
-
var obj = document.getElementById(id);
|
128 |
-
if (obj && obj.nodeName == "OBJECT") {
|
129 |
-
if (mejs.MediaFeatures.isIE) {
|
130 |
-
obj.style.display = "none";
|
131 |
-
(function(){
|
132 |
-
if (obj.readyState == 4) {
|
133 |
-
mejs.Utility.removeObjectInIE(id);
|
134 |
-
} else {
|
135 |
-
setTimeout(arguments.callee, 10);
|
136 |
-
}
|
137 |
-
})();
|
138 |
-
} else {
|
139 |
-
obj.parentNode.removeChild(obj);
|
140 |
-
}
|
141 |
-
}
|
142 |
-
},
|
143 |
-
removeObjectInIE: function(id) {
|
144 |
-
var obj = document.getElementById(id);
|
145 |
-
if (obj) {
|
146 |
-
for (var i in obj) {
|
147 |
-
if (typeof obj[i] == "function") {
|
148 |
-
obj[i] = null;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
obj.parentNode.removeChild(obj);
|
152 |
-
}
|
153 |
-
}
|
154 |
-
};
|
155 |
-
|
156 |
-
|
157 |
-
// Core detector, plugins are added below
|
158 |
-
mejs.PluginDetector = {
|
159 |
-
|
160 |
-
// main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]);
|
161 |
-
hasPluginVersion: function(plugin, v) {
|
162 |
-
var pv = this.plugins[plugin];
|
163 |
-
v[1] = v[1] || 0;
|
164 |
-
v[2] = v[2] || 0;
|
165 |
-
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;
|
166 |
-
},
|
167 |
-
|
168 |
-
// cached values
|
169 |
-
nav: window.navigator,
|
170 |
-
ua: window.navigator.userAgent.toLowerCase(),
|
171 |
-
|
172 |
-
// stored version numbers
|
173 |
-
plugins: [],
|
174 |
-
|
175 |
-
// runs detectPlugin() and stores the version number
|
176 |
-
addPlugin: function(p, pluginName, mimeType, activeX, axDetect) {
|
177 |
-
this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect);
|
178 |
-
},
|
179 |
-
|
180 |
-
// get the version number from the mimetype (all but IE) or ActiveX (IE)
|
181 |
-
detectPlugin: function(pluginName, mimeType, activeX, axDetect) {
|
182 |
-
|
183 |
-
var version = [0,0,0],
|
184 |
-
description,
|
185 |
-
i,
|
186 |
-
ax;
|
187 |
-
|
188 |
-
// Firefox, Webkit, Opera
|
189 |
-
if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') {
|
190 |
-
description = this.nav.plugins[pluginName].description;
|
191 |
-
if (description && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) {
|
192 |
-
version = description.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.');
|
193 |
-
for (i=0; i<version.length; i++) {
|
194 |
-
version[i] = parseInt(version[i].match(/\d+/), 10);
|
195 |
-
}
|
196 |
-
}
|
197 |
-
// Internet Explorer / ActiveX
|
198 |
-
} else if (typeof(window.ActiveXObject) != 'undefined') {
|
199 |
-
try {
|
200 |
-
ax = new ActiveXObject(activeX);
|
201 |
-
if (ax) {
|
202 |
-
version = axDetect(ax);
|
203 |
-
}
|
204 |
-
}
|
205 |
-
catch (e) { }
|
206 |
-
}
|
207 |
-
return version;
|
208 |
-
}
|
209 |
-
};
|
210 |
-
|
211 |
-
// Add Flash detection
|
212 |
-
mejs.PluginDetector.addPlugin('flash','Shockwave Flash','application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash', function(ax) {
|
213 |
-
// adapted from SWFObject
|
214 |
-
var version = [],
|
215 |
-
d = ax.GetVariable("$version");
|
216 |
-
if (d) {
|
217 |
-
d = d.split(" ")[1].split(",");
|
218 |
-
version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
219 |
-
}
|
220 |
-
return version;
|
221 |
-
});
|
222 |
-
|
223 |
-
// Add Silverlight detection
|
224 |
-
mejs.PluginDetector.addPlugin('silverlight','Silverlight Plug-In','application/x-silverlight-2','AgControl.AgControl', function (ax) {
|
225 |
-
// Silverlight cannot report its version number to IE
|
226 |
-
// but it does have a isVersionSupported function, so we have to loop through it to get a version number.
|
227 |
-
// adapted from http://www.silverlightversion.com/
|
228 |
-
var v = [0,0,0,0],
|
229 |
-
loopMatch = function(ax, v, i, n) {
|
230 |
-
while(ax.isVersionSupported(v[0]+ "."+ v[1] + "." + v[2] + "." + v[3])){
|
231 |
-
v[i]+=n;
|
232 |
-
}
|
233 |
-
v[i] -= n;
|
234 |
-
};
|
235 |
-
loopMatch(ax, v, 0, 1);
|
236 |
-
loopMatch(ax, v, 1, 1);
|
237 |
-
loopMatch(ax, v, 2, 10000); // the third place in the version number is usually 5 digits (4.0.xxxxx)
|
238 |
-
loopMatch(ax, v, 2, 1000);
|
239 |
-
loopMatch(ax, v, 2, 100);
|
240 |
-
loopMatch(ax, v, 2, 10);
|
241 |
-
loopMatch(ax, v, 2, 1);
|
242 |
-
loopMatch(ax, v, 3, 1);
|
243 |
-
|
244 |
-
return v;
|
245 |
-
});
|
246 |
-
// add adobe acrobat
|
247 |
-
/*
|
248 |
-
PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PDF', function (ax) {
|
249 |
-
var version = [],
|
250 |
-
d = ax.GetVersions().split(',')[0].split('=')[1].split('.');
|
251 |
-
|
252 |
-
if (d) {
|
253 |
-
version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
254 |
-
}
|
255 |
-
return version;
|
256 |
-
});
|
257 |
-
*/
|
258 |
-
// necessary detection (fixes for <IE9)
|
259 |
-
mejs.MediaFeatures = {
|
260 |
-
init: function() {
|
261 |
-
var
|
262 |
-
t = this,
|
263 |
-
d = document,
|
264 |
-
nav = mejs.PluginDetector.nav,
|
265 |
-
ua = mejs.PluginDetector.ua.toLowerCase(),
|
266 |
-
i,
|
267 |
-
v,
|
268 |
-
html5Elements = ['source','track','audio','video'];
|
269 |
-
|
270 |
-
// detect browsers (only the ones that have some kind of quirk we need to work around)
|
271 |
-
t.isiPad = (ua.match(/ipad/i) !== null);
|
272 |
-
t.isiPhone = (ua.match(/iphone/i) !== null);
|
273 |
-
t.isiOS = t.isiPhone || t.isiPad;
|
274 |
-
t.isAndroid = (ua.match(/android/i) !== null);
|
275 |
-
t.isBustedAndroid = (ua.match(/android 2\.[12]/) !== null);
|
276 |
-
t.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1);
|
277 |
-
t.isChrome = (ua.match(/chrome/gi) !== null);
|
278 |
-
t.isFirefox = (ua.match(/firefox/gi) !== null);
|
279 |
-
t.isWebkit = (ua.match(/webkit/gi) !== null);
|
280 |
-
t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit;
|
281 |
-
t.isOpera = (ua.match(/opera/gi) !== null);
|
282 |
-
t.hasTouch = ('ontouchstart' in window);
|
283 |
-
|
284 |
-
// create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
|
285 |
-
for (i=0; i<html5Elements.length; i++) {
|
286 |
-
v = document.createElement(html5Elements[i]);
|
287 |
-
}
|
288 |
-
|
289 |
-
t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid);
|
290 |
-
|
291 |
-
// detect native JavaScript fullscreen (Safari/Firefox only, Chrome still fails)
|
292 |
-
|
293 |
-
// iOS
|
294 |
-
t.hasSemiNativeFullScreen = (typeof v.webkitEnterFullscreen !== 'undefined');
|
295 |
-
|
296 |
-
// Webkit/firefox
|
297 |
-
t.hasWebkitNativeFullScreen = (typeof v.webkitRequestFullScreen !== 'undefined');
|
298 |
-
t.hasMozNativeFullScreen = (typeof v.mozRequestFullScreen !== 'undefined');
|
299 |
-
|
300 |
-
t.hasTrueNativeFullScreen = (t.hasWebkitNativeFullScreen || t.hasMozNativeFullScreen);
|
301 |
-
t.nativeFullScreenEnabled = t.hasTrueNativeFullScreen;
|
302 |
-
if (t.hasMozNativeFullScreen) {
|
303 |
-
t.nativeFullScreenEnabled = v.mozFullScreenEnabled;
|
304 |
-
}
|
305 |
-
|
306 |
-
|
307 |
-
if (this.isChrome) {
|
308 |
-
t.hasSemiNativeFullScreen = false;
|
309 |
-
}
|
310 |
-
|
311 |
-
if (t.hasTrueNativeFullScreen) {
|
312 |
-
t.fullScreenEventName = (t.hasWebkitNativeFullScreen) ? 'webkitfullscreenchange' : 'mozfullscreenchange';
|
313 |
-
|
314 |
-
|
315 |
-
t.isFullScreen = function() {
|
316 |
-
if (v.mozRequestFullScreen) {
|
317 |
-
return d.mozFullScreen;
|
318 |
-
} else if (v.webkitRequestFullScreen) {
|
319 |
-
return d.webkitIsFullScreen;
|
320 |
-
}
|
321 |
-
}
|
322 |
-
|
323 |
-
t.requestFullScreen = function(el) {
|
324 |
-
|
325 |
-
if (t.hasWebkitNativeFullScreen) {
|
326 |
-
el.webkitRequestFullScreen();
|
327 |
-
} else if (t.hasMozNativeFullScreen) {
|
328 |
-
el.mozRequestFullScreen();
|
329 |
-
}
|
330 |
-
}
|
331 |
-
|
332 |
-
t.cancelFullScreen = function() {
|
333 |
-
if (t.hasWebkitNativeFullScreen) {
|
334 |
-
document.webkitCancelFullScreen();
|
335 |
-
} else if (t.hasMozNativeFullScreen) {
|
336 |
-
document.mozCancelFullScreen();
|
337 |
-
}
|
338 |
-
}
|
339 |
-
|
340 |
-
}
|
341 |
-
|
342 |
-
|
343 |
-
// OS X 10.5 can't do this even if it says it can :(
|
344 |
-
if (t.hasSemiNativeFullScreen && ua.match(/mac os x 10_5/i)) {
|
345 |
-
t.hasNativeFullScreen = false;
|
346 |
-
t.hasSemiNativeFullScreen = false;
|
347 |
-
}
|
348 |
-
|
349 |
-
}
|
350 |
-
};
|
351 |
-
mejs.MediaFeatures.init();
|
352 |
-
|
353 |
-
|
354 |
-
/*
|
355 |
-
extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below)
|
356 |
-
*/
|
357 |
-
mejs.HtmlMediaElement = {
|
358 |
-
pluginType: 'native',
|
359 |
-
isFullScreen: false,
|
360 |
-
|
361 |
-
setCurrentTime: function (time) {
|
362 |
-
this.currentTime = time;
|
363 |
-
},
|
364 |
-
|
365 |
-
setMuted: function (muted) {
|
366 |
-
this.muted = muted;
|
367 |
-
},
|
368 |
-
|
369 |
-
setVolume: function (volume) {
|
370 |
-
this.volume = volume;
|
371 |
-
},
|
372 |
-
|
373 |
-
// for parity with the plugin versions
|
374 |
-
stop: function () {
|
375 |
-
this.pause();
|
376 |
-
},
|
377 |
-
|
378 |
-
// This can be a url string
|
379 |
-
// or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
|
380 |
-
setSrc: function (url) {
|
381 |
-
|
382 |
-
// Fix for IE9 which can't set .src when there are <source> elements. Awesome, right?
|
383 |
-
var
|
384 |
-
existingSources = this.getElementsByTagName('source');
|
385 |
-
while (existingSources.length > 0){
|
386 |
-
this.removeChild(existingSources[0]);
|
387 |
-
}
|
388 |
-
|
389 |
-
if (typeof url == 'string') {
|
390 |
-
this.src = url;
|
391 |
-
} else {
|
392 |
-
var i, media;
|
393 |
-
|
394 |
-
for (i=0; i<url.length; i++) {
|
395 |
-
media = url[i];
|
396 |
-
if (this.canPlayType(media.type)) {
|
397 |
-
this.src = media.src;
|
398 |
-
}
|
399 |
-
}
|
400 |
-
}
|
401 |
-
},
|
402 |
-
|
403 |
-
setVideoSize: function (width, height) {
|
404 |
-
this.width = width;
|
405 |
-
this.height = height;
|
406 |
-
}
|
407 |
-
};
|
408 |
-
|
409 |
-
/*
|
410 |
-
Mimics the <video/audio> element by calling Flash's External Interface or Silverlights [ScriptableMember]
|
411 |
-
*/
|
412 |
-
mejs.PluginMediaElement = function (pluginid, pluginType, mediaUrl) {
|
413 |
-
this.id = pluginid;
|
414 |
-
this.pluginType = pluginType;
|
415 |
-
this.src = mediaUrl;
|
416 |
-
this.events = {};
|
417 |
-
};
|
418 |
-
|
419 |
-
// JavaScript values and ExternalInterface methods that match HTML5 video properties methods
|
420 |
-
// http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html
|
421 |
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
|
422 |
-
mejs.PluginMediaElement.prototype = {
|
423 |
-
|
424 |
-
// special
|
425 |
-
pluginElement: null,
|
426 |
-
pluginType: '',
|
427 |
-
isFullScreen: false,
|
428 |
-
|
429 |
-
// not implemented :(
|
430 |
-
playbackRate: -1,
|
431 |
-
defaultPlaybackRate: -1,
|
432 |
-
seekable: [],
|
433 |
-
played: [],
|
434 |
-
|
435 |
-
// HTML5 read-only properties
|
436 |
-
paused: true,
|
437 |
-
ended: false,
|
438 |
-
seeking: false,
|
439 |
-
duration: 0,
|
440 |
-
error: null,
|
441 |
-
tagName: '',
|
442 |
-
|
443 |
-
// HTML5 get/set properties, but only set (updated by event handlers)
|
444 |
-
muted: false,
|
445 |
-
volume: 1,
|
446 |
-
currentTime: 0,
|
447 |
-
|
448 |
-
// HTML5 methods
|
449 |
-
play: function () {
|
450 |
-
if (this.pluginApi != null) {
|
451 |
-
if (this.pluginType == 'youtube') {
|
452 |
-
this.pluginApi.playVideo();
|
453 |
-
} else {
|
454 |
-
this.pluginApi.playMedia();
|
455 |
-
}
|
456 |
-
this.paused = false;
|
457 |
-
}
|
458 |
-
},
|
459 |
-
load: function () {
|
460 |
-
if (this.pluginApi != null) {
|
461 |
-
if (this.pluginType == 'youtube') {
|
462 |
-
} else {
|
463 |
-
this.pluginApi.loadMedia();
|
464 |
-
}
|
465 |
-
|
466 |
-
this.paused = false;
|
467 |
-
}
|
468 |
-
},
|
469 |
-
pause: function () {
|
470 |
-
if (this.pluginApi != null) {
|
471 |
-
if (this.pluginType == 'youtube') {
|
472 |
-
this.pluginApi.pauseVideo();
|
473 |
-
} else {
|
474 |
-
this.pluginApi.pauseMedia();
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
this.paused = true;
|
479 |
-
}
|
480 |
-
},
|
481 |
-
stop: function () {
|
482 |
-
if (this.pluginApi != null) {
|
483 |
-
if (this.pluginType == 'youtube') {
|
484 |
-
this.pluginApi.stopVideo();
|
485 |
-
} else {
|
486 |
-
this.pluginApi.stopMedia();
|
487 |
-
}
|
488 |
-
this.paused = true;
|
489 |
-
}
|
490 |
-
},
|
491 |
-
canPlayType: function(type) {
|
492 |
-
var i,
|
493 |
-
j,
|
494 |
-
pluginInfo,
|
495 |
-
pluginVersions = mejs.plugins[this.pluginType];
|
496 |
-
|
497 |
-
for (i=0; i<pluginVersions.length; i++) {
|
498 |
-
pluginInfo = pluginVersions[i];
|
499 |
-
|
500 |
-
// test if user has the correct plugin version
|
501 |
-
if (mejs.PluginDetector.hasPluginVersion(this.pluginType, pluginInfo.version)) {
|
502 |
-
|
503 |
-
// test for plugin playback types
|
504 |
-
for (j=0; j<pluginInfo.types.length; j++) {
|
505 |
-
// find plugin that can play the type
|
506 |
-
if (type == pluginInfo.types[j]) {
|
507 |
-
return true;
|
508 |
-
}
|
509 |
-
}
|
510 |
-
}
|
511 |
-
}
|
512 |
-
|
513 |
-
return false;
|
514 |
-
},
|
515 |
-
|
516 |
-
positionFullscreenButton: function(x,y,visibleAndAbove) {
|
517 |
-
if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) {
|
518 |
-
this.pluginApi.positionFullscreenButton(x,y,visibleAndAbove);
|
519 |
-
}
|
520 |
-
},
|
521 |
-
|
522 |
-
hideFullscreenButton: function() {
|
523 |
-
if (this.pluginApi != null && this.pluginApi.hideFullscreenButton) {
|
524 |
-
this.pluginApi.hideFullscreenButton();
|
525 |
-
}
|
526 |
-
},
|
527 |
-
|
528 |
-
|
529 |
-
// custom methods since not all JavaScript implementations support get/set
|
530 |
-
|
531 |
-
// This can be a url string
|
532 |
-
// or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}]
|
533 |
-
setSrc: function (url) {
|
534 |
-
if (typeof url == 'string') {
|
535 |
-
this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(url));
|
536 |
-
this.src = mejs.Utility.absolutizeUrl(url);
|
537 |
-
} else {
|
538 |
-
var i, media;
|
539 |
-
|
540 |
-
for (i=0; i<url.length; i++) {
|
541 |
-
media = url[i];
|
542 |
-
if (this.canPlayType(media.type)) {
|
543 |
-
this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(media.src));
|
544 |
-
this.src = mejs.Utility.absolutizeUrl(url);
|
545 |
-
}
|
546 |
-
}
|
547 |
-
}
|
548 |
-
|
549 |
-
},
|
550 |
-
setCurrentTime: function (time) {
|
551 |
-
if (this.pluginApi != null) {
|
552 |
-
if (this.pluginType == 'youtube') {
|
553 |
-
this.pluginApi.seekTo(time);
|
554 |
-
} else {
|
555 |
-
this.pluginApi.setCurrentTime(time);
|
556 |
-
}
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
this.currentTime = time;
|
561 |
-
}
|
562 |
-
},
|
563 |
-
setVolume: function (volume) {
|
564 |
-
if (this.pluginApi != null) {
|
565 |
-
// same on YouTube and MEjs
|
566 |
-
if (this.pluginType == 'youtube') {
|
567 |
-
this.pluginApi.setVolume(volume * 100);
|
568 |
-
} else {
|
569 |
-
this.pluginApi.setVolume(volume);
|
570 |
-
}
|
571 |
-
this.volume = volume;
|
572 |
-
}
|
573 |
-
},
|
574 |
-
setMuted: function (muted) {
|
575 |
-
if (this.pluginApi != null) {
|
576 |
-
if (this.pluginType == 'youtube') {
|
577 |
-
if (muted) {
|
578 |
-
this.pluginApi.mute();
|
579 |
-
} else {
|
580 |
-
this.pluginApi.unMute();
|
581 |
-
}
|
582 |
-
this.muted = muted;
|
583 |
-
this.dispatchEvent('volumechange');
|
584 |
-
} else {
|
585 |
-
this.pluginApi.setMuted(muted);
|
586 |
-
}
|
587 |
-
this.muted = muted;
|
588 |
-
}
|
589 |
-
},
|
590 |
-
|
591 |
-
// additional non-HTML5 methods
|
592 |
-
setVideoSize: function (width, height) {
|
593 |
-
|
594 |
-
//if (this.pluginType == 'flash' || this.pluginType == 'silverlight') {
|
595 |
-
if ( this.pluginElement.style) {
|
596 |
-
this.pluginElement.style.width = width + 'px';
|
597 |
-
this.pluginElement.style.height = height + 'px';
|
598 |
-
}
|
599 |
-
if (this.pluginApi != null && this.pluginApi.setVideoSize) {
|
600 |
-
this.pluginApi.setVideoSize(width, height);
|
601 |
-
}
|
602 |
-
//}
|
603 |
-
},
|
604 |
-
|
605 |
-
setFullscreen: function (fullscreen) {
|
606 |
-
if (this.pluginApi != null && this.pluginApi.setFullscreen) {
|
607 |
-
this.pluginApi.setFullscreen(fullscreen);
|
608 |
-
}
|
609 |
-
},
|
610 |
-
|
611 |
-
enterFullScreen: function() {
|
612 |
-
if (this.pluginApi != null && this.pluginApi.setFullscreen) {
|
613 |
-
this.setFullscreen(true);
|
614 |
-
}
|
615 |
-
|
616 |
-
},
|
617 |
-
|
618 |
-
exitFullScreen: function() {
|
619 |
-
if (this.pluginApi != null && this.pluginApi.setFullscreen) {
|
620 |
-
this.setFullscreen(false);
|
621 |
-
}
|
622 |
-
},
|
623 |
-
|
624 |
-
// start: fake events
|
625 |
-
addEventListener: function (eventName, callback, bubble) {
|
626 |
-
this.events[eventName] = this.events[eventName] || [];
|
627 |
-
this.events[eventName].push(callback);
|
628 |
-
},
|
629 |
-
removeEventListener: function (eventName, callback) {
|
630 |
-
if (!eventName) { this.events = {}; return true; }
|
631 |
-
var callbacks = this.events[eventName];
|
632 |
-
if (!callbacks) return true;
|
633 |
-
if (!callback) { this.events[eventName] = []; return true; }
|
634 |
-
for (i = 0; i < callbacks.length; i++) {
|
635 |
-
if (callbacks[i] === callback) {
|
636 |
-
this.events[eventName].splice(i, 1);
|
637 |
-
return true;
|
638 |
-
}
|
639 |
-
}
|
640 |
-
return false;
|
641 |
-
},
|
642 |
-
dispatchEvent: function (eventName) {
|
643 |
-
var i,
|
644 |
-
args,
|
645 |
-
callbacks = this.events[eventName];
|
646 |
-
|
647 |
-
if (callbacks) {
|
648 |
-
args = Array.prototype.slice.call(arguments, 1);
|
649 |
-
for (i = 0; i < callbacks.length; i++) {
|
650 |
-
callbacks[i].apply(null, args);
|
651 |
-
}
|
652 |
-
}
|
653 |
-
},
|
654 |
-
// end: fake events
|
655 |
-
|
656 |
-
// fake DOM attribute methods
|
657 |
-
attributes: {},
|
658 |
-
hasAttribute: function(name){
|
659 |
-
return (name in this.attributes);
|
660 |
-
},
|
661 |
-
removeAttribute: function(name){
|
662 |
-
delete this.attributes[name];
|
663 |
-
},
|
664 |
-
getAttribute: function(name){
|
665 |
-
if (this.hasAttribute(name)) {
|
666 |
-
return this.attributes[name];
|
667 |
-
}
|
668 |
-
return '';
|
669 |
-
},
|
670 |
-
setAttribute: function(name, value){
|
671 |
-
this.attributes[name] = value;
|
672 |
-
},
|
673 |
-
|
674 |
-
remove: function() {
|
675 |
-
mejs.Utility.removeSwf(this.pluginElement.id);
|
676 |
-
}
|
677 |
-
};
|
678 |
-
|
679 |
-
// Handles calls from Flash/Silverlight and reports them as native <video/audio> events and properties
|
680 |
-
mejs.MediaPluginBridge = {
|
681 |
-
|
682 |
-
pluginMediaElements:{},
|
683 |
-
htmlMediaElements:{},
|
684 |
-
|
685 |
-
registerPluginElement: function (id, pluginMediaElement, htmlMediaElement) {
|
686 |
-
this.pluginMediaElements[id] = pluginMediaElement;
|
687 |
-
this.htmlMediaElements[id] = htmlMediaElement;
|
688 |
-
},
|
689 |
-
|
690 |
-
// when Flash/Silverlight is ready, it calls out to this method
|
691 |
-
initPlugin: function (id) {
|
692 |
-
|
693 |
-
var pluginMediaElement = this.pluginMediaElements[id],
|
694 |
-
htmlMediaElement = this.htmlMediaElements[id];
|
695 |
-
|
696 |
-
if (pluginMediaElement) {
|
697 |
-
// find the javascript bridge
|
698 |
-
switch (pluginMediaElement.pluginType) {
|
699 |
-
case "flash":
|
700 |
-
pluginMediaElement.pluginElement = pluginMediaElement.pluginApi = document.getElementById(id);
|
701 |
-
break;
|
702 |
-
case "silverlight":
|
703 |
-
pluginMediaElement.pluginElement = document.getElementById(pluginMediaElement.id);
|
704 |
-
pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.MediaElementJS;
|
705 |
-
break;
|
706 |
-
}
|
707 |
-
|
708 |
-
if (pluginMediaElement.pluginApi != null && pluginMediaElement.success) {
|
709 |
-
pluginMediaElement.success(pluginMediaElement, htmlMediaElement);
|
710 |
-
}
|
711 |
-
}
|
712 |
-
},
|
713 |
-
|
714 |
-
// receives events from Flash/Silverlight and sends them out as HTML5 media events
|
715 |
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html
|
716 |
-
fireEvent: function (id, eventName, values) {
|
717 |
-
|
718 |
-
var
|
719 |
-
e,
|
720 |
-
i,
|
721 |
-
bufferedTime,
|
722 |
-
pluginMediaElement = this.pluginMediaElements[id];
|
723 |
-
|
724 |
-
pluginMediaElement.ended = false;
|
725 |
-
pluginMediaElement.paused = true;
|
726 |
-
|
727 |
-
// fake event object to mimic real HTML media event.
|
728 |
-
e = {
|
729 |
-
type: eventName,
|
730 |
-
target: pluginMediaElement
|
731 |
-
};
|
732 |
-
|
733 |
-
// attach all values to element and event object
|
734 |
-
for (i in values) {
|
735 |
-
pluginMediaElement[i] = values[i];
|
736 |
-
e[i] = values[i];
|
737 |
-
}
|
738 |
-
|
739 |
-
// fake the newer W3C buffered TimeRange (loaded and total have been removed)
|
740 |
-
bufferedTime = values.bufferedTime || 0;
|
741 |
-
|
742 |
-
e.target.buffered = e.buffered = {
|
743 |
-
start: function(index) {
|
744 |
-
return 0;
|
745 |
-
},
|
746 |
-
end: function (index) {
|
747 |
-
return bufferedTime;
|
748 |
-
},
|
749 |
-
length: 1
|
750 |
-
};
|
751 |
-
|
752 |
-
pluginMediaElement.dispatchEvent(e.type, e);
|
753 |
-
}
|
754 |
-
};
|
755 |
-
|
756 |
-
/*
|
757 |
-
Default options
|
758 |
-
*/
|
759 |
-
mejs.MediaElementDefaults = {
|
760 |
-
// allows testing on HTML5, flash, silverlight
|
761 |
-
// auto: attempts to detect what the browser can do
|
762 |
-
// native: forces HTML5 playback
|
763 |
-
// shim: disallows HTML5, will attempt either Flash or Silverlight
|
764 |
-
// none: forces fallback view
|
765 |
-
mode: 'auto',
|
766 |
-
// remove or reorder to change plugin priority and availability
|
767 |
-
plugins: ['flash','silverlight','youtube','vimeo'],
|
768 |
-
// shows debug errors on screen
|
769 |
-
enablePluginDebug: false,
|
770 |
-
// overrides the type specified, useful for dynamic instantiation
|
771 |
-
type: '',
|
772 |
-
// path to Flash and Silverlight plugins
|
773 |
-
pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js']),
|
774 |
-
// name of flash file
|
775 |
-
flashName: 'flashmediaelement.swf',
|
776 |
-
// turns on the smoothing filter in Flash
|
777 |
-
enablePluginSmoothing: false,
|
778 |
-
// name of silverlight file
|
779 |
-
silverlightName: 'silverlightmediaelement.xap',
|
780 |
-
// default if the <video width> is not specified
|
781 |
-
defaultVideoWidth: 480,
|
782 |
-
// default if the <video height> is not specified
|
783 |
-
defaultVideoHeight: 270,
|
784 |
-
// overrides <video width>
|
785 |
-
pluginWidth: -1,
|
786 |
-
// overrides <video height>
|
787 |
-
pluginHeight: -1,
|
788 |
-
// additional plugin variables in 'key=value' form
|
789 |
-
pluginVars: [],
|
790 |
-
// rate in milliseconds for Flash and Silverlight to fire the timeupdate event
|
791 |
-
// larger number is less accurate, but less strain on plugin->JavaScript bridge
|
792 |
-
timerRate: 250,
|
793 |
-
// initial volume for player
|
794 |
-
startVolume: 0.8,
|
795 |
-
success: function () { },
|
796 |
-
error: function () { }
|
797 |
-
};
|
798 |
-
|
799 |
-
/*
|
800 |
-
Determines if a browser supports the <video> or <audio> element
|
801 |
-
and returns either the native element or a Flash/Silverlight version that
|
802 |
-
mimics HTML5 MediaElement
|
803 |
-
*/
|
804 |
-
mejs.MediaElement = function (el, o) {
|
805 |
-
return mejs.HtmlMediaElementShim.create(el,o);
|
806 |
-
};
|
807 |
-
|
808 |
-
mejs.HtmlMediaElementShim = {
|
809 |
-
|
810 |
-
create: function(el, o) {
|
811 |
-
var
|
812 |
-
options = mejs.MediaElementDefaults,
|
813 |
-
htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el,
|
814 |
-
tagName = htmlMediaElement.tagName.toLowerCase(),
|
815 |
-
isMediaTag = (tagName === 'audio' || tagName === 'video'),
|
816 |
-
src = (isMediaTag) ? htmlMediaElement.getAttribute('src') : htmlMediaElement.getAttribute('href'),
|
817 |
-
poster = htmlMediaElement.getAttribute('poster'),
|
818 |
-
autoplay = htmlMediaElement.getAttribute('autoplay'),
|
819 |
-
preload = htmlMediaElement.getAttribute('preload'),
|
820 |
-
controls = htmlMediaElement.getAttribute('controls'),
|
821 |
-
playback,
|
822 |
-
prop;
|
823 |
-
|
824 |
-
// extend options
|
825 |
-
for (prop in o) {
|
826 |
-
options[prop] = o[prop];
|
827 |
-
}
|
828 |
-
|
829 |
-
// clean up attributes
|
830 |
-
src = (typeof src == 'undefined' || src === null || src == '') ? null : src;
|
831 |
-
poster = (typeof poster == 'undefined' || poster === null) ? '' : poster;
|
832 |
-
preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload;
|
833 |
-
autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false');
|
834 |
-
controls = !(typeof controls == 'undefined' || controls === null || controls === 'false');
|
835 |
-
|
836 |
-
// test for HTML5 and plugin capabilities
|
837 |
-
playback = this.determinePlayback(htmlMediaElement, options, mejs.MediaFeatures.supportsMediaTag, isMediaTag, src);
|
838 |
-
playback.url = (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '';
|
839 |
-
|
840 |
-
if (playback.method == 'native') {
|
841 |
-
// second fix for android
|
842 |
-
if (mejs.MediaFeatures.isBustedAndroid) {
|
843 |
-
htmlMediaElement.src = playback.url;
|
844 |
-
htmlMediaElement.addEventListener('click', function() {
|
845 |
-
htmlMediaElement.play();
|
846 |
-
}, false);
|
847 |
-
}
|
848 |
-
|
849 |
-
// add methods to native HTMLMediaElement
|
850 |
-
return this.updateNative(playback, options, autoplay, preload);
|
851 |
-
} else if (playback.method !== '') {
|
852 |
-
// create plugin to mimic HTMLMediaElement
|
853 |
-
|
854 |
-
return this.createPlugin( playback, options, poster, autoplay, preload, controls);
|
855 |
-
} else {
|
856 |
-
// boo, no HTML5, no Flash, no Silverlight.
|
857 |
-
this.createErrorMessage( playback, options, poster );
|
858 |
-
|
859 |
-
return this;
|
860 |
-
}
|
861 |
-
},
|
862 |
-
|
863 |
-
determinePlayback: function(htmlMediaElement, options, supportsMediaTag, isMediaTag, src) {
|
864 |
-
var
|
865 |
-
mediaFiles = [],
|
866 |
-
i,
|
867 |
-
j,
|
868 |
-
k,
|
869 |
-
l,
|
870 |
-
n,
|
871 |
-
type,
|
872 |
-
result = { method: '', url: '', htmlMediaElement: htmlMediaElement, isVideo: (htmlMediaElement.tagName.toLowerCase() != 'audio')},
|
873 |
-
pluginName,
|
874 |
-
pluginVersions,
|
875 |
-
pluginInfo,
|
876 |
-
dummy;
|
877 |
-
|
878 |
-
// STEP 1: Get URL and type from <video src> or <source src>
|
879 |
-
|
880 |
-
// supplied type overrides <video type> and <source type>
|
881 |
-
if (typeof options.type != 'undefined' && options.type !== '') {
|
882 |
-
|
883 |
-
// accept either string or array of types
|
884 |
-
if (typeof options.type == 'string') {
|
885 |
-
mediaFiles.push({type:options.type, url:src});
|
886 |
-
} else {
|
887 |
-
|
888 |
-
for (i=0; i<options.type.length; i++) {
|
889 |
-
mediaFiles.push({type:options.type[i], url:src});
|
890 |
-
}
|
891 |
-
}
|
892 |
-
|
893 |
-
// test for src attribute first
|
894 |
-
} else if (src !== null) {
|
895 |
-
type = this.formatType(src, htmlMediaElement.getAttribute('type'));
|
896 |
-
mediaFiles.push({type:type, url:src});
|
897 |
-
|
898 |
-
// then test for <source> elements
|
899 |
-
} else {
|
900 |
-
// test <source> types to see if they are usable
|
901 |
-
for (i = 0; i < htmlMediaElement.childNodes.length; i++) {
|
902 |
-
n = htmlMediaElement.childNodes[i];
|
903 |
-
if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') {
|
904 |
-
src = n.getAttribute('src');
|
905 |
-
type = this.formatType(src, n.getAttribute('type'));
|
906 |
-
mediaFiles.push({type:type, url:src});
|
907 |
-
}
|
908 |
-
}
|
909 |
-
}
|
910 |
-
|
911 |
-
// in the case of dynamicly created players
|
912 |
-
// check for audio types
|
913 |
-
if (!isMediaTag && mediaFiles.length > 0 && mediaFiles[0].url !== null && this.getTypeFromFile(mediaFiles[0].url).indexOf('audio') > -1) {
|
914 |
-
result.isVideo = false;
|
915 |
-
}
|
916 |
-
|
917 |
-
|
918 |
-
// STEP 2: Test for playback method
|
919 |
-
|
920 |
-
// special case for Android which sadly doesn't implement the canPlayType function (always returns '')
|
921 |
-
if (mejs.MediaFeatures.isBustedAndroid) {
|
922 |
-
htmlMediaElement.canPlayType = function(type) {
|
923 |
-
return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'maybe' : '';
|
924 |
-
};
|
925 |
-
}
|
926 |
-
|
927 |
-
|
928 |
-
// test for native playback first
|
929 |
-
if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'native')) {
|
930 |
-
|
931 |
-
if (!isMediaTag) {
|
932 |
-
|
933 |
-
// create a real HTML5 Media Element
|
934 |
-
dummy = document.createElement( result.isVideo ? 'video' : 'audio');
|
935 |
-
htmlMediaElement.parentNode.insertBefore(dummy, htmlMediaElement);
|
936 |
-
htmlMediaElement.style.display = 'none';
|
937 |
-
|
938 |
-
// use this one from now on
|
939 |
-
result.htmlMediaElement = htmlMediaElement = dummy;
|
940 |
-
}
|
941 |
-
|
942 |
-
for (i=0; i<mediaFiles.length; i++) {
|
943 |
-
// normal check
|
944 |
-
if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== ''
|
945 |
-
// special case for Mac/Safari 5.0.3 which answers '' to canPlayType('audio/mp3') but 'maybe' to canPlayType('audio/mpeg')
|
946 |
-
|| htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '') {
|
947 |
-
result.method = 'native';
|
948 |
-
result.url = mediaFiles[i].url;
|
949 |
-
break;
|
950 |
-
}
|
951 |
-
}
|
952 |
-
|
953 |
-
if (result.method === 'native') {
|
954 |
-
if (result.url !== null) {
|
955 |
-
htmlMediaElement.src = result.url;
|
956 |
-
}
|
957 |
-
|
958 |
-
return result;
|
959 |
-
}
|
960 |
-
}
|
961 |
-
|
962 |
-
// if native playback didn't work, then test plugins
|
963 |
-
if (options.mode === 'auto' || options.mode === 'shim') {
|
964 |
-
for (i=0; i<mediaFiles.length; i++) {
|
965 |
-
type = mediaFiles[i].type;
|
966 |
-
|
967 |
-
// test all plugins in order of preference [silverlight, flash]
|
968 |
-
for (j=0; j<options.plugins.length; j++) {
|
969 |
-
|
970 |
-
pluginName = options.plugins[j];
|
971 |
-
|
972 |
-
// test version of plugin (for future features)
|
973 |
-
pluginVersions = mejs.plugins[pluginName];
|
974 |
-
|
975 |
-
for (k=0; k<pluginVersions.length; k++) {
|
976 |
-
pluginInfo = pluginVersions[k];
|
977 |
-
|
978 |
-
// test if user has the correct plugin version
|
979 |
-
|
980 |
-
// for youtube/vimeo
|
981 |
-
if (pluginInfo.version == null ||
|
982 |
-
|
983 |
-
mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) {
|
984 |
-
|
985 |
-
// test for plugin playback types
|
986 |
-
for (l=0; l<pluginInfo.types.length; l++) {
|
987 |
-
// find plugin that can play the type
|
988 |
-
if (type == pluginInfo.types[l]) {
|
989 |
-
result.method = pluginName;
|
990 |
-
result.url = mediaFiles[i].url;
|
991 |
-
return result;
|
992 |
-
}
|
993 |
-
}
|
994 |
-
}
|
995 |
-
}
|
996 |
-
}
|
997 |
-
}
|
998 |
-
}
|
999 |
-
|
1000 |
-
// what if there's nothing to play? just grab the first available
|
1001 |
-
if (result.method === '' && mediaFiles.length > 0) {
|
1002 |
-
result.url = mediaFiles[0].url;
|
1003 |
-
}
|
1004 |
-
|
1005 |
-
return result;
|
1006 |
-
},
|
1007 |
-
|
1008 |
-
formatType: function(url, type) {
|
1009 |
-
var ext;
|
1010 |
-
|
1011 |
-
// if no type is supplied, fake it with the extension
|
1012 |
-
if (url && !type) {
|
1013 |
-
return this.getTypeFromFile(url);
|
1014 |
-
} else {
|
1015 |
-
// only return the mime part of the type in case the attribute contains the codec
|
1016 |
-
// see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element
|
1017 |
-
// `video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4`
|
1018 |
-
|
1019 |
-
if (type && ~type.indexOf(';')) {
|
1020 |
-
return type.substr(0, type.indexOf(';'));
|
1021 |
-
} else {
|
1022 |
-
return type;
|
1023 |
-
}
|
1024 |
-
}
|
1025 |
-
},
|
1026 |
-
|
1027 |
-
getTypeFromFile: function(url) {
|
1028 |
-
var ext = url.substring(url.lastIndexOf('.') + 1);
|
1029 |
-
return (/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + ext;
|
1030 |
-
},
|
1031 |
-
|
1032 |
-
createErrorMessage: function(playback, options, poster) {
|
1033 |
-
var
|
1034 |
-
htmlMediaElement = playback.htmlMediaElement,
|
1035 |
-
errorContainer = document.createElement('div');
|
1036 |
-
|
1037 |
-
errorContainer.className = 'me-cannotplay';
|
1038 |
-
|
1039 |
-
try {
|
1040 |
-
errorContainer.style.width = htmlMediaElement.width + 'px';
|
1041 |
-
errorContainer.style.height = htmlMediaElement.height + 'px';
|
1042 |
-
} catch (e) {}
|
1043 |
-
|
1044 |
-
errorContainer.innerHTML = (poster !== '') ?
|
1045 |
-
'<a href="' + playback.url + '"><img src="' + poster + '" width="100%" height="100%" /></a>' :
|
1046 |
-
'<a href="' + playback.url + '"><span>Download File</span></a>';
|
1047 |
-
|
1048 |
-
htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
|
1049 |
-
htmlMediaElement.style.display = 'none';
|
1050 |
-
|
1051 |
-
options.error(htmlMediaElement);
|
1052 |
-
},
|
1053 |
-
|
1054 |
-
createPlugin:function(playback, options, poster, autoplay, preload, controls) {
|
1055 |
-
var
|
1056 |
-
htmlMediaElement = playback.htmlMediaElement,
|
1057 |
-
width = 1,
|
1058 |
-
height = 1,
|
1059 |
-
pluginid = 'me_' + playback.method + '_' + (mejs.meIndex++),
|
1060 |
-
pluginMediaElement = new mejs.PluginMediaElement(pluginid, playback.method, playback.url),
|
1061 |
-
container = document.createElement('div'),
|
1062 |
-
specialIEContainer,
|
1063 |
-
node,
|
1064 |
-
initVars;
|
1065 |
-
|
1066 |
-
// copy tagName from html media element
|
1067 |
-
pluginMediaElement.tagName = htmlMediaElement.tagName
|
1068 |
-
|
1069 |
-
// copy attributes from html media element to plugin media element
|
1070 |
-
for (var i = 0; i < htmlMediaElement.attributes.length; i++) {
|
1071 |
-
var attribute = htmlMediaElement.attributes[i];
|
1072 |
-
if (attribute.specified == true) {
|
1073 |
-
pluginMediaElement.setAttribute(attribute.name, attribute.value);
|
1074 |
-
}
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
// check for placement inside a <p> tag (sometimes WYSIWYG editors do this)
|
1078 |
-
node = htmlMediaElement.parentNode;
|
1079 |
-
while (node !== null && node.tagName.toLowerCase() != 'body') {
|
1080 |
-
if (node.parentNode.tagName.toLowerCase() == 'p') {
|
1081 |
-
node.parentNode.parentNode.insertBefore(node, node.parentNode);
|
1082 |
-
break;
|
1083 |
-
}
|
1084 |
-
node = node.parentNode;
|
1085 |
-
}
|
1086 |
-
|
1087 |
-
if (playback.isVideo) {
|
1088 |
-
width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth;
|
1089 |
-
height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight;
|
1090 |
-
|
1091 |
-
// in case of '%' make sure it's encoded
|
1092 |
-
width = mejs.Utility.encodeUrl(width);
|
1093 |
-
height = mejs.Utility.encodeUrl(height);
|
1094 |
-
|
1095 |
-
} else {
|
1096 |
-
if (options.enablePluginDebug) {
|
1097 |
-
width = 320;
|
1098 |
-
height = 240;
|
1099 |
-
}
|
1100 |
-
}
|
1101 |
-
|
1102 |
-
// register plugin
|
1103 |
-
pluginMediaElement.success = options.success;
|
1104 |
-
mejs.MediaPluginBridge.registerPluginElement(pluginid, pluginMediaElement, htmlMediaElement);
|
1105 |
-
|
1106 |
-
// add container (must be added to DOM before inserting HTML for IE)
|
1107 |
-
container.className = 'me-plugin';
|
1108 |
-
container.id = pluginid + '_container';
|
1109 |
-
|
1110 |
-
if (playback.isVideo) {
|
1111 |
-
htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement);
|
1112 |
-
} else {
|
1113 |
-
document.body.insertBefore(container, document.body.childNodes[0]);
|
1114 |
-
}
|
1115 |
-
|
1116 |
-
// flash/silverlight vars
|
1117 |
-
initVars = [
|
1118 |
-
'id=' + pluginid,
|
1119 |
-
'isvideo=' + ((playback.isVideo) ? "true" : "false"),
|
1120 |
-
'autoplay=' + ((autoplay) ? "true" : "false"),
|
1121 |
-
'preload=' + preload,
|
1122 |
-
'width=' + width,
|
1123 |
-
'startvolume=' + options.startVolume,
|
1124 |
-
'timerrate=' + options.timerRate,
|
1125 |
-
'height=' + height];
|
1126 |
-
|
1127 |
-
if (playback.url !== null) {
|
1128 |
-
if (playback.method == 'flash') {
|
1129 |
-
initVars.push('file=' + mejs.Utility.encodeUrl(playback.url));
|
1130 |
-
} else {
|
1131 |
-
initVars.push('file=' + playback.url);
|
1132 |
-
}
|
1133 |
-
}
|
1134 |
-
if (options.enablePluginDebug) {
|
1135 |
-
initVars.push('debug=true');
|
1136 |
-
}
|
1137 |
-
if (options.enablePluginSmoothing) {
|
1138 |
-
initVars.push('smoothing=true');
|
1139 |
-
}
|
1140 |
-
if (controls) {
|
1141 |
-
initVars.push('controls=true'); // shows controls in the plugin if desired
|
1142 |
-
}
|
1143 |
-
if (options.pluginVars) {
|
1144 |
-
initVars = initVars.concat(options.pluginVars);
|
1145 |
-
}
|
1146 |
-
|
1147 |
-
switch (playback.method) {
|
1148 |
-
case 'silverlight':
|
1149 |
-
container.innerHTML =
|
1150 |
-
'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' +
|
1151 |
-
'<param name="initParams" value="' + initVars.join(',') + '" />' +
|
1152 |
-
'<param name="windowless" value="true" />' +
|
1153 |
-
'<param name="background" value="black" />' +
|
1154 |
-
'<param name="minRuntimeVersion" value="3.0.0.0" />' +
|
1155 |
-
'<param name="autoUpgrade" value="true" />' +
|
1156 |
-
'<param name="source" value="' + options.pluginPath + options.silverlightName + '" />' +
|
1157 |
-
'</object>';
|
1158 |
-
break;
|
1159 |
-
|
1160 |
-
case 'flash':
|
1161 |
-
|
1162 |
-
if (mejs.MediaFeatures.isIE) {
|
1163 |
-
specialIEContainer = document.createElement('div');
|
1164 |
-
container.appendChild(specialIEContainer);
|
1165 |
-
specialIEContainer.outerHTML =
|
1166 |
-
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
|
1167 |
-
'id="' + pluginid + '" width="' + width + '" height="' + height + '">' +
|
1168 |
-
'<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' +
|
1169 |
-
'<param name="flashvars" value="' + initVars.join('&') + '" />' +
|
1170 |
-
'<param name="quality" value="high" />' +
|
1171 |
-
'<param name="bgcolor" value="#000000" />' +
|
1172 |
-
'<param name="wmode" value="transparent" />' +
|
1173 |
-
'<param name="allowScriptAccess" value="always" />' +
|
1174 |
-
'<param name="allowFullScreen" value="true" />' +
|
1175 |
-
'</object>';
|
1176 |
-
|
1177 |
-
} else {
|
1178 |
-
|
1179 |
-
container.innerHTML =
|
1180 |
-
'<embed id="' + pluginid + '" name="' + pluginid + '" ' +
|
1181 |
-
'play="true" ' +
|
1182 |
-
'loop="false" ' +
|
1183 |
-
'quality="high" ' +
|
1184 |
-
'bgcolor="#000000" ' +
|
1185 |
-
'wmode="transparent" ' +
|
1186 |
-
'allowScriptAccess="always" ' +
|
1187 |
-
'allowFullScreen="true" ' +
|
1188 |
-
'type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" ' +
|
1189 |
-
'src="' + options.pluginPath + options.flashName + '" ' +
|
1190 |
-
'flashvars="' + initVars.join('&') + '" ' +
|
1191 |
-
'width="' + width + '" ' +
|
1192 |
-
'height="' + height + '"></embed>';
|
1193 |
-
}
|
1194 |
-
break;
|
1195 |
-
|
1196 |
-
case 'youtube':
|
1197 |
-
|
1198 |
-
|
1199 |
-
var
|
1200 |
-
videoId = playback.url.substr(playback.url.lastIndexOf('=')+1);
|
1201 |
-
youtubeSettings = {
|
1202 |
-
container: container,
|
1203 |
-
containerId: container.id,
|
1204 |
-
pluginMediaElement: pluginMediaElement,
|
1205 |
-
pluginId: pluginid,
|
1206 |
-
videoId: videoId,
|
1207 |
-
height: height,
|
1208 |
-
width: width
|
1209 |
-
};
|
1210 |
-
|
1211 |
-
if (mejs.PluginDetector.hasPluginVersion('flash', [10,0,0]) ) {
|
1212 |
-
mejs.YouTubeApi.createFlash(youtubeSettings);
|
1213 |
-
} else {
|
1214 |
-
mejs.YouTubeApi.enqueueIframe(youtubeSettings);
|
1215 |
-
}
|
1216 |
-
|
1217 |
-
break;
|
1218 |
-
|
1219 |
-
// DEMO Code. Does NOT work.
|
1220 |
-
case 'vimeo':
|
1221 |
-
console.log('vimeoid');
|
1222 |
-
|
1223 |
-
pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1);
|
1224 |
-
|
1225 |
-
container.innerHTML =
|
1226 |
-
'<object width="' + width + '" height="' + height + '">' +
|
1227 |
-
'<param name="allowfullscreen" value="true" />' +
|
1228 |
-
'<param name="allowscriptaccess" value="always" />' +
|
1229 |
-
'<param name="flashvars" value="api=1" />' +
|
1230 |
-
'<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + pluginMediaElement.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" />' +
|
1231 |
-
'<embed src="//vimeo.com/moogaloop.swf?api=1&clip_id=' + pluginMediaElement.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '"></embed>' +
|
1232 |
-
'</object>';
|
1233 |
-
|
1234 |
-
break;
|
1235 |
-
}
|
1236 |
-
// hide original element
|
1237 |
-
htmlMediaElement.style.display = 'none';
|
1238 |
-
|
1239 |
-
// FYI: options.success will be fired by the MediaPluginBridge
|
1240 |
-
|
1241 |
-
return pluginMediaElement;
|
1242 |
-
},
|
1243 |
-
|
1244 |
-
updateNative: function(playback, options, autoplay, preload) {
|
1245 |
-
|
1246 |
-
var htmlMediaElement = playback.htmlMediaElement,
|
1247 |
-
m;
|
1248 |
-
|
1249 |
-
|
1250 |
-
// add methods to video object to bring it into parity with Flash Object
|
1251 |
-
for (m in mejs.HtmlMediaElement) {
|
1252 |
-
htmlMediaElement[m] = mejs.HtmlMediaElement[m];
|
1253 |
-
}
|
1254 |
-
|
1255 |
-
/*
|
1256 |
-
Chrome now supports preload="none"
|
1257 |
-
if (mejs.MediaFeatures.isChrome) {
|
1258 |
-
|
1259 |
-
// special case to enforce preload attribute (Chrome doesn't respect this)
|
1260 |
-
if (preload === 'none' && !autoplay) {
|
1261 |
-
|
1262 |
-
// forces the browser to stop loading (note: fails in IE9)
|
1263 |
-
htmlMediaElement.src = '';
|
1264 |
-
htmlMediaElement.load();
|
1265 |
-
htmlMediaElement.canceledPreload = true;
|
1266 |
-
|
1267 |
-
htmlMediaElement.addEventListener('play',function() {
|
1268 |
-
if (htmlMediaElement.canceledPreload) {
|
1269 |
-
htmlMediaElement.src = playback.url;
|
1270 |
-
htmlMediaElement.load();
|
1271 |
-
htmlMediaElement.play();
|
1272 |
-
htmlMediaElement.canceledPreload = false;
|
1273 |
-
}
|
1274 |
-
}, false);
|
1275 |
-
// for some reason Chrome forgets how to autoplay sometimes.
|
1276 |
-
} else if (autoplay) {
|
1277 |
-
htmlMediaElement.load();
|
1278 |
-
htmlMediaElement.play();
|
1279 |
-
}
|
1280 |
-
}
|
1281 |
-
*/
|
1282 |
-
|
1283 |
-
// fire success code
|
1284 |
-
options.success(htmlMediaElement, htmlMediaElement);
|
1285 |
-
|
1286 |
-
return htmlMediaElement;
|
1287 |
-
}
|
1288 |
-
};
|
1289 |
-
|
1290 |
-
/*
|
1291 |
-
- test on IE (object vs. embed)
|
1292 |
-
- determine when to use iframe (Firefox, Safari, Mobile) vs. Flash (Chrome, IE)
|
1293 |
-
- fullscreen?
|
1294 |
-
*/
|
1295 |
-
|
1296 |
-
// YouTube Flash and Iframe API
|
1297 |
-
mejs.YouTubeApi = {
|
1298 |
-
isIframeStarted: false,
|
1299 |
-
isIframeLoaded: false,
|
1300 |
-
loadIframeApi: function() {
|
1301 |
-
if (!this.isIframeStarted) {
|
1302 |
-
var tag = document.createElement('script');
|
1303 |
-
tag.src = "http://www.youtube.com/player_api";
|
1304 |
-
var firstScriptTag = document.getElementsByTagName('script')[0];
|
1305 |
-
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
1306 |
-
this.isIframeStarted = true;
|
1307 |
-
}
|
1308 |
-
},
|
1309 |
-
iframeQueue: [],
|
1310 |
-
enqueueIframe: function(yt) {
|
1311 |
-
|
1312 |
-
if (this.isLoaded) {
|
1313 |
-
this.createIframe(yt);
|
1314 |
-
} else {
|
1315 |
-
this.loadIframeApi();
|
1316 |
-
this.iframeQueue.push(yt);
|
1317 |
-
}
|
1318 |
-
},
|
1319 |
-
createIframe: function(settings) {
|
1320 |
-
|
1321 |
-
var
|
1322 |
-
pluginMediaElement = settings.pluginMediaElement,
|
1323 |
-
player = new YT.Player(settings.containerId, {
|
1324 |
-
height: settings.height,
|
1325 |
-
width: settings.width,
|
1326 |
-
videoId: settings.videoId,
|
1327 |
-
playerVars: {controls:0},
|
1328 |
-
events: {
|
1329 |
-
'onReady': function() {
|
1330 |
-
|
1331 |
-
// hook up iframe object to MEjs
|
1332 |
-
settings.pluginMediaElement.pluginApi = player;
|
1333 |
-
|
1334 |
-
// init mejs
|
1335 |
-
mejs.MediaPluginBridge.initPlugin(settings.pluginId);
|
1336 |
-
|
1337 |
-
// create timer
|
1338 |
-
setInterval(function() {
|
1339 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate');
|
1340 |
-
}, 250);
|
1341 |
-
},
|
1342 |
-
'onStateChange': function(e) {
|
1343 |
-
|
1344 |
-
mejs.YouTubeApi.handleStateChange(e.data, player, pluginMediaElement);
|
1345 |
-
|
1346 |
-
}
|
1347 |
-
}
|
1348 |
-
});
|
1349 |
-
},
|
1350 |
-
|
1351 |
-
createEvent: function (player, pluginMediaElement, eventName) {
|
1352 |
-
var obj = {
|
1353 |
-
type: eventName,
|
1354 |
-
target: pluginMediaElement
|
1355 |
-
};
|
1356 |
-
|
1357 |
-
if (player && player.getDuration) {
|
1358 |
-
|
1359 |
-
// time
|
1360 |
-
pluginMediaElement.currentTime = obj.currentTime = player.getCurrentTime();
|
1361 |
-
pluginMediaElement.duration = obj.duration = player.getDuration();
|
1362 |
-
|
1363 |
-
// state
|
1364 |
-
obj.paused = pluginMediaElement.paused;
|
1365 |
-
obj.ended = pluginMediaElement.ended;
|
1366 |
-
|
1367 |
-
// sound
|
1368 |
-
obj.muted = player.isMuted();
|
1369 |
-
obj.volume = player.getVolume() / 100;
|
1370 |
-
|
1371 |
-
// progress
|
1372 |
-
obj.bytesTotal = player.getVideoBytesTotal();
|
1373 |
-
obj.bufferedBytes = player.getVideoBytesLoaded();
|
1374 |
-
|
1375 |
-
// fake the W3C buffered TimeRange
|
1376 |
-
var bufferedTime = obj.bufferedBytes / obj.bytesTotal * obj.duration;
|
1377 |
-
|
1378 |
-
obj.target.buffered = obj.buffered = {
|
1379 |
-
start: function(index) {
|
1380 |
-
return 0;
|
1381 |
-
},
|
1382 |
-
end: function (index) {
|
1383 |
-
return bufferedTime;
|
1384 |
-
},
|
1385 |
-
length: 1
|
1386 |
-
};
|
1387 |
-
|
1388 |
-
}
|
1389 |
-
|
1390 |
-
// send event up the chain
|
1391 |
-
pluginMediaElement.dispatchEvent(obj.type, obj);
|
1392 |
-
},
|
1393 |
-
|
1394 |
-
iFrameReady: function() {
|
1395 |
-
|
1396 |
-
this.isLoaded = true;
|
1397 |
-
this.isIframeLoaded = true;
|
1398 |
-
|
1399 |
-
while (this.iframeQueue.length > 0) {
|
1400 |
-
var settings = this.iframeQueue.pop();
|
1401 |
-
this.createIframe(settings);
|
1402 |
-
}
|
1403 |
-
},
|
1404 |
-
|
1405 |
-
// FLASH!
|
1406 |
-
flashPlayers: {},
|
1407 |
-
createFlash: function(settings) {
|
1408 |
-
|
1409 |
-
this.flashPlayers[settings.pluginId] = settings;
|
1410 |
-
|
1411 |
-
/*
|
1412 |
-
settings.container.innerHTML =
|
1413 |
-
'<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="//www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0" ' +
|
1414 |
-
'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; ">' +
|
1415 |
-
'<param name="allowScriptAccess" value="always">' +
|
1416 |
-
'<param name="wmode" value="transparent">' +
|
1417 |
-
'</object>';
|
1418 |
-
*/
|
1419 |
-
|
1420 |
-
var specialIEContainer,
|
1421 |
-
youtubeUrl = 'http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0';
|
1422 |
-
|
1423 |
-
if (mejs.MediaFeatures.isIE) {
|
1424 |
-
|
1425 |
-
specialIEContainer = document.createElement('div');
|
1426 |
-
settings.container.appendChild(specialIEContainer);
|
1427 |
-
specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
|
1428 |
-
'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '">' +
|
1429 |
-
'<param name="movie" value="' + youtubeUrl + '" />' +
|
1430 |
-
'<param name="wmode" value="transparent" />' +
|
1431 |
-
'<param name="allowScriptAccess" value="always" />' +
|
1432 |
-
'<param name="allowFullScreen" value="true" />' +
|
1433 |
-
'</object>';
|
1434 |
-
} else {
|
1435 |
-
settings.container.innerHTML =
|
1436 |
-
'<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + youtubeUrl + '" ' +
|
1437 |
-
'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; ">' +
|
1438 |
-
'<param name="allowScriptAccess" value="always">' +
|
1439 |
-
'<param name="wmode" value="transparent">' +
|
1440 |
-
'</object>';
|
1441 |
-
}
|
1442 |
-
|
1443 |
-
},
|
1444 |
-
|
1445 |
-
flashReady: function(id) {
|
1446 |
-
var
|
1447 |
-
settings = this.flashPlayers[id],
|
1448 |
-
player = document.getElementById(id),
|
1449 |
-
pluginMediaElement = settings.pluginMediaElement;
|
1450 |
-
|
1451 |
-
// hook up and return to MediaELementPlayer.success
|
1452 |
-
pluginMediaElement.pluginApi =
|
1453 |
-
pluginMediaElement.pluginElement = player;
|
1454 |
-
mejs.MediaPluginBridge.initPlugin(id);
|
1455 |
-
|
1456 |
-
// load the youtube video
|
1457 |
-
player.cueVideoById(settings.videoId);
|
1458 |
-
|
1459 |
-
var callbackName = settings.containerId + '_callback'
|
1460 |
-
|
1461 |
-
window[callbackName] = function(e) {
|
1462 |
-
mejs.YouTubeApi.handleStateChange(e, player, pluginMediaElement);
|
1463 |
-
}
|
1464 |
-
|
1465 |
-
player.addEventListener('onStateChange', callbackName);
|
1466 |
-
|
1467 |
-
setInterval(function() {
|
1468 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate');
|
1469 |
-
}, 250);
|
1470 |
-
},
|
1471 |
-
|
1472 |
-
handleStateChange: function(youTubeState, player, pluginMediaElement) {
|
1473 |
-
switch (youTubeState) {
|
1474 |
-
case -1: // not started
|
1475 |
-
pluginMediaElement.paused = true;
|
1476 |
-
pluginMediaElement.ended = true;
|
1477 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'loadedmetadata');
|
1478 |
-
//createYouTubeEvent(player, pluginMediaElement, 'loadeddata');
|
1479 |
-
break;
|
1480 |
-
case 0:
|
1481 |
-
pluginMediaElement.paused = false;
|
1482 |
-
pluginMediaElement.ended = true;
|
1483 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'ended');
|
1484 |
-
break;
|
1485 |
-
case 1:
|
1486 |
-
pluginMediaElement.paused = false;
|
1487 |
-
pluginMediaElement.ended = false;
|
1488 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'play');
|
1489 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'playing');
|
1490 |
-
break;
|
1491 |
-
case 2:
|
1492 |
-
pluginMediaElement.paused = true;
|
1493 |
-
pluginMediaElement.ended = false;
|
1494 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'pause');
|
1495 |
-
break;
|
1496 |
-
case 3: // buffering
|
1497 |
-
mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'progress');
|
1498 |
-
break;
|
1499 |
-
case 5:
|
1500 |
-
// cued?
|
1501 |
-
break;
|
1502 |
-
|
1503 |
-
}
|
1504 |
-
|
1505 |
-
}
|
1506 |
-
}
|
1507 |
-
// IFRAME
|
1508 |
-
function onYouTubePlayerAPIReady() {
|
1509 |
-
mejs.YouTubeApi.iFrameReady();
|
1510 |
-
}
|
1511 |
-
// FLASH
|
1512 |
-
function onYouTubePlayerReady(id) {
|
1513 |
-
mejs.YouTubeApi.flashReady(id);
|
1514 |
-
}
|
1515 |
-
|
1516 |
-
window.mejs = mejs;
|
1517 |
-
window.MediaElement = mejs.MediaElement;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaelement/mediaelement.min.js
DELETED
@@ -1,59 +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-2012, John Dyer (http://j.hn)
|
11 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
12 |
-
*
|
13 |
-
*/var mejs=mejs||{};mejs.version="2.9.1";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","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo"]}]};
|
14 |
-
mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script"),j=f.length,h=a.length;b<j;b++){g=f[b].src;for(c=0;c<h;c++){e=a[c];if(g.indexOf(e)>
|
15 |
-
-1){d=g.substring(0,g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0],
|
16 |
-
10);var e=parseInt(a[1],10),g=parseInt(a[2],10),f=0,j=0;if(c)f=parseInt(a[3])/d;return j=b*3600+e*60+g+f},removeSwf:function(a){var b=document.getElementById(a);if(b&&b.nodeName=="OBJECT")if(mejs.MediaFeatures.isIE){b.style.display="none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}};
|
17 |
-
mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
|
18 |
-
!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}};
|
19 |
-
mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
|
20 |
-
mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
|
21 |
-
mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!==
|
22 |
-
null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.isOpera=d.match(/opera/gi)!==null;a.hasTouch="ontouchstart"in window;for(c=0;c<g.length;c++)e=document.createElement(g[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined";a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||
|
23 |
-
a.hasMozNativeFullScreen;a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen;if(a.hasMozNativeFullScreen)a.nativeFullScreenEnabled=e.mozFullScreenEnabled;if(this.isChrome)a.hasSemiNativeFullScreen=false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen;else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(f){if(a.hasWebkitNativeFullScreen)f.webkitRequestFullScreen();
|
24 |
-
else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();
|
25 |
-
mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type))this.src=c.src}}},setVideoSize:function(a,b){this.width=a;this.height=b}};
|
26 |
-
mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={}};
|
27 |
-
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,tagName:"",muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.playVideo():this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginType!="youtube"&&this.pluginApi.loadMedia();this.paused=
|
28 |
-
false}},pause:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia();this.paused=true}},stop:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.stopVideo():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},
|
29 |
-
positionFullscreenButton:function(a,b,c){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(a,b,c)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},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=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));
|
30 |
-
this.src=mejs.Utility.absolutizeUrl(a)}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a);
|
31 |
-
this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&
|
32 |
-
this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},attributes:{},
|
33 |
-
hasAttribute:function(a){return a in this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a))return this.attributes[a];return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}};
|
34 |
-
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];if(b){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,
|
35 |
-
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)}};
|
36 |
-
mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],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,pluginVars:[],timerRate:250,startVolume:0.8,success:function(){},
|
37 |
-
error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
|
38 |
-
mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var j=d.getAttribute("autoplay"),h=d.getAttribute("preload"),l=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;h=typeof h=="undefined"||h===null||h==="false"?
|
39 |
-
"none":h;j=!(typeof j=="undefined"||j===null||j==="false");l=!(typeof l=="undefined"||l===null||l==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,j,h)}else if(k.method!=="")return this.createPlugin(k,c,e,j,h,l);else{this.createErrorMessage(k,c,e);return this}},
|
40 |
-
determinePlayback:function(a,b,c,d,e){var g=[],f,j,h={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},l,k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){j=this.formatType(e,a.getAttribute("type"));g.push({type:j,url:e})}else for(f=0;f<a.childNodes.length;f++){j=a.childNodes[f];if(j.nodeType==1&&j.tagName.toLowerCase()=="source"){e=j.getAttribute("src");
|
41 |
-
j=this.formatType(e,j.getAttribute("type"));g.push({type:j,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/,
|
42 |
-
"")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){h.method="native";h.url=g[f].url;break}if(h.method==="native"){if(h.url!==null)a.src=h.url;return h}}if(b.mode==="auto"||b.mode==="shim")for(f=0;f<g.length;f++){j=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];l=mejs.plugins[e];for(c=0;c<l.length;c++){k=l[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(j==k.types[d]){h.method=e;h.url=g[f].url;return h}}}}if(h.method===
|
43 |
-
""&&g.length>0)h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+a},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!==
|
44 |
-
""?'<a href="'+a.url+'"><img src="'+c+'" width="100%" height="100%" /></a>':'<a href="'+a.url+'"><span>Download File</span></a>';d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,j=1,h="me_"+a.method+"_"+mejs.meIndex++,l=new mejs.PluginMediaElement(h,a.method,a.url),k=document.createElement("div"),m;l.tagName=c.tagName;for(m=0;m<c.attributes.length;m++){var n=c.attributes[m];n.specified==true&&l.setAttribute(n.name,n.value)}for(m=
|
45 |
-
c.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(a.isVideo){f=b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;j=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);j=mejs.Utility.encodeUrl(j)}else if(b.enablePluginDebug){f=320;j=240}l.success=
|
46 |
-
b.success;mejs.MediaPluginBridge.registerPluginElement(h,l,c);k.className="me-plugin";k.id=h+"_container";a.isVideo?c.parentNode.insertBefore(k,c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+h,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+j];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");
|
47 |
-
b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+h+'" name="'+h+'" width="'+f+'" height="'+j+'"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+
|
48 |
-
b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+h+'" width="'+f+'" height="'+j+'"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML=
|
49 |
-
'<embed id="'+h+'" name="'+h+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+j+'"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:l,pluginId:h,videoId:b,
|
50 |
-
height:j,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":console.log("vimeoid");l.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<object width="'+f+'" height="'+j+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="api=1" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+
|
51 |
-
l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="//vimeo.com/moogaloop.swf?api=1&clip_id='+l.vimeoid+'&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+f+'" height="'+j+'"></embed></object>'}c.style.display=
|
52 |
-
"none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
|
53 |
-
mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,
|
54 |
-
{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused;
|
55 |
-
c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=this.isLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=
|
56 |
-
a;var b,c="http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");a.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'"><param name="movie" value="'+c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else a.container.innerHTML=
|
57 |
-
'<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; "><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e,
|
58 |
-
c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b,
|
59 |
-
c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaelement/mediaelementplayer.css
CHANGED
@@ -2,12 +2,10 @@
|
|
2 |
position: relative;
|
3 |
background: #000;
|
4 |
font-family: Helvetica, Arial;
|
5 |
-
text-align: left;
|
6 |
-
vertical-align: top;
|
7 |
}
|
8 |
|
9 |
.me-plugin {
|
10 |
-
position: absolute;
|
11 |
}
|
12 |
|
13 |
.mejs-embed, .mejs-embed body {
|
@@ -45,7 +43,7 @@
|
|
45 |
top: 0;
|
46 |
left: 0;
|
47 |
width: 100%;
|
48 |
-
height: 100%;
|
49 |
}
|
50 |
.mejs-poster {
|
51 |
position: absolute;
|
@@ -73,7 +71,7 @@
|
|
73 |
width: 100px;
|
74 |
height: 100px;
|
75 |
margin: -50px 0 0 -50px;
|
76 |
-
background: url(bigplay.png) no-repeat;
|
77 |
}
|
78 |
.mejs-overlay:hover .mejs-overlay-button{
|
79 |
background-position: 0 -100px ;
|
@@ -88,18 +86,15 @@
|
|
88 |
background: #333;
|
89 |
background: url(background.png);
|
90 |
background: rgba(0, 0, 0, 0.9);
|
91 |
-
background: -webkit-gradient(linear,
|
92 |
-
background: -
|
93 |
-
background:
|
94 |
-
background: -o-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));
|
95 |
-
background: -ms-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));
|
96 |
-
background: linear-gradient(rgba(50,50,50,0.9), rgba(0,0,0,0.9));
|
97 |
}
|
98 |
.mejs-overlay-loading span {
|
99 |
display:block;
|
100 |
width: 80px;
|
101 |
height: 80px;
|
102 |
-
background: transparent url(loading.gif)
|
103 |
}
|
104 |
|
105 |
/* End: LAYERS */
|
@@ -115,12 +110,9 @@
|
|
115 |
left: 0;
|
116 |
background: url(background.png);
|
117 |
background: rgba(0, 0, 0, 0.7);
|
118 |
-
background: -webkit-gradient(linear,
|
119 |
-
background: -
|
120 |
-
background:
|
121 |
-
background: -o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
122 |
-
background: -ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
123 |
-
background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
124 |
height: 30px;
|
125 |
width: 100%;
|
126 |
}
|
@@ -143,7 +135,7 @@
|
|
143 |
.mejs-controls .mejs-button button {
|
144 |
cursor: pointer;
|
145 |
display: block;
|
146 |
-
font-size:
|
147 |
line-height: 0;
|
148 |
text-decoration: none;
|
149 |
margin: 7px 5px;
|
@@ -152,7 +144,7 @@
|
|
152 |
height: 16px;
|
153 |
width: 16px;
|
154 |
border: 0;
|
155 |
-
background: transparent url(controls.png) no-repeat;
|
156 |
}
|
157 |
|
158 |
/* :focus for accessibility */
|
@@ -172,9 +164,6 @@
|
|
172 |
overflow: hidden;
|
173 |
text-align: center;
|
174 |
padding: auto 4px;
|
175 |
-
box-sizing: content-box;
|
176 |
-
-moz-box-sizing: content-box;
|
177 |
-
-webkit-box-sizing: content-box;
|
178 |
}
|
179 |
.mejs-container .mejs-controls .mejs-time span {
|
180 |
font-size: 11px;
|
@@ -223,59 +212,27 @@
|
|
223 |
margin: 5px;
|
224 |
background: #333;
|
225 |
background: rgba(50,50,50,0.8);
|
226 |
-
background: -webkit-gradient(linear,
|
227 |
-
background: -
|
228 |
-
background:
|
229 |
-
|
230 |
-
|
231 |
-
background: linear-gradient(rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
232 |
-
}
|
233 |
-
.mejs-controls .mejs-time-rail .mejs-time-buffering {
|
234 |
-
width:100%;
|
235 |
-
background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
236 |
-
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
|
237 |
-
background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
238 |
-
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
239 |
-
background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
240 |
-
background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
241 |
-
-webkit-background-size: 15px 15px;
|
242 |
-
-moz-background-size: 15px 15px;
|
243 |
-
-o-background-size: 15px 15px;
|
244 |
-
background-size: 15px 15px;
|
245 |
-
-webkit-animation: buffering-stripes 2s linear infinite;
|
246 |
-
-moz-animation: buffering-stripes 2s linear infinite;
|
247 |
-
-ms-animation: buffering-stripes 2s linear infinite;
|
248 |
-
-o-animation: buffering-stripes 2s linear infinite;
|
249 |
-
animation: buffering-stripes 2s linear infinite;
|
250 |
-
}
|
251 |
-
|
252 |
-
@-webkit-keyframes buffering-stripes { from {background-position: 0 0;} to {background-position: 30px 0;} }
|
253 |
-
@-moz-keyframes buffering-stripes { from {background-position: 0 0;} to {background-position: 30px 0;} }
|
254 |
-
@-ms-keyframes buffering-stripes { from {background-position: 0 0;} to {background-position: 30px 0;} }
|
255 |
-
@-o-keyframes buffering-stripes { from {background-position: 0 0;} to {background-position: 30px 0;} }
|
256 |
-
@keyframes buffering-stripes { from {background-position: 0 0;} to {background-position: 30px 0;} }
|
257 |
-
|
258 |
.mejs-controls .mejs-time-rail .mejs-time-loaded {
|
259 |
background: #3caac8;
|
260 |
background: rgba(60,170,200,0.8);
|
261 |
-
background: -webkit-gradient(linear,
|
262 |
-
background: -
|
263 |
-
background:
|
264 |
-
|
265 |
-
background: -ms-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));
|
266 |
-
background: linear-gradient(rgba(44,124,145,0.8), rgba(78,183,212,0.8));
|
267 |
width: 0;
|
268 |
}
|
269 |
.mejs-controls .mejs-time-rail .mejs-time-current {
|
270 |
width: 0;
|
271 |
background: #fff;
|
272 |
background: rgba(255,255,255,0.8);
|
273 |
-
background: -webkit-gradient(linear,
|
274 |
-
background: -
|
275 |
-
|
276 |
-
background: -o-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
277 |
-
background: -ms-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
278 |
-
background: linear-gradient(rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
279 |
}
|
280 |
|
281 |
.mejs-controls .mejs-time-rail .mejs-time-handle {
|
@@ -381,9 +338,9 @@
|
|
381 |
margin: 0;
|
382 |
}
|
383 |
.mejs-controls .mejs-volume-button:hover {
|
384 |
-
-webkit-border-radius: 0 0 4px 4px;
|
385 |
-
-moz-border-radius: 0 0 4px 4px;
|
386 |
-
border-radius: 0 0 4px 4px;
|
387 |
}
|
388 |
/*
|
389 |
.mejs-controls .mejs-volume-button:hover .mejs-volume-slider {
|
@@ -428,70 +385,6 @@
|
|
428 |
margin: 0;
|
429 |
}
|
430 |
|
431 |
-
|
432 |
-
/* horizontal version */
|
433 |
-
|
434 |
-
.mejs-controls div.mejs-horizontal-volume-slider {
|
435 |
-
height: 26px;
|
436 |
-
width: 60px;
|
437 |
-
position: relative;
|
438 |
-
}
|
439 |
-
|
440 |
-
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
|
441 |
-
position: absolute;
|
442 |
-
left: 0;
|
443 |
-
top: 11px;
|
444 |
-
width: 50px;
|
445 |
-
height: 8px;
|
446 |
-
margin: 0;
|
447 |
-
padding: 0;
|
448 |
-
font-size: 1px;
|
449 |
-
|
450 |
-
-webkit-border-radius: 2px;
|
451 |
-
-moz-border-radius: 2px;
|
452 |
-
border-radius: 2px;
|
453 |
-
|
454 |
-
background: #333;
|
455 |
-
background: rgba(50,50,50,0.8);
|
456 |
-
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8)));
|
457 |
-
background: -webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
458 |
-
background: -moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
459 |
-
background: -o-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
460 |
-
background: -ms-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
461 |
-
background: linear-gradient(rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
462 |
-
|
463 |
-
}
|
464 |
-
|
465 |
-
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
|
466 |
-
position: absolute;
|
467 |
-
left: 0;
|
468 |
-
top: 11px;
|
469 |
-
width: 50px;
|
470 |
-
height: 8px;
|
471 |
-
margin: 0;
|
472 |
-
padding: 0;
|
473 |
-
font-size: 1px;
|
474 |
-
|
475 |
-
-webkit-border-radius: 2px;
|
476 |
-
-moz-border-radius: 2px;
|
477 |
-
border-radius: 2px;
|
478 |
-
|
479 |
-
background: #fff;
|
480 |
-
background: rgba(255,255,255,0.8);
|
481 |
-
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8)));
|
482 |
-
background: -webkit-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
483 |
-
background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
484 |
-
background: -o-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
485 |
-
background: -ms-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
486 |
-
background: linear-gradient(rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
487 |
-
|
488 |
-
}
|
489 |
-
|
490 |
-
|
491 |
-
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle {
|
492 |
-
display: none;
|
493 |
-
}
|
494 |
-
|
495 |
/* End: Mute/Volume */
|
496 |
|
497 |
|
@@ -545,7 +438,7 @@
|
|
545 |
.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{
|
546 |
clear: both;
|
547 |
float: left;
|
548 |
-
margin: 3px 3px
|
549 |
}
|
550 |
.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{
|
551 |
width: 100px;
|
@@ -568,19 +461,15 @@
|
|
568 |
left: 0;
|
569 |
-xborder-right: solid 1px #fff;
|
570 |
width: 10000px;
|
571 |
-
z-index: 1;
|
572 |
}
|
573 |
.mejs-chapters .mejs-chapter {
|
574 |
position: absolute;
|
575 |
float: left;
|
576 |
background: #222;
|
577 |
background: rgba(0, 0, 0, 0.7);
|
578 |
-
background: -webkit-gradient(linear,
|
579 |
-
background: -
|
580 |
-
background:
|
581 |
-
background: -o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
582 |
-
background: -ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
583 |
-
background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
584 |
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232,endColorstr=#000000);
|
585 |
overflow: hidden;
|
586 |
border: 0;
|
@@ -602,12 +491,8 @@
|
|
602 |
/*background: #333;*/
|
603 |
background: #666;
|
604 |
background: rgba(102,102,102, 0.7);
|
605 |
-
background: -webkit-gradient(linear,
|
606 |
-
background: -
|
607 |
-
background: -moz-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));
|
608 |
-
background: -o-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));
|
609 |
-
background: -ms-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));
|
610 |
-
background: linear-gradient(rgba(102,102,102,0.7), rgba(50,50,50,0.6));
|
611 |
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666,endColorstr=#323232);
|
612 |
}
|
613 |
.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{
|
@@ -742,60 +627,4 @@
|
|
742 |
.mejs-contextmenu .mejs-contextmenu-item:hover {
|
743 |
background: #2C7C91;
|
744 |
color: #fff;
|
745 |
-
}
|
746 |
-
|
747 |
-
|
748 |
-
/* Start: SourceChooser */
|
749 |
-
.mejs-controls .mejs-sourcechooser-button {
|
750 |
-
position: relative;
|
751 |
-
}
|
752 |
-
|
753 |
-
.mejs-controls .mejs-sourcechooser-button button {
|
754 |
-
background-position: -128px 0;
|
755 |
-
}
|
756 |
-
.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector {
|
757 |
-
visibility: hidden;
|
758 |
-
position: absolute;
|
759 |
-
bottom: 26px;
|
760 |
-
right: -10px;
|
761 |
-
width: 130px;
|
762 |
-
height: 100px;
|
763 |
-
background: url(background.png);
|
764 |
-
background: rgba(50,50,50,0.7);
|
765 |
-
border: solid 1px transparent;
|
766 |
-
padding: 10px;
|
767 |
-
overflow: hidden;
|
768 |
-
-webkit-border-radius: 0;
|
769 |
-
-moz-border-radius: 0;
|
770 |
-
border-radius: 0;
|
771 |
-
}
|
772 |
-
|
773 |
-
.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul {
|
774 |
-
margin: 0;
|
775 |
-
padding: 0;
|
776 |
-
display: block;
|
777 |
-
list-style-type: none !important;
|
778 |
-
overflow: hidden;
|
779 |
-
}
|
780 |
-
.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{
|
781 |
-
margin: 0 0 6px 0;
|
782 |
-
padding: 0;
|
783 |
-
list-style-type: none !important;
|
784 |
-
display:block;
|
785 |
-
color: #fff;
|
786 |
-
overflow: hidden;
|
787 |
-
}
|
788 |
-
.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{
|
789 |
-
clear: both;
|
790 |
-
float: left;
|
791 |
-
margin: 3px 3px 0 5px;
|
792 |
-
}
|
793 |
-
.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{
|
794 |
-
width: 100px;
|
795 |
-
float: left;
|
796 |
-
padding: 4px 0 0 0;
|
797 |
-
line-height: 15px;
|
798 |
-
font-family: helvetica, arial;
|
799 |
-
font-size: 10px;
|
800 |
-
}
|
801 |
-
/* End: SourceChooser */
|
2 |
position: relative;
|
3 |
background: #000;
|
4 |
font-family: Helvetica, Arial;
|
|
|
|
|
5 |
}
|
6 |
|
7 |
.me-plugin {
|
8 |
+
position: absolute;
|
9 |
}
|
10 |
|
11 |
.mejs-embed, .mejs-embed body {
|
43 |
top: 0;
|
44 |
left: 0;
|
45 |
width: 100%;
|
46 |
+
height: 100%;
|
47 |
}
|
48 |
.mejs-poster {
|
49 |
position: absolute;
|
71 |
width: 100px;
|
72 |
height: 100px;
|
73 |
margin: -50px 0 0 -50px;
|
74 |
+
background: url(bigplay.png) top left no-repeat;
|
75 |
}
|
76 |
.mejs-overlay:hover .mejs-overlay-button{
|
77 |
background-position: 0 -100px ;
|
86 |
background: #333;
|
87 |
background: url(background.png);
|
88 |
background: rgba(0, 0, 0, 0.9);
|
89 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(50,50,50,0.9)), to(rgba(0,0,0,0.9)));
|
90 |
+
background: -moz-linear-gradient(top, rgba(50,50,50,0.9), rgba(0,0,0,0.9));
|
91 |
+
background: linear-gradient(rgba(50,50,50,0.9), rgba(0,0,0,0.9));
|
|
|
|
|
|
|
92 |
}
|
93 |
.mejs-overlay-loading span {
|
94 |
display:block;
|
95 |
width: 80px;
|
96 |
height: 80px;
|
97 |
+
background: transparent url(loading.gif) center center no-repeat;
|
98 |
}
|
99 |
|
100 |
/* End: LAYERS */
|
110 |
left: 0;
|
111 |
background: url(background.png);
|
112 |
background: rgba(0, 0, 0, 0.7);
|
113 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7)));
|
114 |
+
background: -moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
115 |
+
background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
|
|
|
|
|
|
116 |
height: 30px;
|
117 |
width: 100%;
|
118 |
}
|
135 |
.mejs-controls .mejs-button button {
|
136 |
cursor: pointer;
|
137 |
display: block;
|
138 |
+
font-size: 0px;
|
139 |
line-height: 0;
|
140 |
text-decoration: none;
|
141 |
margin: 7px 5px;
|
144 |
height: 16px;
|
145 |
width: 16px;
|
146 |
border: 0;
|
147 |
+
background: transparent url(controls.png) 0 0 no-repeat;
|
148 |
}
|
149 |
|
150 |
/* :focus for accessibility */
|
164 |
overflow: hidden;
|
165 |
text-align: center;
|
166 |
padding: auto 4px;
|
|
|
|
|
|
|
167 |
}
|
168 |
.mejs-container .mejs-controls .mejs-time span {
|
169 |
font-size: 11px;
|
212 |
margin: 5px;
|
213 |
background: #333;
|
214 |
background: rgba(50,50,50,0.8);
|
215 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8)));
|
216 |
+
background: -moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
217 |
+
background: linear-gradient(rgba(30,30,30,0.8), rgba(60,60,60,0.8));
|
218 |
+
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#1E1E1E,endColorstr=#3C3C3C);
|
219 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
.mejs-controls .mejs-time-rail .mejs-time-loaded {
|
221 |
background: #3caac8;
|
222 |
background: rgba(60,170,200,0.8);
|
223 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(44,124,145,0.8)), to(rgba(78,183,212,0.8)));
|
224 |
+
background: -moz-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8));
|
225 |
+
background: linear-gradient(rgba(44,124,145,0.8), rgba(78,183,212,0.8));
|
226 |
+
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#2C7C91,endColorstr=#4EB7D4);
|
|
|
|
|
227 |
width: 0;
|
228 |
}
|
229 |
.mejs-controls .mejs-time-rail .mejs-time-current {
|
230 |
width: 0;
|
231 |
background: #fff;
|
232 |
background: rgba(255,255,255,0.8);
|
233 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8)));
|
234 |
+
background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8));
|
235 |
+
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#FFFFFF,endColorstr=#C8C8C8);
|
|
|
|
|
|
|
236 |
}
|
237 |
|
238 |
.mejs-controls .mejs-time-rail .mejs-time-handle {
|
338 |
margin: 0;
|
339 |
}
|
340 |
.mejs-controls .mejs-volume-button:hover {
|
341 |
+
-webkit-border-radius: 0 0 4px 4px ;
|
342 |
+
-moz-border-radius: 0 0 4px 4px ;
|
343 |
+
border-radius: 0 0 4px 4px ;
|
344 |
}
|
345 |
/*
|
346 |
.mejs-controls .mejs-volume-button:hover .mejs-volume-slider {
|
385 |
margin: 0;
|
386 |
}
|
387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
/* End: Mute/Volume */
|
389 |
|
390 |
|
438 |
.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{
|
439 |
clear: both;
|
440 |
float: left;
|
441 |
+
margin: 3px 3px 0px 5px;
|
442 |
}
|
443 |
.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{
|
444 |
width: 100px;
|
461 |
left: 0;
|
462 |
-xborder-right: solid 1px #fff;
|
463 |
width: 10000px;
|
|
|
464 |
}
|
465 |
.mejs-chapters .mejs-chapter {
|
466 |
position: absolute;
|
467 |
float: left;
|
468 |
background: #222;
|
469 |
background: rgba(0, 0, 0, 0.7);
|
470 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7)));
|
471 |
+
background: -moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
472 |
+
background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7));
|
|
|
|
|
|
|
473 |
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232,endColorstr=#000000);
|
474 |
overflow: hidden;
|
475 |
border: 0;
|
491 |
/*background: #333;*/
|
492 |
background: #666;
|
493 |
background: rgba(102,102,102, 0.7);
|
494 |
+
background: -webkit-gradient(linear, left top, left bottom, from(rgba(102,102,102,0.7)), to(rgba(50,50,50,0.6)));
|
495 |
+
background: -moz-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6));
|
|
|
|
|
|
|
|
|
496 |
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666,endColorstr=#323232);
|
497 |
}
|
498 |
.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{
|
627 |
.mejs-contextmenu .mejs-contextmenu-item:hover {
|
628 |
background: #2C7C91;
|
629 |
color: #fff;
|
630 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaelement/mediaelementplayer.js
DELETED
@@ -1,2743 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* MediaElementPlayer
|
3 |
-
* http://mediaelementjs.com/
|
4 |
-
*
|
5 |
-
* Creates a controller bar for HTML5 <video> add <audio> tags
|
6 |
-
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
|
7 |
-
*
|
8 |
-
* Copyright 2010-2012, John Dyer (http://j.hn/)
|
9 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
10 |
-
*
|
11 |
-
*/
|
12 |
-
if (typeof jQuery != 'undefined') {
|
13 |
-
mejs.$ = jQuery;
|
14 |
-
} else if (typeof ender != 'undefined') {
|
15 |
-
mejs.$ = ender;
|
16 |
-
}
|
17 |
-
(function ($) {
|
18 |
-
|
19 |
-
// default player values
|
20 |
-
mejs.MepDefaults = {
|
21 |
-
// url to poster (to fix iOS 3.x)
|
22 |
-
poster: '',
|
23 |
-
// default if the <video width> is not specified
|
24 |
-
defaultVideoWidth: 480,
|
25 |
-
// default if the <video height> is not specified
|
26 |
-
defaultVideoHeight: 270,
|
27 |
-
// if set, overrides <video width>
|
28 |
-
videoWidth: -1,
|
29 |
-
// if set, overrides <video height>
|
30 |
-
videoHeight: -1,
|
31 |
-
// default if the user doesn't specify
|
32 |
-
defaultAudioWidth: 400,
|
33 |
-
// default if the user doesn't specify
|
34 |
-
defaultAudioHeight: 30,
|
35 |
-
// width of audio player
|
36 |
-
audioWidth: -1,
|
37 |
-
// height of audio player
|
38 |
-
audioHeight: -1,
|
39 |
-
// initial volume when the player starts (overrided by user cookie)
|
40 |
-
startVolume: 0.8,
|
41 |
-
// useful for <audio> player loops
|
42 |
-
loop: false,
|
43 |
-
// resize to media dimensions
|
44 |
-
enableAutosize: true,
|
45 |
-
// forces the hour marker (##:00:00)
|
46 |
-
alwaysShowHours: false,
|
47 |
-
|
48 |
-
// show framecount in timecode (##:00:00:00)
|
49 |
-
showTimecodeFrameCount: false,
|
50 |
-
// used when showTimecodeFrameCount is set to true
|
51 |
-
framesPerSecond: 25,
|
52 |
-
|
53 |
-
// automatically calculate the width of the progress bar based on the sizes of other elements
|
54 |
-
autosizeProgress : true,
|
55 |
-
// Hide controls when playing and mouse is not over the video
|
56 |
-
alwaysShowControls: false,
|
57 |
-
// force iPad's native controls
|
58 |
-
iPadUseNativeControls: false,
|
59 |
-
// force iPhone's native controls
|
60 |
-
iPhoneUseNativeControls: false,
|
61 |
-
// force Android's native controls
|
62 |
-
AndroidUseNativeControls: false,
|
63 |
-
// features to show
|
64 |
-
features: ['playpause','current','progress','duration','tracks','volume','fullscreen'],
|
65 |
-
// only for dynamic
|
66 |
-
isVideo: true,
|
67 |
-
|
68 |
-
// turns keyboard support on and off for this instance
|
69 |
-
enableKeyboard: true,
|
70 |
-
|
71 |
-
// whenthis player starts, it will pause other players
|
72 |
-
pauseOtherPlayers: true,
|
73 |
-
|
74 |
-
// array of keyboard actions such as play pause
|
75 |
-
keyActions: [
|
76 |
-
{
|
77 |
-
keys: [
|
78 |
-
32, // SPACE
|
79 |
-
179 // GOOGLE play/pause button
|
80 |
-
],
|
81 |
-
action: function(player, media) {
|
82 |
-
if (media.paused || media.ended) {
|
83 |
-
media.play();
|
84 |
-
} else {
|
85 |
-
media.pause();
|
86 |
-
}
|
87 |
-
}
|
88 |
-
},
|
89 |
-
{
|
90 |
-
keys: [38], // UP
|
91 |
-
action: function(player, media) {
|
92 |
-
var newVolume = Math.min(media.volume + 0.1, 1);
|
93 |
-
media.setVolume(newVolume);
|
94 |
-
}
|
95 |
-
},
|
96 |
-
{
|
97 |
-
keys: [40], // DOWN
|
98 |
-
action: function(player, media) {
|
99 |
-
var newVolume = Math.max(media.volume - 0.1, 0);
|
100 |
-
media.setVolume(newVolume);
|
101 |
-
}
|
102 |
-
},
|
103 |
-
{
|
104 |
-
keys: [
|
105 |
-
37, // LEFT
|
106 |
-
227 // Google TV rewind
|
107 |
-
],
|
108 |
-
action: function(player, media) {
|
109 |
-
if (!isNaN(media.duration) && media.duration > 0) {
|
110 |
-
if (player.isVideo) {
|
111 |
-
player.showControls();
|
112 |
-
player.startControlsTimer();
|
113 |
-
}
|
114 |
-
|
115 |
-
// 5%
|
116 |
-
var newTime = Math.max(media.currentTime - (media.duration * 0.05), 0);
|
117 |
-
media.setCurrentTime(newTime);
|
118 |
-
}
|
119 |
-
}
|
120 |
-
},
|
121 |
-
{
|
122 |
-
keys: [
|
123 |
-
39, // RIGHT
|
124 |
-
228 // Google TV forward
|
125 |
-
],
|
126 |
-
action: function(player, media) {
|
127 |
-
if (!isNaN(media.duration) && media.duration > 0) {
|
128 |
-
if (player.isVideo) {
|
129 |
-
player.showControls();
|
130 |
-
player.startControlsTimer();
|
131 |
-
}
|
132 |
-
|
133 |
-
// 5%
|
134 |
-
var newTime = Math.min(media.currentTime + (media.duration * 0.05), media.duration);
|
135 |
-
media.setCurrentTime(newTime);
|
136 |
-
}
|
137 |
-
}
|
138 |
-
},
|
139 |
-
{
|
140 |
-
keys: [70], // f
|
141 |
-
action: function(player, media) {
|
142 |
-
if (typeof player.enterFullScreen != 'undefined') {
|
143 |
-
if (player.isFullScreen) {
|
144 |
-
player.exitFullScreen();
|
145 |
-
} else {
|
146 |
-
player.enterFullScreen();
|
147 |
-
}
|
148 |
-
}
|
149 |
-
}
|
150 |
-
}
|
151 |
-
]
|
152 |
-
};
|
153 |
-
|
154 |
-
mejs.mepIndex = 0;
|
155 |
-
|
156 |
-
mejs.players = [];
|
157 |
-
|
158 |
-
// wraps a MediaElement object in player controls
|
159 |
-
mejs.MediaElementPlayer = function(node, o) {
|
160 |
-
// enforce object, even without "new" (via John Resig)
|
161 |
-
if ( !(this instanceof mejs.MediaElementPlayer) ) {
|
162 |
-
return new mejs.MediaElementPlayer(node, o);
|
163 |
-
}
|
164 |
-
|
165 |
-
var t = this;
|
166 |
-
|
167 |
-
// these will be reset after the MediaElement.success fires
|
168 |
-
t.$media = t.$node = $(node);
|
169 |
-
t.node = t.media = t.$media[0];
|
170 |
-
|
171 |
-
// check for existing player
|
172 |
-
if (typeof t.node.player != 'undefined') {
|
173 |
-
return t.node.player;
|
174 |
-
} else {
|
175 |
-
// attach player to DOM node for reference
|
176 |
-
t.node.player = t;
|
177 |
-
}
|
178 |
-
|
179 |
-
|
180 |
-
// try to get options from data-mejsoptions
|
181 |
-
if (typeof o == 'undefined') {
|
182 |
-
o = t.$node.data('mejsoptions');
|
183 |
-
}
|
184 |
-
|
185 |
-
// extend default options
|
186 |
-
t.options = $.extend({},mejs.MepDefaults,o);
|
187 |
-
|
188 |
-
// add to player array (for focus events)
|
189 |
-
mejs.players.push(t);
|
190 |
-
|
191 |
-
// start up
|
192 |
-
t.init();
|
193 |
-
|
194 |
-
return t;
|
195 |
-
};
|
196 |
-
|
197 |
-
// actual player
|
198 |
-
mejs.MediaElementPlayer.prototype = {
|
199 |
-
|
200 |
-
hasFocus: false,
|
201 |
-
|
202 |
-
controlsAreVisible: true,
|
203 |
-
|
204 |
-
init: function() {
|
205 |
-
|
206 |
-
var
|
207 |
-
t = this,
|
208 |
-
mf = mejs.MediaFeatures,
|
209 |
-
// options for MediaElement (shim)
|
210 |
-
meOptions = $.extend(true, {}, t.options, {
|
211 |
-
success: function(media, domNode) { t.meReady(media, domNode); },
|
212 |
-
error: function(e) { t.handleError(e);}
|
213 |
-
}),
|
214 |
-
tagName = t.media.tagName.toLowerCase();
|
215 |
-
|
216 |
-
t.isDynamic = (tagName !== 'audio' && tagName !== 'video');
|
217 |
-
|
218 |
-
if (t.isDynamic) {
|
219 |
-
// get video from src or href?
|
220 |
-
t.isVideo = t.options.isVideo;
|
221 |
-
} else {
|
222 |
-
t.isVideo = (tagName !== 'audio' && t.options.isVideo);
|
223 |
-
}
|
224 |
-
|
225 |
-
// use native controls in iPad, iPhone, and Android
|
226 |
-
if ((mf.isiPad && t.options.iPadUseNativeControls) || (mf.isiPhone && t.options.iPhoneUseNativeControls)) {
|
227 |
-
|
228 |
-
// add controls and stop
|
229 |
-
t.$media.attr('controls', 'controls');
|
230 |
-
|
231 |
-
// attempt to fix iOS 3 bug
|
232 |
-
//t.$media.removeAttr('poster');
|
233 |
-
// no Issue found on iOS3 -ttroxell
|
234 |
-
|
235 |
-
// override Apple's autoplay override for iPads
|
236 |
-
if (mf.isiPad && t.media.getAttribute('autoplay') !== null) {
|
237 |
-
t.media.load();
|
238 |
-
t.media.play();
|
239 |
-
}
|
240 |
-
|
241 |
-
} else if (mf.isAndroid && t.AndroidUseNativeControls) {
|
242 |
-
|
243 |
-
// leave default player
|
244 |
-
|
245 |
-
} else {
|
246 |
-
|
247 |
-
// DESKTOP: use MediaElementPlayer controls
|
248 |
-
|
249 |
-
// remove native controls
|
250 |
-
t.$media.removeAttr('controls');
|
251 |
-
|
252 |
-
// unique ID
|
253 |
-
t.id = 'mep_' + mejs.mepIndex++;
|
254 |
-
|
255 |
-
// build container
|
256 |
-
t.container =
|
257 |
-
$('<div id="' + t.id + '" class="mejs-container">'+
|
258 |
-
'<div class="mejs-inner">'+
|
259 |
-
'<div class="mejs-mediaelement"></div>'+
|
260 |
-
'<div class="mejs-layers"></div>'+
|
261 |
-
'<div class="mejs-controls"></div>'+
|
262 |
-
'<div class="mejs-clear"></div>'+
|
263 |
-
'</div>' +
|
264 |
-
'</div>')
|
265 |
-
.addClass(t.$media[0].className)
|
266 |
-
.insertBefore(t.$media);
|
267 |
-
|
268 |
-
// add classes for user and content
|
269 |
-
t.container.addClass(
|
270 |
-
(mf.isAndroid ? 'mejs-android ' : '') +
|
271 |
-
(mf.isiOS ? 'mejs-ios ' : '') +
|
272 |
-
(mf.isiPad ? 'mejs-ipad ' : '') +
|
273 |
-
(mf.isiPhone ? 'mejs-iphone ' : '') +
|
274 |
-
(t.isVideo ? 'mejs-video ' : 'mejs-audio ')
|
275 |
-
);
|
276 |
-
|
277 |
-
|
278 |
-
// move the <video/video> tag into the right spot
|
279 |
-
if (mf.isiOS) {
|
280 |
-
|
281 |
-
// sadly, you can't move nodes in iOS, so we have to destroy and recreate it!
|
282 |
-
var $newMedia = t.$media.clone();
|
283 |
-
|
284 |
-
t.container.find('.mejs-mediaelement').append($newMedia);
|
285 |
-
|
286 |
-
t.$media.remove();
|
287 |
-
t.$node = t.$media = $newMedia;
|
288 |
-
t.node = t.media = $newMedia[0]
|
289 |
-
|
290 |
-
} else {
|
291 |
-
|
292 |
-
// normal way of moving it into place (doesn't work on iOS)
|
293 |
-
t.container.find('.mejs-mediaelement').append(t.$media);
|
294 |
-
}
|
295 |
-
|
296 |
-
// find parts
|
297 |
-
t.controls = t.container.find('.mejs-controls');
|
298 |
-
t.layers = t.container.find('.mejs-layers');
|
299 |
-
|
300 |
-
// determine the size
|
301 |
-
|
302 |
-
/* size priority:
|
303 |
-
(1) videoWidth (forced),
|
304 |
-
(2) style="width;height;"
|
305 |
-
(3) width attribute,
|
306 |
-
(4) defaultVideoWidth (for unspecified cases)
|
307 |
-
*/
|
308 |
-
|
309 |
-
var capsTagName = tagName.substring(0,1).toUpperCase() + tagName.substring(1);
|
310 |
-
|
311 |
-
if (t.options[tagName + 'Width'] > 0 || t.options[tagName + 'Width'].toString().indexOf('%') > -1) {
|
312 |
-
t.width = t.options[tagName + 'Width'];
|
313 |
-
} else if (t.media.style.width !== '' && t.media.style.width !== null) {
|
314 |
-
t.width = t.media.style.width;
|
315 |
-
} else if (t.media.getAttribute('width') !== null) {
|
316 |
-
t.width = t.$media.attr('width');
|
317 |
-
} else {
|
318 |
-
t.width = t.options['default' + capsTagName + 'Width'];
|
319 |
-
}
|
320 |
-
|
321 |
-
if (t.options[tagName + 'Height'] > 0 || t.options[tagName + 'Height'].toString().indexOf('%') > -1) {
|
322 |
-
t.height = t.options[tagName + 'Height'];
|
323 |
-
} else if (t.media.style.height !== '' && t.media.style.height !== null) {
|
324 |
-
t.height = t.media.style.height;
|
325 |
-
} else if (t.$media[0].getAttribute('height') !== null) {
|
326 |
-
t.height = t.$media.attr('height');
|
327 |
-
} else {
|
328 |
-
t.height = t.options['default' + capsTagName + 'Height'];
|
329 |
-
}
|
330 |
-
|
331 |
-
// set the size, while we wait for the plugins to load below
|
332 |
-
t.setPlayerSize(t.width, t.height);
|
333 |
-
|
334 |
-
// create MediaElementShim
|
335 |
-
meOptions.pluginWidth = t.height;
|
336 |
-
meOptions.pluginHeight = t.width;
|
337 |
-
}
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
// create MediaElement shim
|
342 |
-
mejs.MediaElement(t.$media[0], meOptions);
|
343 |
-
},
|
344 |
-
|
345 |
-
showControls: function(doAnimation) {
|
346 |
-
var t = this;
|
347 |
-
|
348 |
-
doAnimation = typeof doAnimation == 'undefined' || doAnimation;
|
349 |
-
|
350 |
-
if (t.controlsAreVisible)
|
351 |
-
return;
|
352 |
-
|
353 |
-
if (doAnimation) {
|
354 |
-
t.controls
|
355 |
-
.css('visibility','visible')
|
356 |
-
.stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;});
|
357 |
-
|
358 |
-
// any additional controls people might add and want to hide
|
359 |
-
t.container.find('.mejs-control')
|
360 |
-
.css('visibility','visible')
|
361 |
-
.stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;});
|
362 |
-
|
363 |
-
} else {
|
364 |
-
t.controls
|
365 |
-
.css('visibility','visible')
|
366 |
-
.css('display','block');
|
367 |
-
|
368 |
-
// any additional controls people might add and want to hide
|
369 |
-
t.container.find('.mejs-control')
|
370 |
-
.css('visibility','visible')
|
371 |
-
.css('display','block');
|
372 |
-
|
373 |
-
t.controlsAreVisible = true;
|
374 |
-
}
|
375 |
-
|
376 |
-
t.setControlsSize();
|
377 |
-
|
378 |
-
},
|
379 |
-
|
380 |
-
hideControls: function(doAnimation) {
|
381 |
-
var t = this;
|
382 |
-
|
383 |
-
doAnimation = typeof doAnimation == 'undefined' || doAnimation;
|
384 |
-
|
385 |
-
if (!t.controlsAreVisible)
|
386 |
-
return;
|
387 |
-
|
388 |
-
if (doAnimation) {
|
389 |
-
// fade out main controls
|
390 |
-
t.controls.stop(true, true).fadeOut(200, function() {
|
391 |
-
$(this)
|
392 |
-
.css('visibility','hidden')
|
393 |
-
.css('display','block');
|
394 |
-
|
395 |
-
t.controlsAreVisible = false;
|
396 |
-
});
|
397 |
-
|
398 |
-
// any additional controls people might add and want to hide
|
399 |
-
t.container.find('.mejs-control').stop(true, true).fadeOut(200, function() {
|
400 |
-
$(this)
|
401 |
-
.css('visibility','hidden')
|
402 |
-
.css('display','block');
|
403 |
-
});
|
404 |
-
} else {
|
405 |
-
|
406 |
-
// hide main controls
|
407 |
-
t.controls
|
408 |
-
.css('visibility','hidden')
|
409 |
-
.css('display','block');
|
410 |
-
|
411 |
-
// hide others
|
412 |
-
t.container.find('.mejs-control')
|
413 |
-
.css('visibility','hidden')
|
414 |
-
.css('display','block');
|
415 |
-
|
416 |
-
t.controlsAreVisible = false;
|
417 |
-
}
|
418 |
-
},
|
419 |
-
|
420 |
-
controlsTimer: null,
|
421 |
-
|
422 |
-
startControlsTimer: function(timeout) {
|
423 |
-
|
424 |
-
var t = this;
|
425 |
-
|
426 |
-
timeout = typeof timeout != 'undefined' ? timeout : 1500;
|
427 |
-
|
428 |
-
t.killControlsTimer('start');
|
429 |
-
|
430 |
-
t.controlsTimer = setTimeout(function() {
|
431 |
-
//console.log('timer fired');
|
432 |
-
t.hideControls();
|
433 |
-
t.killControlsTimer('hide');
|
434 |
-
}, timeout);
|
435 |
-
},
|
436 |
-
|
437 |
-
killControlsTimer: function(src) {
|
438 |
-
|
439 |
-
var t = this;
|
440 |
-
|
441 |
-
if (t.controlsTimer !== null) {
|
442 |
-
clearTimeout(t.controlsTimer);
|
443 |
-
delete t.controlsTimer;
|
444 |
-
t.controlsTimer = null;
|
445 |
-
}
|
446 |
-
},
|
447 |
-
|
448 |
-
controlsEnabled: true,
|
449 |
-
|
450 |
-
disableControls: function() {
|
451 |
-
var t= this;
|
452 |
-
|
453 |
-
t.killControlsTimer();
|
454 |
-
t.hideControls(false);
|
455 |
-
this.controlsEnabled = false;
|
456 |
-
},
|
457 |
-
|
458 |
-
enableControls: function() {
|
459 |
-
var t= this;
|
460 |
-
|
461 |
-
t.showControls(false);
|
462 |
-
|
463 |
-
t.controlsEnabled = true;
|
464 |
-
},
|
465 |
-
|
466 |
-
|
467 |
-
// Sets up all controls and events
|
468 |
-
meReady: function(media, domNode) {
|
469 |
-
|
470 |
-
|
471 |
-
var t = this,
|
472 |
-
mf = mejs.MediaFeatures,
|
473 |
-
autoplayAttr = domNode.getAttribute('autoplay'),
|
474 |
-
autoplay = !(typeof autoplayAttr == 'undefined' || autoplayAttr === null || autoplayAttr === 'false'),
|
475 |
-
featureIndex,
|
476 |
-
feature;
|
477 |
-
|
478 |
-
// make sure it can't create itself again if a plugin reloads
|
479 |
-
if (t.created)
|
480 |
-
return;
|
481 |
-
else
|
482 |
-
t.created = true;
|
483 |
-
|
484 |
-
t.media = media;
|
485 |
-
t.domNode = domNode;
|
486 |
-
|
487 |
-
if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) {
|
488 |
-
|
489 |
-
// two built in features
|
490 |
-
t.buildposter(t, t.controls, t.layers, t.media);
|
491 |
-
t.buildkeyboard(t, t.controls, t.layers, t.media);
|
492 |
-
t.buildoverlays(t, t.controls, t.layers, t.media);
|
493 |
-
|
494 |
-
// grab for use by features
|
495 |
-
t.findTracks();
|
496 |
-
|
497 |
-
// add user-defined features/controls
|
498 |
-
for (featureIndex in t.options.features) {
|
499 |
-
feature = t.options.features[featureIndex];
|
500 |
-
if (t['build' + feature]) {
|
501 |
-
try {
|
502 |
-
t['build' + feature](t, t.controls, t.layers, t.media);
|
503 |
-
} catch (e) {
|
504 |
-
// TODO: report control error
|
505 |
-
//throw e;
|
506 |
-
//console.log('error building ' + feature);
|
507 |
-
//console.log(e);
|
508 |
-
}
|
509 |
-
}
|
510 |
-
}
|
511 |
-
|
512 |
-
t.container.trigger('controlsready');
|
513 |
-
|
514 |
-
// reset all layers and controls
|
515 |
-
t.setPlayerSize(t.width, t.height);
|
516 |
-
t.setControlsSize();
|
517 |
-
|
518 |
-
|
519 |
-
// controls fade
|
520 |
-
if (t.isVideo) {
|
521 |
-
|
522 |
-
if (mejs.MediaFeatures.hasTouch) {
|
523 |
-
|
524 |
-
// for touch devices (iOS, Android)
|
525 |
-
// show/hide without animation on touch
|
526 |
-
|
527 |
-
t.$media.bind('touchstart', function() {
|
528 |
-
|
529 |
-
|
530 |
-
// toggle controls
|
531 |
-
if (t.controlsAreVisible) {
|
532 |
-
t.hideControls(false);
|
533 |
-
} else {
|
534 |
-
if (t.controlsEnabled) {
|
535 |
-
t.showControls(false);
|
536 |
-
}
|
537 |
-
}
|
538 |
-
});
|
539 |
-
|
540 |
-
} else {
|
541 |
-
// click controls
|
542 |
-
var clickElement = (t.media.pluginType == 'native') ? t.$media : $(t.media.pluginElement);
|
543 |
-
|
544 |
-
// click to play/pause
|
545 |
-
clickElement.click(function() {
|
546 |
-
if (media.paused) {
|
547 |
-
media.play();
|
548 |
-
} else {
|
549 |
-
media.pause();
|
550 |
-
}
|
551 |
-
});
|
552 |
-
|
553 |
-
|
554 |
-
// show/hide controls
|
555 |
-
t.container
|
556 |
-
.bind('mouseenter mouseover', function () {
|
557 |
-
if (t.controlsEnabled) {
|
558 |
-
if (!t.options.alwaysShowControls) {
|
559 |
-
t.killControlsTimer('enter');
|
560 |
-
t.showControls();
|
561 |
-
t.startControlsTimer(2500);
|
562 |
-
}
|
563 |
-
}
|
564 |
-
})
|
565 |
-
.bind('mousemove', function() {
|
566 |
-
if (t.controlsEnabled) {
|
567 |
-
if (!t.controlsAreVisible) {
|
568 |
-
t.showControls();
|
569 |
-
}
|
570 |
-
//t.killControlsTimer('move');
|
571 |
-
if (!t.options.alwaysShowControls) {
|
572 |
-
t.startControlsTimer(2500);
|
573 |
-
}
|
574 |
-
}
|
575 |
-
})
|
576 |
-
.bind('mouseleave', function () {
|
577 |
-
if (t.controlsEnabled) {
|
578 |
-
if (!t.media.paused && !t.options.alwaysShowControls) {
|
579 |
-
t.startControlsTimer(1000);
|
580 |
-
}
|
581 |
-
}
|
582 |
-
});
|
583 |
-
}
|
584 |
-
|
585 |
-
// check for autoplay
|
586 |
-
if (autoplay && !t.options.alwaysShowControls) {
|
587 |
-
t.hideControls();
|
588 |
-
}
|
589 |
-
|
590 |
-
// resizer
|
591 |
-
if (t.options.enableAutosize) {
|
592 |
-
t.media.addEventListener('loadedmetadata', function(e) {
|
593 |
-
// if the <video height> was not set and the options.videoHeight was not set
|
594 |
-
// then resize to the real dimensions
|
595 |
-
if (t.options.videoHeight <= 0 && t.domNode.getAttribute('height') === null && !isNaN(e.target.videoHeight)) {
|
596 |
-
t.setPlayerSize(e.target.videoWidth, e.target.videoHeight);
|
597 |
-
t.setControlsSize();
|
598 |
-
t.media.setVideoSize(e.target.videoWidth, e.target.videoHeight);
|
599 |
-
}
|
600 |
-
}, false);
|
601 |
-
}
|
602 |
-
}
|
603 |
-
|
604 |
-
// EVENTS
|
605 |
-
|
606 |
-
// FOCUS: when a video starts playing, it takes focus from other players (possibily pausing them)
|
607 |
-
media.addEventListener('play', function() {
|
608 |
-
|
609 |
-
// go through all other players
|
610 |
-
for (var i=0, il=mejs.players.length; i<il; i++) {
|
611 |
-
var p = mejs.players[i];
|
612 |
-
if (p.id != t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended) {
|
613 |
-
p.pause();
|
614 |
-
}
|
615 |
-
p.hasFocus = false;
|
616 |
-
}
|
617 |
-
|
618 |
-
t.hasFocus = true;
|
619 |
-
},false);
|
620 |
-
|
621 |
-
|
622 |
-
// ended for all
|
623 |
-
t.media.addEventListener('ended', function (e) {
|
624 |
-
try{
|
625 |
-
t.media.setCurrentTime(0);
|
626 |
-
} catch (exp) {
|
627 |
-
|
628 |
-
}
|
629 |
-
t.media.pause();
|
630 |
-
|
631 |
-
if (t.setProgressRail)
|
632 |
-
t.setProgressRail();
|
633 |
-
if (t.setCurrentRail)
|
634 |
-
t.setCurrentRail();
|
635 |
-
|
636 |
-
if (t.options.loop) {
|
637 |
-
t.media.play();
|
638 |
-
} else if (!t.options.alwaysShowControls && t.controlsEnabled) {
|
639 |
-
t.showControls();
|
640 |
-
}
|
641 |
-
}, false);
|
642 |
-
|
643 |
-
// resize on the first play
|
644 |
-
t.media.addEventListener('loadedmetadata', function(e) {
|
645 |
-
if (t.updateDuration) {
|
646 |
-
t.updateDuration();
|
647 |
-
}
|
648 |
-
if (t.updateCurrent) {
|
649 |
-
t.updateCurrent();
|
650 |
-
}
|
651 |
-
|
652 |
-
if (!t.isFullScreen) {
|
653 |
-
t.setPlayerSize(t.width, t.height);
|
654 |
-
t.setControlsSize();
|
655 |
-
}
|
656 |
-
}, false);
|
657 |
-
|
658 |
-
|
659 |
-
// webkit has trouble doing this without a delay
|
660 |
-
setTimeout(function () {
|
661 |
-
t.setPlayerSize(t.width, t.height);
|
662 |
-
t.setControlsSize();
|
663 |
-
}, 50);
|
664 |
-
|
665 |
-
// adjust controls whenever window sizes (used to be in fullscreen only)
|
666 |
-
$(window).resize(function() {
|
667 |
-
|
668 |
-
// don't resize for fullscreen mode
|
669 |
-
if ( !(t.isFullScreen || (mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen)) ) {
|
670 |
-
t.setPlayerSize(t.width, t.height);
|
671 |
-
}
|
672 |
-
|
673 |
-
// always adjust controls
|
674 |
-
t.setControlsSize();
|
675 |
-
});
|
676 |
-
|
677 |
-
// TEMP: needs to be moved somewhere else
|
678 |
-
if (t.media.pluginType == 'youtube') {
|
679 |
-
t.container.find('.mejs-overlay-play').hide();
|
680 |
-
}
|
681 |
-
}
|
682 |
-
|
683 |
-
// force autoplay for HTML5
|
684 |
-
if (autoplay && media.pluginType == 'native') {
|
685 |
-
media.load();
|
686 |
-
media.play();
|
687 |
-
}
|
688 |
-
|
689 |
-
|
690 |
-
if (t.options.success) {
|
691 |
-
|
692 |
-
if (typeof t.options.success == 'string') {
|
693 |
-
window[t.options.success](t.media, t.domNode, t);
|
694 |
-
} else {
|
695 |
-
t.options.success(t.media, t.domNode, t);
|
696 |
-
}
|
697 |
-
}
|
698 |
-
},
|
699 |
-
|
700 |
-
handleError: function(e) {
|
701 |
-
var t = this;
|
702 |
-
|
703 |
-
t.controls.hide();
|
704 |
-
|
705 |
-
// Tell user that the file cannot be played
|
706 |
-
if (t.options.error) {
|
707 |
-
t.options.error(e);
|
708 |
-
}
|
709 |
-
},
|
710 |
-
|
711 |
-
setPlayerSize: function(width,height) {
|
712 |
-
var t = this;
|
713 |
-
|
714 |
-
if (typeof width != 'undefined')
|
715 |
-
t.width = width;
|
716 |
-
|
717 |
-
if (typeof height != 'undefined')
|
718 |
-
t.height = height;
|
719 |
-
|
720 |
-
// detect 100% mode
|
721 |
-
if (t.height.toString().indexOf('%') > 0) {
|
722 |
-
|
723 |
-
// do we have the native dimensions yet?
|
724 |
-
var
|
725 |
-
nativeWidth = (t.media.videoWidth && t.media.videoWidth > 0) ? t.media.videoWidth : t.options.defaultVideoWidth,
|
726 |
-
nativeHeight = (t.media.videoHeight && t.media.videoHeight > 0) ? t.media.videoHeight : t.options.defaultVideoHeight,
|
727 |
-
parentWidth = t.container.parent().width(),
|
728 |
-
newHeight = parseInt(parentWidth * nativeHeight/nativeWidth, 10);
|
729 |
-
|
730 |
-
if (t.container.parent()[0].tagName.toLowerCase() === 'body') { // && t.container.siblings().count == 0) {
|
731 |
-
parentWidth = $(window).width();
|
732 |
-
newHeight = $(window).height();
|
733 |
-
}
|
734 |
-
|
735 |
-
|
736 |
-
// set outer container size
|
737 |
-
t.container
|
738 |
-
.width(parentWidth)
|
739 |
-
.height(newHeight);
|
740 |
-
|
741 |
-
// set native <video>
|
742 |
-
t.$media
|
743 |
-
.width('100%')
|
744 |
-
.height('100%');
|
745 |
-
|
746 |
-
// set shims
|
747 |
-
t.container.find('object, embed, iframe')
|
748 |
-
.width('100%')
|
749 |
-
.height('100%');
|
750 |
-
|
751 |
-
// if shim is ready, send the size to the embeded plugin
|
752 |
-
if (t.media.setVideoSize)
|
753 |
-
t.media.setVideoSize(parentWidth, newHeight);
|
754 |
-
|
755 |
-
// set the layers
|
756 |
-
t.layers.children('.mejs-layer')
|
757 |
-
.width('100%')
|
758 |
-
.height('100%');
|
759 |
-
|
760 |
-
|
761 |
-
} else {
|
762 |
-
|
763 |
-
t.container
|
764 |
-
.width(t.width)
|
765 |
-
.height(t.height);
|
766 |
-
|
767 |
-
t.layers.children('.mejs-layer')
|
768 |
-
.width(t.width)
|
769 |
-
.height(t.height);
|
770 |
-
|
771 |
-
}
|
772 |
-
},
|
773 |
-
|
774 |
-
setControlsSize: function() {
|
775 |
-
var t = this,
|
776 |
-
usedWidth = 0,
|
777 |
-
railWidth = 0,
|
778 |
-
rail = t.controls.find('.mejs-time-rail'),
|
779 |
-
total = t.controls.find('.mejs-time-total'),
|
780 |
-
current = t.controls.find('.mejs-time-current'),
|
781 |
-
loaded = t.controls.find('.mejs-time-loaded'),
|
782 |
-
others = rail.siblings();
|
783 |
-
|
784 |
-
|
785 |
-
// allow the size to come from custom CSS
|
786 |
-
if (t.options && !t.options.autosizeProgress) {
|
787 |
-
// Also, frontends devs can be more flexible
|
788 |
-
// due the opportunity of absolute positioning.
|
789 |
-
railWidth = parseInt(rail.css('width'));
|
790 |
-
}
|
791 |
-
|
792 |
-
// attempt to autosize
|
793 |
-
if (railWidth === 0 || !railWidth) {
|
794 |
-
|
795 |
-
// find the size of all the other controls besides the rail
|
796 |
-
others.each(function() {
|
797 |
-
if ($(this).css('position') != 'absolute') {
|
798 |
-
usedWidth += $(this).outerWidth(true);
|
799 |
-
}
|
800 |
-
});
|
801 |
-
|
802 |
-
// fit the rail into the remaining space
|
803 |
-
railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.width());
|
804 |
-
}
|
805 |
-
|
806 |
-
// outer area
|
807 |
-
rail.width(railWidth);
|
808 |
-
// dark space
|
809 |
-
total.width(railWidth - (total.outerWidth(true) - total.width()));
|
810 |
-
|
811 |
-
if (t.setProgressRail)
|
812 |
-
t.setProgressRail();
|
813 |
-
if (t.setCurrentRail)
|
814 |
-
t.setCurrentRail();
|
815 |
-
},
|
816 |
-
|
817 |
-
|
818 |
-
buildposter: function(player, controls, layers, media) {
|
819 |
-
var t = this,
|
820 |
-
poster =
|
821 |
-
$('<div class="mejs-poster mejs-layer">' +
|
822 |
-
'</div>')
|
823 |
-
.appendTo(layers),
|
824 |
-
posterUrl = player.$media.attr('poster');
|
825 |
-
|
826 |
-
// prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster)
|
827 |
-
if (player.options.poster !== '') {
|
828 |
-
posterUrl = player.options.poster;
|
829 |
-
}
|
830 |
-
|
831 |
-
// second, try the real poster
|
832 |
-
if (posterUrl !== '' && posterUrl != null) {
|
833 |
-
t.setPoster(posterUrl);
|
834 |
-
} else {
|
835 |
-
poster.hide();
|
836 |
-
}
|
837 |
-
|
838 |
-
media.addEventListener('play',function() {
|
839 |
-
poster.hide();
|
840 |
-
}, false);
|
841 |
-
},
|
842 |
-
|
843 |
-
setPoster: function(url) {
|
844 |
-
var t = this,
|
845 |
-
posterDiv = t.container.find('.mejs-poster'),
|
846 |
-
posterImg = posterDiv.find('img');
|
847 |
-
|
848 |
-
if (posterImg.length == 0) {
|
849 |
-
posterImg = $('<img width="100%" height="100%" />').appendTo(posterDiv);
|
850 |
-
}
|
851 |
-
|
852 |
-
posterImg.attr('src', url);
|
853 |
-
},
|
854 |
-
|
855 |
-
buildoverlays: function(player, controls, layers, media) {
|
856 |
-
if (!player.isVideo)
|
857 |
-
return;
|
858 |
-
|
859 |
-
var
|
860 |
-
loading =
|
861 |
-
$('<div class="mejs-overlay mejs-layer">'+
|
862 |
-
'<div class="mejs-overlay-loading"><span></span></div>'+
|
863 |
-
'</div>')
|
864 |
-
.hide() // start out hidden
|
865 |
-
.appendTo(layers),
|
866 |
-
error =
|
867 |
-
$('<div class="mejs-overlay mejs-layer">'+
|
868 |
-
'<div class="mejs-overlay-error"></div>'+
|
869 |
-
'</div>')
|
870 |
-
.hide() // start out hidden
|
871 |
-
.appendTo(layers),
|
872 |
-
// this needs to come last so it's on top
|
873 |
-
bigPlay =
|
874 |
-
$('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+
|
875 |
-
'<div class="mejs-overlay-button"></div>'+
|
876 |
-
'</div>')
|
877 |
-
.appendTo(layers)
|
878 |
-
.click(function() {
|
879 |
-
if (media.paused) {
|
880 |
-
media.play();
|
881 |
-
} else {
|
882 |
-
media.pause();
|
883 |
-
}
|
884 |
-
});
|
885 |
-
|
886 |
-
/*
|
887 |
-
if (mejs.MediaFeatures.isiOS || mejs.MediaFeatures.isAndroid) {
|
888 |
-
bigPlay.remove();
|
889 |
-
loading.remove();
|
890 |
-
}
|
891 |
-
*/
|
892 |
-
|
893 |
-
|
894 |
-
// show/hide big play button
|
895 |
-
media.addEventListener('play',function() {
|
896 |
-
bigPlay.hide();
|
897 |
-
loading.hide();
|
898 |
-
controls.find('.mejs-time-buffering').hide();
|
899 |
-
error.hide();
|
900 |
-
}, false);
|
901 |
-
|
902 |
-
media.addEventListener('playing', function() {
|
903 |
-
bigPlay.hide();
|
904 |
-
loading.hide();
|
905 |
-
controls.find('.mejs-time-buffering').hide();
|
906 |
-
error.hide();
|
907 |
-
}, false);
|
908 |
-
|
909 |
-
media.addEventListener('seeking', function() {
|
910 |
-
loading.show();
|
911 |
-
controls.find('.mejs-time-buffering').show();
|
912 |
-
}, false);
|
913 |
-
|
914 |
-
media.addEventListener('seeked', function() {
|
915 |
-
loading.hide();
|
916 |
-
controls.find('.mejs-time-buffering').hide();
|
917 |
-
}, false);
|
918 |
-
|
919 |
-
media.addEventListener('pause',function() {
|
920 |
-
if (!mejs.MediaFeatures.isiPhone) {
|
921 |
-
bigPlay.show();
|
922 |
-
}
|
923 |
-
}, false);
|
924 |
-
|
925 |
-
media.addEventListener('waiting', function() {
|
926 |
-
loading.show();
|
927 |
-
controls.find('.mejs-time-buffering').show();
|
928 |
-
}, false);
|
929 |
-
|
930 |
-
|
931 |
-
// show/hide loading
|
932 |
-
media.addEventListener('loadeddata',function() {
|
933 |
-
// for some reason Chrome is firing this event
|
934 |
-
//if (mejs.MediaFeatures.isChrome && media.getAttribute && media.getAttribute('preload') === 'none')
|
935 |
-
// return;
|
936 |
-
|
937 |
-
loading.show();
|
938 |
-
controls.find('.mejs-time-buffering').show();
|
939 |
-
}, false);
|
940 |
-
media.addEventListener('canplay',function() {
|
941 |
-
loading.hide();
|
942 |
-
controls.find('.mejs-time-buffering').hide();
|
943 |
-
}, false);
|
944 |
-
|
945 |
-
// error handling
|
946 |
-
media.addEventListener('error',function() {
|
947 |
-
loading.hide();
|
948 |
-
controls.find('.mejs-time-buffering').hide();
|
949 |
-
error.show();
|
950 |
-
error.find('mejs-overlay-error').html("Error loading this resource");
|
951 |
-
}, false);
|
952 |
-
},
|
953 |
-
|
954 |
-
buildkeyboard: function(player, controls, layers, media) {
|
955 |
-
|
956 |
-
var t = this;
|
957 |
-
|
958 |
-
// listen for key presses
|
959 |
-
$(document).keydown(function(e) {
|
960 |
-
|
961 |
-
if (player.hasFocus && player.options.enableKeyboard) {
|
962 |
-
|
963 |
-
// find a matching key
|
964 |
-
for (var i=0, il=player.options.keyActions.length; i<il; i++) {
|
965 |
-
var keyAction = player.options.keyActions[i];
|
966 |
-
|
967 |
-
for (var j=0, jl=keyAction.keys.length; j<jl; j++) {
|
968 |
-
if (e.keyCode == keyAction.keys[j]) {
|
969 |
-
e.preventDefault();
|
970 |
-
keyAction.action(player, media);
|
971 |
-
return false;
|
972 |
-
}
|
973 |
-
}
|
974 |
-
}
|
975 |
-
}
|
976 |
-
|
977 |
-
return true;
|
978 |
-
});
|
979 |
-
|
980 |
-
// check if someone clicked outside a player region, then kill its focus
|
981 |
-
$(document).click(function(event) {
|
982 |
-
if ($(event.target).closest('.mejs-container').length == 0) {
|
983 |
-
player.hasFocus = false;
|
984 |
-
}
|
985 |
-
});
|
986 |
-
|
987 |
-
},
|
988 |
-
|
989 |
-
findTracks: function() {
|
990 |
-
var t = this,
|
991 |
-
tracktags = t.$media.find('track');
|
992 |
-
|
993 |
-
// store for use by plugins
|
994 |
-
t.tracks = [];
|
995 |
-
tracktags.each(function(index, track) {
|
996 |
-
|
997 |
-
track = $(track);
|
998 |
-
|
999 |
-
t.tracks.push({
|
1000 |
-
srclang: track.attr('srclang').toLowerCase(),
|
1001 |
-
src: track.attr('src'),
|
1002 |
-
kind: track.attr('kind'),
|
1003 |
-
label: track.attr('label') || '',
|
1004 |
-
entries: [],
|
1005 |
-
isLoaded: false
|
1006 |
-
});
|
1007 |
-
});
|
1008 |
-
},
|
1009 |
-
changeSkin: function(className) {
|
1010 |
-
this.container[0].className = 'mejs-container ' + className;
|
1011 |
-
this.setPlayerSize(this.width, this.height);
|
1012 |
-
this.setControlsSize();
|
1013 |
-
},
|
1014 |
-
play: function() {
|
1015 |
-
this.media.play();
|
1016 |
-
},
|
1017 |
-
pause: function() {
|
1018 |
-
this.media.pause();
|
1019 |
-
},
|
1020 |
-
load: function() {
|
1021 |
-
this.media.load();
|
1022 |
-
},
|
1023 |
-
setMuted: function(muted) {
|
1024 |
-
this.media.setMuted(muted);
|
1025 |
-
},
|
1026 |
-
setCurrentTime: function(time) {
|
1027 |
-
this.media.setCurrentTime(time);
|
1028 |
-
},
|
1029 |
-
getCurrentTime: function() {
|
1030 |
-
return this.media.currentTime;
|
1031 |
-
},
|
1032 |
-
setVolume: function(volume) {
|
1033 |
-
this.media.setVolume(volume);
|
1034 |
-
},
|
1035 |
-
getVolume: function() {
|
1036 |
-
return this.media.volume;
|
1037 |
-
},
|
1038 |
-
setSrc: function(src) {
|
1039 |
-
this.media.setSrc(src);
|
1040 |
-
},
|
1041 |
-
remove: function() {
|
1042 |
-
var t = this;
|
1043 |
-
|
1044 |
-
if (t.media.pluginType == 'flash') {
|
1045 |
-
t.media.remove();
|
1046 |
-
} else if (t.media.pluginType == 'native') {
|
1047 |
-
t.media.prop('controls', true);
|
1048 |
-
}
|
1049 |
-
|
1050 |
-
// grab video and put it back in place
|
1051 |
-
if (!t.isDynamic) {
|
1052 |
-
t.$node.insertBefore(t.container)
|
1053 |
-
}
|
1054 |
-
|
1055 |
-
t.container.remove();
|
1056 |
-
}
|
1057 |
-
};
|
1058 |
-
|
1059 |
-
// turn into jQuery plugin
|
1060 |
-
if (typeof jQuery != 'undefined') {
|
1061 |
-
jQuery.fn.mediaelementplayer = function (options) {
|
1062 |
-
return this.each(function () {
|
1063 |
-
new mejs.MediaElementPlayer(this, options);
|
1064 |
-
});
|
1065 |
-
};
|
1066 |
-
}
|
1067 |
-
|
1068 |
-
$(document).ready(function() {
|
1069 |
-
// auto enable using JSON attribute
|
1070 |
-
$('.mejs-player').mediaelementplayer();
|
1071 |
-
});
|
1072 |
-
|
1073 |
-
// push out to window
|
1074 |
-
window.MediaElementPlayer = mejs.MediaElementPlayer;
|
1075 |
-
|
1076 |
-
})(mejs.$);
|
1077 |
-
|
1078 |
-
(function($) {
|
1079 |
-
|
1080 |
-
$.extend(mejs.MepDefaults, {
|
1081 |
-
playpauseText: 'Play/Pause'
|
1082 |
-
});
|
1083 |
-
|
1084 |
-
// PLAY/pause BUTTON
|
1085 |
-
$.extend(MediaElementPlayer.prototype, {
|
1086 |
-
buildplaypause: function(player, controls, layers, media) {
|
1087 |
-
var
|
1088 |
-
t = this,
|
1089 |
-
play =
|
1090 |
-
$('<div class="mejs-button mejs-playpause-button mejs-play" >' +
|
1091 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.playpauseText + '"></button>' +
|
1092 |
-
'</div>')
|
1093 |
-
.appendTo(controls)
|
1094 |
-
.click(function(e) {
|
1095 |
-
e.preventDefault();
|
1096 |
-
|
1097 |
-
if (media.paused) {
|
1098 |
-
media.play();
|
1099 |
-
} else {
|
1100 |
-
media.pause();
|
1101 |
-
}
|
1102 |
-
|
1103 |
-
return false;
|
1104 |
-
});
|
1105 |
-
|
1106 |
-
media.addEventListener('play',function() {
|
1107 |
-
play.removeClass('mejs-play').addClass('mejs-pause');
|
1108 |
-
}, false);
|
1109 |
-
media.addEventListener('playing',function() {
|
1110 |
-
play.removeClass('mejs-play').addClass('mejs-pause');
|
1111 |
-
}, false);
|
1112 |
-
|
1113 |
-
|
1114 |
-
media.addEventListener('pause',function() {
|
1115 |
-
play.removeClass('mejs-pause').addClass('mejs-play');
|
1116 |
-
}, false);
|
1117 |
-
media.addEventListener('paused',function() {
|
1118 |
-
play.removeClass('mejs-pause').addClass('mejs-play');
|
1119 |
-
}, false);
|
1120 |
-
}
|
1121 |
-
});
|
1122 |
-
|
1123 |
-
})(mejs.$);
|
1124 |
-
(function($) {
|
1125 |
-
|
1126 |
-
$.extend(mejs.MepDefaults, {
|
1127 |
-
stopText: 'Stop'
|
1128 |
-
});
|
1129 |
-
|
1130 |
-
// STOP BUTTON
|
1131 |
-
$.extend(MediaElementPlayer.prototype, {
|
1132 |
-
buildstop: function(player, controls, layers, media) {
|
1133 |
-
var t = this,
|
1134 |
-
stop =
|
1135 |
-
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
|
1136 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
|
1137 |
-
'</div>')
|
1138 |
-
.appendTo(controls)
|
1139 |
-
.click(function() {
|
1140 |
-
if (!media.paused) {
|
1141 |
-
media.pause();
|
1142 |
-
}
|
1143 |
-
if (media.currentTime > 0) {
|
1144 |
-
media.setCurrentTime(0);
|
1145 |
-
controls.find('.mejs-time-current').width('0px');
|
1146 |
-
controls.find('.mejs-time-handle').css('left', '0px');
|
1147 |
-
controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
|
1148 |
-
controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
|
1149 |
-
layers.find('.mejs-poster').show();
|
1150 |
-
}
|
1151 |
-
});
|
1152 |
-
}
|
1153 |
-
});
|
1154 |
-
|
1155 |
-
})(mejs.$);
|
1156 |
-
(function($) {
|
1157 |
-
// progress/loaded bar
|
1158 |
-
$.extend(MediaElementPlayer.prototype, {
|
1159 |
-
buildprogress: function(player, controls, layers, media) {
|
1160 |
-
|
1161 |
-
$('<div class="mejs-time-rail">'+
|
1162 |
-
'<span class="mejs-time-total">'+
|
1163 |
-
'<span class="mejs-time-buffering"></span>'+
|
1164 |
-
'<span class="mejs-time-loaded"></span>'+
|
1165 |
-
'<span class="mejs-time-current"></span>'+
|
1166 |
-
'<span class="mejs-time-handle"></span>'+
|
1167 |
-
'<span class="mejs-time-float">' +
|
1168 |
-
'<span class="mejs-time-float-current">00:00</span>' +
|
1169 |
-
'<span class="mejs-time-float-corner"></span>' +
|
1170 |
-
'</span>'+
|
1171 |
-
'</span>'+
|
1172 |
-
'</div>')
|
1173 |
-
.appendTo(controls);
|
1174 |
-
controls.find('.mejs-time-buffering').hide();
|
1175 |
-
|
1176 |
-
var
|
1177 |
-
t = this,
|
1178 |
-
total = controls.find('.mejs-time-total'),
|
1179 |
-
loaded = controls.find('.mejs-time-loaded'),
|
1180 |
-
current = controls.find('.mejs-time-current'),
|
1181 |
-
handle = controls.find('.mejs-time-handle'),
|
1182 |
-
timefloat = controls.find('.mejs-time-float'),
|
1183 |
-
timefloatcurrent = controls.find('.mejs-time-float-current'),
|
1184 |
-
handleMouseMove = function (e) {
|
1185 |
-
// mouse position relative to the object
|
1186 |
-
var x = e.pageX,
|
1187 |
-
offset = total.offset(),
|
1188 |
-
width = total.outerWidth(),
|
1189 |
-
percentage = 0,
|
1190 |
-
newTime = 0,
|
1191 |
-
pos = x - offset.left;
|
1192 |
-
|
1193 |
-
|
1194 |
-
if (x > offset.left && x <= width + offset.left && media.duration) {
|
1195 |
-
percentage = ((x - offset.left) / width);
|
1196 |
-
newTime = (percentage <= 0.02) ? 0 : percentage * media.duration;
|
1197 |
-
|
1198 |
-
// seek to where the mouse is
|
1199 |
-
if (mouseIsDown) {
|
1200 |
-
media.setCurrentTime(newTime);
|
1201 |
-
}
|
1202 |
-
|
1203 |
-
// position floating time box
|
1204 |
-
if (!mejs.MediaFeatures.hasTouch) {
|
1205 |
-
timefloat.css('left', pos);
|
1206 |
-
timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime) );
|
1207 |
-
timefloat.show();
|
1208 |
-
}
|
1209 |
-
}
|
1210 |
-
},
|
1211 |
-
mouseIsDown = false,
|
1212 |
-
mouseIsOver = false;
|
1213 |
-
|
1214 |
-
// handle clicks
|
1215 |
-
//controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove);
|
1216 |
-
total
|
1217 |
-
.bind('mousedown', function (e) {
|
1218 |
-
// only handle left clicks
|
1219 |
-
if (e.which === 1) {
|
1220 |
-
mouseIsDown = true;
|
1221 |
-
handleMouseMove(e);
|
1222 |
-
$(document)
|
1223 |
-
.bind('mousemove.dur', function(e) {
|
1224 |
-
handleMouseMove(e);
|
1225 |
-
})
|
1226 |
-
.bind('mouseup.dur', function (e) {
|
1227 |
-
mouseIsDown = false;
|
1228 |
-
timefloat.hide();
|
1229 |
-
$(document).unbind('.dur');
|
1230 |
-
});
|
1231 |
-
return false;
|
1232 |
-
}
|
1233 |
-
})
|
1234 |
-
.bind('mouseenter', function(e) {
|
1235 |
-
mouseIsOver = true;
|
1236 |
-
$(document).bind('mousemove.dur', function(e) {
|
1237 |
-
handleMouseMove(e);
|
1238 |
-
});
|
1239 |
-
if (!mejs.MediaFeatures.hasTouch) {
|
1240 |
-
timefloat.show();
|
1241 |
-
}
|
1242 |
-
})
|
1243 |
-
.bind('mouseleave',function(e) {
|
1244 |
-
mouseIsOver = false;
|
1245 |
-
if (!mouseIsDown) {
|
1246 |
-
$(document).unbind('.dur');
|
1247 |
-
timefloat.hide();
|
1248 |
-
}
|
1249 |
-
});
|
1250 |
-
|
1251 |
-
// loading
|
1252 |
-
media.addEventListener('progress', function (e) {
|
1253 |
-
player.setProgressRail(e);
|
1254 |
-
player.setCurrentRail(e);
|
1255 |
-
}, false);
|
1256 |
-
|
1257 |
-
// current time
|
1258 |
-
media.addEventListener('timeupdate', function(e) {
|
1259 |
-
player.setProgressRail(e);
|
1260 |
-
player.setCurrentRail(e);
|
1261 |
-
}, false);
|
1262 |
-
|
1263 |
-
|
1264 |
-
// store for later use
|
1265 |
-
t.loaded = loaded;
|
1266 |
-
t.total = total;
|
1267 |
-
t.current = current;
|
1268 |
-
t.handle = handle;
|
1269 |
-
},
|
1270 |
-
setProgressRail: function(e) {
|
1271 |
-
|
1272 |
-
var
|
1273 |
-
t = this,
|
1274 |
-
target = (e != undefined) ? e.target : t.media,
|
1275 |
-
percent = null;
|
1276 |
-
|
1277 |
-
// newest HTML5 spec has buffered array (FF4, Webkit)
|
1278 |
-
if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
|
1279 |
-
// TODO: account for a real array with multiple values (only Firefox 4 has this so far)
|
1280 |
-
percent = target.buffered.end(0) / target.duration;
|
1281 |
-
}
|
1282 |
-
// Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
|
1283 |
-
// to be anything other than 0. If the byte count is available we use this instead.
|
1284 |
-
// Browsers that support the else if do not seem to have the bufferedBytes value and
|
1285 |
-
// should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8.
|
1286 |
-
else if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
|
1287 |
-
percent = target.bufferedBytes / target.bytesTotal;
|
1288 |
-
}
|
1289 |
-
// Firefox 3 with an Ogg file seems to go this way
|
1290 |
-
else if (e && e.lengthComputable && e.total != 0) {
|
1291 |
-
percent = e.loaded/e.total;
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
// finally update the progress bar
|
1295 |
-
if (percent !== null) {
|
1296 |
-
percent = Math.min(1, Math.max(0, percent));
|
1297 |
-
// update loaded bar
|
1298 |
-
if (t.loaded && t.total) {
|
1299 |
-
t.loaded.width(t.total.width() * percent);
|
1300 |
-
}
|
1301 |
-
}
|
1302 |
-
},
|
1303 |
-
setCurrentRail: function() {
|
1304 |
-
|
1305 |
-
var t = this;
|
1306 |
-
|
1307 |
-
if (t.media.currentTime != undefined && t.media.duration) {
|
1308 |
-
|
1309 |
-
// update bar and handle
|
1310 |
-
if (t.total && t.handle) {
|
1311 |
-
var
|
1312 |
-
newWidth = t.total.width() * t.media.currentTime / t.media.duration,
|
1313 |
-
handlePos = newWidth - (t.handle.outerWidth(true) / 2);
|
1314 |
-
|
1315 |
-
t.current.width(newWidth);
|
1316 |
-
t.handle.css('left', handlePos);
|
1317 |
-
}
|
1318 |
-
}
|
1319 |
-
|
1320 |
-
}
|
1321 |
-
});
|
1322 |
-
})(mejs.$);
|
1323 |
-
(function($) {
|
1324 |
-
|
1325 |
-
// options
|
1326 |
-
$.extend(mejs.MepDefaults, {
|
1327 |
-
duration: -1,
|
1328 |
-
timeAndDurationSeparator: ' <span> | </span> '
|
1329 |
-
});
|
1330 |
-
|
1331 |
-
|
1332 |
-
// current and duration 00:00 / 00:00
|
1333 |
-
$.extend(MediaElementPlayer.prototype, {
|
1334 |
-
buildcurrent: function(player, controls, layers, media) {
|
1335 |
-
var t = this;
|
1336 |
-
|
1337 |
-
$('<div class="mejs-time">'+
|
1338 |
-
'<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '')
|
1339 |
-
+ (player.options.showTimecodeFrameCount? '00:00:00':'00:00')+ '</span>'+
|
1340 |
-
'</div>')
|
1341 |
-
.appendTo(controls);
|
1342 |
-
|
1343 |
-
t.currenttime = t.controls.find('.mejs-currenttime');
|
1344 |
-
|
1345 |
-
media.addEventListener('timeupdate',function() {
|
1346 |
-
player.updateCurrent();
|
1347 |
-
}, false);
|
1348 |
-
},
|
1349 |
-
|
1350 |
-
|
1351 |
-
buildduration: function(player, controls, layers, media) {
|
1352 |
-
var t = this;
|
1353 |
-
|
1354 |
-
if (controls.children().last().find('.mejs-currenttime').length > 0) {
|
1355 |
-
$(t.options.timeAndDurationSeparator +
|
1356 |
-
'<span class="mejs-duration">' +
|
1357 |
-
(t.options.duration > 0 ?
|
1358 |
-
mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :
|
1359 |
-
((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00'))
|
1360 |
-
) +
|
1361 |
-
'</span>')
|
1362 |
-
.appendTo(controls.find('.mejs-time'));
|
1363 |
-
} else {
|
1364 |
-
|
1365 |
-
// add class to current time
|
1366 |
-
controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container');
|
1367 |
-
|
1368 |
-
$('<div class="mejs-time mejs-duration-container">'+
|
1369 |
-
'<span class="mejs-duration">' +
|
1370 |
-
(t.options.duration > 0 ?
|
1371 |
-
mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) :
|
1372 |
-
((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00'))
|
1373 |
-
) +
|
1374 |
-
'</span>' +
|
1375 |
-
'</div>')
|
1376 |
-
.appendTo(controls);
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
t.durationD = t.controls.find('.mejs-duration');
|
1380 |
-
|
1381 |
-
media.addEventListener('timeupdate',function() {
|
1382 |
-
player.updateDuration();
|
1383 |
-
}, false);
|
1384 |
-
},
|
1385 |
-
|
1386 |
-
updateCurrent: function() {
|
1387 |
-
var t = this;
|
1388 |
-
|
1389 |
-
if (t.currenttime) {
|
1390 |
-
t.currenttime.html(mejs.Utility.secondsToTimeCode(t.media.currentTime, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25));
|
1391 |
-
}
|
1392 |
-
},
|
1393 |
-
|
1394 |
-
updateDuration: function() {
|
1395 |
-
var t = this;
|
1396 |
-
|
1397 |
-
if (t.media.duration && t.durationD) {
|
1398 |
-
t.durationD.html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25));
|
1399 |
-
}
|
1400 |
-
}
|
1401 |
-
});
|
1402 |
-
|
1403 |
-
})(mejs.$);
|
1404 |
-
(function($) {
|
1405 |
-
|
1406 |
-
$.extend(mejs.MepDefaults, {
|
1407 |
-
muteText: 'Mute Toggle',
|
1408 |
-
hideVolumeOnTouchDevices: true,
|
1409 |
-
|
1410 |
-
audioVolume: 'horizontal',
|
1411 |
-
videoVolume: 'vertical'
|
1412 |
-
});
|
1413 |
-
|
1414 |
-
$.extend(MediaElementPlayer.prototype, {
|
1415 |
-
buildvolume: function(player, controls, layers, media) {
|
1416 |
-
|
1417 |
-
// Android and iOS don't support volume controls
|
1418 |
-
if (mejs.MediaFeatures.hasTouch && this.options.hideVolumeOnTouchDevices)
|
1419 |
-
return;
|
1420 |
-
|
1421 |
-
var t = this,
|
1422 |
-
mode = (t.isVideo) ? t.options.videoVolume : t.options.audioVolume,
|
1423 |
-
mute = (mode == 'horizontal') ?
|
1424 |
-
|
1425 |
-
// horizontal version
|
1426 |
-
$('<div class="mejs-button mejs-volume-button mejs-mute">'+
|
1427 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
|
1428 |
-
'</div>' +
|
1429 |
-
'<div class="mejs-horizontal-volume-slider">'+ // outer background
|
1430 |
-
'<div class="mejs-horizontal-volume-total"></div>'+ // line background
|
1431 |
-
'<div class="mejs-horizontal-volume-current"></div>'+ // current volume
|
1432 |
-
'<div class="mejs-horizontal-volume-handle"></div>'+ // handle
|
1433 |
-
'</div>'
|
1434 |
-
)
|
1435 |
-
.appendTo(controls) :
|
1436 |
-
|
1437 |
-
// vertical version
|
1438 |
-
$('<div class="mejs-button mejs-volume-button mejs-mute">'+
|
1439 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+
|
1440 |
-
'<div class="mejs-volume-slider">'+ // outer background
|
1441 |
-
'<div class="mejs-volume-total"></div>'+ // line background
|
1442 |
-
'<div class="mejs-volume-current"></div>'+ // current volume
|
1443 |
-
'<div class="mejs-volume-handle"></div>'+ // handle
|
1444 |
-
'</div>'+
|
1445 |
-
'</div>')
|
1446 |
-
.appendTo(controls),
|
1447 |
-
volumeSlider = t.container.find('.mejs-volume-slider, .mejs-horizontal-volume-slider'),
|
1448 |
-
volumeTotal = t.container.find('.mejs-volume-total, .mejs-horizontal-volume-total'),
|
1449 |
-
volumeCurrent = t.container.find('.mejs-volume-current, .mejs-horizontal-volume-current'),
|
1450 |
-
volumeHandle = t.container.find('.mejs-volume-handle, .mejs-horizontal-volume-handle'),
|
1451 |
-
|
1452 |
-
positionVolumeHandle = function(volume, secondTry) {
|
1453 |
-
|
1454 |
-
if (!volumeSlider.is(':visible') && typeof secondTry != 'undefined') {
|
1455 |
-
volumeSlider.show();
|
1456 |
-
positionVolumeHandle(volume, true);
|
1457 |
-
volumeSlider.hide()
|
1458 |
-
return;
|
1459 |
-
}
|
1460 |
-
|
1461 |
-
// correct to 0-1
|
1462 |
-
volume = Math.max(0,volume);
|
1463 |
-
volume = Math.min(volume,1);
|
1464 |
-
|
1465 |
-
// ajust mute button style
|
1466 |
-
if (volume == 0) {
|
1467 |
-
mute.removeClass('mejs-mute').addClass('mejs-unmute');
|
1468 |
-
} else {
|
1469 |
-
mute.removeClass('mejs-unmute').addClass('mejs-mute');
|
1470 |
-
}
|
1471 |
-
|
1472 |
-
// position slider
|
1473 |
-
if (mode == 'vertical') {
|
1474 |
-
var
|
1475 |
-
|
1476 |
-
// height of the full size volume slider background
|
1477 |
-
totalHeight = volumeTotal.height(),
|
1478 |
-
|
1479 |
-
// top/left of full size volume slider background
|
1480 |
-
totalPosition = volumeTotal.position(),
|
1481 |
-
|
1482 |
-
// the new top position based on the current volume
|
1483 |
-
// 70% volume on 100px height == top:30px
|
1484 |
-
newTop = totalHeight - (totalHeight * volume);
|
1485 |
-
|
1486 |
-
// handle
|
1487 |
-
volumeHandle.css('top', totalPosition.top + newTop - (volumeHandle.height() / 2));
|
1488 |
-
|
1489 |
-
// show the current visibility
|
1490 |
-
volumeCurrent.height(totalHeight - newTop );
|
1491 |
-
volumeCurrent.css('top', totalPosition.top + newTop);
|
1492 |
-
} else {
|
1493 |
-
var
|
1494 |
-
|
1495 |
-
// height of the full size volume slider background
|
1496 |
-
totalWidth = volumeTotal.width(),
|
1497 |
-
|
1498 |
-
// top/left of full size volume slider background
|
1499 |
-
totalPosition = volumeTotal.position(),
|
1500 |
-
|
1501 |
-
// the new left position based on the current volume
|
1502 |
-
newLeft = totalWidth * volume;
|
1503 |
-
|
1504 |
-
// handle
|
1505 |
-
volumeHandle.css('left', totalPosition.left + newLeft - (volumeHandle.width() / 2));
|
1506 |
-
|
1507 |
-
// rezize the current part of the volume bar
|
1508 |
-
volumeCurrent.width( newLeft );
|
1509 |
-
}
|
1510 |
-
},
|
1511 |
-
handleVolumeMove = function(e) {
|
1512 |
-
|
1513 |
-
var volume = null,
|
1514 |
-
totalOffset = volumeTotal.offset();
|
1515 |
-
|
1516 |
-
// calculate the new volume based on the moust position
|
1517 |
-
if (mode == 'vertical') {
|
1518 |
-
|
1519 |
-
var
|
1520 |
-
railHeight = volumeTotal.height(),
|
1521 |
-
totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10),
|
1522 |
-
newY = e.pageY - totalOffset.top;
|
1523 |
-
|
1524 |
-
volume = (railHeight - newY) / railHeight;
|
1525 |
-
|
1526 |
-
// the controls just hide themselves (usually when mouse moves too far up)
|
1527 |
-
if (totalOffset.top == 0 || totalOffset.left == 0)
|
1528 |
-
return;
|
1529 |
-
|
1530 |
-
} else {
|
1531 |
-
var
|
1532 |
-
railWidth = volumeTotal.width(),
|
1533 |
-
newX = e.pageX - totalOffset.left;
|
1534 |
-
|
1535 |
-
volume = newX / railWidth;
|
1536 |
-
}
|
1537 |
-
|
1538 |
-
// ensure the volume isn't outside 0-1
|
1539 |
-
volume = Math.max(0,volume);
|
1540 |
-
volume = Math.min(volume,1);
|
1541 |
-
|
1542 |
-
// position the slider and handle
|
1543 |
-
positionVolumeHandle(volume);
|
1544 |
-
|
1545 |
-
// set the media object (this will trigger the volumechanged event)
|
1546 |
-
if (volume == 0) {
|
1547 |
-
media.setMuted(true);
|
1548 |
-
} else {
|
1549 |
-
media.setMuted(false);
|
1550 |
-
}
|
1551 |
-
media.setVolume(volume);
|
1552 |
-
},
|
1553 |
-
mouseIsDown = false,
|
1554 |
-
mouseIsOver = false;
|
1555 |
-
|
1556 |
-
// SLIDER
|
1557 |
-
|
1558 |
-
mute
|
1559 |
-
.hover(function() {
|
1560 |
-
volumeSlider.show();
|
1561 |
-
mouseIsOver = true;
|
1562 |
-
}, function() {
|
1563 |
-
mouseIsOver = false;
|
1564 |
-
|
1565 |
-
if (!mouseIsDown && mode == 'vertical') {
|
1566 |
-
volumeSlider.hide();
|
1567 |
-
}
|
1568 |
-
});
|
1569 |
-
|
1570 |
-
volumeSlider
|
1571 |
-
.bind('mouseover', function() {
|
1572 |
-
mouseIsOver = true;
|
1573 |
-
})
|
1574 |
-
.bind('mousedown', function (e) {
|
1575 |
-
handleVolumeMove(e);
|
1576 |
-
$(document)
|
1577 |
-
.bind('mousemove.vol', function(e) {
|
1578 |
-
handleVolumeMove(e);
|
1579 |
-
})
|
1580 |
-
.bind('mouseup.vol', function () {
|
1581 |
-
mouseIsDown = false;
|
1582 |
-
$(document).unbind('.vol');
|
1583 |
-
|
1584 |
-
if (!mouseIsOver && mode == 'vertical') {
|
1585 |
-
volumeSlider.hide();
|
1586 |
-
}
|
1587 |
-
});
|
1588 |
-
mouseIsDown = true;
|
1589 |
-
|
1590 |
-
return false;
|
1591 |
-
});
|
1592 |
-
|
1593 |
-
|
1594 |
-
// MUTE button
|
1595 |
-
mute.find('button').click(function() {
|
1596 |
-
media.setMuted( !media.muted );
|
1597 |
-
});
|
1598 |
-
|
1599 |
-
// listen for volume change events from other sources
|
1600 |
-
media.addEventListener('volumechange', function(e) {
|
1601 |
-
if (!mouseIsDown) {
|
1602 |
-
if (media.muted) {
|
1603 |
-
positionVolumeHandle(0);
|
1604 |
-
mute.removeClass('mejs-mute').addClass('mejs-unmute');
|
1605 |
-
} else {
|
1606 |
-
positionVolumeHandle(media.volume);
|
1607 |
-
mute.removeClass('mejs-unmute').addClass('mejs-mute');
|
1608 |
-
}
|
1609 |
-
}
|
1610 |
-
}, false);
|
1611 |
-
|
1612 |
-
if (t.container.is(':visible')) {
|
1613 |
-
// set initial volume
|
1614 |
-
positionVolumeHandle(player.options.startVolume);
|
1615 |
-
|
1616 |
-
// shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements
|
1617 |
-
if (media.pluginType === 'native') {
|
1618 |
-
media.setVolume(player.options.startVolume);
|
1619 |
-
}
|
1620 |
-
}
|
1621 |
-
}
|
1622 |
-
});
|
1623 |
-
|
1624 |
-
})(mejs.$);
|
1625 |
-
|
1626 |
-
(function($) {
|
1627 |
-
|
1628 |
-
$.extend(mejs.MepDefaults, {
|
1629 |
-
usePluginFullScreen: true,
|
1630 |
-
newWindowCallback: function() { return '';},
|
1631 |
-
fullscreenText: 'Fullscreen'
|
1632 |
-
});
|
1633 |
-
|
1634 |
-
$.extend(MediaElementPlayer.prototype, {
|
1635 |
-
|
1636 |
-
isFullScreen: false,
|
1637 |
-
|
1638 |
-
isNativeFullScreen: false,
|
1639 |
-
|
1640 |
-
docStyleOverflow: null,
|
1641 |
-
|
1642 |
-
isInIframe: false,
|
1643 |
-
|
1644 |
-
buildfullscreen: function(player, controls, layers, media) {
|
1645 |
-
|
1646 |
-
if (!player.isVideo)
|
1647 |
-
return;
|
1648 |
-
|
1649 |
-
player.isInIframe = (window.location != window.parent.location);
|
1650 |
-
|
1651 |
-
// native events
|
1652 |
-
if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
1653 |
-
|
1654 |
-
// chrome doesn't alays fire this in an iframe
|
1655 |
-
var target = null;
|
1656 |
-
|
1657 |
-
if (mejs.MediaFeatures.hasMozNativeFullScreen) {
|
1658 |
-
target = $(document);
|
1659 |
-
} else {
|
1660 |
-
target = player.container;
|
1661 |
-
}
|
1662 |
-
|
1663 |
-
target.bind(mejs.MediaFeatures.fullScreenEventName, function(e) {
|
1664 |
-
//player.container.bind('webkitfullscreenchange', function(e) {
|
1665 |
-
|
1666 |
-
|
1667 |
-
if (mejs.MediaFeatures.isFullScreen()) {
|
1668 |
-
player.isNativeFullScreen = true;
|
1669 |
-
// reset the controls once we are fully in full screen
|
1670 |
-
player.setControlsSize();
|
1671 |
-
} else {
|
1672 |
-
player.isNativeFullScreen = false;
|
1673 |
-
// when a user presses ESC
|
1674 |
-
// make sure to put the player back into place
|
1675 |
-
player.exitFullScreen();
|
1676 |
-
}
|
1677 |
-
});
|
1678 |
-
}
|
1679 |
-
|
1680 |
-
var t = this,
|
1681 |
-
normalHeight = 0,
|
1682 |
-
normalWidth = 0,
|
1683 |
-
container = player.container,
|
1684 |
-
fullscreenBtn =
|
1685 |
-
$('<div class="mejs-button mejs-fullscreen-button">' +
|
1686 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.fullscreenText + '"></button>' +
|
1687 |
-
'</div>')
|
1688 |
-
.appendTo(controls);
|
1689 |
-
|
1690 |
-
if (t.media.pluginType === 'native' || (!t.options.usePluginFullScreen && !mejs.MediaFeatures.isFirefox)) {
|
1691 |
-
|
1692 |
-
fullscreenBtn.click(function() {
|
1693 |
-
var isFullScreen = (mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || player.isFullScreen;
|
1694 |
-
|
1695 |
-
if (isFullScreen) {
|
1696 |
-
player.exitFullScreen();
|
1697 |
-
} else {
|
1698 |
-
player.enterFullScreen();
|
1699 |
-
}
|
1700 |
-
});
|
1701 |
-
|
1702 |
-
} else {
|
1703 |
-
|
1704 |
-
var hideTimeout = null,
|
1705 |
-
supportsPointerEvents = (function() {
|
1706 |
-
// TAKEN FROM MODERNIZR
|
1707 |
-
var element = document.createElement('x'),
|
1708 |
-
documentElement = document.documentElement,
|
1709 |
-
getComputedStyle = window.getComputedStyle,
|
1710 |
-
supports;
|
1711 |
-
if(!('pointerEvents' in element.style)){
|
1712 |
-
return false;
|
1713 |
-
}
|
1714 |
-
element.style.pointerEvents = 'auto';
|
1715 |
-
element.style.pointerEvents = 'x';
|
1716 |
-
documentElement.appendChild(element);
|
1717 |
-
supports = getComputedStyle &&
|
1718 |
-
getComputedStyle(element, '').pointerEvents === 'auto';
|
1719 |
-
documentElement.removeChild(element);
|
1720 |
-
return !!supports;
|
1721 |
-
})();
|
1722 |
-
|
1723 |
-
console.log('supportsPointerEvents', supportsPointerEvents);
|
1724 |
-
|
1725 |
-
if (supportsPointerEvents && !mejs.MediaFeatures.isOpera) { // opera doesn't allow this :(
|
1726 |
-
|
1727 |
-
// allows clicking through the fullscreen button and controls down directly to Flash
|
1728 |
-
|
1729 |
-
/*
|
1730 |
-
When a user puts his mouse over the fullscreen button, the controls are disabled
|
1731 |
-
So we put a div over the video and another one on iether side of the fullscreen button
|
1732 |
-
that caputre mouse movement
|
1733 |
-
and restore the controls once the mouse moves outside of the fullscreen button
|
1734 |
-
*/
|
1735 |
-
|
1736 |
-
var fullscreenIsDisabled = false,
|
1737 |
-
restoreControls = function() {
|
1738 |
-
if (fullscreenIsDisabled) {
|
1739 |
-
// hide the hovers
|
1740 |
-
videoHoverDiv.hide();
|
1741 |
-
controlsLeftHoverDiv.hide();
|
1742 |
-
controlsRightHoverDiv.hide();
|
1743 |
-
|
1744 |
-
// restore the control bar
|
1745 |
-
fullscreenBtn.css('pointer-events', '');
|
1746 |
-
t.controls.css('pointer-events', '');
|
1747 |
-
|
1748 |
-
// store for later
|
1749 |
-
fullscreenIsDisabled = false;
|
1750 |
-
}
|
1751 |
-
},
|
1752 |
-
videoHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
|
1753 |
-
controlsLeftHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
|
1754 |
-
controlsRightHoverDiv = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls),
|
1755 |
-
positionHoverDivs = function() {
|
1756 |
-
var style = {position: 'absolute', top: 0, left: 0}; //, backgroundColor: '#f00'};
|
1757 |
-
videoHoverDiv.css(style);
|
1758 |
-
controlsLeftHoverDiv.css(style);
|
1759 |
-
controlsRightHoverDiv.css(style);
|
1760 |
-
|
1761 |
-
// over video, but not controls
|
1762 |
-
videoHoverDiv
|
1763 |
-
.width( t.container.width() )
|
1764 |
-
.height( t.container.height() - t.controls.height() );
|
1765 |
-
|
1766 |
-
// over controls, but not the fullscreen button
|
1767 |
-
var fullScreenBtnOffset = fullscreenBtn.offset().left - t.container.offset().left;
|
1768 |
-
fullScreenBtnWidth = fullscreenBtn.outerWidth(true);
|
1769 |
-
|
1770 |
-
controlsLeftHoverDiv
|
1771 |
-
.width( fullScreenBtnOffset )
|
1772 |
-
.height( t.controls.height() )
|
1773 |
-
.css({top: t.container.height() - t.controls.height()});
|
1774 |
-
|
1775 |
-
// after the fullscreen button
|
1776 |
-
controlsRightHoverDiv
|
1777 |
-
.width( t.container.width() - fullScreenBtnOffset - fullScreenBtnWidth )
|
1778 |
-
.height( t.controls.height() )
|
1779 |
-
.css({top: t.container.height() - t.controls.height(),
|
1780 |
-
left: fullScreenBtnOffset + fullScreenBtnWidth});
|
1781 |
-
};
|
1782 |
-
|
1783 |
-
$(document).resize(function() {
|
1784 |
-
positionHoverDivs();
|
1785 |
-
});
|
1786 |
-
|
1787 |
-
// on hover, kill the fullscreen button's HTML handling, allowing clicks down to Flash
|
1788 |
-
fullscreenBtn
|
1789 |
-
.mouseover(function() {
|
1790 |
-
|
1791 |
-
if (!t.isFullScreen) {
|
1792 |
-
|
1793 |
-
var buttonPos = fullscreenBtn.offset(),
|
1794 |
-
containerPos = player.container.offset();
|
1795 |
-
|
1796 |
-
// move the button in Flash into place
|
1797 |
-
media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, false);
|
1798 |
-
|
1799 |
-
// allows click through
|
1800 |
-
fullscreenBtn.css('pointer-events', 'none');
|
1801 |
-
t.controls.css('pointer-events', 'none');
|
1802 |
-
|
1803 |
-
// show the divs that will restore things
|
1804 |
-
videoHoverDiv.show();
|
1805 |
-
controlsRightHoverDiv.show();
|
1806 |
-
controlsLeftHoverDiv.show();
|
1807 |
-
positionHoverDivs();
|
1808 |
-
|
1809 |
-
fullscreenIsDisabled = true;
|
1810 |
-
}
|
1811 |
-
|
1812 |
-
});
|
1813 |
-
|
1814 |
-
// restore controls anytime the user enters or leaves fullscreen
|
1815 |
-
media.addEventListener('fullscreenchange', function(e) {
|
1816 |
-
restoreControls();
|
1817 |
-
});
|
1818 |
-
|
1819 |
-
|
1820 |
-
// the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events
|
1821 |
-
// so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button
|
1822 |
-
/*
|
1823 |
-
$(document).mousemove(function(e) {
|
1824 |
-
|
1825 |
-
// if the mouse is anywhere but the fullsceen button, then restore it all
|
1826 |
-
if (fullscreenIsDisabled) {
|
1827 |
-
|
1828 |
-
var fullscreenBtnPos = fullscreenBtn.offset();
|
1829 |
-
|
1830 |
-
|
1831 |
-
if (e.pageY < fullscreenBtnPos.top || e.pageY > fullscreenBtnPos.top + fullscreenBtn.outerHeight(true) ||
|
1832 |
-
e.pageX < fullscreenBtnPos.left || e.pageX > fullscreenBtnPos.left + fullscreenBtn.outerWidth(true)
|
1833 |
-
) {
|
1834 |
-
|
1835 |
-
fullscreenBtn.css('pointer-events', '');
|
1836 |
-
t.controls.css('pointer-events', '');
|
1837 |
-
|
1838 |
-
fullscreenIsDisabled = false;
|
1839 |
-
}
|
1840 |
-
}
|
1841 |
-
});
|
1842 |
-
*/
|
1843 |
-
|
1844 |
-
|
1845 |
-
} else {
|
1846 |
-
|
1847 |
-
// the hover state will show the fullscreen button in Flash to hover up and click
|
1848 |
-
|
1849 |
-
fullscreenBtn
|
1850 |
-
.mouseover(function() {
|
1851 |
-
|
1852 |
-
if (hideTimeout !== null) {
|
1853 |
-
clearTimeout(hideTimeout);
|
1854 |
-
delete hideTimeout;
|
1855 |
-
}
|
1856 |
-
|
1857 |
-
var buttonPos = fullscreenBtn.offset(),
|
1858 |
-
containerPos = player.container.offset();
|
1859 |
-
|
1860 |
-
media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, true);
|
1861 |
-
|
1862 |
-
})
|
1863 |
-
.mouseout(function() {
|
1864 |
-
|
1865 |
-
if (hideTimeout !== null) {
|
1866 |
-
clearTimeout(hideTimeout);
|
1867 |
-
delete hideTimeout;
|
1868 |
-
}
|
1869 |
-
|
1870 |
-
hideTimeout = setTimeout(function() {
|
1871 |
-
media.hideFullscreenButton();
|
1872 |
-
}, 1500);
|
1873 |
-
|
1874 |
-
|
1875 |
-
});
|
1876 |
-
}
|
1877 |
-
}
|
1878 |
-
|
1879 |
-
player.fullscreenBtn = fullscreenBtn;
|
1880 |
-
|
1881 |
-
$(document).bind('keydown',function (e) {
|
1882 |
-
if (((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen) && e.keyCode == 27) {
|
1883 |
-
player.exitFullScreen();
|
1884 |
-
}
|
1885 |
-
});
|
1886 |
-
|
1887 |
-
},
|
1888 |
-
enterFullScreen: function() {
|
1889 |
-
|
1890 |
-
var t = this;
|
1891 |
-
|
1892 |
-
// firefox+flash can't adjust plugin sizes without resetting :(
|
1893 |
-
if (t.media.pluginType !== 'native' && (mejs.MediaFeatures.isFirefox || t.options.usePluginFullScreen)) {
|
1894 |
-
//t.media.setFullscreen(true);
|
1895 |
-
//player.isFullScreen = true;
|
1896 |
-
return;
|
1897 |
-
}
|
1898 |
-
|
1899 |
-
// store overflow
|
1900 |
-
docStyleOverflow = document.documentElement.style.overflow;
|
1901 |
-
// set it to not show scroll bars so 100% will work
|
1902 |
-
document.documentElement.style.overflow = 'hidden';
|
1903 |
-
|
1904 |
-
// store sizing
|
1905 |
-
normalHeight = t.container.height();
|
1906 |
-
normalWidth = t.container.width();
|
1907 |
-
|
1908 |
-
// attempt to do true fullscreen (Safari 5.1 and Firefox Nightly only for now)
|
1909 |
-
if (t.media.pluginType === 'native') {
|
1910 |
-
if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
1911 |
-
|
1912 |
-
mejs.MediaFeatures.requestFullScreen(t.container[0]);
|
1913 |
-
//return;
|
1914 |
-
|
1915 |
-
if (t.isInIframe) {
|
1916 |
-
// sometimes exiting from fullscreen doesn't work
|
1917 |
-
// notably in Chrome <iframe>. Fixed in version 17
|
1918 |
-
setTimeout(function checkFullscreen() {
|
1919 |
-
|
1920 |
-
if (t.isNativeFullScreen) {
|
1921 |
-
|
1922 |
-
// check if the video is suddenly not really fullscreen
|
1923 |
-
if ($(window).width() !== screen.width) {
|
1924 |
-
// manually exit
|
1925 |
-
t.exitFullScreen();
|
1926 |
-
} else {
|
1927 |
-
// test again
|
1928 |
-
setTimeout(checkFullscreen, 500);
|
1929 |
-
}
|
1930 |
-
}
|
1931 |
-
|
1932 |
-
|
1933 |
-
}, 500);
|
1934 |
-
}
|
1935 |
-
|
1936 |
-
} else if (mejs.MediaFeatures.hasSemiNativeFullScreen) {
|
1937 |
-
t.media.webkitEnterFullscreen();
|
1938 |
-
return;
|
1939 |
-
}
|
1940 |
-
}
|
1941 |
-
|
1942 |
-
// check for iframe launch
|
1943 |
-
if (t.isInIframe) {
|
1944 |
-
var url = t.options.newWindowCallback(this);
|
1945 |
-
|
1946 |
-
|
1947 |
-
if (url !== '') {
|
1948 |
-
|
1949 |
-
// launch immediately
|
1950 |
-
if (!mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
1951 |
-
t.pause();
|
1952 |
-
window.open(url, t.id, 'top=0,left=0,width=' + screen.availWidth + ',height=' + screen.availHeight + ',resizable=yes,scrollbars=no,status=no,toolbar=no');
|
1953 |
-
return;
|
1954 |
-
} else {
|
1955 |
-
setTimeout(function() {
|
1956 |
-
if (!t.isNativeFullScreen) {
|
1957 |
-
t.pause();
|
1958 |
-
window.open(url, t.id, 'top=0,left=0,width=' + screen.availWidth + ',height=' + screen.availHeight + ',resizable=yes,scrollbars=no,status=no,toolbar=no');
|
1959 |
-
}
|
1960 |
-
}, 250);
|
1961 |
-
}
|
1962 |
-
}
|
1963 |
-
|
1964 |
-
}
|
1965 |
-
|
1966 |
-
// full window code
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
// make full size
|
1971 |
-
t.container
|
1972 |
-
.addClass('mejs-container-fullscreen')
|
1973 |
-
.width('100%')
|
1974 |
-
.height('100%');
|
1975 |
-
//.css({position: 'fixed', left: 0, top: 0, right: 0, bottom: 0, overflow: 'hidden', width: '100%', height: '100%', 'z-index': 1000});
|
1976 |
-
|
1977 |
-
// Only needed for safari 5.1 native full screen, can cause display issues elsewhere
|
1978 |
-
// Actually, it seems to be needed for IE8, too
|
1979 |
-
//if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
1980 |
-
setTimeout(function() {
|
1981 |
-
t.container.css({width: '100%', height: '100%'});
|
1982 |
-
t.setControlsSize();
|
1983 |
-
}, 500);
|
1984 |
-
//}
|
1985 |
-
|
1986 |
-
if (t.pluginType === 'native') {
|
1987 |
-
t.$media
|
1988 |
-
.width('100%')
|
1989 |
-
.height('100%');
|
1990 |
-
} else {
|
1991 |
-
t.container.find('object, embed, iframe')
|
1992 |
-
.width('100%')
|
1993 |
-
.height('100%');
|
1994 |
-
|
1995 |
-
//if (!mejs.MediaFeatures.hasTrueNativeFullScreen) {
|
1996 |
-
t.media.setVideoSize($(window).width(),$(window).height());
|
1997 |
-
//}
|
1998 |
-
}
|
1999 |
-
|
2000 |
-
t.layers.children('div')
|
2001 |
-
.width('100%')
|
2002 |
-
.height('100%');
|
2003 |
-
|
2004 |
-
if (t.fullscreenBtn) {
|
2005 |
-
t.fullscreenBtn
|
2006 |
-
.removeClass('mejs-fullscreen')
|
2007 |
-
.addClass('mejs-unfullscreen');
|
2008 |
-
}
|
2009 |
-
|
2010 |
-
t.setControlsSize();
|
2011 |
-
t.isFullScreen = true;
|
2012 |
-
},
|
2013 |
-
|
2014 |
-
exitFullScreen: function() {
|
2015 |
-
|
2016 |
-
var t = this;
|
2017 |
-
|
2018 |
-
// firefox can't adjust plugins
|
2019 |
-
if (t.media.pluginType !== 'native' && mejs.MediaFeatures.isFirefox) {
|
2020 |
-
t.media.setFullscreen(false);
|
2021 |
-
//player.isFullScreen = false;
|
2022 |
-
return;
|
2023 |
-
}
|
2024 |
-
|
2025 |
-
// come outo of native fullscreen
|
2026 |
-
if (mejs.MediaFeatures.hasTrueNativeFullScreen && (mejs.MediaFeatures.isFullScreen() || t.isFullScreen)) {
|
2027 |
-
mejs.MediaFeatures.cancelFullScreen();
|
2028 |
-
}
|
2029 |
-
|
2030 |
-
// restore scroll bars to document
|
2031 |
-
document.documentElement.style.overflow = docStyleOverflow;
|
2032 |
-
|
2033 |
-
t.container
|
2034 |
-
.removeClass('mejs-container-fullscreen')
|
2035 |
-
.width(normalWidth)
|
2036 |
-
.height(normalHeight);
|
2037 |
-
//.css({position: '', left: '', top: '', right: '', bottom: '', overflow: 'inherit', width: normalWidth + 'px', height: normalHeight + 'px', 'z-index': 1});
|
2038 |
-
|
2039 |
-
if (t.pluginType === 'native') {
|
2040 |
-
t.$media
|
2041 |
-
.width(normalWidth)
|
2042 |
-
.height(normalHeight);
|
2043 |
-
} else {
|
2044 |
-
t.container.find('object embed')
|
2045 |
-
.width(normalWidth)
|
2046 |
-
.height(normalHeight);
|
2047 |
-
|
2048 |
-
t.media.setVideoSize(normalWidth, normalHeight);
|
2049 |
-
}
|
2050 |
-
|
2051 |
-
t.layers.children('div')
|
2052 |
-
.width(normalWidth)
|
2053 |
-
.height(normalHeight);
|
2054 |
-
|
2055 |
-
t.fullscreenBtn
|
2056 |
-
.removeClass('mejs-unfullscreen')
|
2057 |
-
.addClass('mejs-fullscreen');
|
2058 |
-
|
2059 |
-
t.setControlsSize();
|
2060 |
-
t.isFullScreen = false;
|
2061 |
-
}
|
2062 |
-
});
|
2063 |
-
|
2064 |
-
})(mejs.$);
|
2065 |
-
|
2066 |
-
(function($) {
|
2067 |
-
|
2068 |
-
// add extra default options
|
2069 |
-
$.extend(mejs.MepDefaults, {
|
2070 |
-
// this will automatically turn on a <track>
|
2071 |
-
startLanguage: '',
|
2072 |
-
|
2073 |
-
tracksText: 'Captions/Subtitles'
|
2074 |
-
});
|
2075 |
-
|
2076 |
-
$.extend(MediaElementPlayer.prototype, {
|
2077 |
-
|
2078 |
-
hasChapters: false,
|
2079 |
-
|
2080 |
-
buildtracks: function(player, controls, layers, media) {
|
2081 |
-
if (!player.isVideo)
|
2082 |
-
return;
|
2083 |
-
|
2084 |
-
if (player.tracks.length == 0)
|
2085 |
-
return;
|
2086 |
-
|
2087 |
-
var t= this, i, options = '';
|
2088 |
-
|
2089 |
-
player.chapters =
|
2090 |
-
$('<div class="mejs-chapters mejs-layer"></div>')
|
2091 |
-
.prependTo(layers).hide();
|
2092 |
-
player.captions =
|
2093 |
-
$('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>')
|
2094 |
-
.prependTo(layers).hide();
|
2095 |
-
player.captionsText = player.captions.find('.mejs-captions-text');
|
2096 |
-
player.captionsButton =
|
2097 |
-
$('<div class="mejs-button mejs-captions-button">'+
|
2098 |
-
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.tracksText + '"></button>'+
|
2099 |
-
'<div class="mejs-captions-selector">'+
|
2100 |
-
'<ul>'+
|
2101 |
-
'<li>'+
|
2102 |
-
'<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' +
|
2103 |
-
'<label for="' + player.id + '_captions_none">None</label>'+
|
2104 |
-
'</li>' +
|
2105 |
-
'</ul>'+
|
2106 |
-
'</div>'+
|
2107 |
-
'</div>')
|
2108 |
-
.appendTo(controls)
|
2109 |
-
|
2110 |
-
// hover
|
2111 |
-
.hover(function() {
|
2112 |
-
$(this).find('.mejs-captions-selector').css('visibility','visible');
|
2113 |
-
}, function() {
|
2114 |
-
$(this).find('.mejs-captions-selector').css('visibility','hidden');
|
2115 |
-
})
|
2116 |
-
|
2117 |
-
// handle clicks to the language radio buttons
|
2118 |
-
.delegate('input[type=radio]','click',function() {
|
2119 |
-
lang = this.value;
|
2120 |
-
|
2121 |
-
if (lang == 'none') {
|
2122 |
-
player.selectedTrack = null;
|
2123 |
-
} else {
|
2124 |
-
for (i=0; i<player.tracks.length; i++) {
|
2125 |
-
if (player.tracks[i].srclang == lang) {
|
2126 |
-
player.selectedTrack = player.tracks[i];
|
2127 |
-
player.captions.attr('lang', player.selectedTrack.srclang);
|
2128 |
-
player.displayCaptions();
|
2129 |
-
break;
|
2130 |
-
}
|
2131 |
-
}
|
2132 |
-
}
|
2133 |
-
});
|
2134 |
-
//.bind('mouseenter', function() {
|
2135 |
-
// player.captionsButton.find('.mejs-captions-selector').css('visibility','visible')
|
2136 |
-
//});
|
2137 |
-
|
2138 |
-
if (!player.options.alwaysShowControls) {
|
2139 |
-
// move with controls
|
2140 |
-
player.container
|
2141 |
-
.bind('mouseenter', function () {
|
2142 |
-
// push captions above controls
|
2143 |
-
player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover');
|
2144 |
-
|
2145 |
-
})
|
2146 |
-
.bind('mouseleave', function () {
|
2147 |
-
if (!media.paused) {
|
2148 |
-
// move back to normal place
|
2149 |
-
player.container.find('.mejs-captions-position').removeClass('mejs-captions-position-hover');
|
2150 |
-
}
|
2151 |
-
});
|
2152 |
-
} else {
|
2153 |
-
player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover');
|
2154 |
-
}
|
2155 |
-
|
2156 |
-
player.trackToLoad = -1;
|
2157 |
-
player.selectedTrack = null;
|
2158 |
-
player.isLoadingTrack = false;
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
// add to list
|
2163 |
-
for (i=0; i<player.tracks.length; i++) {
|
2164 |
-
if (player.tracks[i].kind == 'subtitles') {
|
2165 |
-
player.addTrackButton(player.tracks[i].srclang, player.tracks[i].label);
|
2166 |
-
}
|
2167 |
-
}
|
2168 |
-
|
2169 |
-
player.loadNextTrack();
|
2170 |
-
|
2171 |
-
|
2172 |
-
media.addEventListener('timeupdate',function(e) {
|
2173 |
-
player.displayCaptions();
|
2174 |
-
}, false);
|
2175 |
-
|
2176 |
-
media.addEventListener('loadedmetadata', function(e) {
|
2177 |
-
player.displayChapters();
|
2178 |
-
}, false);
|
2179 |
-
|
2180 |
-
player.container.hover(
|
2181 |
-
function () {
|
2182 |
-
// chapters
|
2183 |
-
if (player.hasChapters) {
|
2184 |
-
player.chapters.css('visibility','visible');
|
2185 |
-
player.chapters.fadeIn(200).height(player.chapters.find('.mejs-chapter').outerHeight());
|
2186 |
-
}
|
2187 |
-
},
|
2188 |
-
function () {
|
2189 |
-
if (player.hasChapters && !media.paused) {
|
2190 |
-
player.chapters.fadeOut(200, function() {
|
2191 |
-
$(this).css('visibility','hidden');
|
2192 |
-
$(this).css('display','block');
|
2193 |
-
});
|
2194 |
-
}
|
2195 |
-
});
|
2196 |
-
|
2197 |
-
// check for autoplay
|
2198 |
-
if (player.node.getAttribute('autoplay') !== null) {
|
2199 |
-
player.chapters.css('visibility','hidden');
|
2200 |
-
}
|
2201 |
-
},
|
2202 |
-
|
2203 |
-
loadNextTrack: function() {
|
2204 |
-
var t = this;
|
2205 |
-
|
2206 |
-
t.trackToLoad++;
|
2207 |
-
if (t.trackToLoad < t.tracks.length) {
|
2208 |
-
t.isLoadingTrack = true;
|
2209 |
-
t.loadTrack(t.trackToLoad);
|
2210 |
-
} else {
|
2211 |
-
// add done?
|
2212 |
-
t.isLoadingTrack = false;
|
2213 |
-
}
|
2214 |
-
},
|
2215 |
-
|
2216 |
-
loadTrack: function(index){
|
2217 |
-
var
|
2218 |
-
t = this,
|
2219 |
-
track = t.tracks[index],
|
2220 |
-
after = function() {
|
2221 |
-
|
2222 |
-
track.isLoaded = true;
|
2223 |
-
|
2224 |
-
// create button
|
2225 |
-
//t.addTrackButton(track.srclang);
|
2226 |
-
t.enableTrackButton(track.srclang, track.label);
|
2227 |
-
|
2228 |
-
t.loadNextTrack();
|
2229 |
-
|
2230 |
-
};
|
2231 |
-
|
2232 |
-
if (track.isTranslation) {
|
2233 |
-
|
2234 |
-
// translate the first track
|
2235 |
-
mejs.TrackFormatParser.translateTrackText(t.tracks[0].entries, t.tracks[0].srclang, track.srclang, t.options.googleApiKey, function(newOne) {
|
2236 |
-
|
2237 |
-
// store the new translation
|
2238 |
-
track.entries = newOne;
|
2239 |
-
|
2240 |
-
after();
|
2241 |
-
});
|
2242 |
-
|
2243 |
-
} else {
|
2244 |
-
$.ajax({
|
2245 |
-
url: track.src,
|
2246 |
-
success: function(d) {
|
2247 |
-
|
2248 |
-
// parse the loaded file
|
2249 |
-
track.entries = mejs.TrackFormatParser.parse(d);
|
2250 |
-
after();
|
2251 |
-
|
2252 |
-
if (track.kind == 'chapters' && t.media.duration > 0) {
|
2253 |
-
t.drawChapters(track);
|
2254 |
-
}
|
2255 |
-
},
|
2256 |
-
error: function() {
|
2257 |
-
t.loadNextTrack();
|
2258 |
-
}
|
2259 |
-
});
|
2260 |
-
}
|
2261 |
-
},
|
2262 |
-
|
2263 |
-
enableTrackButton: function(lang, label) {
|
2264 |
-
var t = this;
|
2265 |
-
|
2266 |
-
if (label === '') {
|
2267 |
-
label = mejs.language.codes[lang] || lang;
|
2268 |
-
}
|
2269 |
-
|
2270 |
-
t.captionsButton
|
2271 |
-
.find('input[value=' + lang + ']')
|
2272 |
-
.prop('disabled',false)
|
2273 |
-
.siblings('label')
|
2274 |
-
.html( label );
|
2275 |
-
|
2276 |
-
// auto select
|
2277 |
-
if (t.options.startLanguage == lang) {
|
2278 |
-
$('#' + t.id + '_captions_' + lang).click();
|
2279 |
-
}
|
2280 |
-
|
2281 |
-
t.adjustLanguageBox();
|
2282 |
-
},
|
2283 |
-
|
2284 |
-
addTrackButton: function(lang, label) {
|
2285 |
-
var t = this;
|
2286 |
-
if (label === '') {
|
2287 |
-
label = mejs.language.codes[lang] || lang;
|
2288 |
-
}
|
2289 |
-
|
2290 |
-
t.captionsButton.find('ul').append(
|
2291 |
-
$('<li>'+
|
2292 |
-
'<input type="radio" name="' + t.id + '_captions" id="' + t.id + '_captions_' + lang + '" value="' + lang + '" disabled="disabled" />' +
|
2293 |
-
'<label for="' + t.id + '_captions_' + lang + '">' + label + ' (loading)' + '</label>'+
|
2294 |
-
'</li>')
|
2295 |
-
);
|
2296 |
-
|
2297 |
-
t.adjustLanguageBox();
|
2298 |
-
|
2299 |
-
// remove this from the dropdownlist (if it exists)
|
2300 |
-
t.container.find('.mejs-captions-translations option[value=' + lang + ']').remove();
|
2301 |
-
},
|
2302 |
-
|
2303 |
-
adjustLanguageBox:function() {
|
2304 |
-
var t = this;
|
2305 |
-
// adjust the size of the outer box
|
2306 |
-
t.captionsButton.find('.mejs-captions-selector').height(
|
2307 |
-
t.captionsButton.find('.mejs-captions-selector ul').outerHeight(true) +
|
2308 |
-
t.captionsButton.find('.mejs-captions-translations').outerHeight(true)
|
2309 |
-
);
|
2310 |
-
},
|
2311 |
-
|
2312 |
-
displayCaptions: function() {
|
2313 |
-
|
2314 |
-
if (typeof this.tracks == 'undefined')
|
2315 |
-
return;
|
2316 |
-
|
2317 |
-
var
|
2318 |
-
t = this,
|
2319 |
-
i,
|
2320 |
-
track = t.selectedTrack;
|
2321 |
-
|
2322 |
-
if (track != null && track.isLoaded) {
|
2323 |
-
for (i=0; i<track.entries.times.length; i++) {
|
2324 |
-
if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop){
|
2325 |
-
t.captionsText.html(track.entries.text[i]);
|
2326 |
-
t.captions.show().height(0);
|
2327 |
-
return; // exit out if one is visible;
|
2328 |
-
}
|
2329 |
-
}
|
2330 |
-
t.captions.hide();
|
2331 |
-
} else {
|
2332 |
-
t.captions.hide();
|
2333 |
-
}
|
2334 |
-
},
|
2335 |
-
|
2336 |
-
displayChapters: function() {
|
2337 |
-
var
|
2338 |
-
t = this,
|
2339 |
-
i;
|
2340 |
-
|
2341 |
-
for (i=0; i<t.tracks.length; i++) {
|
2342 |
-
if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) {
|
2343 |
-
t.drawChapters(t.tracks[i]);
|
2344 |
-
t.hasChapters = true;
|
2345 |
-
break;
|
2346 |
-
}
|
2347 |
-
}
|
2348 |
-
},
|
2349 |
-
|
2350 |
-
drawChapters: function(chapters) {
|
2351 |
-
var
|
2352 |
-
t = this,
|
2353 |
-
i,
|
2354 |
-
dur,
|
2355 |
-
//width,
|
2356 |
-
//left,
|
2357 |
-
percent = 0,
|
2358 |
-
usedPercent = 0;
|
2359 |
-
|
2360 |
-
t.chapters.empty();
|
2361 |
-
|
2362 |
-
for (i=0; i<chapters.entries.times.length; i++) {
|
2363 |
-
dur = chapters.entries.times[i].stop - chapters.entries.times[i].start;
|
2364 |
-
percent = Math.floor(dur / t.media.duration * 100);
|
2365 |
-
if (percent + usedPercent > 100 || // too large
|
2366 |
-
i == chapters.entries.times.length-1 && percent + usedPercent < 100) // not going to fill it in
|
2367 |
-
{
|
2368 |
-
percent = 100 - usedPercent;
|
2369 |
-
}
|
2370 |
-
//width = Math.floor(t.width * dur / t.media.duration);
|
2371 |
-
//left = Math.floor(t.width * chapters.entries.times[i].start / t.media.duration);
|
2372 |
-
//if (left + width > t.width) {
|
2373 |
-
// width = t.width - left;
|
2374 |
-
//}
|
2375 |
-
|
2376 |
-
t.chapters.append( $(
|
2377 |
-
'<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' +
|
2378 |
-
'<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' +
|
2379 |
-
'<span class="ch-title">' + chapters.entries.text[i] + '</span>' +
|
2380 |
-
'<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start) + '–' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop) + '</span>' +
|
2381 |
-
'</div>' +
|
2382 |
-
'</div>'));
|
2383 |
-
usedPercent += percent;
|
2384 |
-
}
|
2385 |
-
|
2386 |
-
t.chapters.find('div.mejs-chapter').click(function() {
|
2387 |
-
t.media.setCurrentTime( parseFloat( $(this).attr('rel') ) );
|
2388 |
-
if (t.media.paused) {
|
2389 |
-
t.media.play();
|
2390 |
-
}
|
2391 |
-
});
|
2392 |
-
|
2393 |
-
t.chapters.show();
|
2394 |
-
}
|
2395 |
-
});
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
mejs.language = {
|
2400 |
-
codes: {
|
2401 |
-
af:'Afrikaans',
|
2402 |
-
sq:'Albanian',
|
2403 |
-
ar:'Arabic',
|
2404 |
-
be:'Belarusian',
|
2405 |
-
bg:'Bulgarian',
|
2406 |
-
ca:'Catalan',
|
2407 |
-
zh:'Chinese',
|
2408 |
-
'zh-cn':'Chinese Simplified',
|
2409 |
-
'zh-tw':'Chinese Traditional',
|
2410 |
-
hr:'Croatian',
|
2411 |
-
cs:'Czech',
|
2412 |
-
da:'Danish',
|
2413 |
-
nl:'Dutch',
|
2414 |
-
en:'English',
|
2415 |
-
et:'Estonian',
|
2416 |
-
tl:'Filipino',
|
2417 |
-
fi:'Finnish',
|
2418 |
-
fr:'French',
|
2419 |
-
gl:'Galician',
|
2420 |
-
de:'German',
|
2421 |
-
el:'Greek',
|
2422 |
-
ht:'Haitian Creole',
|
2423 |
-
iw:'Hebrew',
|
2424 |
-
hi:'Hindi',
|
2425 |
-
hu:'Hungarian',
|
2426 |
-
is:'Icelandic',
|
2427 |
-
id:'Indonesian',
|
2428 |
-
ga:'Irish',
|
2429 |
-
it:'Italian',
|
2430 |
-
ja:'Japanese',
|
2431 |
-
ko:'Korean',
|
2432 |
-
lv:'Latvian',
|
2433 |
-
lt:'Lithuanian',
|
2434 |
-
mk:'Macedonian',
|
2435 |
-
ms:'Malay',
|
2436 |
-
mt:'Maltese',
|
2437 |
-
no:'Norwegian',
|
2438 |
-
fa:'Persian',
|
2439 |
-
pl:'Polish',
|
2440 |
-
pt:'Portuguese',
|
2441 |
-
//'pt-pt':'Portuguese (Portugal)',
|
2442 |
-
ro:'Romanian',
|
2443 |
-
ru:'Russian',
|
2444 |
-
sr:'Serbian',
|
2445 |
-
sk:'Slovak',
|
2446 |
-
sl:'Slovenian',
|
2447 |
-
es:'Spanish',
|
2448 |
-
sw:'Swahili',
|
2449 |
-
sv:'Swedish',
|
2450 |
-
tl:'Tagalog',
|
2451 |
-
th:'Thai',
|
2452 |
-
tr:'Turkish',
|
2453 |
-
uk:'Ukrainian',
|
2454 |
-
vi:'Vietnamese',
|
2455 |
-
cy:'Welsh',
|
2456 |
-
yi:'Yiddish'
|
2457 |
-
}
|
2458 |
-
};
|
2459 |
-
|
2460 |
-
/*
|
2461 |
-
Parses WebVVT format which should be formatted as
|
2462 |
-
================================
|
2463 |
-
WEBVTT
|
2464 |
-
|
2465 |
-
1
|
2466 |
-
00:00:01,1 --> 00:00:05,000
|
2467 |
-
A line of text
|
2468 |
-
|
2469 |
-
2
|
2470 |
-
00:01:15,1 --> 00:02:05,000
|
2471 |
-
A second line of text
|
2472 |
-
|
2473 |
-
===============================
|
2474 |
-
|
2475 |
-
Adapted from: http://www.delphiki.com/html5/playr
|
2476 |
-
*/
|
2477 |
-
mejs.TrackFormatParser = {
|
2478 |
-
// match start "chapter-" (or anythingelse)
|
2479 |
-
pattern_identifier: /^([a-zA-z]+-)?[0-9]+$/,
|
2480 |
-
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})?)(.*)$/,
|
2481 |
-
|
2482 |
-
split2: function (text, regex) {
|
2483 |
-
// normal version for compliant browsers
|
2484 |
-
// see below for IE fix
|
2485 |
-
return text.split(regex);
|
2486 |
-
},
|
2487 |
-
parse: function(trackText) {
|
2488 |
-
var
|
2489 |
-
i = 0,
|
2490 |
-
lines = this.split2(trackText, /\r?\n/),
|
2491 |
-
entries = {text:[], times:[]},
|
2492 |
-
timecode,
|
2493 |
-
text;
|
2494 |
-
|
2495 |
-
for(; i<lines.length; i++) {
|
2496 |
-
// check for the line number
|
2497 |
-
if (this.pattern_identifier.exec(lines[i])){
|
2498 |
-
// skip to the next line where the start --> end time code should be
|
2499 |
-
i++;
|
2500 |
-
timecode = this.pattern_timecode.exec(lines[i]);
|
2501 |
-
|
2502 |
-
if (timecode && i<lines.length){
|
2503 |
-
i++;
|
2504 |
-
// grab all the (possibly multi-line) text that follows
|
2505 |
-
text = lines[i];
|
2506 |
-
i++;
|
2507 |
-
while(lines[i] !== '' && i<lines.length){
|
2508 |
-
text = text + '\n' + lines[i];
|
2509 |
-
i++;
|
2510 |
-
}
|
2511 |
-
|
2512 |
-
// Text is in a different array so I can use .join
|
2513 |
-
entries.text.push(text);
|
2514 |
-
entries.times.push(
|
2515 |
-
{
|
2516 |
-
start: mejs.Utility.timeCodeToSeconds(timecode[1]),
|
2517 |
-
stop: mejs.Utility.timeCodeToSeconds(timecode[3]),
|
2518 |
-
settings: timecode[5]
|
2519 |
-
});
|
2520 |
-
}
|
2521 |
-
}
|
2522 |
-
}
|
2523 |
-
|
2524 |
-
return entries;
|
2525 |
-
}
|
2526 |
-
};
|
2527 |
-
|
2528 |
-
// test for browsers with bad String.split method.
|
2529 |
-
if ('x\n\ny'.split(/\n/gi).length != 3) {
|
2530 |
-
// add super slow IE8 and below version
|
2531 |
-
mejs.TrackFormatParser.split2 = function(text, regex) {
|
2532 |
-
var
|
2533 |
-
parts = [],
|
2534 |
-
chunk = '',
|
2535 |
-
i;
|
2536 |
-
|
2537 |
-
for (i=0; i<text.length; i++) {
|
2538 |
-
chunk += text.substring(i,i+1);
|
2539 |
-
if (regex.test(chunk)) {
|
2540 |
-
parts.push(chunk.replace(regex, ''));
|
2541 |
-
chunk = '';
|
2542 |
-
}
|
2543 |
-
}
|
2544 |
-
parts.push(chunk);
|
2545 |
-
return parts;
|
2546 |
-
}
|
2547 |
-
}
|
2548 |
-
|
2549 |
-
})(mejs.$);
|
2550 |
-
|
2551 |
-
/*
|
2552 |
-
* ContextMenu Plugin
|
2553 |
-
*
|
2554 |
-
*
|
2555 |
-
*/
|
2556 |
-
|
2557 |
-
(function($) {
|
2558 |
-
|
2559 |
-
$.extend(mejs.MepDefaults,
|
2560 |
-
{ 'contextMenuItems': [
|
2561 |
-
// demo of a fullscreen option
|
2562 |
-
{
|
2563 |
-
render: function(player) {
|
2564 |
-
|
2565 |
-
// check for fullscreen plugin
|
2566 |
-
if (typeof player.enterFullScreen == 'undefined')
|
2567 |
-
return null;
|
2568 |
-
|
2569 |
-
if (player.isFullScreen) {
|
2570 |
-
return "Turn off Fullscreen";
|
2571 |
-
} else {
|
2572 |
-
return "Go Fullscreen";
|
2573 |
-
}
|
2574 |
-
},
|
2575 |
-
click: function(player) {
|
2576 |
-
if (player.isFullScreen) {
|
2577 |
-
player.exitFullScreen();
|
2578 |
-
} else {
|
2579 |
-
player.enterFullScreen();
|
2580 |
-
}
|
2581 |
-
}
|
2582 |
-
}
|
2583 |
-
,
|
2584 |
-
// demo of a mute/unmute button
|
2585 |
-
{
|
2586 |
-
render: function(player) {
|
2587 |
-
if (player.media.muted) {
|
2588 |
-
return "Unmute";
|
2589 |
-
} else {
|
2590 |
-
return "Mute";
|
2591 |
-
}
|
2592 |
-
},
|
2593 |
-
click: function(player) {
|
2594 |
-
if (player.media.muted) {
|
2595 |
-
player.setMuted(false);
|
2596 |
-
} else {
|
2597 |
-
player.setMuted(true);
|
2598 |
-
}
|
2599 |
-
}
|
2600 |
-
},
|
2601 |
-
// separator
|
2602 |
-
{
|
2603 |
-
isSeparator: true
|
2604 |
-
}
|
2605 |
-
,
|
2606 |
-
// demo of simple download video
|
2607 |
-
{
|
2608 |
-
render: function(player) {
|
2609 |
-
return "Download Video";
|
2610 |
-
},
|
2611 |
-
click: function(player) {
|
2612 |
-
window.location.href = player.media.currentSrc;
|
2613 |
-
}
|
2614 |
-
}
|
2615 |
-
]}
|
2616 |
-
);
|
2617 |
-
|
2618 |
-
|
2619 |
-
$.extend(MediaElementPlayer.prototype, {
|
2620 |
-
buildcontextmenu: function(player, controls, layers, media) {
|
2621 |
-
|
2622 |
-
// create context menu
|
2623 |
-
player.contextMenu = $('<div class="mejs-contextmenu"></div>')
|
2624 |
-
.appendTo($('body'))
|
2625 |
-
.hide();
|
2626 |
-
|
2627 |
-
// create events for showing context menu
|
2628 |
-
player.container.bind('contextmenu', function(e) {
|
2629 |
-
if (player.isContextMenuEnabled) {
|
2630 |
-
e.preventDefault();
|
2631 |
-
player.renderContextMenu(e.clientX-1, e.clientY-1);
|
2632 |
-
return false;
|
2633 |
-
}
|
2634 |
-
});
|
2635 |
-
player.container.bind('click', function() {
|
2636 |
-
player.contextMenu.hide();
|
2637 |
-
});
|
2638 |
-
player.contextMenu.bind('mouseleave', function() {
|
2639 |
-
|
2640 |
-
//console.log('context hover out');
|
2641 |
-
player.startContextMenuTimer();
|
2642 |
-
|
2643 |
-
});
|
2644 |
-
},
|
2645 |
-
|
2646 |
-
isContextMenuEnabled: true,
|
2647 |
-
enableContextMenu: function() {
|
2648 |
-
this.isContextMenuEnabled = true;
|
2649 |
-
},
|
2650 |
-
disableContextMenu: function() {
|
2651 |
-
this.isContextMenuEnabled = false;
|
2652 |
-
},
|
2653 |
-
|
2654 |
-
contextMenuTimeout: null,
|
2655 |
-
startContextMenuTimer: function() {
|
2656 |
-
//console.log('startContextMenuTimer');
|
2657 |
-
|
2658 |
-
var t = this;
|
2659 |
-
|
2660 |
-
t.killContextMenuTimer();
|
2661 |
-
|
2662 |
-
t.contextMenuTimer = setTimeout(function() {
|
2663 |
-
t.hideContextMenu();
|
2664 |
-
t.killContextMenuTimer();
|
2665 |
-
}, 750);
|
2666 |
-
},
|
2667 |
-
killContextMenuTimer: function() {
|
2668 |
-
var timer = this.contextMenuTimer;
|
2669 |
-
|
2670 |
-
//console.log('killContextMenuTimer', timer);
|
2671 |
-
|
2672 |
-
if (timer != null) {
|
2673 |
-
clearTimeout(timer);
|
2674 |
-
delete timer;
|
2675 |
-
timer = null;
|
2676 |
-
}
|
2677 |
-
},
|
2678 |
-
|
2679 |
-
hideContextMenu: function() {
|
2680 |
-
this.contextMenu.hide();
|
2681 |
-
},
|
2682 |
-
|
2683 |
-
renderContextMenu: function(x,y) {
|
2684 |
-
|
2685 |
-
// alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly
|
2686 |
-
var t = this,
|
2687 |
-
html = '',
|
2688 |
-
items = t.options.contextMenuItems;
|
2689 |
-
|
2690 |
-
for (var i=0, il=items.length; i<il; i++) {
|
2691 |
-
|
2692 |
-
if (items[i].isSeparator) {
|
2693 |
-
html += '<div class="mejs-contextmenu-separator"></div>';
|
2694 |
-
} else {
|
2695 |
-
|
2696 |
-
var rendered = items[i].render(t);
|
2697 |
-
|
2698 |
-
// render can return null if the item doesn't need to be used at the moment
|
2699 |
-
if (rendered != null) {
|
2700 |
-
html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>';
|
2701 |
-
}
|
2702 |
-
}
|
2703 |
-
}
|
2704 |
-
|
2705 |
-
// position and show the context menu
|
2706 |
-
t.contextMenu
|
2707 |
-
.empty()
|
2708 |
-
.append($(html))
|
2709 |
-
.css({top:y, left:x})
|
2710 |
-
.show();
|
2711 |
-
|
2712 |
-
// bind events
|
2713 |
-
t.contextMenu.find('.mejs-contextmenu-item').each(function() {
|
2714 |
-
|
2715 |
-
// which one is this?
|
2716 |
-
var $dom = $(this),
|
2717 |
-
itemIndex = parseInt( $dom.data('itemindex'), 10 ),
|
2718 |
-
item = t.options.contextMenuItems[itemIndex];
|
2719 |
-
|
2720 |
-
// bind extra functionality?
|
2721 |
-
if (typeof item.show != 'undefined')
|
2722 |
-
item.show( $dom , t);
|
2723 |
-
|
2724 |
-
// bind click action
|
2725 |
-
$dom.click(function() {
|
2726 |
-
// perform click action
|
2727 |
-
if (typeof item.click != 'undefined')
|
2728 |
-
item.click(t);
|
2729 |
-
|
2730 |
-
// close
|
2731 |
-
t.contextMenu.hide();
|
2732 |
-
});
|
2733 |
-
});
|
2734 |
-
|
2735 |
-
// stop the controls from hiding
|
2736 |
-
setTimeout(function() {
|
2737 |
-
t.killControlsTimer('rev3');
|
2738 |
-
}, 100);
|
2739 |
-
|
2740 |
-
}
|
2741 |
-
});
|
2742 |
-
|
2743 |
-
})(mejs.$);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaelement/mediaelementplayer.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;text-align:left;vertical-align:top;}.me-plugin{position:absolute;}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden;}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000;}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%;}.mejs-background{position:absolute;top:0;left:0;}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%;}.mejs-poster{position:absolute;top:0;left:0;}.mejs-poster img{border:0;padding:0;border:0;display:block;}.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) 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,0% 0,0% 100%,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-o-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-ms-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) 50% 50% 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,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%;}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;background:0;font-family:Helvetica,Arial;border:0;}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.png) no-repeat;}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;padding:auto 4px;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;}.mejs-container .mejs-controls .mejs-time span{font-size:11px;color:#fff;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-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));}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite;}@-webkit-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-moz-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-ms-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-o-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-o-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-ms-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));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,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.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{position:absolute;display:none;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 .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls div.mejs-horizontal-volume-slider{height:26px;width:60px;position:relative;}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-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));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-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,0% 0,0% 100%,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-o-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-ms-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.mejs-clear{clear:both;}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}.mejs-controls .mejs-sourcechooser-button{position:relative;}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-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-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}
|
1 |
+
.mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;}.me-plugin{position:absolute;}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden;}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000;}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%;}.mejs-background{position:absolute;top:0;left:0;}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%;}.mejs-poster{position:absolute;top:0;left:0;}.mejs-poster img{border:0;padding:0;border:0;display:block;}.mejs-overlay{position:absolute;top:0;left:0;}.mejs-overlay-play{cursor:pointer;}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.png) top left no-repeat;}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px;}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9),rgba(0,0,0,0.9));}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) center center no-repeat;}.mejs-container .mejs-controls{position:absolute;background:none;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%;}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;background:0;font-family:Helvetica,Arial;border:0;}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.png) 0 0 no-repeat;}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;padding:auto 4px;}.mejs-container .mejs-controls .mejs-time span{font-size:11px;color:#fff;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#1E1E1E,endColorstr=#3C3C3C);}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#2C7C91,endColorstr=#4EB7D4);width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{width:0;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#FFFFFF,endColorstr=#C8C8C8);}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;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 .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,left top,left bottom,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.mejs-clear{clear:both;}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}
|
mediaelement/mediaelementplayer.min.js
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* MediaElementPlayer
|
3 |
-
* http://mediaelementjs.com/
|
4 |
-
*
|
5 |
-
* Creates a controller bar for HTML5 <video> add <audio> tags
|
6 |
-
* using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
|
7 |
-
*
|
8 |
-
* Copyright 2010-2012, John Dyer (http://j.hn/)
|
9 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
10 |
-
*
|
11 |
-
*/if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
|
12 |
-
(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks",
|
13 |
-
"volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-0.1,0))}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.max(b.currentTime-b.duration*0.05,0))}}},{keys:[39,
|
14 |
-
228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.min(b.currentTime+b.duration*0.05,b.duration))}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!="undefined")a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players=[];mejs.MediaElementPlayer=function(a,b){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,b);this.$media=this.$node=f(a);
|
15 |
-
this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);mejs.players.push(this);this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}),
|
16 |
-
d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls","controls");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.AndroidUseNativeControls)){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);
|
17 |
-
a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);a.$media.remove();a.$node=a.$media=b;a.node=a.media=b[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");b=d.substring(0,1).toUpperCase()+d.substring(1);
|
18 |
-
a.width=a.options[d+"Width"]>0||a.options[d+"Width"].toString().indexOf("%")>-1?a.options[d+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+b+"Width"];a.height=a.options[d+"Height"]>0||a.options[d+"Height"].toString().indexOf("%")>-1?a.options[d+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"):
|
19 |
-
a.options["default"+b+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.height;c.pluginHeight=a.width}mejs.MediaElement(a.$media[0],c)},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true});b.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true})}else{b.controls.css("visibility",
|
20 |
-
"visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)if(a){b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");b.controlsAreVisible=false});b.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display",
|
21 |
-
"block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!="undefined"?a:1500;b.killControlsTimer("start");b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;
|
22 |
-
this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,b){var c=this,d=mejs.MediaFeatures,e=b.getAttribute("autoplay");e=!(typeof e=="undefined"||e===null||e==="false");var g;if(!c.created){c.created=true;c.media=a;c.domNode=b;if(!(d.isAndroid&&c.options.AndroidUseNativeControls)&&!(d.isiPad&&c.options.iPadUseNativeControls)&&
|
23 |
-
!(d.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(g in c.options.features){d=c.options.features[g];if(c["build"+d])try{c["build"+d](c,c.controls,c.layers,c.media)}catch(k){}}c.container.trigger("controlsready");c.setPlayerSize(c.width,c.height);c.setControlsSize();if(c.isVideo){if(mejs.MediaFeatures.hasTouch)c.$media.bind("touchstart",function(){if(c.controlsAreVisible)c.hideControls(false);
|
24 |
-
else c.controlsEnabled&&c.showControls(false)});else{(c.media.pluginType=="native"?c.$media:f(c.media.pluginElement)).click(function(){a.paused?a.play():a.pause()});c.container.bind("mouseenter mouseover",function(){if(c.controlsEnabled)if(!c.options.alwaysShowControls){c.killControlsTimer("enter");c.showControls();c.startControlsTimer(2500)}}).bind("mousemove",function(){if(c.controlsEnabled){c.controlsAreVisible||c.showControls();c.options.alwaysShowControls||c.startControlsTimer(2500)}}).bind("mouseleave",
|
25 |
-
function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&c.startControlsTimer(1E3)})}e&&!c.options.alwaysShowControls&&c.hideControls();c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(h){if(c.options.videoHeight<=0&&c.domNode.getAttribute("height")===null&&!isNaN(h.target.videoHeight)){c.setPlayerSize(h.target.videoWidth,h.target.videoHeight);c.setControlsSize();c.media.setVideoSize(h.target.videoWidth,h.target.videoHeight)}},false)}a.addEventListener("play",
|
26 |
-
function(){for(var h=0,o=mejs.players.length;h<o;h++){var n=mejs.players[h];n.id!=c.id&&c.options.pauseOtherPlayers&&!n.paused&&!n.ended&&n.pause();n.hasFocus=false}c.hasFocus=true},false);c.media.addEventListener("ended",function(){try{c.media.setCurrentTime(0)}catch(h){}c.media.pause();c.setProgressRail&&c.setProgressRail();c.setCurrentRail&&c.setCurrentRail();if(c.options.loop)c.media.play();else!c.options.alwaysShowControls&&c.controlsEnabled&&c.showControls()},false);c.media.addEventListener("loadedmetadata",
|
27 |
-
function(){c.updateDuration&&c.updateDuration();c.updateCurrent&&c.updateCurrent();if(!c.isFullScreen){c.setPlayerSize(c.width,c.height);c.setControlsSize()}},false);setTimeout(function(){c.setPlayerSize(c.width,c.height);c.setControlsSize()},50);f(window).resize(function(){c.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height);c.setControlsSize()});c.media.pluginType=="youtube"&&c.container.find(".mejs-overlay-play").hide()}if(e&&
|
28 |
-
a.pluginType=="native"){a.load();a.play()}if(c.options.success)typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},setPlayerSize:function(a,b){if(typeof a!="undefined")this.width=a;if(typeof b!="undefined")this.height=b;if(this.height.toString().indexOf("%")>0){var c=this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth,
|
29 |
-
d=this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.options.defaultVideoHeight,e=this.container.parent().width();c=parseInt(e*d/c,10);if(this.container.parent()[0].tagName.toLowerCase()==="body"){e=f(window).width();c=f(window).height()}this.container.width(e).height(c);this.$media.width("100%").height("100%");this.container.find("object, embed, iframe").width("100%").height("100%");this.media.setVideoSize&&this.media.setVideoSize(e,c);this.layers.children(".mejs-layer").width("100%").height("100%")}else{this.container.width(this.width).height(this.height);
|
30 |
-
this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,b=0,c=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");var e=c.siblings();if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){e.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});b=this.controls.width()-a-(c.outerWidth(true)-
|
31 |
-
c.width())}c.width(b);d.width(b-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"),c=b.find("img");if(c.length==
|
32 |
-
0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a)},buildoverlays:function(a,b,c,d){if(a.isVideo){var e=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),k=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).click(function(){d.paused?d.play():
|
33 |
-
d.pause()});d.addEventListener("play",function(){k.hide();e.hide();b.find(".mejs-time-buffering").hide();g.hide()},false);d.addEventListener("playing",function(){k.hide();e.hide();b.find(".mejs-time-buffering").hide();g.hide()},false);d.addEventListener("seeking",function(){e.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("seeked",function(){e.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||k.show()},
|
34 |
-
false);d.addEventListener("waiting",function(){e.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("loadeddata",function(){e.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("canplay",function(){e.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("error",function(){e.hide();b.find(".mejs-time-buffering").hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")},false)}},buildkeyboard:function(a,b,c,d){f(document).keydown(function(e){if(a.hasFocus&&
|
35 |
-
a.options.enableKeyboard)for(var g=0,k=a.options.keyActions.length;g<k;g++)for(var h=a.options.keyActions[g],o=0,n=h.keys.length;o<n;o++)if(e.keyCode==h.keys[o]){e.preventDefault();h.action(a,d);return false}return true});f(document).click(function(e){if(f(e.target).closest(".mejs-container").length==0)a.hasFocus=false})},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(c,d){d=f(d);a.tracks.push({srclang:d.attr("srclang").toLowerCase(),src:d.attr("src"),kind:d.attr("kind"),
|
36 |
-
label:d.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},
|
37 |
-
getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){if(this.media.pluginType=="flash")this.media.remove();else this.media.pluginType=="native"&&this.media.prop("controls",true);this.isDynamic||this.$node.insertBefore(this.container);this.container.remove()}};if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){return this.each(function(){new mejs.MediaElementPlayer(this,a)})};f(document).ready(function(){f(".mejs-player").mediaelementplayer()});
|
38 |
-
window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
|
39 |
-
(function(f){f.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);
|
40 |
-
d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
|
41 |
-
(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+'"></button></div>').appendTo(b).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);b.find(".mejs-time-current").width("0px");b.find(".mejs-time-handle").css("left","0px");b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));
|
42 |
-
b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-poster").show()}})}})})(mejs.$);
|
43 |
-
(function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><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(b);b.find(".mejs-time-buffering").hide();var e=
|
44 |
-
b.find(".mejs-time-total");c=b.find(".mejs-time-loaded");var g=b.find(".mejs-time-current"),k=b.find(".mejs-time-handle"),h=b.find(".mejs-time-float"),o=b.find(".mejs-time-float-current"),n=function(l){l=l.pageX;var q=e.offset(),i=e.outerWidth(),j=0;j=0;var m=l-q.left;if(l>q.left&&l<=i+q.left&&d.duration){j=(l-q.left)/i;j=j<=0.02?0:j*d.duration;p&&d.setCurrentTime(j);if(!mejs.MediaFeatures.hasTouch){h.css("left",m);o.html(mejs.Utility.secondsToTimeCode(j));h.show()}}},p=false;e.bind("mousedown",function(l){if(l.which===
|
45 |
-
1){p=true;n(l);f(document).bind("mousemove.dur",function(q){n(q)}).bind("mouseup.dur",function(){p=false;h.hide();f(document).unbind(".dur")});return false}}).bind("mouseenter",function(){f(document).bind("mousemove.dur",function(l){n(l)});mejs.MediaFeatures.hasTouch||h.show()}).bind("mouseleave",function(){if(!p){f(document).unbind(".dur");h.hide()}});d.addEventListener("progress",function(l){a.setProgressRail(l);a.setCurrentRail(l)},false);d.addEventListener("timeupdate",function(l){a.setProgressRail(l);
|
46 |
-
a.setCurrentRail(l)},false);this.loaded=c;this.total=e;this.current=g;this.handle=k},setProgressRail:function(a){var b=a!=undefined?a.target:this.media,c=null;if(b&&b.buffered&&b.buffered.length>0&&b.buffered.end&&b.duration)c=b.buffered.end(0)/b.duration;else if(b&&b.bytesTotal!=undefined&&b.bytesTotal>0&&b.bufferedBytes!=undefined)c=b.bufferedBytes/b.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)c=a.loaded/a.total;if(c!==null){c=Math.min(1,Math.max(0,c));this.loaded&&this.total&&this.loaded.width(this.total.width()*
|
47 |
-
c)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=this.total.width()*this.media.currentTime/this.media.duration,b=a-this.handle.outerWidth(true)/2;this.current.width(a);this.handle.css("left",b)}}})})(mejs.$);
|
48 |
-
(function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" <span> | </span> "});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,c,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(b);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,
|
49 |
-
b,c,d){if(b.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(b.find(".mejs-time"));else{b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");
|
50 |
-
f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(b)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()},
|
51 |
-
false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){if(this.media.duration&&this.durationD)this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$);
|
52 |
-
(function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true,audioVolume:"horizontal",videoVolume:"vertical"});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,c,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=this.isVideo?this.options.videoVolume:this.options.audioVolume,g=e=="horizontal"?f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+this.id+'" title="'+this.options.muteText+
|
53 |
-
'"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(b):f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+this.id+'" title="'+this.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(b),
|
54 |
-
k=this.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),h=this.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),o=this.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),n=this.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),p=function(j,m){if(!k.is(":visible")&&typeof m!="undefined"){k.show();p(j,true);k.hide()}else{j=Math.max(0,j);j=Math.min(j,1);j==0?g.removeClass("mejs-mute").addClass("mejs-unmute"):g.removeClass("mejs-unmute").addClass("mejs-mute");
|
55 |
-
if(e=="vertical"){var r=h.height(),s=h.position(),t=r-r*j;n.css("top",s.top+t-n.height()/2);o.height(r-t);o.css("top",s.top+t)}else{r=h.width();s=h.position();r=r*j;n.css("left",s.left+r-n.width()/2);o.width(r)}}},l=function(j){var m=null,r=h.offset();if(e=="vertical"){m=h.height();parseInt(h.css("top").replace(/px/,""),10);m=(m-(j.pageY-r.top))/m;if(r.top==0||r.left==0)return}else{m=h.width();m=(j.pageX-r.left)/m}m=Math.max(0,m);m=Math.min(m,1);p(m);m==0?d.setMuted(true):d.setMuted(false);d.setVolume(m)},
|
56 |
-
q=false,i=false;g.hover(function(){k.show();i=true},function(){i=false;!q&&e=="vertical"&&k.hide()});k.bind("mouseover",function(){i=true}).bind("mousedown",function(j){l(j);f(document).bind("mousemove.vol",function(m){l(m)}).bind("mouseup.vol",function(){q=false;f(document).unbind(".vol");!i&&e=="vertical"&&k.hide()});q=true;return false});g.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(){if(!q)if(d.muted){p(0);g.removeClass("mejs-mute").addClass("mejs-unmute")}else{p(d.volume);
|
57 |
-
g.removeClass("mejs-unmute").addClass("mejs-mute")}},false);if(this.container.is(":visible")){p(a.options.startVolume);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}}}})})(mejs.$);
|
58 |
-
(function(f){f.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:"Fullscreen"});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(a,b,c,d){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;if(mejs.MediaFeatures.hasTrueNativeFullScreen){c=null;c=mejs.MediaFeatures.hasMozNativeFullScreen?f(document):a.container;c.bind(mejs.MediaFeatures.fullScreenEventName,
|
59 |
-
function(){if(mejs.MediaFeatures.isFullScreen()){a.isNativeFullScreen=true;a.setControlsSize()}else{a.isNativeFullScreen=false;a.exitFullScreen()}})}var e=this,g=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.fullscreenText+'"></button></div>').appendTo(b);if(e.media.pluginType==="native"||!e.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||
|
60 |
-
a.isFullScreen?a.exitFullScreen():a.enterFullScreen()});else{var k=null;b=function(){var i=document.createElement("x"),j=document.documentElement,m=window.getComputedStyle;if(!("pointerEvents"in i.style))return false;i.style.pointerEvents="auto";i.style.pointerEvents="x";j.appendChild(i);m=m&&m(i,"").pointerEvents==="auto";j.removeChild(i);return!!m}();console.log("supportsPointerEvents",b);if(b&&!mejs.MediaFeatures.isOpera){var h=false,o=function(){if(h){n.hide();p.hide();l.hide();g.css("pointer-events",
|
61 |
-
"");e.controls.css("pointer-events","");h=false}},n=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(o),p=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(o),l=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(o),q=function(){var i={position:"absolute",top:0,left:0};n.css(i);p.css(i);l.css(i);n.width(e.container.width()).height(e.container.height()-e.controls.height());i=g.offset().left-e.container.offset().left;fullScreenBtnWidth=
|
62 |
-
g.outerWidth(true);p.width(i).height(e.controls.height()).css({top:e.container.height()-e.controls.height()});l.width(e.container.width()-i-fullScreenBtnWidth).height(e.controls.height()).css({top:e.container.height()-e.controls.height(),left:i+fullScreenBtnWidth})};f(document).resize(function(){q()});g.mouseover(function(){if(!e.isFullScreen){var i=g.offset(),j=a.container.offset();d.positionFullscreenButton(i.left-j.left,i.top-j.top,false);g.css("pointer-events","none");e.controls.css("pointer-events",
|
63 |
-
"none");n.show();l.show();p.show();q();h=true}});d.addEventListener("fullscreenchange",function(){o()})}else g.mouseover(function(){if(k!==null){clearTimeout(k);delete k}var i=g.offset(),j=a.container.offset();d.positionFullscreenButton(i.left-j.left,i.top-j.top,true)}).mouseout(function(){if(k!==null){clearTimeout(k);delete k}k=setTimeout(function(){d.hideFullscreenButton()},1500)})}a.fullscreenBtn=g;f(document).bind("keydown",function(i){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||
|
64 |
-
e.isFullScreen)&&i.keyCode==27)a.exitFullScreen()})}},enterFullScreen:function(){var a=this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(a.container[0]);a.isInIframe&&
|
65 |
-
setTimeout(function c(){if(a.isNativeFullScreen)f(window).width()!==screen.width?a.exitFullScreen():setTimeout(c,500)},500)}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=a.options.newWindowCallback(this);if(b!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},
|
66 |
-
250);else{a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find("object, embed, iframe").width("100%").height("100%");a.media.setVideoSize(f(window).width(),
|
67 |
-
f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow=
|
68 |
-
docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=
|
69 |
-
false}}})})(mejs.$);
|
70 |
-
(function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles"});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,b,c,d){if(a.isVideo)if(a.tracks.length!=0){var e;a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).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(c).hide();a.captionsText=a.captions.find(".mejs-captions-text");
|
71 |
-
a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(b).hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},function(){f(this).find(".mejs-captions-selector").css("visibility",
|
72 |
-
"hidden")}).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none")a.selectedTrack=null;else for(e=0;e<a.tracks.length;e++)if(a.tracks[e].srclang==lang){a.selectedTrack=a.tracks[e];a.captions.attr("lang",a.selectedTrack.srclang);a.displayCaptions();break}});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("mouseenter",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",
|
73 |
-
function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(e=0;e<a.tracks.length;e++)a.tracks[e].kind=="subtitles"&&a.addTrackButton(a.tracks[e].srclang,a.tracks[e].label);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()},false);d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility",
|
74 |
-
"visible");a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight())}},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")}},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 b=
|
75 |
-
this,c=b.tracks[a],d=function(){c.isLoaded=true;b.enableTrackButton(c.srclang,c.label);b.loadNextTrack()};c.isTranslation?mejs.TrackFormatParser.translateTrackText(b.tracks[0].entries,b.tracks[0].srclang,c.srclang,b.options.googleApiKey,function(e){c.entries=e;d()}):f.ajax({url:c.src,success:function(e){c.entries=mejs.TrackFormatParser.parse(e);d();c.kind=="chapters"&&b.media.duration>0&&b.drawChapters(c)},error:function(){b.loadNextTrack()}})},enableTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||
|
76 |
-
a;this.captionsButton.find("input[value="+a+"]").prop("disabled",false).siblings("label").html(b);this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,b){if(b==="")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+" (loading)</label></li>"));this.adjustLanguageBox();
|
77 |
-
this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,b=this.selectedTrack;if(b!=null&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&
|
78 |
-
this.media.currentTime<=b.entries.times[a].stop){this.captionsText.html(b.entries.text[a]);this.captions.show().height(0);return}this.captions.hide()}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var b=this,c,d,e=d=0;b.chapters.empty();for(c=0;c<a.entries.times.length;c++){d=a.entries.times[c].stop-a.entries.times[c].start;d=Math.floor(d/
|
79 |
-
b.media.duration*100);if(d+e>100||c==a.entries.times.length-1&&d+e<100)d=100-e;b.chapters.append(f('<div class="mejs-chapter" rel="'+a.entries.times[c].start+'" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+(c==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"–"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+
|
80 |
-
"</span></div></div>"));e+=d}b.chapters.find("div.mejs-chapter").click(function(){b.media.setCurrentTime(parseFloat(f(this).attr("rel")));b.media.paused&&b.media.play()});b.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",
|
81 |
-
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",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,
|
82 |
-
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,b){return a.split(b)},parse:function(a){var b=0;a=this.split2(a,/\r?\n/);for(var c={text:[],times:[]},d,e;b<a.length;b++)if(this.pattern_identifier.exec(a[b])){b++;if((d=this.pattern_timecode.exec(a[b]))&&b<a.length){b++;e=a[b];for(b++;a[b]!==""&&b<a.length;){e=e+"\n"+a[b];b++}c.text.push(e);c.times.push({start:mejs.Utility.timeCodeToSeconds(d[1]),stop:mejs.Utility.timeCodeToSeconds(d[3]),
|
83 |
-
settings:d[5]})}}return c}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,b){var c=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(b.test(d)){c.push(d.replace(b,""));d=""}}c.push(d);return c}})(mejs.$);
|
84 |
-
(function(f){f.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]});
|
85 |
-
f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled){b.preventDefault();a.renderContextMenu(b.clientX-1,b.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled=
|
86 |
-
true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,b){for(var c=this,d="",e=c.options.contextMenuItems,g=0,k=e.length;g<
|
87 |
-
k;g++)if(e[g].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var h=e[g].render(c);if(h!=null)d+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+Math.random()*1E6+'">'+h+"</div>"}c.contextMenu.empty().append(f(d)).css({top:b,left:a}).show();c.contextMenu.find(".mejs-contextmenu-item").each(function(){var o=f(this),n=parseInt(o.data("itemindex"),10),p=c.options.contextMenuItems[n];typeof p.show!="undefined"&&p.show(o,c);o.click(function(){typeof p.click!=
|
88 |
-
"undefined"&&p.click(c);c.contextMenu.hide()})});setTimeout(function(){c.killControlsTimer("rev3")},100)}})})(mejs.$);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mediaelement/silverlightmediaelement.xap
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -4,14 +4,14 @@ Donate link: http://mediaelementjs.com/
|
|
4 |
Tags: html5, video, audio, player, flash, mp4, mp3, ogg, webm, wmv, captions, subtitles, websrt, srt, accessible, Silverlight, javascript,
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.3
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
MediaElement.js is an HTML5 video and audio player with Flash fallback and captions. Supports IE, Firefox, Opera, Safari, Chrome and iPhone, iPad, Android.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
Video and audio plugin for WordPress built on the MediaElement.js HTML5 media player library. Provides Flash or Silverlight fallback players for non-HTML5 browsers. Supports iPhone, iPad, and Andriod.
|
14 |
-
Supports MP4, OGG, WebM, WMV, MP3, WAV, WMA files as well as captions with WebSRT files.
|
15 |
|
16 |
Check out <a href="http://mediaelementjs.com/">mediaElementjs.com</a> for more information and examples.
|
17 |
|
@@ -156,10 +156,6 @@ View <a href="http://mediaelementjs.com/">MediaElementjs.com</a> for more inform
|
|
156 |
|
157 |
== Changelog ==
|
158 |
|
159 |
-
= 2.27.0 =
|
160 |
-
* Update to 2.7.0 codebase
|
161 |
-
* Lots of bug fixes and updates
|
162 |
-
|
163 |
= 2.2.5 =
|
164 |
* Update to 2.2.5 codebase
|
165 |
* Support for true fullscreen in Chrome and Firefox (in addition to Safari)
|
4 |
Tags: html5, video, audio, player, flash, mp4, mp3, ogg, webm, wmv, captions, subtitles, websrt, srt, accessible, Silverlight, javascript,
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.3
|
7 |
+
Stable tag: 2.5.0
|
8 |
|
9 |
MediaElement.js is an HTML5 video and audio player with Flash fallback and captions. Supports IE, Firefox, Opera, Safari, Chrome and iPhone, iPad, Android.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
Video and audio plugin for WordPress built on the MediaElement.js HTML5 media player library. Provides Flash or Silverlight fallback players for non-HTML5 browsers. Supports iPhone, iPad, and Andriod.
|
14 |
+
Supports MP4, OGG, WebM, WMV, MP3, WAV, WMA files as well as captions with WebSRT files.
|
15 |
|
16 |
Check out <a href="http://mediaelementjs.com/">mediaElementjs.com</a> for more information and examples.
|
17 |
|
156 |
|
157 |
== Changelog ==
|
158 |
|
|
|
|
|
|
|
|
|
159 |
= 2.2.5 =
|
160 |
* Update to 2.2.5 codebase
|
161 |
* Support for true fullscreen in Chrome and Firefox (in addition to Safari)
|