onvif
    Preparing search index...

    Function withUrlCredentials

    • Set or replace URL userinfo (e.g. RTSP from GetStreamUri for FFmpeg). Uses the WHATWG URL API so existing credentials are replaced (not doubled) and reserved characters in username/password are percent-encoded.

      The returned string embeds the password in cleartext userinfo. Do not log it; log the device URI from GetStreamUri, or redact userinfo first.

      Parameters

      • url: string | URL
      • username: string = ''
      • password: string = ''

      Returns string