-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.2.10, 4.1.16, 4.3.8, 4.4.6, 4.5.2, 5.0
-
None
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
The VideoJS Player generates a fatal error when a webm video file is to be played in the Safari browser.
The cause is the use of the constant "GLOB_BRACE", which does not exist on non-GNU systems, such as Alpine.
More infos: https://www.php.net/manual/en/filesystem.constants.php#constant.glob-available-flags
The faulty line is in the file "media/player/videojs/ogvloader.php" line: 50
$files = glob("{$basepath}*.{js,wasm}", GLOB_BRACE);
The following simple fix would solve this:
$files = array_merge(glob($basepath . ".js"), glob($basepath . ".wasm"));
Steps to reproduce
Preparations
- A Moodle installation under Alpine is required
- The page requests must be made either under Apple/Safari or using an appropriate “user agent” specification.
- A webm video file is required.
Note on the Alpine installation.
The installation can be done under Docker using an Alpine image as base.
Steps
Create a working material "page" in a course and embed a webm video.
Call up the page either with a Safari or the corresponding "user agent".
In this case, the VideoJS Player will load the file "media/player/videojs/ogvloader.php". Loading is aborted with a 500 error. The error in the log looks something like this:
PHP Fatal error: Uncaught Error: Undefined constant "GLOB_BRACE" in /var/www/localhost/htdocs/media/player/videojs/ogvloader.php:50\nStack trace:\n#0 {main}\n thrown in /var/www/localhost/htdocs/media/player/videojs/ogvloader.php on line 50
- is a regression caused by
-
MDL-65943 RecordRTC Content Does Not Playback in iOS (multiple browsers)
-
- Closed
-