Add feature to jump to marker (#471)

* Add options for setting marker and jumping to marker
* Correct "mute" to "muted"
This commit is contained in:
jacobcolbert
2019-05-06 00:41:16 -04:00
committed by Ilya Grigorik
parent e91b4c9cdb
commit d8965f644c
3 changed files with 30 additions and 9 deletions

View File

@@ -486,6 +486,10 @@
pauseSpeed(v, value);
} else if (action === 'muted') {
muted(v, value);
} else if (action === 'mark') {
setMark(v);
} else if (action === 'jump') {
jumpToMark(v);
}
}
});
@@ -520,6 +524,16 @@
v.muted = v.muted !== true;
}
function setMark(v) {
v.vsc.mark = v.currentTime;
}
function jumpToMark(v) {
if (v.vsc.mark && typeof v.vsc.mark === "number") {
v.currentTime = v.vsc.mark;
}
}
function handleDrag(video, controller, e) {
const shadowController = controller.shadowRoot.querySelector('#controller');