Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/core/src/components/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export default class TinyPlayEvents {
const type = this.type(name)
if (type && typeof callback !== 'function') return console.error(`${name} 事件的回调函数必须是一个函数`)
if (!this.events[name]) this.events[name] = []
this.events[name].push(callback)
// 重复代码 移除
// this.events[name].push(callback)
// video 事件,直接绑定到 video 元素上
if (type === 'video') {
this.player.video.addEventListener(name, callback)
Expand Down