Skip to content

Commit

Permalink
Add video samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Feb 23, 2024
1 parent bb05df3 commit d5238b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/remote-room.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { get as getStore, writable, type Updater, type Writable } from 'svelte/store';
import { ref, onValue, get, child, update, type DatabaseReference } from 'firebase/database';
import { database } from './firebase';
import videoExample from './video-example';

export interface RemoteRoomRaw {
url: string;
Expand Down Expand Up @@ -30,7 +31,7 @@ export class RemoteRoom implements Writable<RemoteRoomRaw> {
initRoom = initSnapshot.val();
} else {
initRoom = {
url: '',
url: videoExample(),
paused: true,
time: 0,
isLocalMode: false,
Expand Down
12 changes: 12 additions & 0 deletions src/video-example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const videos = [
"https://youtu.be/8Ddhxl2omFc",
"https://youtu.be/XIv97tIImz8",
"https://youtu.be/ARP7zFYUvdg",
"https://youtu.be/W971JmpqWxM",
"https://youtu.be/emrL_OG-br0",
"https://youtu.be/3FE77v-Kclw",
];

export default function (): string {
return videos[Math.floor(Math.random() * videos.length)];
}

0 comments on commit d5238b0

Please sign in to comment.