Agora.io远程视频为空白。只有音频有效。本地作品中的一切

时间:2020-05-27 18:01:46

标签: java android agora.io

过去15个小时一直在努力寻找解决方法,但遗憾的是没有找到任何解决方法,将不胜感激。

Extra info: local video n audio works, even remote audio. But not remote video.


Stracktrace:

剧透!! stacktrace非常大!!!


05/27 22:56:36: Launching 'REmote_ctrl.app.Slave' on Wingtech 2014818.
$ adb shell am start -n "com.satyamedh.slave/com.satyamedh.slave.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 6721 on device 'wingtech-2014818-192.168.1.21:5555'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.

休息https://pastebin.com/GvB64q5t

问我任何代码,我将编辑正文。

edit:两项活动之一:

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import android.Manifest;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;

import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;

import io.agora.rtc.Constants;
import io.agora.rtc.IRtcEngineEventHandler;
import io.agora.rtc.RtcEngine;
import io.agora.rtc.video.VideoCanvas;
import io.agora.rtc.video.VideoEncoderConfiguration;

....在https://pastebin.com/UDf2inMJ中休息

2 个答案:

答案 0 :(得分:1)

更改UI时,需要确保在UI线程上进行更改。就您而言,您正在调用setupRemoteVideo()方法。您需要确保在UI线程中执行此操作。这是您的操作方式:

@Override 
public void onFirstRemoteVideoDecoded(final int uid, int width, int height, int elapsed) { 
    runOnUiThread(new Runnable() { 
        @Override 
        public void run() { 
            setupRemoteVideo(uid);
        }
    }); 
}

您也可以查看此示例应用程序以供参考:https://github.com/AgoraIO/Basic-Video-Call/blob/5a1433db49010f07e08b52f8f7913381c727b3a5/One-to-One-Video/Agora-Android-Tutorial-1to1/app/src/main/java/io/agora/tutorials1v1vcall/VideoChatViewActivity.java#L98

答案 1 :(得分:0)

我自己刚刚遇到了这个问题(在 iOS 中)。对我们来说,是我们用 our uid 设置了画布 uid,但它应该是远程用户的 uid。如果您在第一次设置引擎时拥有它,您可以使用它,或者您可以等到获得 didJoinedOfUidremoteVideoStateChangedOfUid 回调来设置它。