Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have noticed that in the latest dev versions of videojs, the javascript appears to load in the wrong order, so videojs object properties are defined before the videojs object has been instantiated. It seems the solution to this is to add weighting to the javascript properties.
eg.
$jsopts = array('group' => JS_LIBRARY, 'preprocess' => !$remote, 'type' => $remote ? 'external' : 'file');
$cssdata = $path . '/video-js.css';
$cssopts = array('preprocess' => !$remote, 'type' => $remote ? 'external' : 'file');
$swfdata = 'videojs.options.flash.swf = "' . file_create_url($path . '/video-js.swf') . '"';
$swfopts = array('group' => JS_LIBRARY, 'type' => 'inline');
becomes
$jsopts = array('group' => JS_LIBRARY, 'preprocess' => !$remote, 'type' => $remote ? 'external' : 'file', 'weight' => 0);
$cssdata = $path . '/video-js.css';
$cssopts = array('preprocess' => !$remote, 'type' => $remote ? 'external' : 'file');
$swfdata = 'videojs.options.flash.swf = "' . file_create_url($path . '/video-js.swf') . '"';
$swfopts = array('group' => JS_LIBRARY, 'type' => 'inline', 'weight' => 1);
Comments
Comment #1
Jorrit CreditAttribution: Jorrit commentedI have already fixed that (see #1999688: Videojs blocks page render). I think the -dev release wasn't rebuilt when you tried it. Can you try again?
Comment #2
shaunjohnston CreditAttribution: shaunjohnston commentedAh, yes it looks like we crossed some wires there. Looks good. Thanks!