No webrtc in iOS 12 homescreen app

SLM

Member
If you add a site to your homescreen on iOS, you can start the site like you would start a regular app.

The problem is that since iOS 12, a site added to homescreen does not display a WebRTC stream from flashphoner anymore even though the preferredMediaprovider array is set to ["WebRTC","WSPlayer"]. Flashphoner.getMediaProviders()[0] always returns "WSPlayer" in stead of WebRTC. This is not the case when you open the same site in Safari.

The javascript SDK we use is flashphoner-api-0.5.28.2747-c136ced9f00ecfc5d584d0f9a0a51a35a963a3ca but I have also tried it with the flashphoner-api-0.5.28.2747-36a8c8f5914254474f503bb89f2e75432968cc4e version of Oct 31 with the same result. Server version is 5.0.2971
 

Max

Administrator
Staff member
Hello
We have similar request regarding WebView on iOS 12
We are checking now how WebView works with WebRTC and checking if it works at all.
 

SLM

Member
It might have the same cause as this (not related to Flashphoner) :
https://medium.com/@tuure.kaunisto/...e-screen-web-app-to-stop-working-7ab7916eef45
fter the iOS 12 update the stream stopped working. What really puzzled us was that it still worked just fine in Safari but not when launched fullscreen from the home screen icon (apple-mobile-web-app-capable). There were no JavaScript errors and it just seemed that the fullscreen version dismissed the onaddstream event handler altogether.
A deprecation warning instead of silent failure would have saved us a lot of trouble but we did finally notice that the RTCPeerConnection.onaddstream property was deprecated along with the callback parameters for other methods. We fixed the issue by switching to the ontrack event handler and refactored the old callback code to use promises.
 

Max

Administrator
Staff member

SLM

Member
Stream also plays in my own player but it's wsplayer, not webrtc. And we do use 2 way streaming.

Edit: And it's not a webview, it's a site added to homescreen which is a bit different. Webrtc is available in homescreen
 

Max

Administrator
Staff member

SLM

Member
I understand the priority setting, but the problem is that in a homescreen app, the stream will never be displayed as webrtc. Only wsplayer. Which means a longer delay, no fullscreen video, and with our current setting on the server, a somewhat lower quality stream. This is not a problem as long as the device is incapable of playing a webrtc stream, but this problem also concerns the newest iPhones around.

The fact that because of the current inability to publish a stream with WebRTC in a homescreen app is also a gamechanger. We would have to start notifying people to uninstall the homescreen app because they will have less options available than when using a normal Safari tab.
 

Max

Administrator
Staff member
Please confirm if the issue is reproducible with the demo server.

Tried this on iPhone 5s iOS 12.1, and the issue has not been reproduced: WebRTC not WSPlayer has been used in the case
- shortcut to https://demo.flashphoner.com/client2/examples/demo/streaming/player/player.html added to home screen
- the page opened from the home screen
- playback started - WebRTC is used

In another player example - Embed Player (https://demo.flashphoner.com/client2/examples/demo/streaming/embed_player/sample.html) - checkboxes can be used to deselect unrequired media providers.

Page http://demo.flashphoner.com:8081/?action=stat can be monitored: streams_websocket_out will increment in case WSPlayer would be used.
 

SLM

Member
It turns out that adding this line to your demo can disable webrtc streaming alltogether:
<meta name="apple-mobile-web-app-capable" content="yes" />

Any page added to homescreen that has this line / setting will not display webrtc flashphoner streams. Only wsplayer.
 

Max

Administrator
Staff member
<meta name="apple-mobile-web-app-capable" content="yes" />
Yes, as playback via WebRTC doesn't work when WKWebView is used, that would be the workaround - to remove the line, so that Safari is used for opening the page from home screen.
 
Top