0
Answered

al resfrecar o actualizar la pagina web no carga la ecena

yohan_21_ 3 years ago in SitePal Silver updated by Gil Sideman 3 years ago 4

enla consola del navegador me muestra este error: Audio Requires User Input NotAllowedError: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDDError!!!

Under review

Hello Yohan!

On modern web browsers, audio playback in a web page must be preceded by user interaction with the page (e.g. user clicks on a button, or touches the screen). This user action “activates” the web page which will then allow audio playback. This restriction is intended to prevent a web page from playing audio unprompted. Attempting to do so will not cause a problem – but may not work, depending on the browser & the circumstances.

On desktop browsers, the restriction is not absolute. Some browsers will allow play-on-load for a user who has visited your page before and interacted with media on the page. The policies enacted by browsers in this regard are both evolving & undocumented.

The main takeaways should be:

  • It is ok to try to initiate speech as soon as the page loads (if you are doing so using the API verify that API has loaded first!).

  • You should be aware that such play-on-load attempts may be blocked by the browser, and will always be blocked on mobile browsers.

  • It therefore makes sense to design your web page / application to not rely on play-on-load. You should always provide another way for the user to initiate the verbal interaction with your speaking character, in case play-on-load is blocked.

I hope this is helpful.

Regards,

Gil

The SitePal Team

hola un placel... ya comprendo el ecenario.. pero lo extraño es que cuando inicio por primera vez en ell servidor localhost deveplomen si inicia hablando la ecena, pero cuando actualizo la pagina ya no lo hace. ahora me gustaria saber ya una vez en la nube. cada usuario que visite la web. podra iniciar la primera vez conversando la ecena como ejemplo una presentacion. despues que refresque o actualize la pagina si el usuario lo quiere escuchar ya deberia reproducirlo manualmente, de ser cierto si estaria sastifecho que me funcione de esa forma, espero me comprenda...tambien quiero aprovechar este hilo para saacrme una duda ¿de donde tengo que llamar o como creeo la funcion setStatus(1,0,0,1) con estos parametro que le prestableci ? Ya que no consigo en la documentacion informacion sobre esta funcion setStatus() no veo la forma de que parte la puedo llamar. de antemano gracias por su atencion

+1

Yohan - 

I think I understand what you are asking - let me try to explain further. 

* You can set your Scene to "play on load" (turn on in Scene Options)

* As you described - this may work fine in your development environment (localhost), but will be blocked by the browser when served from the web server. 

* To add to the confusion, "play on load" might not always be blocked - it may work sometimes. 

* For new users coming to your web site - it will almost always be blocked.

So, in designing your web page, you should assume that the character will not play-on-load. If the speech is a critical part of the page design, you may want to add a prominent button, or pop-up, to prompt the user to interact with the page.  This button can be used to initiate speech using the API. 

You asked about "setStatus" - this function is part of our Standard (Client) API - a set of JavaScript API functions that is built in to SitePal and can be used from your web page when you embed your speaking charactrer.

Please review API documentation and examples on our support page here: 

www.sitepal.com/support

Hope this helps,

Gil