aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/test-embed.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/standalone/videos/test-embed.ts')
-rw-r--r--client/src/standalone/videos/test-embed.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/standalone/videos/test-embed.ts b/client/src/standalone/videos/test-embed.ts
index 8e83d92a9..e5e6365dc 100644
--- a/client/src/standalone/videos/test-embed.ts
+++ b/client/src/standalone/videos/test-embed.ts
@@ -9,6 +9,7 @@ window.addEventListener('load', async () => {
9 9
10 const iframe = document.createElement('iframe') 10 const iframe = document.createElement('iframe')
11 iframe.src = `/videos/embed/${videoId}?autoplay=1&controls=0&api=1` 11 iframe.src = `/videos/embed/${videoId}?autoplay=1&controls=0&api=1`
12
12 const mainElement = document.querySelector('#host') 13 const mainElement = document.querySelector('#host')
13 mainElement.appendChild(iframe) 14 mainElement.appendChild(iframe)
14 15
@@ -93,4 +94,12 @@ window.addEventListener('load', async () => {
93 resolutions => updateResolutions(resolutions)) 94 resolutions => updateResolutions(resolutions))
94 player.addEventListener('resolutionUpdate', 95 player.addEventListener('resolutionUpdate',
95 resolutions => updateResolutions(resolutions)) 96 resolutions => updateResolutions(resolutions))
97
98 const updateVolume = (volume: number) => {
99 const volumeEl = document.getElementById('volume')
100 volumeEl.innerText = (volume * 100) + '%'
101 }
102
103 player.getVolume().then(volume => updateVolume(volume))
104 player.addEventListener('volumeChange', volume => updateVolume(volume))
96}) 105})