Hi !
We've had users complaining about performance issues on pages containing a lot of video players.
The issue was encountered on topics course format and is described as video frame loaded as blank spaces with the user needing to refresh the page in hope to get the player working this time
We fixed the issue very simply with this patch :
--- a/media/player/videojs/classes/plugin.php
|
+++ b/media/player/videojs/classes/plugin.php
|
@@ -206,7 +206,7 @@ class media_videojs_plugin extends core_media_player_native |
{
|
// Create <video> or <audio> tag with necessary attributes and all sources. |
// We don't want fallback to another player because list_supported_urls() is already smart. |
// Otherwise we could end up with nested <audio> or <video> tags. Fallback to link only. |
- $attributes += ['preload' => 'auto', 'controls' => 'true', 'title' => $title]; |
+ $attributes += ['preload' => 'metadata', 'controls' => 'true', 'title' => $title]; |
$text = html_writer::tag($isaudio ? 'audio' : 'video', $sources . self::LINKPLACEHOLDER, $attributes); |
}
|
It does not fit our need to this day but we considered making this behavior conditionnal with a admin setting. This admin could be a very simple checkbox 'Preload videos' yes/no