IOS Safari Issue

Hey,

I've tested FlashPhoner server, with this URL: https://demo.flashphoner.com:8888/dashboard.xhtml with Safari IOS and it works great!
I have same server installed on my side, and also it works on IOS great!

I've tried to copy same code for a website i'm building, and on IOS it doesn't work.

I've noticed the following error when playing on IOS User Agent:
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

Which falles here in flashphoner.js here:
var playFirstVideo = function (display, isLocal, src) {
if (!getCacheInstance(display)) {
var video = document.createElement('video');
video.setAttribute("playsinline", "");
video.setAttribute("webkit-playsinline", "");
display.appendChild(video);
video.id = uuid_v1() + (isLocal ? LOCAL_CACHED_VIDEO : REMOTE_CACHED_VIDEO);
if (src) {
video.src = src;
} else {
video.src = "/flashphoner/dependencies/media/preloader.mp4";
}
video.play();
}
};

on the line video.play();

Do you have an idea why if it's the same code?

10x,
Eyal
 

Attachments

Max

Administrator
Staff member
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
This error means you have to click UI element on the page (user interaction) and start playback upon the click.
iOS Safari won't play video without user UI interaction, i.e. button click.
Please take a look at the player code:
https://demo.flashphoner.com:8888/client2/examples/demo/streaming/player/player.html
https://demo.flashphoner.com:8888/client2/examples/demo/streaming/player/player.js
Code:
function start() {
    if (Flashphoner.getMediaProviders()[0] === "WSPlayer") {
        Flashphoner.playFirstSound();
    } else if (Browser.isSafariWebRTC() || Flashphoner.getMediaProviders()[0] === "MSE") {
        Flashphoner.playFirstVideo(remoteVideo);
    }
...
}
As you can see, if browser is Safari, the code runs Flashphoner.playFirstVideo(remoteVideo); on user click.
 
I see... So why same code works on your side and on my side doesn't what can be the problem ?
On Android, works fine.
 

Max

Administrator
Staff member
So why same code works on your side and on my side doesn't what can be the problem ?
Please provide URL with your code sample. We will check.
 
Hey, it's not staybled. How can i send you the code (it's same code as yours BTW)... need print screens? Consol ? What exactly need to send?
 

Max

Administrator
Staff member
Hello
What do you mean "not staybled"?
Please describe issue in detail and share a few screenshots.
First of all we have to understand what the issue is.
How exactly do you test this? Could you please describe.
 

Max

Administrator
Staff member
Hello

We provide public forum support.
You can modify our default sample, test and report an issue affecting the tweaked sample.
Example:
https://demo.flashphoner.com/client2/examples/demo/streaming/player/player.html
https://demo.flashphoner.com/client2/examples/demo/streaming/player/player.js
Developer docs:
https://docs.flashphoner.com/display/WCS5EN/Web+SDK
So if something does not work you can share the tweaked sample right here.
If you need to send private details like passwords, access, etc, you can send it to support@flashphoner.com

For private (extended) support, please contact sales@flashphoner.com to get a quote.
 
Top