Skip to content

PublisherOptions

属性

属性类型必填说明
urlstringWebRTC 推流地址
apistring信令服务器地址
sourceMediaSource媒体源配置
videoHTMLVideoElement本地预览元素
configRTCConfigurationICE 服务器配置

示例

typescript
const publisher = new RtcPublisher({
  url: 'webrtc://localhost/live/mystream',
  api: 'http://localhost:1985/rtc/v1/publish/',
  source: { type: 'camera', audio: true },
  video: preview,
  config: {
    iceServers: [{ urls: 'stun:stun.l.google.com:19302' }],
  },
});

基于 MIT 许可证发布