fix(#2903): fixed playing storage broadcast

keep-around/3d3716c8eecddecc93aa1855ad3f52b67b2f7b4b
Rakov Roman 3 years ago
parent 71d1c1620b
commit 5b0fcd0428
  1. 6
      src/features/MatchPage/components/LiveMatch/helpers.tsx
  2. 8
      src/features/StreamPlayer/hooks/index.tsx

@ -23,7 +23,11 @@ const getFullMatchChapters = (
playlist: MatchPlaylistOption,
) => {
const bound = find(profile?.video_bounds, { h: FULL_MATCH_BOUNDARY })
const durationMs = (playlist.duration ?? 0) * 1000
const durationMs = (bound && !profile?.live)
? ((playlist.duration ?? 0) - Number(bound.s)) * 1000
: (playlist.duration ?? 0) * 1000
return [
{
duration: durationMs,

@ -303,13 +303,11 @@ export const useVideoPlayer = ({
const regURL = /\d{6,20}/gi
useEffect(() => {
if ((isLive
if (((isLive || chapters[0].duration === chaptersProps[0].duration)
&& chapters[0]?.endOffsetMs === chaptersProps[0]?.endOffsetMs
&& (
chapters[0]?.url.match(regURL)?.[0] === chaptersProps[0]?.url.match(regURL)?.[0]
)
)
&& chapters[0]?.url.match(regURL)?.[0] === chaptersProps[0]?.url.match(regURL)?.[0])
|| (isEmpty(chapters) || isEmpty(chaptersProps))) return
setPlayerState({
...initialState,
chapters: chaptersProps,

Loading…
Cancel
Save