From 3229ee32f0108683d76a1ab55207340f82f8ba3a Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Tue, 8 Nov 2022 23:48:30 -0800 Subject: [PATCH] video: minor tweaks --- lib/Controller/VideoController.php | 1 + src/components/PsVideo.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Controller/VideoController.php b/lib/Controller/VideoController.php index 48c2b389..d677b68f 100644 --- a/lib/Controller/VideoController.php +++ b/lib/Controller/VideoController.php @@ -74,6 +74,7 @@ class VideoController extends ApiBase // Make upstream request $ch = curl_init("http://localhost:9999/vod/$path/$profile"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); diff --git a/src/components/PsVideo.ts b/src/components/PsVideo.ts index d28b32a7..12ede6aa 100644 --- a/src/components/PsVideo.ts +++ b/src/components/PsVideo.ts @@ -87,6 +87,7 @@ class VideoContentSetup { type: "application/x-mpegURL", }); + const overrideNative = !videojs.browser.IS_SAFARI; content.videojs = videojs(content.videoElement, { fluid: true, autoplay: true, @@ -98,12 +99,15 @@ class VideoContentSetup { }, ], preload: "metadata", - inactivityTimeout: 0, + playbackRates: [0.5, 1, 1.5, 2], + responsive: true, html5: { vhs: { - overrideNative: !videojs.browser.IS_SAFARI, + overrideNative: overrideNative, withCredentials: false, }, + nativeAudioTracks: !overrideNative, + nativeVideoTracks: !overrideNative, }, }); @@ -115,6 +119,8 @@ class VideoContentSetup { this.src({ src: e.slide.data.src, }); + this.options().html5.nativeAudioTracks = true; + this.options().html5.nativeVideoTracks = true; } } });