Restore paused state after seek

This commit is contained in:
Sam Potts
2018-04-11 21:52:31 +10:00
parent ee79c46145
commit 5ed3ff9084
11 changed files with 37 additions and 11 deletions

View File

@ -270,6 +270,9 @@ const youtube = {
return Number(instance.getCurrentTime());
},
set(time) {
// Vimeo will automatically play on seek
const { paused } = player.media;
// Set seeking flag
player.media.seeking = true;
@ -278,6 +281,11 @@ const youtube = {
// Seek after events sent
instance.seekTo(time);
// Restore pause state
if (paused) {
player.pause();
}
},
});