Skip to content

Commit

Permalink
Add remote server option for Broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-face committed May 28, 2024
1 parent 747d5d1 commit 6ce803f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions widget/page/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ const Option2Broadcast = ({ url, pId }) => {
);
};

const Option3Broadcast = ({ pId }) => {
return (
<>
Set api key and start a stream!
<Markdown text={broadcastApiKeyCode} />
<Broadcast.GenerateStream
url={"https://livepeer-webserver-613b208ef083.herokuapp.com"}
/>
<Broadcast.Player />
Or you can insert a playbackId and watch a stream:
<Broadcast.WatchStream pId={pId} />
</>
);
};

const [selectedOption, setSelectedOption] = useState("apiKey");
const [selectedComponent, setSelectedComponent] = useState("player");
const [displayVideo, setDisplayVideo] = useState(false);
Expand Down Expand Up @@ -229,6 +244,19 @@ return (
<Option2Broadcast url={url} pId={pId} />
</>
)}
{selectedOption === "remoteServer" && (
<>
<div>
Provide a playbackId if you wanna watch a stream:
<input
type="text"
onChange={(event) => setPid(event.target.value)}
value={pId}
/>
</div>
<Option3Broadcast pId={pId} />
</>
)}
</>
)}
</div>
Expand Down

0 comments on commit 6ce803f

Please sign in to comment.