You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need some clarification on how to set events vs listeners for a player instance (using version 3.6.8)
In the following example, I get inconsistent firing of events. The comments explain the behavior I'm seeing using Chrome on Windows 10 as my test browser.
var player = new Plyr('#video-player', {
listeners: {
ready: function (e) {
console.log('plyr ready', e); // does not fire
},
play: function (e) {
console.log('plyr: play', e); // fires for both play AND pause
},
pause: function (e) {
console.log('plyr: pause', e); // does not fire
},
seek: function (e) {
console.log('plyr: seek', e); // fires
}
}
});
player.on('ready', function (e) {
console.log('plyr: on(ready)', e); // fires
});
player.on('play', function (e) {
console.log('plyr: on(play)', e); // fires
});
player.on('pause', function (e) {
console.log('plyr: on(pause)', e); // fires
});
player.on('seek', function (e) {
console.log('plyr: on(seek)', e); // does not fire
});
It's weird that the play callback in the listeners option gets called for both play and pause, while the pause doesn't get called at all.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need some clarification on how to set events vs listeners for a player instance (using
version 3.6.8
)In the following example, I get inconsistent firing of events. The comments explain the behavior I'm seeing using Chrome on Windows 10 as my test browser.
It's weird that the play callback in the
listeners
option gets called for both play and pause, while the pause doesn't get called at all.Beta Was this translation helpful? Give feedback.
All reactions