Skip to content

Commit

Permalink
[Video] Revert safari hackfix (#5367)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius authored Oct 7, 2024
1 parent 58b1d93 commit 94e7bfb
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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>) {
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 94e7bfb

Please sign in to comment.