From d43227d2de3d67925b92b980d913e5fa352237e2 Mon Sep 17 00:00:00 2001 From: unclebinary1001 Date: Sat, 5 Oct 2024 23:09:14 -0500 Subject: [PATCH] refactor: update vjs onRequst to onRequest --- web/components/video/VideoJS/VideoJS.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/components/video/VideoJS/VideoJS.tsx b/web/components/video/VideoJS/VideoJS.tsx index d40347f7d..75c5d1df0 100644 --- a/web/components/video/VideoJS/VideoJS.tsx +++ b/web/components/video/VideoJS/VideoJS.tsx @@ -36,9 +36,9 @@ export const VideoJS: FC = ({ options, onReady }) => { ) { ( videojs.getPlayer(videoRef.current).tech({ IWillNotUseThisInPlugins: true }) as any - ).vhs.xhr.beforeRequest = o => { + ).vhs.xhr.onRequest = o => { if (o.uri.match('m3u8')) { - const cachebuster = Math.random().toString(16).substr(2, 8); + const cachebuster = Math.random().toString(16).slice(2, 8); // eslint-disable-next-line no-param-reassign o.uri = `${o.uri}?cachebust=${cachebuster}`; }