Skip to content

Commit

Permalink
fix: pull the base url for streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
lart2150 committed Nov 5, 2022
1 parent 3373705 commit 17d3c11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Playback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Typography from '@mui/material/Typography';
import { forwardRef, ReactElement, Ref, useEffect, useState } from 'react';
import { forwardRef, ReactElement, Ref, useContext, useEffect, useState } from 'react';
import CloseIcon from '@mui/icons-material/Close';

import type { MyShows, Recording } from '@/types/Tivo';
Expand All @@ -13,6 +13,7 @@ import Slide from '@mui/material/Slide';
import VideoJS from './VideoJS';
import Container from '@mui/material/Container';
import { useFetch } from '@/util/api';
import { tivoContext } from './TivoContext';

type Props = {
openState : boolean;
Expand Down Expand Up @@ -46,6 +47,7 @@ const Transition = forwardRef(function Transition(
const Playback = ({openState, close, recording} : Props) : JSX.Element => {
const [stream, setStream] = useState<Stream|null>(null);
const fetch = useFetch();
const context = useContext(tivoContext);


const clearSession = async (hlsSessionId : string) => {
Expand Down Expand Up @@ -120,7 +122,7 @@ const Playback = ({openState, close, recording} : Props) : JSX.Element => {
preload: 'auto',
autoplay: true,
sources : [{
src: `${stream.hlsSession.playlistUri}`,
src: `${(context?.apiBaseUrl ?? '') + stream.hlsSession.playlistUri}`,
type: 'application/x-mpegURL'
}]
}}
Expand Down

0 comments on commit 17d3c11

Please sign in to comment.