Playback rate (#411)

* update
This commit is contained in:
Harvey Zack authored and GitHub committed 2022-10-29 21:14:17 +08:00
1 parent efc9cf7362
commit 6715bc457a
16 files changed
+268 -267

No files matched your search

@@ -1,4 +1,4 @@
import { errorHandle, def } from '../utils';
import { def } from '../utils';
export default function playbackRateMix(art) {
const {
@@ -14,8 +14,6 @@ export default function playbackRateMix(art) {
set(rate) {
if (rate) {
if (rate === $video.playbackRate) return;
const rateList = [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 3.0, 4.0];
errorHandle(rateList.includes(rate), `'playbackRate' only accept ${rateList.toString()} as parameters`);
$video.playbackRate = rate;
notice.show = `${i18n.get('Rate')}: ${rate === 1.0 ? i18n.get('Normal') : `${rate}x`}`;
art.emit('playbackRate', rate);