Skip to content

Commit

Permalink
Merge branch 'main' into custom-segment-storage-example
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlika committed Sep 26, 2024
2 parents 0d2b51f + 21a030f commit 2bc6d5c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import "./app.css";
import { P2PVideoDemo } from "p2p-media-loader-demo";

function App() {
return <P2PVideoDemo debugToolsEnabled={false} />;
return (
<P2PVideoDemo
streamUrl={
"https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.DmumNckWFTqz.m3u8"
}
debugToolsEnabled={false}
/>
);
}

export default App;
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { PeerDetails } from "p2p-media-loader-core";
import { HlsjsVidstackIndexedDB } from "./players/hlsjs/HlsjsVidstackIndexedDB";

type DemoProps = {
streamUrl?: string;
debugToolsEnabled?: boolean;
};

Expand Down Expand Up @@ -55,7 +56,10 @@ const playerComponents = {
vidstack_hls: HlsjsVidstack,
};

export const P2PVideoDemo = ({ debugToolsEnabled = false }: DemoProps) => {
export const P2PVideoDemo = ({
streamUrl,
debugToolsEnabled = false,
}: DemoProps) => {
const data = useRef<DownloadStats>({
httpDownloaded: 0,
p2pDownloaded: 0,
Expand Down Expand Up @@ -117,7 +121,7 @@ export const P2PVideoDemo = ({ debugToolsEnabled = false }: DemoProps) => {

return PlayerComponent ? (
<PlayerComponent
streamUrl={queryParams.streamUrl}
streamUrl={streamUrl ?? queryParams.streamUrl}
announceTrackers={trackers}
onPeerConnect={onPeerConnect}
onPeerClose={onPeerClose}
Expand Down

0 comments on commit 2bc6d5c

Please sign in to comment.