Skip to content

Commit

Permalink
[OSX/Linux] Fix Video Not Starting Sometimes #111
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed Jul 18, 2016
1 parent 7070e7b commit 875cdaf
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/components/Player/utils/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,17 @@ events.opening = () => {
} catch (e) {}
}

// _.defer(() => {
_.defer(() => {
PlayerActions.updateImage(image);
ProgressActions.settingChange({
position: 0
});
player.events.emit('setTitle', player.wcjs.playlist.items[player.wcjs.playlist.currentItem].title);
// });
});
_.delay(() => {
PlayerActions.updateImage(image);
}, 1000)

ProgressActions.settingChange({
position: 0
});
player.events.emit('setTitle', player.wcjs.playlist.items[player.wcjs.playlist.currentItem].title);

player.set({
lastItem: player.wcjs.playlist.currentItem,
Expand Down Expand Up @@ -233,11 +237,19 @@ events.playing = () => {

player.secondPlay = true;

// i hate this, but otherwise it bugs
_.delay(() => {
// i don't like it, but if a delay is not set it sometimes bugs
PlayerActions.updateImage(player.itemDesc().setting.image);
}, 500);

_.delay(() => {
PlayerActions.updateImage(player.itemDesc().setting.image);
}, 1000);

_.delay(() => {
PlayerActions.updateImage(player.itemDesc().setting.image);
}, 1500);

// catch first play event
prebuffering.end();

Expand Down

0 comments on commit 875cdaf

Please sign in to comment.