AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.46k stars 172 forks source link

iOS full screen is showing a black stream when going from portrait to landscape or viceversa #595

Open g1za opened 11 months ago

g1za commented 11 months ago

Hello,

With latest version I can go full screen using the companion app (latest version) and Safari (iOS 17.1). But when I rotate my mobile in landscape mode the stream goes black. It will come back when back to portrait mode.

In HA log I see this which is logged right after I go full screen using the overlaying button: Uncaught error from WebKit 605.1.15 on iOS 17.1 TypeError: undefined is not an object (evaluating 'this.requestFullscreen().catch') /webrtc/webrtc-camera.js:533:41

Regards

AlexxIT commented 11 months ago

Try latest master version

g1za commented 11 months ago

I'm already on 3.5.0.

Edit: ah I see there was a new commit to master following 3.5.0. Ok I will try it. Thanks

g1za commented 11 months ago

I replaced webrtc-camera.js with the latest version, restarted, but I see the same behavior as before:

`Logger: frontend.js.latest.202310050 Source: components/system_log/init.py:300 First occurred: 10:16:55 (1 occurrences) Last logged: 10:16:55

Uncaught error from WebKit 605.1.15 on iOS 17.1 TypeError: undefined is not an object (evaluating 'this.requestFullscreen().catch') /webrtc/webrtc-camera.js:533:41`

AlexxIT commented 11 months ago

I think you have problems with cache in your browser. 533 line is different in latest master version

g1za commented 11 months ago

This time I first deleted the webrtc-camera.js file in custom_components -> webrtc -> www and then I replaced it with the new version. If I now open the new one I see line 533 is this.requestFullscreen().catch(console.warn);

I restarted, cleared the cache of the companion app and forced a full cache reload in the browser (Firefox).

As soon as I load the stream full screen in the companion app, in the log I still get:

Uncaught error from WebKit 605.1.15 on iOS 17.1 TypeError: undefined is not an object (evaluating 'this.requestFullscreen().catch') /webrtc/webrtc-camera.js:533:41

g1za commented 11 months ago

wait it seems when I downloaded the new file the new commit was not included. :| I copied the code and pasted in the file. I now have all 642 lines of code and I also see line 533 is different. Let me test again

g1za commented 11 months ago

ok I had to delete the .gz archives in the www folder. Now when I go full screen and then landscape I do not see any error in the log. But the stream in landscape is still black :(

g1za commented 9 months ago

I was checking if anything changed with the new release (v3.5.1) and I discovered something interesting. It seems the problem is linked to the action of rotating the device. If I put the mobile in landscape and I go full screen the stream is shown; at that point it becomes black if I rotate it to portrait. Still no errors in the log. Hope this is useful somehow. Cheers

Martinvdm commented 3 months ago

Having the same issue