0

I have a php-script (it fetches mp3-files from MySQL database) and flash-player for listening. Working with player has been implemented with swfObject 2.2. If I'm loading one mp3-file, it works fine. But if I want to load some mp3, I get only the last mp3 in player(in html-source I see all, what needed, but not on the frontpage)

swfobject and mp3-player includes correctly, because working with one file is ok.

any clues?

    <div class="myFlashPlayers">
    <script type="text/javascript">
    var flashvars = {url:'1.mp3',artist:'artist1', track:'track1', duration:'4:32'};
    var params = {};
    var attributes = {};
    swfobject.embedSWF("player.swf", "myAlternativeContent", "320", "40", "9.0.0", false, flashvars, params, attributes);


    var flashvars = {url:'2.mp3',artist:'artist2', track:'track2', duration:'1:03'};
    var params = {};
    var attributes = {};
    swfobject.embedSWF("player.swf", "myAlternativeContent", "320", "40", "9.0.0", false, flashvars, params, attributes);
    </script></div>

1 Answer 1

1

The name parameter becomes the <object>'s DOM id parameter (among other things), which has to be unique. You'll have to assign a different name in each swfobject invocation. Even just appending 1, 2, etc... will be enough.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.