]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/standalone/videos/test-embed.ts
Merge branch 'release/3.4.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / standalone / videos / test-embed.ts
index 066b3e0246b68c8280877bb42d8003b30745eb24..18c338a2da583d303c259fe2cb49a8b89e2a3d6f 100644 (file)
@@ -8,13 +8,15 @@ window.addEventListener('load', async () => {
 
   const isPlaylist = window.location.pathname.startsWith('/video-playlists/')
 
-  const elementId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0]
+  const elementId = !lastPart.includes('?') ? lastPart : lastPart.split('?')[0]
 
   const iframe = document.createElement('iframe')
   iframe.src = isPlaylist
     ? `/video-playlists/embed/${elementId}?api=1`
     : `/videos/embed/${elementId}?api=1`
 
+  iframe.sandbox.add('allow-same-origin', 'allow-scripts', 'allow-popups')
+
   const mainElement = document.querySelector('#host')
   mainElement.appendChild(iframe)
 
@@ -47,7 +49,7 @@ window.addEventListener('load', async () => {
   let playbackRates: number[] = []
   let currentRate = await player.getPlaybackRate()
 
-  const updateRates = async () => {
+  const updateRates = () => {
     const rateListEl = document.querySelector('#rate-list')
     rateListEl.innerHTML = ''
 
@@ -84,8 +86,6 @@ window.addEventListener('load', async () => {
     captionEl.innerHTML = ''
 
     captions.forEach(c => {
-      console.log(c)
-
       if (c.mode === 'showing') {
         const itemEl = document.createElement('strong')
         itemEl.innerText = `${c.label} (active)`