首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用OpenVidu只创建音频调用

使用OpenVidu只创建音频调用
EN

Stack Overflow用户
提问于 2020-01-07 05:34:03
回答 1查看 475关注 0票数 0

我只想要不使用摄像头的音频呼叫。但是下面的代码只适用于相机permission.When,我删除了相机权限,这样就不叫streamCreated事件了。

代码语言:javascript
复制
   const publisher: Publisher = this.OV.initPublisher(undefined, {
      audioSource: undefined, // The source of audio. If undefined default microphone
      videoSource: undefined, // The source of video. If undefined default webcam
      publishAudio: true, // Whether you want to start publishing with your audio unmuted or not
      publishVideo: false, // Whether you want to start publishing with your video enabled or not
      resolution: '640x480', // The resolution of your video
      frameRate: 30, // The frame rate of your video
      insertMode: 'APPEND', // How the video is inserted in the target element 'video-container'
      mirror: true // Whether to mirror your local video or not
    });

我正在使用Ionic的android应用程序。

EN

回答 1

Stack Overflow用户

发布于 2020-01-07 15:43:37

您需要将“videoSource”设置为“false”,而不是“未定义”。像这样的事情应该有效:

代码语言:javascript
复制
const publisher: Publisher = this.OV.initPublisher(undefined, {
      audioSource: undefined, // The source of audio. If undefined default microphone
      videoSource: false, // The source of video. If undefined default webcam
      publishAudio: true, // Whether you want to start publishing with your audio unmuted or not
      publishVideo: false, // Whether you want to start publishing with your video enabled or not
      resolution: '640x480', // The resolution of your video
      frameRate: 30, // The frame rate of your video
      insertMode: 'APPEND', // How the video is inserted in the target element 'video-container'
      mirror: true // Whether to mirror your local video or not
    });
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59622721

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档