【问题标题】:How to do screen sharing in agora without getting an authentication problem如何在没有身份验证问题的情况下在 agora 中进行屏幕共享
【发布时间】:2022-01-03 13:05:31
【问题描述】:

我已经为视频通话实现了 agora sdk 3.0。

现在我正在尝试让屏幕共享工作,但我不断收到中提供的错误 下图(加入失败:NO_AUTHORIZED)。

Picture of console while sharing a screen

屏幕共享代码示例:

async shareScreen() {
  this.shareClient = AgoraRTC.createClient({
    mode: 'rtc',
    codec: 'vp8'
  })

  this.shareClient.init('xxxxxxxxxxxxxx', () => {
    this.shareClient.join('same token video call started with', 'same room name of current outgoing video call', null, (uid) => {
      const streamSpec = {
        streamID: uid,
        audio: false,
        video: false,
        screen: true
      }
      if (isFirefox()) {
        streamSpec.mediaSource = 'window';
      } else if (!isCompatibleChrome()) {
        streamSpec.extensionId = 'minllpmhdgpndnkomcoccfekfegnlikg';
      }
      this.shareScreenStream = AgoraRTC.createStream(streamSpec);
      // Initialize the stream.
      this.shareScreenStream.init(() => {
        // Play the stream.
        this.shareScreenStream.play('renderer');
        // Publish the stream.
        this.shareClient.publish(this.shareScreenStream);

      }, function(err) {
        console.log(err);
      });

    }, function(err) {
      console.log(err);
    })
  });
},

【问题讨论】:

    标签: vue.js video-streaming agora.io screensharing


    【解决方案1】:

    屏幕共享客户端应使用基于 UID 和频道名称的唯一令牌。不是主要用户正在使用的那个。

    【讨论】:

      猜你喜欢
      • 2020-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-02
      • 2014-11-09
      • 1970-01-01
      • 1970-01-01
      • 2018-10-26
      相关资源
      最近更新 更多