From 933656c3a72da408413aac49de7d80fc9badbcc4 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sat, 6 May 2023 20:06:13 -0700 Subject: [PATCH] fix(player): fix vjs throwing warning about accessing tech --- web/components/video/VideoJS/VideoJS.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/components/video/VideoJS/VideoJS.tsx b/web/components/video/VideoJS/VideoJS.tsx index f1e39b2a8..2515696bf 100644 --- a/web/components/video/VideoJS/VideoJS.tsx +++ b/web/components/video/VideoJS/VideoJS.tsx @@ -31,8 +31,12 @@ export const VideoJS: FC = ({ options, onReady }) => { } // Add a cachebuster param to playlist URLs. - if ((videojs.getPlayer(videoRef.current).tech() as any)?.vhs) { - (videojs.getPlayer(videoRef.current).tech() as any).vhs.xhr.beforeRequest = o => { + if ( + (videojs.getPlayer(videoRef.current).tech({ IWillNotUseThisInPlugins: true }) as any)?.vhs + ) { + ( + videojs.getPlayer(videoRef.current).tech({ IWillNotUseThisInPlugins: true }) as any + ).vhs.xhr.beforeRequest = o => { if (o.uri.match('m3u8')) { const cachebuster = Math.random().toString(16).substr(2, 8); // eslint-disable-next-line no-param-reassign