Twilio' Twilio-Video-app-android' Github应用程序视频通话应用程序在加入房间时崩溃

发布于 2025-01-22 17:23:20 字数 205 浏览 0 评论 0原文

我是Twilio的新手,我正在开发一个用于视频通话的Andorid应用程序,我从Github的Twilio“ Twilio-Video-App-android”开始 但是当我单击加入房间时,应用程序崩溃了 “ boolean com.twilio.video.localaudiotrack.isrealed()'在null对象参考上” 无法理解为什么向您展示此异常向您提供帮助!

I am new to twilio and i am developing a andorid app for video calling i have started with the twilio 'twilio-video-app-android' from github
But app crashes when i click on join room with an exception
"boolean com.twilio.video.LocalAudioTrack.isReleased()' on a null object reference"
Unable to understand why is it showing this exception looking fwd to you help THANKS!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溇涏 2025-01-29 17:23:20

我看到了视频QuickStart-Android样本同样的致命例外。我注意到这一点:

  • 如果我杀死该应用程序,再次从IDE跑步,尝试加入房间,它会崩溃。
  • 但是,如果我卸载,重新安装然后运行,那不会崩溃。

这是崩溃的位置:

        room = connect(this, accessToken, roomListener) {
        roomName(roomName)
        /*
         * Add local audio track to connect options to share with participants.
         */
        audioTracks(listOf(localAudioTrack))
        /*
         * Add local video track to connect options to share with participants.
         */
        videoTracks(listOf(localVideoTrack))
        ...

但是问题不存在,问题是轨道的初始化。这些仅在成功许可授予后进行实例化,因此,如果该应用程序已经具有未达到代码路径的所需权限,则不会初始化轨道,并且连接代码会爆炸。在(较小)QuickStart应用程序中为我添加单个代码语句:

    /*
     * Check camera and microphone permissions. Also, request for bluetooth
     * permissions for enablement of bluetooth audio routing.
     */
    if (!checkPermissionForCameraAndMicrophone()) {
        Timber.i("Requesting camera and mic permissions")
        requestPermissionForCameraMicrophoneAndBluetooth()
    } else {
        createAudioAndVideoTracks() // <------ **** ADD THIS STATEMENT ****
        audioSwitch.start { audioDevices, audioDevice -> updateAudioDeviceIcon(audioDevice) }
    }

@philnash我希望QuickStart示例将被更新,因为它非常需要它。它不使用Androidx,依赖于弃用的API(例如PeferenceManager),该代码带有棉绒警告,它针对的是2019年的Android等。它会产生不必要的痛苦和成本来整合Twilio视频,而当样本不保留最新情况时。

I saw the same fatal exception with the video-quickstart-android sample. I noticed that:

  • If I kill the app, run again from IDE, try to join a room, it crashes.
  • But if I uninstall, reinstall, and then run, that does not crash.

This is the location of the crash:

        room = connect(this, accessToken, roomListener) {
        roomName(roomName)
        /*
         * Add local audio track to connect options to share with participants.
         */
        audioTracks(listOf(localAudioTrack))
        /*
         * Add local video track to connect options to share with participants.
         */
        videoTracks(listOf(localVideoTrack))
        ...

But the problem is not there, it is the initialisation of the tracks that is the issue. These are only instantiated after a successful permission grant, so if the app already has the required permissions that code path is not reached, the tracks are not initialised, and the connect code blows up. Adding a single code statement into the code as follows fixed it for me in the (smaller) quickstart app:

    /*
     * Check camera and microphone permissions. Also, request for bluetooth
     * permissions for enablement of bluetooth audio routing.
     */
    if (!checkPermissionForCameraAndMicrophone()) {
        Timber.i("Requesting camera and mic permissions")
        requestPermissionForCameraMicrophoneAndBluetooth()
    } else {
        createAudioAndVideoTracks() // <------ **** ADD THIS STATEMENT ****
        audioSwitch.start { audioDevices, audioDevice -> updateAudioDeviceIcon(audioDevice) }
    }

@philnash I hope the quickstart sample will be updated as it badly needs it. It's not using AndroidX, is reliant on deprecated APIs (e.g. PreferenceManager), the code is littered with lint warnings, it targets the 2019 release of Android etc. It creates unnecessary pain and cost to integrate Twilio Video when samples are not kept up to date.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文