You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app that I wrote and released for Android and am now testing and modifying as required for iOS. I use SimpleAudioPlayer as an easy cross-platform way of playing audio clips.
I only ever need to play one clip at a time, so I wrote the program to instantiate the object and reference the "current" player, similar to:
player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
I intercept the playback ended event and tell it the next clip to play. This worked fine on Android. On iOS, it threw an error that the object had been modified or no longer existed (sorry I don't have the exact error but can re-created it if necessary). I ended up working around the issue by using the the create player call like this instead:
player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.CreateSimpleAudioPlayer();
And calling this again in each playback ended event to re-create the object, as well as adding the playback ended event again.
Is this difference in behaviour between Android and iOS expected? The code as modified for iOS does also work on Android, but I don't know if there might be side effects?
The text was updated successfully, but these errors were encountered:
I have an app that I wrote and released for Android and am now testing and modifying as required for iOS. I use SimpleAudioPlayer as an easy cross-platform way of playing audio clips.
I only ever need to play one clip at a time, so I wrote the program to instantiate the object and reference the "current" player, similar to:
player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
I intercept the playback ended event and tell it the next clip to play. This worked fine on Android. On iOS, it threw an error that the object had been modified or no longer existed (sorry I don't have the exact error but can re-created it if necessary). I ended up working around the issue by using the the create player call like this instead:
player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.CreateSimpleAudioPlayer();
And calling this again in each playback ended event to re-create the object, as well as adding the playback ended event again.
Is this difference in behaviour between Android and iOS expected? The code as modified for iOS does also work on Android, but I don't know if there might be side effects?
The text was updated successfully, but these errors were encountered: