From e1f5df533c5004eaee30617cdd4a8dbf1a637f21 Mon Sep 17 00:00:00 2001 From: webmiraclepro Date: Thu, 13 Sep 2018 04:20:13 +0800 Subject: [PATCH] Prevent YouTube from playing after seekTo when paused Still not ideal as it will show a spinner if the video hasn't been played yet, but better than nothing Partially fixes https://github.com/CookPete/react-player/issues/437 --- src/players/YouTube.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/players/YouTube.js b/src/players/YouTube.js index 73bf05b..a0b904b 100644 --- a/src/players/YouTube.js +++ b/src/players/YouTube.js @@ -71,6 +71,9 @@ export class YouTube extends Component { } seekTo (amount) { this.callPlayer('seekTo', amount) + if (!this.props.playing) { + this.pause() + } } setVolume (fraction) { this.callPlayer('setVolume', fraction * 100)