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

Jorrit’s picture

Status: Active » Postponed (maintainer needs more info)

I 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?

shaunjohnston’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ah, yes it looks like we crossed some wires there. Looks good. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.