Media element autoplay property does not work

:backhand_index_pointing_right: Bug Description


1. Summary

Playback doesn’t start automatically when mediaElement.autoplay is set to true.

Note that we’ve always had this issue and we’ve had to do some workarounds to make it work, as we have scenarios where we need to start playing automatically and scenarios where we just need to load playback.

Bug Severity
Select one that applies

  • Impacts operation of app
  • Blocks current development
  • Improvement suggestion
  • Issue with documentation (If selected, please share the doc link and describe the issue)
  • Other

2. Steps to Reproduce

  • set mediaElement.autoplay = true
  • play something

3. Observed Behavior

Playback doesn’t start automatically. We need to call mediaElement.play() to start playback.

4. Expected Behavior

Playback starts automatically if mediaElement.autoplay = true

4.a Possible Root Cause & Temporary Workaround

Workaround: if mediaElement.autoplay is true, then call mediaElement.play() to “fake” the autoplay.

5. Logs or crash report

6. Environment

Please fill out the fields related to your bug below:

  • SDK Version: 0.20.2975

  • App State: Foreground

  • OS Information
    Please ssh into the device via kepler exec vda shelland copy the output from cat /etc/os-releaseinto the answer section below. Note, if you don’t have a simulator running or device attached kepler exec vda shell will respond with vda: no devices/emulators found

    NAME="OS"
    OE_VERSION="4.0.0"
    OS_MAJOR_VERSION="1"
    OS_MINOR_VERSION="1"
    RELEASE_ID="10"
    OS_VERSION="1.1"
    BRANCH_CODE="TV Ship"
    BUILD_DESC="OS 1.1 (TV Ship/98)"
    BUILD_FINGERPRINT="4.0.152680.0(3072cab629675a74)/98N:user-external/release-keys"
    BUILD_VARIANT="user-external"
    BUILD_TAGS="release-keys"
    BUILD_DATE="Tue Aug 26 03:25:49 UTC 2025"
    BUILD_TIMESTAMP="1756178749"
    VERSION_NUMBER="1001010009850"
    

7. Example Code Snippet / Screenshots / Screengrabs

N/A


:backhand_index_pointing_right: Playback Issues


If this is a playback issue, please provide your VPKG and/or content URL, any pre-conditions (like geo-location) [Share privately with your Amazon contact] , and let us know if it’s x86 or arm7.


<!-- Describe your playback issue if applicable -->

Please share the following details in addition:_

  • Player SDK: [Bitmovin, Shaka, ...]
  • Player SDK Version: [e.g. 1.23]
    • Audio Codecs: [AAC, ...]
    • Video Codecs: [h.264, mp4]
    • Manifest Types: [m3u8, dash, etc ..]

Q: Would you like to be contacted to share your latest VPKG compiled with latest SDK:

[Y/N] [Share privately with your Amazon contact]

Q: VPN or Login needed to verify functionality in VPKG?

[Y/N] [Share privately with your Amazon contact]

Q: If applicable, please provide your media/content url
If this is created dynamically, tokenized, etc please provide a way for us to access it

[N/A or Content / Media Url for testing] [Share privately with your Amazon contact]

Q: Are there any special headers required to reproduce the issue you are facing?

[N/A or Insert Headers]

Additionally please provide the following if possible
Provide Screenshots / Screengrabs / Logs. Please include as much information as you can that will help debug.

<!-- Answer here if applicable --> 

:backhand_index_pointing_right: Additional Context


Any Additional Context you would like to provide?
Add any other relevant information, such as recent updates to the SDK, dependencies, or device OS that may affect the bug.

<!-- Answer here if applicable  --> 

Hi @David_Mitjana_Castro ,

Could you please provide logs for the issue you have observed?

Thanks,
Rohit

I’ve just found the issue on our side → we were setting the media element’s autoplay property before calling the media element’s initialize() method, so the player was trying to play before initializing and it failed - but no errors were shown.

It makes sense to first “initialize” the media element and then set the autoplay property, but it’s not straightforward to guess this if it’s not highlighted in the docs, even though the docs first call the initialize() method and then set the autoplay property.

Would be good to have a comment added to the Media Player Walkthrough docs so it’s clear that it’s key to set the autoplay property after calling the media element’s initialize() method. Also the player could throw a warning log if autoplay is set before initializing the media element.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.