HTML5 Audio: Chrome on Android doesn't automatically play song vs Chrome on PC does

I’ve made an HTML5 iPod.

You can try it here.

  • Testing background color espresso Android
  • Is Bluetooth File Exchange Completely Secure?
  • What is tools:mockup, tools:mockup_crop and tools:mockup_opacity
  • Convert String containing an ID into an Integer-ID
  • Android Media Player Restart Audio After Calling Stop
  • findViewById() returns null - tried EVERYTHING

    On a PC, while using Chrome. If I navigate to a song, it starts playing automatically.
    But while using Chrome on Android it doesn’t play the song. I have to hit the play/pause button again to play the audio.

    Here is the code which runs, when you select the song to play:

    audioPlayer.oncanplaythrough = "isAppLoaded";
    audioPlayer.autoplay = "autoplay";

    and here is the play/pause code.

            if (audioPlayer.paused)

    Could it have some thing to do with the ‘autoplay’ variable?
    The default browser in Android plays the song immediately.


    Related posts:

    using pre-built static libraries for Android NDK development
    How to slide image with finger touch in android?
    How to change the ActionBar text color in Android 5.0 Lollipop?
    How to create circular ProgressBar in android?
    How to extract or unpack an .ab file (Android Backup file)
    how to get user current opened application?
  • JSON jsonObject.optString() returns String “null”
  • Adding EditText to Alert Dialog.
  • How To Set Text In An EditText
  • Android No Resource Identifier Found for XLargeScreens
  • Changing the color of an object in an Android application
  • Eclipse error, “The selection cannot be launched, and there are no recent launches”
  • 4 Solutions collect form web for “HTML5 Audio: Chrome on Android doesn't automatically play song vs Chrome on PC does”

    Please refer this link …

    Chrome does not allow applications to play HTML5 audio without an explicit action by the user, similar to how it is handled by iOS, but differently than the stock Android browser handles it.

    Autoplay is not honored on android as it will cost data usage.

    In case someone bumps into this – Android version of Chrome in fact blocks autoplay function, but you can change settings of the browser. To do this, you have to enter chrome://flags and set Disable gesture requirement for media playback to on. It’s impossible to force this setting via web, but if you’re writing a dedicated web app like I did, you can use it.

    Update your Chrome to 29, this version now support WebAudio API and fixed many issues.

    see: Chrome for Android Update

    I’m using the SoundJS Lib and work very well in all browsers (only don’t work well in Default Android Browser and Chrome with the Android version is less than 4.1).

    See these examples:!/SoundJS/demos/testSuite

    Support for Web Audio API on Chrome for Android:

    SoundJS limitations:

    Add create.js to your page:

    <script src=""></script>

    and then launch sound this way:

        createjs.Sound.registerSound("./click.mp3", "x");
        setTimeout(function () {
        }, 10000)

    Works for me on lastest Android.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.