mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 12:49:37 +03:00
fix(player): fix vjs throwing warning about accessing tech
This commit is contained in:
parent
2368e9160e
commit
933656c3a7
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue