[Video] Revert safari hackfix (#5367)

This commit is contained in:
Samuel Newman
2024-10-07 22:55:03 +03:00
committed by GitHub
parent 58b1d9326d
commit 94e7bfbe40
@@ -1,6 +1,5 @@
import React, {useCallback, useEffect, useRef, useState} from 'react'
import {isSafari} from '#/lib/browser'
import {useVideoVolumeState} from '../../VideoVolumeContext'
export function useVideoElement(ref: React.RefObject<HTMLVideoElement>) {
@@ -38,12 +37,6 @@ export function useVideoElement(ref: React.RefObject<HTMLVideoElement>) {
const handleTimeUpdate = () => {
if (!ref.current) return
setCurrentTime(round(ref.current.currentTime) || 0)
// HACK: Safari randomly fires `stalled` events when changing between segments
// let's just clear the buffering state if the video is still progressing -sfn
if (isSafari) {
if (bufferingTimeout) clearTimeout(bufferingTimeout)
setBuffering(false)
}
}
const handleDurationChange = () => {