However the same type of issue occurs - if the user then clicks Next then Prev during this audio playback, the audio on the iPad does not restart from initial state. ALSO, I have tried having NO audio on a slide until a user clicks a specific button : eg "Play Audio" which then does a "Show Layer" which contains the audio.Have tried MANY variations on the attached file (adjusted all the checkboxes in the Cog layer where applicable) with varying issues.When navigating with NEXT from a page with audio that's part-way through and clicking PREV to return, the audio is always resumed from where it left off rather than resetting. Cannot get the iPad (1st generation iOS5 is our test spec) to "Reset to initial state".Mostly will work in Chrome although Slide 3 in this example doesn't seem to play audio in Chrome the FIRST time the slide is loaded.Need to be able to navigate with Next/Prev and have audio on each slide Reset to initial state and play from beginning in both iPad and Chrome.To get audio to work consistently on iPad and Google Chrome in HTML5 ONLY - am unable to use flash even on Chrome.Within the file I have placed some comments to explain what I'm trying to do on each Slide attempt and what I see seem to experience. I'm REALLY hoping someone out there is able to provide an example file (or preferably tweak my own) that works as I'd hoped.Īttached, I have a test file that I have made to try out various methods of getting consistent HTML5 audio on iPad and Chrome. Would appreciate any help on this - I am at my wits end.I've been banging my head for a few days now and tried so many combinations of things that I'm sure I'm now chasing my own tail. But all this only works when Safari is in focus, bot when in another app, or screen is locked. What I have tried: changing the src and calling the play event directly inside the audio element's ended event. To reproduce using the above example link:ģ) Wait around 3 minutes for the track to endĮxpected result: The next track should play automatically after ended event.Īctual result: The next track does not play in iOS 15 Safari. The Media Sessions API also sets the correct track name/title.Īn example is here (not mine as mine is behind a paywall but I can create a minimum reproducible example if required): play() resolves without errors, but audio does not play. After screenlock, the JS execution is still continuing after the ended event on the audio element as console.log pumps out text. Hi, I am getting this bug again too in Safari in iOS 15. ended event so we can play the next song. Either don't suspend JS execution for tabs playing audio, or at least fire the. When it finishes, audio will stop song2.mp3 will never.Įxpected results: The audio.ended event fires and the next song starts playing.Īctual results: The audio.ended event never fires because the screen is off or because Safari is in the background JS execution is suspended.Īdditional info: While suspending JS execution is wise for battery life reasons, it harms the user experience when listening to audio on the web. While song1.mp3 is playing, turn off the phone screen.ĥ. ended event handler, set audio.src = "song2.mp3", and. ended event handler to the audio element. In JavaScript, set audio.src = "song1.mp3", and. Here's a simple page that demonstrates the problem: ġ. ended event doesn't fire if the web app is running in the background or if the screen is off.
0 Comments
Leave a Reply. |