Skip to content

Instantly share code, notes, and snippets.

@daggerhart
Last active January 3, 2017 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daggerhart/2319e201b67e9dedb6a89ef95cb83006 to your computer and use it in GitHub Desktop.
Save daggerhart/2319e201b67e9dedb6a89ef95cb83006 to your computer and use it in GitHub Desktop.
Drupal 7 behavior to get video.js working with ajax
(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