【问题标题】:Showing Dominant Speaker in the primaryView在主视图中显示主导说话者
【发布时间】:2019-10-07 19:13:40
【问题描述】:

如何在 Android 快速入门应用的主视图中显示主讲者。

https://github.com/twilio/video-quickstart-android/tree/master/quickstart

感谢和问候 赛琳德拉

编辑

添加代码:

public void OnDominantSpeakerChanged(Room room, RemoteParticipant remoteParticipant) {
  if (remoteParticipant!=null) {
    if (remoteParticipant.RemoteVideoTracks.Count > 0) {
      RemoteVideoTrackPublication remoteVideoTrackPublication = remoteParticipant.RemoteVideoTracks[0];
      remoteParticipantIdentity = remoteParticipant.Identity;
      AddRemoteParticipantVideo(remoteVideoTrackPublication.RemoteVideoTrack); 
    }
  }
}

【问题讨论】:

    标签: twilio twilio-programmable-voice twilio-video


    【解决方案1】:

    这里是 Twilio 开发者宣传员。

    您可以通过侦听群组会议室中 Room 对象中的 dominantSpeakerChanged 事件来检测主要发言者。对于 Android,您需要使用 4.3.0 或更高版本才能启用支持。

    查看the documentation on detecting dominant speaker in Twilio Video here

    【讨论】:

    • 您好 Philnash,感谢您的回复。我将以下代码用于 android 的快速启动应用程序,该应用程序是从 Twilio 提供的 GitHub 下载的。但是所有参与者的视频都在primaryvideoview中闪烁
    • 你能用你用来检测主要说话者的代码编辑你的问题吗?
    • public void OnDominantSpeakerChanged(Room room, RemoteParticipant remoteParticipant) { if (remoteParticipant!=null) { if (remoteParticipant.RemoteVideoTracks.Count > 0) { RemoteVideoTrackPublication remoteVideoTrackPublication = remoteParticipant.RemoteVideoTracks[0]; remoteParticipantIdentity = remoteParticipant.Identity;AddRemoteParticipantVideo(remoteVideoTrackPublication.RemoteVideoTrack); } } }
    • 您确定将.enableDominantSpeaker(true) 添加到您的连接选项吗?此外,您需要覆盖的方法是onDominantSpeakerChanged,开头是小写的o
    • 我已经添加了 .enableDominantSpeaker(true),下面是代码,但它仍然没有按预期工作 Override public void onDominantSpeakerChanged(NonNull Room room, Nullable RemoteParticipant remoteParticipant) { if (remoteParticipant!=null ){ RemoteVideoTrackPublication remoteVideoTrackPublication = remoteParticipant.getRemoteVideoTracks().get(0); addRemoteParticipantVideo(remoteVideoTrackPublication.getRemoteVideoTrack()); } }
    猜你喜欢
    • 1970-01-01
    • 2011-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-28
    • 1970-01-01
    • 1970-01-01
    • 2013-08-10
    相关资源
    最近更新 更多