Use built in pause() and play() (#475)

Fix #474 and #428
This commit is contained in:
jacobcolbert
2019-05-18 10:56:39 -04:00
committed by Ilya Grigorik
parent d8965f644c
commit 568282a106

View File

@@ -483,7 +483,7 @@
} else if (action === 'fast') {
resetSpeed(v, value);
} else if (action === 'pause') {
pauseSpeed(v, value);
pause(v);
} else if (action === 'muted') {
muted(v, value);
} else if (action === 'mark') {
@@ -495,12 +495,12 @@
});
}
function pauseSpeed(v, target) {
// not working as expected in youtube for now
if (v.playbackRate === target) {
v.play()
function pause(v) {
if (v.paused) {
v.play();
} else {
v.pause();
}
resetSpeed(v, target)
}
function resetSpeed(v, target) {