]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-videojs-plugin.ts
Add no result text if there are no results
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-videojs-plugin.ts
index 8b50e323e701a7d727a27f6a013cc3c533409f11..ca2b9a724929738e2f44f43c8c6c50b613bcede6 100644 (file)
@@ -2,7 +2,7 @@
 
 import * as videojs from 'video.js'
 import * as WebTorrent from 'webtorrent'
-import { VideoFile } from '../../../../shared'
+import { VideoFile } from '../../../../shared/models/videos/video.model'
 
 import { renderVideo } from './video-renderer'
 
@@ -235,9 +235,7 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
         if (err) return handleError(err)
 
         this.renderer = renderer
-        player.play()
-
-        return done()
+        player.play().then(done)
       })
     })
 
@@ -265,7 +263,7 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
     const isPaused = player.paused()
 
     // Hide bigPlayButton
-    if (!isPaused && this.player_.options_.bigPlayButton) {
+    if (!isPaused) {
       this.player_.bigPlayButton.hide()
     }
 
@@ -323,10 +321,14 @@ const peertubePlugin = function (options: PeertubePluginOptions) {
       player.updateVideoFile()
     } else {
       player.one('play', () => {
-        // Pause, we wait the video to load before
-        player.pause()
-
-        player.updateVideoFile(undefined, () => player.play())
+        // On firefox, we need to wait to load the video before playing
+        if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {
+          player.pause()
+          player.updateVideoFile(undefined, () => player.play())
+          return
+        }
+
+        player.updateVideoFile(undefined)
       })
     }