Skip to content

Commit

Permalink
fix: trigger video event
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jun 25, 2017
1 parent 6bd08c0 commit 24bf673
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/DPlayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/DPlayer.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dplayer",
"version": "1.4.0",
"version": "1.4.1",
"description": "Wow, such a lovely HTML5 danmaku video player",
"main": "dist/DPlayer.min.js",
"style": "dist/DPlayer.min.css",
Expand Down
2 changes: 1 addition & 1 deletion src/DPlayer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
console.log('\n %c DPlayer 1.4.0 %c http://dplayer.js.org \n\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
console.log('\n %c DPlayer 1.4.1 %c http://dplayer.js.org \n\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');

require('./DPlayer.scss');
const utils = require('./utils.js');
Expand Down
6 changes: 4 additions & 2 deletions src/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ class Video {
// trigger event
trigger (type, event) {
const events = type === 'all' ? this.eventAll : this.eventCurrent;
for (let i = 0; i < events[event].length; i++) {
events[event][i]();
if (events[event]) {
for (let i = 0; i < events[event].length; i++) {
events[event][i]();
}
}
}

Expand Down

0 comments on commit 24bf673

Please sign in to comment.