-
Notifications
You must be signed in to change notification settings - Fork 440
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
can i control the player via javascript? #190
Comments
Join to this question, thanks |
One more joining! |
You can call |
How can you get the instance ? I've tried this, but it doesn't work: audiojs.instances['0'].load($('a', this).attr('data-src')); |
Chiming in here too. Calling .play() on the audio element starts playing, but the actual element doesn't update and shows the pause icon still. |
As far as I know - This is because you are accessing the html5 audio instance and not the audiojs instance. |
As part of my work to write a script that would play sequentially through a list of multiple audio.js players on a page (representing CD tracks) I was able to call play() on audio.js instances and have the targeted player update to display a 'play' icon: $('.audiojs').each(function(index) {
var container = $(this);
var audioPlayer = container.find('audio');
audioPlayer.nextPlayerInstance = 'audiojs' + (index + 1);
audioPlayer.on('ended', function() {
if (audiojs.instances[audioPlayer.nextPlayerInstance]) {
audiojs.instances[audioPlayer.nextPlayerInstance].play();
}
});
}); |
@patricklewis you are my hero ! Thank you for this snippet :) You rock :) Thanks to that, i can control different playlists :) |
Hello, I had audiojs player on one of my ASP.NET page webform as show below and everything worked fine. My question is: Is there way to make the track play for only 30 seconds instead of the whole track after the play button was clicked? Thank you very much!
|
i want to trigger play or pause in js, thank you
The text was updated successfully, but these errors were encountered: