From 3bdd5b4f6d9273a33c00c293ad3f31ef8efbc5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Timb=C3=B3?= Date: Tue, 18 Apr 2023 19:27:01 -0300 Subject: [PATCH] remove videojs; use lvpr.tv instead (#43) --- client/src/receiver/index.css | 11 ++--------- client/src/receiver/index.html | 29 ++++++++--------------------- client/src/receiver/index.ts | 17 ++--------------- 3 files changed, 12 insertions(+), 45 deletions(-) diff --git a/client/src/receiver/index.css b/client/src/receiver/index.css index b0b6981..84658cc 100644 --- a/client/src/receiver/index.css +++ b/client/src/receiver/index.css @@ -15,22 +15,15 @@ body { background: #1f1f1f; } -#video { +#iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: none transparent; + border: none; /* transform: scaleX(-1); */ /* border: 1px solid #dddddd; */ /* box-sizing: border-box; */ } - -.vjs-big-play-button { - position: absolute !important; - top: 50% !important; - left: 50% !important; - transform: translate(-50%, -50%) !important; - transition: opacity 0.2s linear, color 0.2s linear; -} diff --git a/client/src/receiver/index.html b/client/src/receiver/index.html index cd24078..b8629a4 100644 --- a/client/src/receiver/index.html +++ b/client/src/receiver/index.html @@ -5,33 +5,20 @@ - + Just Cast It - - - - - + diff --git a/client/src/receiver/index.ts b/client/src/receiver/index.ts index 449b367..de98365 100644 --- a/client/src/receiver/index.ts +++ b/client/src/receiver/index.ts @@ -1,9 +1,6 @@ const { body } = document -const video = document.getElementById('video') - -// @ts-ignore -const player = videojs(video) +const iframe = document.getElementById('iframe') as HTMLIFrameElement // set background to transparent when inside iframe if (window.location !== window.parent.location) { @@ -17,9 +14,6 @@ console.log('hostname', hostname) console.log('port', port) console.log('pathname', pathname) -player.volume(1) -player.controls(true) - const humanId = pathname.substr(1) fetch(`/api/stream/${humanId}`) .then((res) => { @@ -32,12 +26,5 @@ fetch(`/api/stream/${humanId}`) return { playbackUrl } }) .then((info) => { - player.src({ - src: info.playbackUrl, - type: 'application/x-mpegURL', - withCredentials: false, - }) - player.hlsQualitySelector({ - displayCurrentQuality: true, - }) + iframe.src = `https://lvpr.tv/?v=${info.playbackId}` })