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

This commit is contained in:
Steve Gilvarry
2025-12-31 13:58:26 +11:00
parent 8760a2b79f
commit caab1cc6ee

View File

@@ -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 '<video id="'.$videoId.'" class="video-js" width="'.$width.'" height="'.$height.'"
controls autoplay preload="auto">
<source src="'.$src.'" type="video/mp4">
Your browser does not support the video tag.
</video>
<script' . ($cspNonce ? ' nonce="'.$cspNonce.'"' : '') . '>
document.addEventListener("DOMContentLoaded", function() {
if (typeof videojs === "undefined") {
console.error("videojs is not loaded");
return;
}
videojs("'.$videoId.'", {
controls: true,
autoplay: true,
preload: "auto"
});
});
</script>';
case 'video/x-ms-asf' :
case 'video/x-msvideo' :
case 'video/mp4' :
if ( isWindows() ) {
return '<object id="'.$id.'" width="'.$width.'" height="'.$height.'
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"