fix(#2922): fix play next episide for live match

keep-around/35b5d122c05048fb9e164c9881034e52d923e277
Andrei Dekterev 3 years ago
parent 2fd168b18e
commit 169929d02f
  1. 61749
      package-lock.json
  2. 2
      package.json
  3. 11
      src/features/MatchPage/store/hooks/index.tsx
  4. 5
      src/features/MatchSidePlaylists/hooks.tsx
  5. 2
      src/features/StreamPlayer/components/ProgressBar/hooks.tsx
  6. 2
      src/features/StreamPlayer/components/ProgressBar/index.tsx
  7. 7
      src/features/StreamPlayer/hooks/index.tsx
  8. 3
      src/features/StreamPlayer/index.tsx

61749
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -69,7 +69,7 @@
"@types/react-window": "^1.8.5", "@types/react-window": "^1.8.5",
"@types/styled-components": "^5.1.15", "@types/styled-components": "^5.1.15",
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
"eslint": "^7.14.0", "eslint": "^7.0.1",
"eslint-config-airbnb": "18.2.1", "eslint-config-airbnb": "18.2.1",
"eslint-config-react-app": "^7.0.1", "eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",

@ -148,7 +148,16 @@ export const useMatchPage = () => {
} }
const playEpisodes = () => { const playEpisodes = () => {
setIsPlayinFiltersEpisodes(true) setIsPlayinFiltersEpisodes(true)
playNextEpisode(0)
if (matchProfile?.live) {
handlePlaylistClick({
episodes: episodesToPlay.map((el) => el.episodes[0]),
id: 1,
type: episodesToPlay[0].type,
})
} else {
playNextEpisode(0)
}
} }
const disablePlayingEpisodes = () => { const disablePlayingEpisodes = () => {

@ -15,7 +15,6 @@ export const useMatchSidePlaylists = () => {
closePopup, closePopup,
events, events,
matchPlaylists: playlists, matchPlaylists: playlists,
profile,
tournamentData, tournamentData,
} = useMatchPageStore() } = useMatchPageStore()
const [selectedTab, setSelectedTab] = useState<Tabs>(Tabs.WATCH) const [selectedTab, setSelectedTab] = useState<Tabs>(Tabs.WATCH)
@ -58,10 +57,6 @@ export const useMatchSidePlaylists = () => {
if (selectedTab !== Tabs.EVENTS) closePopup() if (selectedTab !== Tabs.EVENTS) closePopup()
}, [selectedTab, closePopup]) }, [selectedTab, closePopup])
useEffect(() => {
isWatchTabVisible && setSelectedTab(Tabs.WATCH)
}, [profile, isWatchTabVisible])
return { return {
isEventTabVisible, isEventTabVisible,
isVideoTabVisible, isVideoTabVisible,

@ -33,7 +33,7 @@ export const useProgressBar = ({
chapters, chapters,
loadedProgress, loadedProgress,
playedProgress, playedProgress,
videoDuration: duration, videoDuration: chapters[activeChapterIndex].duration || duration,
}), }),
[ [
activeChapterIndex, activeChapterIndex,

@ -18,7 +18,7 @@ export const ProgressBar = (props: Props) => {
return ( return (
<ProgressBarList ref={progressBarRef}> <ProgressBarList ref={progressBarRef}>
<Chapters chapters={calculatedChapters} /> <Chapters chapters={calculatedChapters} />
{isScrubberVisible === false ? null : ( {isScrubberVisible && (
<ScrubberContainer> <ScrubberContainer>
<Scrubber style={{ left: `${playedProgressInPercent}%` }}> <Scrubber style={{ left: `${playedProgressInPercent}%` }}>
<TimeTooltip time={time} /> <TimeTooltip time={time} />

@ -269,7 +269,10 @@ export const useVideoPlayer = ({
}, [duration, isLiveTime]) }, [duration, isLiveTime])
useEffect(() => { useEffect(() => {
if (duration && isPausedTime && chapters[0]?.isFullMatchChapter) { if (duration
&& isPausedTime
&& chapters[0]?.isFullMatchChapter
) {
backToPausedTime() backToPausedTime()
} }
// eslint-disable-next-line // eslint-disable-next-line
@ -326,7 +329,7 @@ export const useVideoPlayer = ({
const { duration: chapterDuration } = getActiveChapter() const { duration: chapterDuration } = getActiveChapter()
if (playedProgress >= chapterDuration && !seeking) { if (playedProgress >= chapterDuration && !seeking) {
if (isLive) { if (isLive && isLastChapterPlaying) {
backToPausedTime() backToPausedTime()
} else { } else {
playNextChapter() playNextChapter()

@ -35,6 +35,7 @@ export const StreamPlayer = (props: Props) => {
const { const {
activeChapterIndex, activeChapterIndex,
allPlayedProgress,
backToLive, backToLive,
buffering, buffering,
centerControlsVisible, centerControlsVisible,
@ -153,7 +154,7 @@ export const StreamPlayer = (props: Props) => {
)} )}
<Controls <Controls
allPlayedProgress={playedProgress} allPlayedProgress={allPlayedProgress}
backToLive={backToLive} backToLive={backToLive}
controlsVisible={mainControlsVisible} controlsVisible={mainControlsVisible}
duration={duration} duration={duration}

Loading…
Cancel
Save