]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-player-manager.ts
More robust tests
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-player-manager.ts
index 018845a54c85fecfb3da850273ec86d8dfdeea1b..ed82e0496595611024ac9fe0703d0aa5bd4bc0bd 100644 (file)
@@ -220,7 +220,9 @@ export class PeertubePlayerManager {
     const isHLS = mode === 'p2p-media-loader'
 
     let autoplay = this.getAutoPlayValue(commonOptions.autoplay)
-    let html5 = {}
+    let html5 = {
+      preloadTextTracks: false
+    }
 
     const plugins: VideoJSPluginOptions = {
       peertube: {
@@ -248,7 +250,7 @@ export class PeertubePlayerManager {
     if (isHLS) {
       const { hlsjs } = PeertubePlayerManager.addP2PMediaLoaderOptions(plugins, options, p2pMediaLoaderModule)
 
-      html5 = hlsjs.html5
+      Object.assign(html5, hlsjs.html5)
     }
 
     if (mode === 'webtorrent') {
@@ -500,7 +502,8 @@ export class PeertubePlayerManager {
       const isLoopEnabled = player.options_['loop']
       const items = [
         {
-          label: isLoopEnabled ? player.localize('Stop playing in loop') : player.localize('Play in loop'),
+          icon: 'repeat',
+          label: player.localize('Play in loop') + (isLoopEnabled ? '<span class="vjs-icon-tick-white"></span>' : ''),
           listener: function () {
             player.options_['loop'] = !isLoopEnabled
           }
@@ -518,6 +521,7 @@ export class PeertubePlayerManager {
           }
         },
         {
+          icon: 'code',
           label: player.localize('Copy embed code'),
           listener: () => {
             copyToClipboard(buildVideoOrPlaylistEmbed(videoEmbedUrl, videoEmbedTitle))
@@ -534,7 +538,10 @@ export class PeertubePlayerManager {
         })
       }
 
-      return items
+      return items.map(i => ({
+        ...i,
+        label: `<span class="vjs-icon-${i.icon || 'link-2'}"></span>` + i.label
+      }))
     }
 
     // adding the menu