Page 1 of 1

Audio Player on Start Screen Auto Play Not Working

Posted: Fri Mar 27, 2015 9:09 pm
by tcbeaton

I have an audio player on my app's start screen. The URL is hard-coded into the app and "Auto Play" is selected. When the app starts in the web test window, the audio starts playing immediately; when I run the app on my Samsung S4, the auto play is not honored. Is there something I'm missing? I've attempted to use the .play() and .start() JavaScript in the load and page show events with no success either. Thanks for your help.


Audio Player on Start Screen Auto Play Not Working

Posted: Sat Mar 28, 2015 4:35 am
by Illya Stepanov

Hi Thomas -

Could you please show us code that you used on the page load and show events?


Audio Player on Start Screen Auto Play Not Working

Posted: Mon Mar 30, 2015 5:51 pm
by tcbeaton

Hi Illya,

It's the audio properties on the right side of the page, see attached image. Unfortunately, you may not get the stream to play with this URL, since it's an internal URL within our company. The audio does play if you click on the player's play button, but it doesn't auto play, as indicated by the check box.

The app has four images with a click event that runs this code:

Appery("homePageAudioPlayer").attr("src","http://mm1.zradio.org:8008/;");

When clicking the images and executing the above code, if the players "auto play" box is checked, each of the new streams begin playing immediately; if the box is not checked, the play button is required to be pressed to start each stream. The only one that's not auto playing is the initial stream, which is hard coded (screen shot attached).

Image


Audio Player on Start Screen Auto Play Not Working

Posted: Tue Mar 31, 2015 4:00 am
by Yurii Orishchuk

Hi Thomas,

Please try the following:

  1. Add "page show" event hander.

  2. Populate it with following JS code:

    pre

    //Where "mobileaudio_56" is your audio component name.
    var player = Appery("mobileaudio_56").get(0);

    player.src = "http://mm1.zradio.org:8008/;";
    var onDelay = function(){
    player.play();
    };
    window.setTimeout(onDelay, 100);

    /pre

    Regards.