refactor(2152): play stream from playbackURL

keep-around/c838b5b01bd082034322cb3ffedddb6953cc450e
Mirlan 4 years ago
parent 454f2e8df6
commit c838b5b01b
  1. 5
      src/features/MatchPage/components/LiveMatch/hooks/index.tsx
  2. 4
      src/requests/getMatchInfo.tsx

@ -35,7 +35,10 @@ export const useLiveMatch = (profile: MatchInfo) => {
onPlaylistSelect: handlePlaylistClick,
resume: resume ?? fromStartIfStreamPaused,
selectedPlaylist,
streamUrl: `${API_ROOT}/video/stream/${sportType}/${matchId}.m3u8`,
streamUrl: (
profile?.playbackUrl
|| `${API_ROOT}/video/stream/${sportType}/${matchId}.m3u8`
),
...usePlayerProgressReporter(),
...useLastPlayPosition(),
}

@ -22,6 +22,7 @@ export type MatchInfo = {
date: string,
has_video: boolean,
live: boolean,
playbackUrl?: string,
storage: boolean,
sub: boolean,
team1: Team,
@ -33,8 +34,7 @@ export type MatchInfo = {
},
} | null
export const getMatchInfo = (sportId: number, matchId: number)
: Promise<MatchInfo> => {
export const getMatchInfo = (sportId: number, matchId: number): Promise<MatchInfo> => {
const config = {
body: {
params: {

Loading…
Cancel
Save