1.安装
npm install videojs-hotkeys
2.main.js中引入
import videojshotkeys from 'videojs-hotkeys' Vue.use(videojshotkeys)
3.videojs中使用
let player = videojs('#my-player', { autoplay: true, preload: 'auto', // aspectRatio: '16:9', playbackRates: [1, 1.25, 1.5, 1.75, 2], controlBar: { volumePanel: { inline: false }, fullscreenToggle: true, customControlSpacer: false } }, function () { this.addClass('test666') this.hotkeys({ volumeStep: 0.1, seekStep: 5, enableModifiersForNumbers: false }) })