Refactor Artplayer class to add keydown event listener

This commit is contained in:
Harvey Zack committed 2024-10-20 16:21:34 +08:00
1 parent 0ddb7751a1
commit b6df6a6148
9 files changed
+87 -42

No files matched your search

@@ -785,6 +785,23 @@ art.on('muted', (state) => {
});
```
## `keydown`
监听来自 `document` 的 `keydown` 事件
<div className="run-code">▶ Run Code</div>
```js{6}
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
});
art.on('keydown', (event) => {
console.log(event.code);
});
```
## `video:canplay`
The browser can play the media file, but estimates there is not enough data to play through to the end without having to stop for further buffering