Skip to content

RtcPlayerOptions

属性

属性类型必填说明
urlstringWebRTC 播放地址
apistring信令服务器地址
videoHTMLVideoElement视频元素
media'audio' | 'video' | 'all'媒体类型,默认 all
configRTCConfigurationICE 服务器配置

示例

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