Skip to content

Commit

Permalink
Add streaming support
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Apr 12, 2024
1 parent 841e81b commit f1dedfc
Show file tree
Hide file tree
Showing 33 changed files with 464 additions and 216 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ VITE_FIREBASE_MEASUREMENT_ID=
# base URL where the website is hosted (e.g. https://watchtogether.online)
VITE_URL=

# base64 of JSON of iceServers (https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#iceservers) value (without quites in this file!)
VITE_ICE_SERVERS_JSON=

# usernames separated by comma to be randomly picked for users
VITE_USERNAMES=🐵,🐒,🦍,🦧,🐶,🐕,🦮,🐕‍🦺,🐩,🐺,🦊,🦝,🐱,🐈,🐈‍⬛,🦁,🐯,🐅,🐆,🐴,🫎,🫏,🐎,🦄,🦓,🦌,🦬,🐮,🐂,🐃,🐄,🐷,🐖,🐗,🐽,🐏,🐑,🐐,🐪,🐫,🦙,🦒,🐘,🦣,🦏,🦛,🐭,🐁,🐀,🐹,🐰,🐇,🐿️,🦫,🦔,🦇,🐻,🐻‍❄️,🐨,🐼,🦥,🦦,🦨,🦘,🦡,🦃,🐔,🐓,🐣,🐤,🐥,🐦,🐧,🕊️,🦅,🦆,🦢,🦉,🦤,🪶,🦩,🦚,🦜,🪽,🐦‍⬛,🪿,🐸,🐊,🐢,🦎,🐍,🐲,🐉,🦕,🦖,🐳,🐋,🐬,🦭,🐟,🐠,🐡,🦈,🐙,🪼,🦀,🦞,🦐,🦑,🐌,🦋,🐛,🐜,🐝,🪲,🐞,🦗,🪳,🕷️,🦂,🦟,🪰,🪱,💐,🌸,🪷,🏵️,🌹,🌺,🌻,🌼,🌷,⛄,🧸,🎃,🍇,🍈,🍉,🍊,🍋,🍌,🍍,🥭,🍎,🍏,🍐,🍑,🍒,🍓,🫐,🥝,🍅,🫒

Expand All @@ -25,5 +28,8 @@ VITE_PROXIES_HLS_URL=
# URL of running http proxy that proxies request to URL which provided in ?url= query parameter. better to have on dedicated server
VITE_PROXIES_REGULAR_URL=

# list of urls of custom web-torrent trackers separated by comma
VITE_WEB_TORRENT_TRACKERS=

# video URL examples (URL-encoded) separated by comma
VITE_URL_EXAMPLES=
32 changes: 32 additions & 0 deletions .env copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
VITE_FIREBASE_API_KEY=AIzaSyAaLHJrzUf7dEfOefuG1Q6rODGBlzMqz1I
VITE_FIREBASE_AUTHDOMAIN=movie-together-e5a84.firebaseapp.com
VITE_FIREBASE_DATABASE_URL=https://movie-together-e5a84-default-rtdb.europe-west1.firebasedatabase.app
VITE_FIREBASE_PROJECT_ID=movie-together-e5a84
VITE_FIREBASE_STORE_BUCKET=movie-together-e5a84.appspot.com
VITE_FIREBASE_MESSAGES_SENDER_ID=369270072783
VITE_VITE_FIREBASE_APP_ID=1:369270072783:web:431fbeaa1a21964a675eba
VITE_FIREBASE_MEASUREMENT_ID=G-39LEN0SXX6

VITE_USERNAMES="🐵,🐒,🦍,🦧,🐶,🐕,🦮,🐕‍🦺,🐩,🐺,🦊,🦝,🐱,🐈,🐈‍⬛,🦁,🐯,🐅,🐆,🐴,🫎,🫏,🐎,🦄,🦓,🦌,🦬,🐮,🐂,🐃,🐄,🐷,🐖,🐗,🐽,🐏,🐑,🐐,🐪,🐫,🦙,🦒,🐘,🦣,🦏,🦛,🐭,🐁,🐀,🐹,🐰,🐇,🐿️,🦫,🦔,🦇,🐻,🐻‍❄️,🐨,🐼,🦥,🦦,🦨,🦘,🦡,🦃,🐔,🐓,🐣,🐤,🐥,🐦,🐧,🕊️,🦅,🦆,🦢,🦉,🦤,🪶,🦩,🦚,🦜,🪽,🐦‍⬛,🪿,🐸,🐊,🐢,🦎,🐍,🐲,🐉,🦕,🦖,🐳,🐋,🐬,🦭,🐟,🐠,🐡,🦈,🐙,🪼,🦀,🦞,🦐,🦑,🐌,🦋,🐛,🐜,🐝,🪲,🐞,🦗,🪳,🕷️,🦂,🦟,🪰,🪱,💐,🌸,🪷,🏵️,🌹,🌺,🌻,🌼,🌷,⛄,🧸,🎃,🍇,🍈,🍉,🍊,🍋,🍌,🍍,🥭,🍎,🍏,🍐,🍑,🍒,🍓,🫐,🥝,🍅,🫒"

# base URL where the website is hosted (e.g. https://watchtogether.online)
VITE_URL=https://watchtogether.online

# base64 of JSON of iceServers (https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#iceservers) value (without quites in this file!)
VITE_ICE_SERVERS_JSON=WyB7ICJ1cmxzIjogWyJzdHVuOmZyZWVzdHVuLm5ldDo1MzUwIl0gfSwgeyAidXJscyI6IFsidHVybnM6ZnJlZXN0dW4udGVsOjUzNTAiXSwgInVzZXJuYW1lIjogImZyZWUiLCAiY3JlZGVudGlhbCI6ICJmcmVlIiB9IF0=

# [ all parameters below this line are optional ]
VITE_SENTRY_DSN=https://e622fa358656e1bdcec1b3409676fe7f@o4506688521175040.ingest.us.sentry.io/4506942185603072
VITE_ANALYTICS_MEASHUREMENT_ID=G-39LEN0SXX6

# URL of running HLS-proxy (https://github.com/warren-bank/HLS-Proxy). better to have on dedicated server
VITE_PROXIES_HLS_URL=https://proxy.watchtogether.online:15478

# URL of running http proxy that proxies request to URL which provided in ?url= query parameter. better to have on dedicated server
VITE_PROXIES_REGULAR_URL=https://proxy.watchtogether.online:41932

# list of urls of custom web-torrent trackers separated by comma
VITE_WEB_TORRENT_TRACKERS=wss://proxy.watchtogether.online:41932/torrent

# video URL examples (URL-encoded) separated by comma
VITE_URL_EXAMPLES="https://youtu.be/8Ddhxl2omFc,https://youtu.be/ARP7zFYUvdg,https://youtu.be/emrL_OG-br0,https://youtu.be/rSYmOg5MCPE,https://youtu.be/sfDcqfRiJZU,https://youtu.be/CQCcapWEbu8,https://youtu.be/LsbzC6fMjZo,https://youtu.be/Ef25BS-_V9Q,https://youtu.be/AhHQgUcfgCk,https://youtu.be/8sWZg7X1uCc,https://youtu.be/S_T6niL9dww,https://youtu.be/n3DPKpDqAcE,https://youtu.be/oE2Ut5Se1yk,https://youtu.be/aBkPorVbSkc,https://youtu.be/9iugIrxhWt4,https://youtu.be/Erk4-gbuRtA,https://youtu.be/bSrLXJsdYWE,https://youtu.be/O2psfobub3g,https://youtu.be/ygUWPgOSOfY,https://youtu.be/ihLLCDqILbY,https://youtu.be/QQcFlThmUXQ,https://youtu.be/-RiXrhp82No,https://youtu.be/ttJ6MQaY_UM,https://youtu.be/I_adw7auOc4,https://youtu.be/bPWnrpi4k8A,https://youtu.be/4SQzmu9TNUc,https://youtu.be/B0bllIPSp0w,https://youtu.be/S8mQAUq18JY,https://youtu.be/fLdcKn4mluo,https://youtu.be/13zANjUb87Q,https://youtu.be/n7bCjw99eBE,https://youtu.be/3Ii5hAjwrIs,https://youtu.be/fWpOvyDnyOo,https://youtu.be/3LQYWJGY1Vo,https://youtu.be/et3VfIpD7gM,https://youtu.be/NI9LctUiBQs,https://youtu.be/E77HnLXU-Sc,https://youtu.be/_xDZyklqgI8,https://youtu.be/gZrVHfdt0ss,https://youtu.be/NFz2h3A0GE0,https://youtu.be/MkNuvmFqV4M,https://youtu.be/Xi9Ae6zckOM,https://youtu.be/NKifgpK2A8I,https://youtu.be/Om5ZnYv3uPc,https://youtu.be/hypGOzKhQik,https://youtu.be/giOh-4cRsfc,https://youtu.be/oODOYFAW-Ak,https://youtu.be/4lOjwgJRz8M,https://youtu.be/xJAuPdyFoSQ,https://youtu.be/6zP4K0DIhIY,https://youtu.be/upjc-T-jZHo,https://youtu.be/ebkzBdughoo,https://youtu.be/-c0Cd4hbflE,https://youtu.be/uC_C_2xCm44,https://youtu.be/DfoAVV0cZec,https://youtu.be/IMbGlx1u1ko,https://youtu.be/P_dUMLmY0lY,https://youtu.be/f58jOye8D5A,https://youtu.be/Z7N_TQRfW7k,https://youtu.be/PyYjStlhs-Y,https://youtu.be/dPEBBJu_3uU,https://youtu.be/BLYNgCAPCug,https://youtu.be/1L0QUsRNOts,https://youtu.be/CcL3Y3SuIT0,https://youtu.be/-txOzir1KxY,https://youtu.be/5QXYsPOmcBw,https://youtu.be/9JSeoWrtoog,https://youtu.be/XOsJd88dSMg,https://youtu.be/vAGYjHkUZbE,https://youtu.be/6rgESNSNqAI,https://youtu.be/v3oeef0e1ss,https://youtu.be/iUj0j_QFxb4,https://youtu.be/lP9J1E7r1cs,https://youtu.be/XtiVPzif0L4,https://youtu.be/IXPDeAldkO4,https://youtu.be/JSsng-JYCck,https://youtu.be/MtAHllqOhIQ,https://youtu.be/JoU9_rqcOHQ,https://youtu.be/7s7AfYVYlgU,https://youtu.be/o65o4bsJ7Fg,https://youtu.be/h4jdohrp6w0,https://youtu.be/z8CCPgeSWP0,https://youtu.be/tMDWiCYuZoI,https://youtu.be/YZn_VN-LpAI,https://youtu.be/Y24SFizQ9gM,https://youtu.be/y9ZBFAzTdhs,https://youtu.be/4zgOu6M1K0I,https://youtu.be/ViO0uJJqWi0,https://youtu.be/oGjrNhKEs4I,https://youtu.be/mEY1HTUjxZE,https://youtu.be/T5v69aYldic,https://youtu.be/l9RxescLF3E,https://youtu.be/kKQ2ngKTLGA,https://youtu.be/99c61Ii48Jc,https://youtu.be/vFCXgCoEgNI,https://youtu.be/8zRsxVznKmk,https://youtu.be/uQT8OM0-Mzg,https://youtu.be/y8GafhyEsj0,https://youtu.be/7v3tkUuV84g,https://youtu.be/v1z_nnkEu4M,https://youtu.be/oDkM9D4WS_E,https://youtu.be/6CmkDFc-eco,https://youtu.be/v9lQH8t7Zb0,https://youtu.be/IHD52S2yNNk,https://youtu.be/EsBaNy4EMts,https://youtu.be/WgZinDNRVAM,https://youtu.be/H41i4MuxF0M,https://youtu.be/JsxOl-7uQag,https://youtu.be/t7zkgC_RC04,https://youtu.be/rz12graEZoM,https://youtu.be/xv5YTv25c3M,https://youtu.be/5MJqAnO_G5M,https://youtu.be/fQKQsoRXEo8,https://youtu.be/JBgrgbLPbXA,https://youtu.be/8B5vaajZbNg,https://youtu.be/PIi1p2QhhNg,https://youtu.be/R-TOPPrvNc8,https://youtu.be/bCcCvVQv0cw,https://youtu.be/xmV2bfuQwzg,https://youtu.be/lP2EajpzK-s,https://youtu.be/_Rwxj_pQZLE,https://youtu.be/EAt9UwmeMVw,https://youtu.be/laAulGiwYWE,https://youtu.be/6NvKTcpkCJ8,https://youtu.be/sz9qjHuPZJA,https://youtu.be/000ml_JnENY,https://youtu.be/QGs8uwi5yfg,https://youtu.be/34AAAV8YHwQ,https://youtu.be/Iv4nXSPR4XQ,https://youtu.be/o6PQzDAiFks,https://youtu.be/cbvCzgXTcP8,https://youtu.be/5pgsRC9hyoA,https://youtu.be/_BWFqYiIcbA,https://youtu.be/LHYkJ-5O2IM,https://youtu.be/6PoYr8tDGFk,https://youtu.be/IokmBrolboM,https://youtu.be/CUsUUbPOTx8,https://youtu.be/CgFkfGSypto,https://youtu.be/yi-ZDdZqT-o,https://youtu.be/wk_iXkTjavw,https://youtu.be/lbgwJJkVwCQ,https://youtu.be/JBZ0ESqdlO4,https://youtu.be/CZQ1tnVHw0Q,https://youtu.be/QA6C-rZ0OO4,https://youtu.be/HZA4Eck_GDA,https://youtu.be/istU-HkASK8,https://youtu.be/Po4iNQTbX7A,https://youtu.be/96Jb57jA9vA,https://youtu.be/-kTsedMyz5U,https://youtu.be/IBchPcGLK1Q,https://youtu.be/mT-bKk6dXvE,https://youtu.be/ih_FgmkndBg,https://youtu.be/kg-K7jrcEOw,https://youtu.be/BEAcpwsLeeA,https://youtu.be/_vOaaQsKBU8,https://youtu.be/-hewFad0X10,https://youtu.be/-nAqyGQDfck,https://youtu.be/1SXaqgmeZYM,https://youtu.be/D4rwQcR1yFY,https://youtu.be/fOh9Dr37CHo,https://youtu.be/_YoJs-r1AcU,https://youtu.be/leyxms14A6c,https://youtu.be/ryEPUnVOV1U,https://youtu.be/elIbCM0QKsM,https://youtu.be/JfUBB6NFdi0,https://youtu.be/nBNNHlUFSgo,https://youtu.be/QSIfRcmeidM,https://youtu.be/VwlZ8jTl4iI,https://youtu.be/tIL98L6QA_8,https://youtu.be/-wdWyeSfr4E,https://youtu.be/_cRBGFGZlB0,https://youtu.be/8IvnrENPKBE,https://youtu.be/LgwwbFYSgrE,https://youtu.be/vmdxaoIW3wQ,https://youtu.be/2E_H1F1WEm8,https://youtu.be/DALVD6nHH1Q,https://youtu.be/3gEFbkRqWgY,https://youtu.be/c5gCQQisces,https://youtu.be/z4afSe3Y60U,https://youtu.be/ieankB18LRs,https://youtu.be/xQ-EuIC3eGQ,https://youtu.be/q6-yI0WqCWM,https://youtu.be/3-dhotwhTNA,https://youtu.be/kWO_vkWITbU,https://youtu.be/izK48wi2TMk,https://youtu.be/zucjOXNauMc,https://youtu.be/Xk3xTXoQmuk,https://youtu.be/KyII_cRuqJU,https://youtu.be/S1vXy0qQ3kI,https://youtu.be/5N5x5pbsDdc,https://youtu.be/Tbbl6aYk_Rs,https://youtu.be/vnUaEq-F90I,https://youtu.be/Dhb3EZ9ASlI,https://youtu.be/FRwnXxydKso,https://youtu.be/lWEge9NiMeA,https://youtu.be/5a1Dgc3bQQk,https://youtu.be/yL9xoQOJwok,https://youtu.be/y7bxkV40IcA,https://youtu.be/S_btrF4xqt0,https://youtu.be/oLbqN_hn_9c,https://youtu.be/EM3k6Jx7yOM,https://youtu.be/qk2pfE6zP6E,https://youtu.be/jKuumKUpldE,https://youtu.be/afYr5SNTiSU,https://youtu.be/mTPYPWlMjwI,https://youtu.be/scpjfTJm_Io,https://youtu.be/2psUp-JULMc,https://youtu.be/sH55t_A0LY8,https://youtu.be/9Vyg7jXeI2U,https://youtu.be/q9pMWg4ww8A,https://youtu.be/Qml-zaUflzQ,https://youtu.be/6uUF-OJbneI,https://youtu.be/KD-jD_K-gtU,https://youtu.be/fqhmkvXdlGM,https://youtu.be/4J6Uw-KYMrA,https://youtu.be/C7jahGyPEf4,https://youtu.be/8ttQvqrJuUM,https://youtu.be/VEIgKTAbFr4,https://youtu.be/_HQOSFEQAFE,https://youtu.be/EirDYsMdn2k,https://youtu.be/yjDq6imM0x4,https://youtu.be/mf8Z66e3PCM,https://youtu.be/S_98JdLzrgs,https://youtu.be/J5KeAoqe1hs,https://youtu.be/OEHGuGGP9DA,https://youtu.be/HSM1Byt0kUw,https://youtu.be/Zt-TzTAuzbc,https://youtu.be/R4TT1CmX5Ig,https://youtu.be/VlyFy4NtRCE,https://youtu.be/wgoIX1AhsB4"
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ ARG VITE_VITE_FIREBASE_APP_ID
ARG VITE_FIREBASE_MEASUREMENT_ID
ARG VITE_USERNAMES
ARG VITE_URL
ARG VITE_ICE_SERVERS
ARG VITE_WEB_TORRENT_TRACKERS
ARG VITE_SENTRY_DSN
ARG VITE_ANALYTICS_MEASHUREMENT_ID
ARG VITE_PROXIES_HLS_URL
ARG VITE_PROXIES_REGULAR_URL
ARG VITE_URL_EXAMPLES
ARG NODE_ENV

RUN npm run build -- --mode $NODE_ENV && npm run copy-static
RUN npm run build -- --mode $NODE_ENV

FROM scratch as bundle
COPY --from=builder /app/dist /dist
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@vime/svelte": "^5.4.1",
"firebase": "^10.8.1",
"firebase-admin": "^12.0.0",
"prettier-bytes": "^1.0.4",
"sass": "^1.71.1",
"svelte": "^4.2.12",
"svelte-check": "^3.6.6",
Expand Down
3 changes: 2 additions & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import { _ } from 'svelte-i18n';
import { randomStr } from './utils';
import Analytics from './analytics.svelte';
import LanguageSelector from './components/language-selector.svelte';
import Page from './components/index.svelte';
import { environment, isProduction } from './settings';
import './app.scss';
import LanguageSelector from './components/language-selector.svelte';
let header;
let roomId: string;
Expand Down Expand Up @@ -59,6 +59,7 @@
· <a class="uk-text-muted" href="https://svelte.dev" target="_blank">Svelte</a>
· <a class="uk-text-muted" href="https://firebase.google.com" target="_blank">Firebase</a>
· <a class="uk-text-muted" href="https://vidstack.io" target="_blank">Vidstack</a>
· <a class="uk-text-muted" href="https://webtorrent.io" target="_blank">WebTorrent</a>
· <a class="uk-text-muted" href="https://getuikit.com" target="_blank">UIkit</a>
</div>
<div>
Expand Down
2 changes: 0 additions & 2 deletions src/analytics.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts" context="module">
import type { SourceType } from './normalize-link';
import { analytics, isProduction } from './settings';
const trackRaw = function (...args: any[]) {
Expand Down Expand Up @@ -38,7 +37,6 @@
export class WatchedMinuteEvent extends Event<{
roomId: string;
sourceType: SourceType;
url: string;
}> {
readonly name: string = 'watch_minute';
Expand Down
Loading

0 comments on commit f1dedfc

Please sign in to comment.