Support `loop` for `[audio]` and `[video]` shortcodes that specify files that are played using MediaElement's Flash plugin bridge.

Fixes #27368.


Built from https://develop.svn.wordpress.org/trunk@28363


git-svn-id: http://core.svn.wordpress.org/trunk@28191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-11 01:28:15 +00:00
parent 5df38694e9
commit fb1aab6520
1 changed files with 11 additions and 3 deletions

View File

@ -16,9 +16,17 @@
}
settings.success = function (mejs) {
var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
if ( 'flash' === mejs.pluginType && autoplay ) {
mejs.addEventListener( 'canplay', function () {
var autoplay, loop;
if ( 'flash' === mejs.pluginType ) {
autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop;
autoplay && mejs.addEventListener( 'canplay', function () {
mejs.play();
}, false );
loop && mejs.addEventListener( 'ended', function () {
mejs.play();
}, false );
}