Last active
January 3, 2017 21:12
-
-
Save daggerhart/2319e201b67e9dedb6a89ef95cb83006 to your computer and use it in GitHub Desktop.
Drupal 7 behavior to get video.js working with ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
Drupal.behaviors.videojsajax = { | |
attach: function (context, settings) { | |
if ( typeof videojs != 'undefined' ) { | |
// find all video elements with video-js class, and re-init them | |
$('video.video-js').each( function( i , element ){ | |
videojs($(element)[0] , {}, function() {}); | |
}); | |
} | |
} | |
}; | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment