-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to avoid autoplay #58
Comments
Yeah, this is done intentionally, so it may be hard to override. Here is the code that does this. https://github.com/mediafront/osmplayer/blob/2.x/src/osmplayer.js#L137 What you may be able to do is hook into the event handler, and alter the data.autoplay before it makes it to this code. You can also force the options within the player which should handle the case if your event handler is called after the playlist load. Here is what I am thinking, but I have not yet tested it.
|
HI thanks for your reply, my code load at the same time the playlist and the first element of it, so i'm not able to hook into the event handler before the loading. I've also try to stop the media but this intrudes every time i play any item. There's other similar solution or you've any others idea? minplayer.get('playlist', function(playlist) { playlist.options.playlist = path; playlist.options.autoplay = false; playlist.load(0, 0); // Bind to the play event of the media. media.bind('playing', {obj: this}, function(event) { media.pause(); }); }); |
Hi,
i have a problem when i switch from one playlist(youtube) to another, i can't stop auto-play of new video. How to load the first element of the playlist without auto-play?
can you help me please?
This is my code:
minplayer.get('media', function(media) {
media.stop();
minplayer.get('playlist', function(playlist) {
playlist.options.playlist = path;
playlist.options.autoplay = false;
playlist.load(0, 0);
})
});
Thanks
Marco A.
The text was updated successfully, but these errors were encountered: