mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-22 02:18:45 -04:00
set min/max on playback speed
Video playback range in Chrome: [0.0625, 16] Audio playback range in Chrome: [0.05, 4] Setting min to 0.05 and max to 16, since outside of this range you're not getting audio or video. closes #26
This commit is contained in:
@@ -102,9 +102,13 @@ chrome.extension.sendMessage({}, function(response) {
|
|||||||
if (action === 'rewind') {
|
if (action === 'rewind') {
|
||||||
v.currentTime -= rewindTime;
|
v.currentTime -= rewindTime;
|
||||||
} else if (action === 'faster') {
|
} else if (action === 'faster') {
|
||||||
v.playbackRate += speedStep
|
// Maxium playback speed in Chrome is set to 16:
|
||||||
|
// https://code.google.com/p/chromium/codesearch#chromium/src/media/blink/webmediaplayer_impl.cc&l=64
|
||||||
|
v.playbackRate = Math.Min(v.playbackRate + speedStep, 16);
|
||||||
} else if (action === 'slower') {
|
} else if (action === 'slower') {
|
||||||
v.playbackRate = Math.max(v.playbackRate - speedStep, 0.00);
|
// Audio playback is cut at 0.05:
|
||||||
|
// https://code.google.com/p/chromium/codesearch#chromium/src/media/filters/audio_renderer_algorithm.cc&l=49
|
||||||
|
v.playbackRate = Math.max(v.playbackRate - speedStep, 0.05);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user