Skip to content

Instantly share code, notes, and snippets.

@mfairchild365
Last active August 29, 2015 14:23
Show Gist options
  • Save mfairchild365/281709523ade809049ce to your computer and use it in GitHub Desktop.
Save mfairchild365/281709523ade809049ce to your computer and use it in GitHub Desktop.
Test
require(['jquery', 'wdn'], function($, WDN) {
$(function() {
var $splashIntro = $('.law-intro'),
introMedia,
splashRevert = function() {
introMedia.pause();
$splashIntro.removeClass('playing');
return false;
};
WDN.initializePlugin('carousel');
WDN.setPluginParam('mediaelement_wdn', 'options', {
success: function (media) {
introMedia = media;
$(introMedia).trigger('resize');
media.addEventListener('ended', splashRevert, false);
}
});
WDN.initializePlugin('mediaelement_wdn');
$('.wdn-icon-cancel', $splashIntro).click(splashRevert);
$('#splash_play').click(function(e) {
e.preventDefault();
$splashIntro.addClass('playing');
$(introMedia).data('mediaelementplayer').adjustLanguageBox();
$(introMedia).trigger('resize');
setTimeout(function() {
introMedia.play();
}, 250);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment