Hi, I am trying to built a wep page in Wix Studio that play a different sound depending of the box that is clicked. I am using Audio Player element, changing “src” property with each clic event in both boxes. The test in mobil view in the preview of wix studio and google chrome work well, but not in the real iphone.
There is some problems with the audioplayer in iphones ?
Here is my code of the page that uses the audioplayer element:
let blueAudio = "some mp3 url";
let orangeAudio ="some mp3 url";
let audioPlayer;
let audioStoped;
$w.onReady(function () {
audioPlayer = $w('#audioPlayer1');
audioPlayer.play();
audioStoped = false;
});
export function boxOrange_click(event) {
audioPlayer.src = orangeAudio;
console.log("click");
if(audioStoped) {
audioPlayer.play();
audioStoped = false;
}
}
export function boxBlue_click(event) {
audioPlayer.src = blueAudio;
console.log("click");
if(audioStoped) {
audioPlayer.play();
audioStoped = false;
}
}
export function audioPlayer1_ended(event) {
audioPlayer.stop()
.then(function() {
audioStoped = true;
});
}
The link for the web page is this: https://acnetcenter.wixstudio.io/test1
Thanks in advance,