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

hello #7

Open
john1-lab opened this issue Apr 30, 2021 · 1 comment
Open

hello #7

john1-lab opened this issue Apr 30, 2021 · 1 comment

Comments

@john1-lab
Copy link

john1-lab commented Apr 30, 2021

Hi, thanks for this project it's very useful for those who doesn't have the advanced knowledge of javascript. I have a question i'd be appreciated if you can answer. Im using a code like this to start the music:

<button onclick="musicPlayer('Test','test.mp3');" class="btn_ "><i class="fa fa-play-circle " id="display-buton "></i><img src=" {% static 'photos/..jpg' %} " alt="img" class="img" ></button>
musicPlayer contains these codes:


function musicPlayer(music_name, music) {

        var iconImage = null;

        AP.init({
            container: '#player', //a string containing one CSS selector
            volume: 0.7,
            autoPlay: true,
            notification: true,
            playList: [{
                'icon': iconImage,
                'title': music_name,
                'file': music
            }]
        });
    }

it starts the music perfectly but there is an issue. I can't start another music with another button(the same button code with above but contains another mp3 file). What i wanna do is when a music runs on player, i wanna be able to change it with clicking on another button. The code above cannot do that.

@john1-lab
Copy link
Author

i have to refresh the page to be able to change the music. Im waiting for your help <3

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

1 participant