Viewing 9 replies - 1 through 9 (of 9 total)
  • If he’s putting it in the generic ‘text’ sidebar widget – it takes HTML – inline code isn’t going to work since the widget isn’t geared for that (I tried that with WPAudio a couple of weeks ago, but have since decided I didn’t need the audio in a sidebar).

    If the current audio plugin isn’t working then he might try simply using either an audioplayer widget for the sidebar or getting a player that outputs HTML so that it can be used.

    Thread Starter marillawex

    (@marillawex)

    Hmmm……okay – thanks! Audio Player is working well in the rest of the site – but I’ll look for another plugin that has a widget. Thanks for your help!

    You could use the PHP Code widget: https://www.ads-software.com/extend/plugins/php-code-widget/

    Then insert the PHP code found in my FAQ page: https://wpaudioplayer.com/frequently-asked-questions

    Martin

    I tried your solution as described above and It doesn’t seem to be working. I’m most likely doing something wrong, but I’m not sure what.

    Here is the site in question. I’m trying to get a test file to play in the widget with Music as the title.

    https://www.shiphighintransit.com/

    Here is the code I’m using.

    <?php if (function_exists("insert_audio_player")) {insert_audio_player("[audio:https://www.shiphighintransit.com/wordpress2/wp-content/audio/test01.mp3]"); } ?>

    Thanks

    Much easier way to use the same Audio Player in a widget is to download the standalone version and extract “player.swf” and “audio-player.js” to your server, and call up the player.swf using object type:

    <object type=”application/x-shockwave-flash” data=”https://your server location/player.swf” id=”audioplayer1″ height=”24″ width=”240″>
    <param name=”movie” value=”https://your server location/player.swf”>
    <param name=”FlashVars” value=”playerID=audioplayer1&soundFile=https://YOUR_URL.mp3″>
    <param name=”quality” value=”high”>
    <param name=”menu” value=”false”>
    <param name=”wmode” value=”transparent”>

    Works like a charm for me.

    Check out this website for more details: https://www.macloo.com/examples/audio_player/index.html

    I recommend mahvin’s solution. Thanks for that, mahvin.

    I used another method though, by creating a child theme and adding this code to the top of the sidebar.php

    <?php if (function_exists("insert_audio_player")) {
      insert_audio_player("[audio:https://example.org/path/to/audiofile/song.mp3|autostart=yes|loop=yes]");
    } ?>

    Adding |autostart=yes|loop=yes makes the file start when the page is loaded and loops the file.
    The player is loaded in the top of the sidebar and does not act like a widget. The player starts over when the visitor browses to a different page. For me this did the trick.

    Hi

    I’m using the “get custom fields” plugin to call an mp3 link from a weekly post into the sidebar.

    the idea is to have a track of the week so I cant use the php to hard code a single mp3 into the sidebar. I want it to dynamically call the link from the weekly post.

    is there some way I can edit the code

    <?php if (function_exists(“insert_audio_player”)) { insert_audio_player(“[audio:https://www.domain.com/path/to/song.mp3%5D&#8221;);
    } ?>

    to replace the audio:”URL” with the link in the custom field?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Use Audio Player in a sidebar widget?’ is closed to new replies.