Oh-video with go2rtc and two way audio

Hey everyone, I’m having difficulties with the oh-video widget - or maybe the go2rtc link, I’m not sure - in the oh-webframe, the same url works fine (but lacks two way audio of course). When I add the url:
https://go2rtcmydomain.com/webrtc.html?src=camera&media=video+audio+microphone

Which works correctly in the browser, two way audio included, I get a black screen and no stream.
The media controls are all there but no stream.

Any hints?

if the same webrtc.html url works in a normal browser tab but oh-video / webframe is black, it is usually the iframe/permissions thing not go2rtc itself.

microphone + webrtc inside a widget is picky:

  • browser will block mic in a cross-origin iframe unless the iframe allow list has microphone; camera; autoplay
  • mixed content kills it if main ui is https and the go2rtc link is http (or bad cert)
  • oh-video sometimes wants a raw stream url, not the full webrtc.html page. try the go2rtc stream endpoint / the embed the widget docs expect, and keep webrtc.html for a webframe only

quick checks:

  1. open browser devtools on the ui page, look for iframe permission / autoplay errors
  2. confirm the widget url is exactly the same origin scheme as the ui (https both sides)
  3. for two way audio you basically need webframe + allow mic, plain oh-video often wont pass microphone through

if webframe still blacks out, paste the exact widget yaml and whether ui and go2rtc are same host or reverse proxied.

Funnily enough AI came to the rescue and I got a widget to work with two way audio!
I’ll leave it for the community.


version: 1
widgets:
  go2rtc_twoway_audio:
    tags: []
    props:
      parameters:
        - description: "E.g.: https://URL/webrtc.html?src=cameraname"
          label: Full go2rtc URL
          name: streamUrl
          required: true
          type: TEXT
        - default: true
          description: Starts the camera without audio. Reduces network bandwidth.
          label: Start Muted
          name: startMuted
          required: false
          type: BOOLEAN
      parameterGroups: []
    component: f7-card
    config:
      style:
        padding: 0px
        height: 300px
        position: relative
    slots:
      default:
        - component: iframe
          config:
            src: '=(vars[props.streamUrl]) ? props.streamUrl + "&media=video+audio+microphone" : (props.startMuted ? props.streamUrl + "&media=video&muted=true" : props.streamUrl)'
            style:
              width: 100%
              height: 100%
              border: none
            allow: microphone; camera; fullscreen;
        - component: oh-button
          config:
            iconF7: '=(vars[props.streamUrl]) ? "mic_fill" : "mic_slash_fill"'
            iconColor: '=(vars[props.streamUrl]) ? "red" : "white"'
            action: variable
            actionVariable: =props.streamUrl
            actionVariableValue: "=(vars[props.streamUrl]) ? false : true"
            style:
              position: absolute
              bottom: 15px
              right: 15px
              background: rgba(0,0,0,0.6)
              border-radius: 50%
              width: 45px
              height: 45px
              box-shadow: 0px 4px 10px rgba(0,0,0,0.3)

Anyway it’s working :slight_smile: @nite_route thank you for the hints, I ended up setting most of my services with let’s encrypt certificates too to make sure no HTTP connections were happening in between.