|
|
|
|
@ -9,7 +9,6 @@ import size from 'lodash/size' |
|
|
|
|
|
|
|
|
|
import { useFullscreen } from 'features/StreamPlayer/hooks/useFullscreen' |
|
|
|
|
import { useVolume } from 'features/VideoPlayer/hooks/useVolume' |
|
|
|
|
import { useMatchPopupStore } from 'features/MatchPopup' |
|
|
|
|
|
|
|
|
|
import { useObjectState } from 'hooks' |
|
|
|
|
|
|
|
|
|
@ -170,6 +169,10 @@ export const useMultiSourcePlayer = ({ |
|
|
|
|
playNextChapter() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const onPause = () => { |
|
|
|
|
setPlayerState({ playing: false }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
onPlayingChange(playing) |
|
|
|
|
}, [playing, onPlayingChange]) |
|
|
|
|
@ -195,13 +198,9 @@ export const useMultiSourcePlayer = ({ |
|
|
|
|
playNextChapter, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
const { selectedPlaylist } = useMatchPopupStore() |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (selectedPlaylist) { |
|
|
|
|
startPlaying() |
|
|
|
|
} |
|
|
|
|
}, [selectedPlaylist, startPlaying]) |
|
|
|
|
startPlaying() |
|
|
|
|
}, [chapters, startPlaying]) |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
activeChapterIndex, |
|
|
|
|
@ -218,6 +217,7 @@ export const useMultiSourcePlayer = ({ |
|
|
|
|
onEnded, |
|
|
|
|
onError: handleError, |
|
|
|
|
onLoadedProgress, |
|
|
|
|
onPause, |
|
|
|
|
onPlayedProgress, |
|
|
|
|
onPlayerClick, |
|
|
|
|
onProgressChange, |
|
|
|
|
|