fix(#1701): fix red line

keep-around/fdb88b04b32b9392e76795099e2ec47c9856b38b
Andrei Dekterev 4 years ago committed by Andrei Dekterev
parent 602050f347
commit 4330dd7d74
  1. 1
      src/features/MatchPage/store/hooks/useEvents.tsx
  2. 4
      src/features/MatchPopup/types.tsx
  3. 2
      src/features/StreamPlayer/components/ProgressBar/helpers/calculateChapterStyles/index.tsx
  4. 9
      src/features/StreamPlayer/hooks/index.tsx

@ -18,6 +18,7 @@ export const useEvents = () => {
sportType,
}).then(fetchLexics)
.then(setEvents)
.catch(() => setEvents([]))
}, [
fetchLexics,
matchId,

@ -38,8 +38,8 @@ export type SettingsBySport = Partial<Record<SportTypes, Settings>>
export const defaultSettings: Settings = {
episodeDuration: {
after: 20,
before: 6,
after: 30,
before: 10,
},
selectedActions: [],
selectedFormat: PlayerPlaylistFormats.ALL_MATCH_TIME,

@ -49,7 +49,7 @@ export const calculateChapterStyles = ({
const activeChapter = {
...chapter,
loaded: calculateChapterProgress(loadedProgress, chapter),
played: calculateChapterProgress(playedProgress, chapter),
played: playedProgress * 100 / videoDuration,
width: chapter.isFullMatchChapter
? 100
: chapter.duration * 100 / videoDuration,

@ -121,7 +121,7 @@ export const useVideoPlayer = ({
const rewindForward = () => {
const chapter = getActiveChapter()
const newProgress = playedProgress + REWIND_SECONDS * 1000
if (newProgress <= chapter.duration) {
if (newProgress <= chapter.duration || isLive) {
seekTo(chapter.startOffsetMs + newProgress)
} else if (isLastChapterPlaying) {
playNextChapter()
@ -158,9 +158,6 @@ export const useVideoPlayer = ({
const onWaiting = () => {
setPlayerState({ buffering: true })
if (!playing) {
setPlayerState({ buffering: false })
}
}
const onPlaying = () => {
@ -221,6 +218,10 @@ export const useVideoPlayer = ({
useEffect(() => {
onPlayingChange(playing)
if (playing) {
setPlayerState({ buffering: false })
}
// eslint-disable-next-line
}, [playing, onPlayingChange])
useEffect(() => {

Loading…
Cancel
Save