mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
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:

committed by
Ilya Grigorik

parent
e91b4c9cdb
commit
d8965f644c
14
inject.js
14
inject.js
@@ -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');
|
||||
|
||||
|
Reference in New Issue
Block a user