Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix(player): fix vjs throwing warning about accessing tech

Gabe Kangas79ad905a2a3c
diff --git a/web/components/video/VideoJS/VideoJS.tsx b/web/components/video/VideoJS/VideoJS.tsx
index f1e39b2a8b..2515696bf3 100644
--- a/web/components/video/VideoJS/VideoJS.tsx
+++ b/web/components/video/VideoJS/VideoJS.tsx
@@ -31,8 +31,12 @@ export const VideoJS: FC<VideoJSProps> = ({ 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