Commit fb94e5bf by Tianqing Liu

feat: 增加节流控制

1 parent 3ecf4e47
......@@ -2,13 +2,12 @@
<div ref="container"
:data-player-type="this.playerType"
:class="containerClassName"
@wheel="handleWheel"
>
</div>
</template>
<script>
import { merge } from 'lodash';
import { merge, throttle } from 'lodash';
// checkSupportMSEHevc checkSupportSIMD, checkSupportWCSHevc
import { getWatermarkCanvasImg } from './utils';
import { getPlayerConfig, getRotateConfig, getMirrorRotate, getPlaybackConfig } from './config';
......@@ -143,6 +142,7 @@ export default {
});
// 电子放大
this.$refs.container.addEventListener('wheel', throttle(this.handleWheel, 200));
},
setForward(rate) {
this._jessibuca.forward(rate);
......@@ -180,7 +180,6 @@ export default {
},
handleWheel(event) {
console.log('handleWheel', event);
// TODO: 增加防抖动
event.stopPropagation();
const direction = event.deltaY < 0;
this.zoom(direction);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!