Android Question Black incoming video ussing webview in WebRTC

Discussion in 'Android Questions' started by scsjc, May 12, 2019.

  1. scsjc

    scsjc Well-Known Member Licensed User

    some time ago I used this code to make a videocall using the WebRTC, and it worked perfectly.
    attached code:

    Code:
    Sub Activity_Create(FirstTime As Boolean)
        WebView1.Initialize(
    "WebView1")
        WebView1.Visible=
    True
        WebView1.BringToFront
        
    Activity.AddView(WebView1,0,0,100%x,100%y)
        
        
    Dim nameroom As String = "room1234"
        
    Activity.Title="https://appr.tc/r/" & nameroom 'addess to conect room from weburl
        
        rp.CheckAndRequest(rp.PERMISSION_CAMERA)
        
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        
    If Result Then
            rp.CheckAndRequest(rp.PERMISSION_RECORD_AUDIO)
            
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
            
    If Result Then
                
    Dim client As JavaObject
                client.InitializeNewInstance(
    Application.PackageName & ".main$MyChromeClient"Null)
                
    Dim jo As JavaObject = WebView1
                jo.RunMethod(
    "setWebChromeClient"Array(client))
                
                WebView1.LoadUrl(
    "https://appr.tc/r/" & nameroom)
            
    End If
        
    End If
    End Sub

    #if Java
    import android.webkit.*;
    public static class MyChromeClient extends WebChromeClient {
    @Override
         public void onPermissionRequest(PermissionRequest request) {
            request.grant(request.getResources());
        }
    }
    #End If

    I do not know if due to some update by WebRTC or the webview, but when users connect in the same VideoChat the Android terminal through webview only displays a black screen.

    Does anyone know why it may be due?
    thank you
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. scsjc

    scsjc Well-Known Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice