From caab1cc6ee6c073b8aeb72e2cf5d059dd2d8d87d Mon Sep 17 00:00:00 2001 From: Steve Gilvarry Date: Wed, 31 Dec 2025 13:58:26 +1100 Subject: [PATCH] Update getVideoStreamHtml to use videojs for mp4, I suspect this whole section including ZM_WEB_USE_OBJECT_TAGS can be deprecated. But minimal changes to upgrade videojs is all I am going for here --- web/includes/functions.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 169f7d0eb..81a411a65 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -145,9 +145,30 @@ function getVideoStreamHTML($id, $src, $width, $height, $format, $title='') { $mimeType = 'video/'.$format; if ( ZM_WEB_USE_OBJECT_TAGS ) { switch( $mimeType ) { + case 'video/mp4' : + // Use Video.js for MP4 playback instead of deprecated plugins + global $cspNonce; + $videoId = $id ?: 'videoobj_' . uniqid(); + return ' + + document.addEventListener("DOMContentLoaded", function() { + if (typeof videojs === "undefined") { + console.error("videojs is not loaded"); + return; + } + videojs("'.$videoId.'", { + controls: true, + autoplay: true, + preload: "auto" + }); + }); + '; case 'video/x-ms-asf' : case 'video/x-msvideo' : - case 'video/mp4' : if ( isWindows() ) { return '