I know it’s possible since I’ve seen it in a few Hype-created apps, where audio starts as soon as the app launches without having to tap on any button. I’m assuming it’s done with some java library. If anyone can point me in the right direction?
This requires configuring the UIWebView or WKWebView of a native within the app properly to make sure it can autoplay audio. It isn’t a java library but how you program the app in Objective-C or Swift. The basic (and most modern) steps are:
Create a WKWebViewConfiguration object
Set the mediaTypesRequiringUserActionForPlayback property to WKAudiovisualMediaTypeNone
Initialize the WKWebView with the configuration object
Then in Hype audio can be played on actions that don’t require user actions, like the mentioned ‘On Scene Load’ action.
There’s a lot of moving parts and questions when programming a native app, so it is hard to help specifically more than the suggestion I gave without more details on your project… Here is sample Objective-C code showing how it is setup:
This can’t be copied/pasted directly, since it relies on knowledge of a [self view] and also probably a lot of things on what you want done with the webView.
If you want sound “on scene load” you can just put that in Hype. It works when building the app in Xcode both on iPad en iPhone.
If you want sound triggered by a timeline (I have tried that before, but did not work), then you probably need the code Jonathan showed you.