5
|
1 |
/* global mejs, _wpmejsSettings */ |
0
|
2 |
(function ($) { |
|
3 |
// add mime-type aliases to MediaElement plugin support |
|
4 |
mejs.plugins.silverlight[0].types.push('video/x-ms-wmv'); |
|
5 |
mejs.plugins.silverlight[0].types.push('audio/x-ms-wma'); |
|
6 |
|
|
7 |
$(function () { |
|
8 |
var settings = {}; |
|
9 |
|
5
|
10 |
if ( typeof _wpmejsSettings !== 'undefined' ) { |
|
11 |
settings = _wpmejsSettings; |
|
12 |
} |
|
13 |
|
|
14 |
settings.success = settings.success || function (mejs) { |
|
15 |
var autoplay, loop; |
|
16 |
|
|
17 |
if ( 'flash' === mejs.pluginType ) { |
|
18 |
autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay; |
|
19 |
loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop; |
|
20 |
|
|
21 |
autoplay && mejs.addEventListener( 'canplay', function () { |
|
22 |
mejs.play(); |
|
23 |
}, false ); |
|
24 |
|
|
25 |
loop && mejs.addEventListener( 'ended', function () { |
|
26 |
mejs.play(); |
|
27 |
}, false ); |
|
28 |
} |
|
29 |
}; |
0
|
30 |
|
|
31 |
$('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings ); |
|
32 |
}); |
|
33 |
|
|
34 |
}(jQuery)); |