diff --git a/stream/tiling-frontend/package.json b/stream/tiling-frontend/package.json index f2b1860..be14666 100644 --- a/stream/tiling-frontend/package.json +++ b/stream/tiling-frontend/package.json @@ -12,8 +12,11 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.1", "@tsconfig/svelte": "^5.0.4", + "autoprefixer": "^10.4.19", + "postcss": "^8.4.40", "svelte": "^4.2.18", "svelte-check": "^3.8.1", + "tailwindcss": "^3.4.7", "tslib": "^2.6.3", "typescript": "^5.2.2", "vite": "^5.3.1" diff --git a/stream/tiling-frontend/postcss.config.js b/stream/tiling-frontend/postcss.config.js new file mode 100644 index 0000000..2e7af2b --- /dev/null +++ b/stream/tiling-frontend/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/stream/tiling-frontend/src/App.svelte b/stream/tiling-frontend/src/App.svelte index 10704c6..6f671d7 100644 --- a/stream/tiling-frontend/src/App.svelte +++ b/stream/tiling-frontend/src/App.svelte @@ -18,13 +18,15 @@ name: string; }[] | null = null; + let activePaths: string[] = []; + onMount(() => { const fetchData = async () => { try { const activeStreamResponse = await fetch( "http://localhost:8000/api/v1/active_stream", ); - activeStream = await activeStreamResponse.text(); + activeStream = (await activeStreamResponse.text()).replaceAll('"', ""); const pathListResponse = await fetch( "http://localhost:9997/v3/paths/list", ); @@ -36,7 +38,6 @@ delete newData[i].bytesSent; } } - console.log(videos); videos = Object.fromEntries( Object.entries(videos).filter(([_, v]) => v != null), ); @@ -44,9 +45,13 @@ if (JSON.stringify(newData) !== JSON.stringify(pathData)) { console.log("Data changed"); pathData = newData; + for (let pathIdx = 0; pathIdx < pathData?.length! - 1; pathIdx++) { + if (pathData![pathIdx].ready) { + activePaths.push(pathData![pathIdx].name); + } + } setTimeout(() => { for (const video in videos) { - console.log(video); const hlsInstance = new hls({ progressive: false }); hlsInstance.loadSource( `http://localhost:8888/${video}/index.m3u8`, @@ -75,45 +80,73 @@ >
-+ + +
No one is here yet!
Check back later