Audio with embedded html


#1

We’re writing a simple queue management system, where the number is shown as an embeded html.
When the number changes, it plays a sound. But the sound doesn’t work on android player (still have not tried on windows player).
With chrome, in a normal web page, I have to interact with a click on the page, to make it allow me to play the sound. But obviously this interaction is not possible on Xibo.
Is the problem the same? Is there a workaround?

Thanks


#2

Xibo for Windows Player uses Internet Explorer. Xibo for Android uses Android WebView.

Webview didn’t support ‘autoplay’, it requires user interaction to play. There are some tricks to do it, but it doesn’t work on all devices.


#3

Thank you Jonatan, I did some research.
With default Chrome,it’s possible to disable autoplay policy or setting a parameter (chrome://flags/#autoplay-policy).

Is it possible to set such flags in Webview used by Xibo? I use only DSCS9 Android players.


#4

On android we set setMediaPlaybackRequiresUserGesture to false, which is the fullest extent we can control that option and I think does the same as your policy link.


#5

Thank you Dan, we use in embedded javascript this function:
var n=new SpeechSynthesisUtterance("Serviamo il numero "+e);
window.speechSynthesis.speak(n)

It works in preview after interaction, but it doesn’t work in the player, both Android an Windows.
I see in another post that the function jQuery sound.play() should work, so it’s a specific problem with the SpeechSynthesisUtterance function?

Thanks!


#6

I didn’t know that API existed - you learn something new every day!

A quick double check on caniuse shows that it wont work in IE or in the Android Browser (webview or chromium).

Sorry about that :worried:


#7

Ok, at least you found where the problem is.
We’ll play an .mp3 file.

Thanks