aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/test-embed.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-17 14:20:43 +0100
committerChocobozzz <me@florianbigard.com>2019-12-18 10:14:23 +0100
commit6377a9f2b0f762be9af61f46b4f0a9efd0c4b7c2 (patch)
treec632833f4275df8d75a6df55fe8673a7dec7c0ec /client/src/standalone/videos/test-embed.ts
parentc3b937916711136cb1ce974f769205439a3d2e04 (diff)
downloadPeerTube-6377a9f2b0f762be9af61f46b4f0a9efd0c4b7c2.tar.gz
PeerTube-6377a9f2b0f762be9af61f46b4f0a9efd0c4b7c2.tar.zst
PeerTube-6377a9f2b0f762be9af61f46b4f0a9efd0c4b7c2.zip
Fix test embed page
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})