From 91d9558963c4eb6e47d74a14ff8d527c6326e0e1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 8 Jun 2018 14:20:43 +0200 Subject: [PATCH] Fix seeking on auto resolution change --- client/e2e/src/po/video-watch.po.ts | 6 ++++++ client/src/assets/player/peertube-videojs-plugin.ts | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/e2e/src/po/video-watch.po.ts b/client/e2e/src/po/video-watch.po.ts index fce8a6c3d..13f4ae945 100644 --- a/client/e2e/src/po/video-watch.po.ts +++ b/client/e2e/src/po/video-watch.po.ts @@ -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() diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index f303301d5..e4fea0991 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -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() }) -- 2.25.1