Skip to content

PublisherOptions

Properties

PropertyTypeRequiredDescription
urlstringYesWebRTC publishing URL
apistringYesSignaling server URL
sourceMediaSourceYesMedia source config
videoHTMLVideoElementNoPreview element
configRTCConfigurationNoICE server config

Example

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 许可证发布