Fix seeking on auto resolution change
authorChocobozzz <me@florianbigard.com>
Fri, 8 Jun 2018 12:20:43 +0000 (14:20 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 8 Jun 2018 12:20:43 +0000 (14:20 +0200)
client/e2e/src/po/video-watch.po.ts
client/src/assets/player/peertube-videojs-plugin.ts

index fce8a6c3df06eadbb6f609ebbedb4c3b3c2d0fc0..13f4ae94592618e04c7d1bd10703ec61e406d144 100644 (file)
@@ -54,6 +54,12 @@ export class VideoWatchPage {
     const videojsEl = element(by.css('div.video-js'))
     await browser.wait(browser.ExpectedConditions.elementToBeClickable(videojsEl))
 
+    // On Android, we need to click twice on "play" (BrowserStack particularity)
+    if (isMobileDevice) {
+      await browser.sleep(3000)
+      await videojsEl.click()
+    }
+
     await browser.sleep(7000)
 
     return videojsEl.click()
index f303301d5f0df50574dded8190cd827a179b6862..e4fea0991901159fdfedd3d21bfbe55782ae99ab 100644 (file)
@@ -263,7 +263,7 @@ class PeerTubePlugin extends Plugin {
     const options = {
       forcePlay: false,
       delay,
-      seek: currentTime
+      seek: currentTime + (delay / 1000)
     }
     this.updateVideoFile(newVideoFile, options)
   }
@@ -310,6 +310,7 @@ class PeerTubePlugin extends Plugin {
                           this.player.pause()
                           this.player.posterImage.show()
                           this.player.removeClass('vjs-has-autoplay')
+                          this.player.removeClass('vjs-has-big-play-button-clicked')
 
                           return done()
                         })