home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.02k stars 2.75k forks source link

Can't play video content in an iframe from android compagnon app #17417

Closed nmoreau33 closed 11 months ago

nmoreau33 commented 1 year ago

Checklist

Describe the issue you are experiencing

I'm using a connected video doorphone from reolink. It supports the onvif profile T protocol, which enables me to have an audio backchannel in the rstp stream. This rstp stream is entered in go2rtc. Next, I create a local go.html page in my www folder containing the following:

Then, in lovelace, I call up the page in question via :

type: iframe url: https://sub.mydomain.org:8123/local/go.html aspect_ratio: 50% title: Doorbell

As my domain is published through a nginx reverse proxy, the microphone is switched on by default in my browser. This works correctly from a PC via different browsers. This worked in June on my Android cell phone via the companion app, but has since stopped working without the configuration having been changed.

Describe the behavior you expected

I expect playing this video iframe in lovelace webcard.

Steps to reproduce the issue

  1. Every step detailled in "Describe the issue you are experiencing"

What version of Home Assistant Core has the issue?

2023.7.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Google Chrome on android 115.0.5790.138

Which operating system are you using to run this browser?

No response

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

TheDescender commented 1 year ago

Want to join in on this, since I'm experiencing the same problem. Only difference being that I navigate to my camera using HA ingress, as such: /api/hassio_ingress/PDkuFwCYU2xopZiWPVPSZ2SNAzjQe2S_aadGWGrLZhw/webrtc.html?src=camera.carport_camera_2way&media=video+audio+microphone

This seems very similar to an issue mentioned in this browser_mod github issue thread https://github.com/home-assistant/android/issues/3044

Based on what's been said there, it seems this is likely due to limitations in the iframe panel navigation.

github-actions[bot] commented 11 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

TheDescender commented 11 months ago

I would prefer this issue didn't just randomly get swept under the rug. @nmoreau33 have you had a chance to test if the issue was solved?

nmoreau33 commented 11 months ago

I've just tested with the latest version of home assistant 2023.11.1 and unfortunately the problem is still there. Everything works fine in a web browser, but not in the mobile application.

nmoreau33 commented 11 months ago

I've finally found my mistake. To do so, I activated the webview debug. I present the video stream of my video doorkeeper on the Internet via go2rtc. So I've enabled authentication via the go2rtc API to protect the viewing of my stream. I then call up the URL of the video stream via an iframe, itself published in a lovelace card. Here, to avoid typing in the credentials, I specify the credentials in the URL like https://user:password@monurl.com. This is blocked. The error is: Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details. So I removed the credentials from my URL and it works.

TheDescender commented 11 months ago

@nmoreau33 I see. So am I correctly understanding that this solution involves exposing go2rtc directly to the internet with its own dns record instead of having it behind HA?

nmoreau33 commented 11 months ago

Yes, that's right. In fact, I'd like to have two way audio. As a result, I'm obliged to present the video stream in https to enable the web browser to activate the microphone. So I'm using two separate dns recordings. One for home assistant and the other for the go2rtc stream.

TheDescender commented 11 months ago

Yeah I'd really prefer the functionally just worked natively in the app. I'm planning to swap all my camera cards to frigate cards, which hopefully removes the issue.