question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Audio and Video Not Woking but View Loads

See original GitHub issue

Description

I have Integrated Jitsi meet view into my own Android Application. It is loading the conference room successfully , but the video and mic button seems muted state and i can’t change the state. I have given the required permissions on manifest file and tried the url loading with url Object instead of load url with string.


import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.facebook.react.modules.core.PermissionListener;

import org.jitsi.meet.sdk.JitsiMeetActivityInterface;
import org.jitsi.meet.sdk.JitsiMeetView;
import org.jitsi.meet.sdk.ReactActivityLifecycleCallbacks;

// Example
//
public class MainActivity extends AppCompatActivity implements JitsiMeetActivityInterface {
    private JitsiMeetView view;

    @Override
    protected void onActivityResult(
            int requestCode,
            int resultCode,
            Intent data) {
        ReactActivityLifecycleCallbacks.onActivityResult(
                this, requestCode, resultCode, data);
    }

    @Override
    public void onBackPressed() {
        if (!ReactActivityLifecycleCallbacks.onBackPressed()) {
            // Invoke the default handler if it wasn't handled by React.
            super.onBackPressed();
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        view = new JitsiMeetView(this);
//        view.setWelcomePageEnabled(true);
//
////        view.loadURLString("https://meet.jit.si/Test123");
//        view.loadURL(null);
        Bundle config = new Bundle();
        config.putBoolean("startWithAudioMuted", false);
        config.putBoolean("startWithVideoMuted", false);
        Bundle urlObject = new Bundle();
        urlObject.putBundle("config", config);
        urlObject.putString("url", jitsi_url );


        view.loadURLObject(urlObject);
        setContentView(view);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        view.dispose();
        view = null;

        ReactActivityLifecycleCallbacks.onHostDestroy(this);
    }

    @Override
    public void onNewIntent(Intent intent) {
        ReactActivityLifecycleCallbacks.onNewIntent(intent);
    }

    @Override
    public void onRequestPermissionsResult(
            final int requestCode,
            final String[] permissions,
            final int[] grantResults) {
        ReactActivityLifecycleCallbacks.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    @Override
    protected void onResume() {
        super.onResume();

        ReactActivityLifecycleCallbacks.onHostResume(this);
    }

    @Override
    protected void onStop() {
        super.onStop();

        ReactActivityLifecycleCallbacks.onHostPause(this);
    }

    @Override
    public void requestPermissions(String[] permissions, int requestCode, PermissionListener listener) {

    }
}

screenshot_20181218-115155

@saghul I have seen the similar issue #3353 but seems the solution is not provided. Is this due to using Jitsi meet view instead of JitsiMeet Activity?

When i Use the Jitsi meet Activity , Its Just showing a blank screen (#3683 I have opened this issue and waiting for your fix ) ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
FaizalMalikcommented, Dec 18, 2018

Those who tried the above and not worked(for me not worked the above one 😦 ) - use this one


 @TargetApi(Build.VERSION_CODES.M)                                                                                          
 @Override                                                                                                                  
 public void requestPermissions(String[] permissions, int requestCode, PermissionListener listener) {                       
                                                                                                                            
     String[] PERMISSIONS = {                                                                                               
             Manifest.permission.RECORD_AUDIO,                                                                              
             android.Manifest.permission.CAMERA                                                                             
     };                                                                                                                     
                                                                                                                            
       this.requestPermissions(permissions,requestCode);                                                                    
                                                                                                                            
     if(!hasPermissions( PERMISSIONS)){                                                                                     
         ActivityCompat.requestPermissions(this, PERMISSIONS, PERMISSION_ALL);                                              
     }                                                                                                                      
                                                                                                                            
 }                                                                                                                          
 public boolean hasPermissions(String... permissions) {                                                                     
     if ( permissions != null) {                                                                                            
         for (String permission : permissions) {                                                                            
             if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {               
                 return false;                                                                                              
             }                                                                                                              
         }                                                                                                                  
     }                                                                                                                      
     return true;                                                                                                           
 }         
0reactions
saghulcommented, Dec 18, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Videos Not Playing on Android Phone
How to Fix Videos Not Playing On Android phone · 2. Clear cache on your Android phone · 3. Uninstall insecure apps on...
Read more >
[Android] Audio and Video Not Woking but View Loads #3353
I have a button that loads a meet view. Everything loads fine and connects, but the video and audio dont work. Pressing the...
Read more >
Troubleshoot video errors, buffering, and freezing - Android
Troubleshoot audio issues​​ Try some of the following troubleshooting steps: Make sure the sound/volume is turned on for your browser or device. Check...
Read more >
8 Ways to Fix Video Sound Not Working on Android
Part 2: How to Fix Video No Sound Problem on Android? (8 Ways) · 01 Fix 1: The volume settings · 02 Fix...
Read more >
How to Fix No Sound on Videos on Android? [7 Solutions]
No sound when playing videos on Android devices? After watching this video, you will learn 8 solutions on how to fix the issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found