audio.play onComplete bug?

I’m playing an audio file and have an onComplete function, and within that function I check event.completed to make sure the audio finished playing.  However in HTML5 builds the event.completed is always false, it never returns true even on a successfull audio file play.

The code works just fine in simulator, iOs, Android, etc.  Only have this problem on HTML5 builds.

Here’s an example:

local playNext = function(event) if event.completed == true then print("DO STUFF") end end local handle = audio.loadSound("voices/test.mp3") audio.play( handle, {onComplete = playNext} )

I’m playing an audio file and have an onComplete function, and within that function I check event.completed to make sure the audio finished playing.  However in HTML5 builds the event.completed is always false, it never returns true even on a successfull audio file play.

The code works just fine in simulator, iOs, Androidcmy coles.etc.  Only have this problem on HTML5 builds. 

Here’s an example:

local playNext = function(event) if event.completed == true then print(“DO STUFF”) end end local handle = audio.loadSound(“voices/test.mp3”) audio.play( handle, {onComplete = playNext} )

Did you found solution for this? if yes then do let me know i am facing same kind of problem thanks :slight_smile:

Nope, still a bug.  I worked around it by ignoring event.completed when I am doing html5 builds.  It’s not an ideal solution because some of my sounds overlap now, but it’s not game breaking.  Is there a place to report actual bugs other than here?

On HTML5 build you have try something like this

if event.completed or ( event.channel == channel and not awardsoundstopped ) then
triggerrewardcoin()
end

event.completed is working fine with android/iOS where (event.channel == channel and not awardsoundstopped) is for HTML