I have a freshly created application in order to test audio on mobile (ios/ iphone SE). Based on WebAudio documentation and the react 360 issues regarding the issue, I've learned that I needed to create an html button entity to create 'user interaction' and then once that is achieved, the audio should work.
Expected behavior
Audio should play on mobile when a user clicks the html button from index.html
Actual behavior
Audio fails to play on mobile when a user clicks the html button from index.html
Reproduction
Here is the code:
index.html
<html>
<head>
<title>ExampleVR</title>
<style>body { margin: 0; }</style>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<!-- Attachment point for your app -->
<div id="container">
<button id="enter" onclick="enterApp();">
Click to Enter VR
</button>
</div>
<script src="./client.bundle?platform=vr"></script>
<script>
// Initialize the React 360 application
function enterApp() {
React360.init(
'index.bundle?platform=vr&dev=true',
document.getElementById('container'),
{
assetRoot: 'static_assets/',
}
);
}
</script>
Description
I have a freshly created application in order to test audio on mobile (ios/ iphone SE). Based on WebAudio documentation and the react 360 issues regarding the issue, I've learned that I needed to create an html button entity to create 'user interaction' and then once that is achieved, the audio should work.
Expected behavior
Audio should play on mobile when a user clicks the html button from index.html
Actual behavior
Audio fails to play on mobile when a user clicks the html button from index.html
Reproduction
Here is the code:
index.html