Forums

[Plugin: Audio Player] Can individual tracks be played by clicking links (2 posts)

  1. waitek
    Member
    Posted 1 year ago #

    I have multiple tracks playing through one audio player (version 2 beta). The forward/back track selection buttons are cool, but I'd also like to create a list of clickable track links to include elsewhere on the page. These links would control what track was playing. Is this possible? If so, what would a sample link look like? Thank you.

    http://wordpress.org/extend/plugins/audio-player/

  2. dronemetal
    Member
    Posted 11 months ago #

    hi waitek,

    i solved this problem quick and dirty by reloading the page and using a GET variable in the url to specify an audio file. i used php and will try to explain more:

    my page containing the player ist called "playerContainer.php". it has the player as you know it, only that the embed function will receive whatever parameter you give it in the url (i hope there is no security risk here):

    <div id="player">
    <script type="text/javascript">
    	AudioPlayer.embed("player", {soundFile: "http://www.droneband.de/juggerTemp/audio/<?= $_GET['audio'] ?>.mp3"
    	});
    </script></div>

    then you can create links from whereever you like to that page and pass the mp3 name wihout the ".mp3" ending. like this:

    <a href="playerContainer.php?audio=audioFilenameWithoutMp3Ending">Sample</a>

    works fine for me, although I wound prefer some way to pass the filename directly to the player via javascript. i hope this feature will be implemented in the future.

    let me know if you need more explanations!

Topic Closed

This topic has been closed to new replies.

About this Topic