From 450503e6929ca01dded499c2270b05a4a2852025 Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Fri, 30 Sep 2022 18:36:37 +0600 Subject: [PATCH] fix(#2761): fix play video from videotab and show videotab --- src/features/MatchPage/components/LiveMatch/hooks/index.tsx | 5 +---- src/features/MatchSidePlaylists/hooks.tsx | 4 ++-- src/features/StreamPlayer/hooks/index.tsx | 4 +++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/features/MatchPage/components/LiveMatch/hooks/index.tsx b/src/features/MatchPage/components/LiveMatch/hooks/index.tsx index d6b046b0..82f31bba 100644 --- a/src/features/MatchPage/components/LiveMatch/hooks/index.tsx +++ b/src/features/MatchPage/components/LiveMatch/hooks/index.tsx @@ -72,9 +72,6 @@ export const useLiveMatch = () => { onPlaylistSelect, resume: resume ?? fromStartIfStreamPaused, selectedPlaylist, - streamUrl: ( - profile?.playbackUrl - || `${API_ROOT}/video/stream/${sportType}/${matchId}.m3u8` - ), + streamUrl: `${API_ROOT}/video/stream/${sportType}/${matchId}.m3u8`, } } diff --git a/src/features/MatchSidePlaylists/hooks.tsx b/src/features/MatchSidePlaylists/hooks.tsx index b76c003b..d2bdb621 100644 --- a/src/features/MatchSidePlaylists/hooks.tsx +++ b/src/features/MatchSidePlaylists/hooks.tsx @@ -59,8 +59,8 @@ export const useMatchSidePlaylists = () => { }, [selectedTab, closePopup]) useEffect(() => { - setSelectedTab(Tabs.WATCH) - }, [profile]) + isWatchTabVisible && setSelectedTab(Tabs.WATCH) + }, [profile, isWatchTabVisible]) return { isEventTabVisible, diff --git a/src/features/StreamPlayer/hooks/index.tsx b/src/features/StreamPlayer/hooks/index.tsx index b7293218..e8e4cc83 100644 --- a/src/features/StreamPlayer/hooks/index.tsx +++ b/src/features/StreamPlayer/hooks/index.tsx @@ -299,7 +299,9 @@ export const useVideoPlayer = ({ useEffect(() => { if ((isLive - && chapters[0]?.endOffsetMs === chaptersProps[0]?.endOffsetMs) + && chapters[0]?.endOffsetMs === chaptersProps[0]?.endOffsetMs + && chapters[0]?.url === chaptersProps[0]?.url + ) || isEmpty(chapters)) return setPlayerState({ ...initialState,