Openvidu-mvc-java sample app

Hi all,
i downloaded openvidu-mvc-java sample app, when i login as subscriber, and enter the video page, the publisher video is freezed and i must click on it to be played. There is no problem in other sample app openvidu-js-java that is equivalent to openvidu-mvc-java. It’s because using Thymeleaf?!

The problem can be related with “autoplay” feature of HTML videos.

In openvidu-js-java, the user interacts with the page and the video is shown. But in openvidu-mvc-java, the user click on a link and a new page with the session videos is show. That is, session page is “new” and you have to click to play it.

It is just an idea, because html video element seems very similar in the two apps:

`

Did someone find a fix for this ?

It is not really a fix what you must look for, but a way of overcoming the security of browsers regarding autoplay of streams with audio. Chrome has introduced several changes in its behavior in recent times, and right now I think it works with a somewhat obscure “trust” measure: depending on the trust level the browser has for a specific page, it will allow autoplay or not. The default way of overcoming this limitation in all pages is listening to the “play” event of the HTML video element. If it does not automatically happen, then you must show users a button or warning or whatever your feel like in order for they to click on the video to unmute and play it. Browser will allow it, as all it needs is some kind of user interaction.

1 Like

Thanks for your reply.
I have a message in firefox saying that autoplay is only allowed when the video is muted etc…
I tried to add $(event.element).prop('muted', true); after session.on('streamCreated', (event) => { but there is no change.