Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DOMException: play() failed because the user didn't interact with the document first.

Eslam_ElbyalyJul 11 2024

Hi.

I've developed a PWA using APEX 23.2 then used https://www.webintoapp.com/ to convert it into .APK file.

My Login page has a static region for playing audio…

<audio id="myAudio" autoplay>
    <source src="#APP_FILES#AudioFiles/LoginAudio5FadingOut.mp3" type="audio/mpeg"></source>
</audio>

When run the app using Windows 11 Home edition> MS Edge browser, the audio file plays most of the time. And some times, the browser shows error…

DOMException: play() failed because the user didn't interact with the document first.

But when I converted the app into .APK file and try to test it on an Android Mobile phone, the audio file never runs.

I tried to make a button that when clicked plays the audio file using…

document.getElementById("myAudio").play();

And created another page load dynamic action to simulate user click on that button using…

$("#TEST_PLAY_AUDIO").click();

But unfortunately, it did not work.

Is there a way to make it work?

Thanks a lot

Comments
Post Details
Added on Jul 11 2024
4 comments
415 views