Skip to content

RtcPlayerOptions

Properties

PropertyTypeRequiredDescription
urlstringYesWebRTC playback URL
apistringYesSignaling server URL
videoHTMLVideoElementNoVideo element
media'audio' | 'video' | 'all'NoMedia type, default all
configRTCConfigurationNoICE server config

Example

typescript
import { RtcPlayer } from '@webrtc-player/core';

const player = new RtcPlayer({
  url: 'webrtc://localhost/live/livestream',
  api: 'http://localhost:1985/rtc/v1/play/',
  video: videoElement,
});

基于 MIT 许可证发布