Skip to content
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

Where exactly do I paste this code? #255

Open
blunatic28 opened this issue Mar 14, 2019 · 1 comment
Open

Where exactly do I paste this code? #255

blunatic28 opened this issue Mar 14, 2019 · 1 comment

Comments

@blunatic28
Copy link

Hello,

I am not experienced in coding, but I just customized a template and multiplied the players in my html, but obviously only the first one works (same issue as @hexplor had, here: #223).

I don't know where to paste this snippet provided by @patricklewis, I would appreciate your feedback. Or, if it's hard to explain, and someone can edit the file for me, I don't mind paying for your services.

My website is online, you can see the issue: www.christinageorgioumusic.com

Thanks!
Christina

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();
        }
    });
});

Originally posted by @patricklewis in #190 (comment)

@ikwyl6
Copy link

ikwyl6 commented Dec 4, 2023

Instead of multiple players, why not have one player with a song list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants