Closed dy closed 3 years ago
Side question: why all events are conventionally handled via player.on(event, handler)
, whereas onReady
requires a separate option? Why can't it just be player = new vlitejs(...); player.on('ready', handler)
?
Hey @yoriiis I like your player, it's nice looking good alternative, would like to use it in a little coming project (charity). If you'd consider making these little fixes to bring it to polished state, I can make a donation.
@yoriiis any hope for response?
neither
seekTo(x)
norplay()
work
@dy The autoplay policy is strict and can only be initiated by a user gesture. But, if the video is muted, the play is granted. The autoplay
parameter does it automatically (muted + play) and it works.
If you want to do some code before the play (seek or something else), you can use the onReady
function. The muted
needs to be enabled. There is a bug to transfer the mute option to the player, I will make a fix. You can still use the methods directly:
const player = new Vlitejs('#player', {
options: {
playPause: false,
time: false,
volume: false,
fullscreen: false,
poster: false
// muted: true To be fixed
},
provider: 'youtube',
onReady: async (player) => {
player.seekTo(10)
player.mute()
player.play()
}
})
Side question: why all events are conventionally handled via
player.on(event, handler)
, whereasonReady
requires a separate option? Why can't it just beplayer = new vlitejs(...); player.on('ready', handler)
?
When I wrote it, I preferred to separate the "onReady" function.
Hey @yoriiis I like your player, it's nice looking good alternative, would like to use it in a little coming project (charity). If you'd consider making these little fixes to bring it to polished state, I can make a donation.
Great, share your project when you're ready. Thanks for sponsoring me :)
just hangs with the error:
neither
seekTo(x)
norplay()
work