Coder Social home page Coder Social logo

plugin-webrtc's Introduction

English | 简体中文

WebRTC 插件

提供通过网页发布视频到monibuca,以及从monibuca拉流通过webrtc进行播放的功能,遵循WHIP规范

插件地址

https://github.com/Monibuca/plugin-webrtc

插件引入

    import (  _ "m7s.live/plugin/webrtc/v4" )

默认配置

webrtc:
  iceservers: []
  publicip: [] # 可以是数组也可以是字符串(内部自动转成数组)
  port: tcp:9000 # 可以是udp:8000-9000 范围端口,也可以udp:9000 单个端口
  pli: 2s # 2s

ICE服务器配置格式

webrtc:
  iceservers:
    - urls: 
        - stun:stun.l.google.com:19302
        - turn:turn.example.org
      username: user
      credential: pass

本地测试无需修改配置,如果远程访问,则需要配置publicip

基本原理

通过浏览器和monibuca交换sdp信息,然后读取rtp包或者发送rtp的方式进行

API

播放地址

/webrtc/play/[streamPath]

Body: SDP

Content-Type: application/sdp

Response Body: SDP

推流地址

/webrtc/push/[streamPath]

Body: SDP

Content-Type: application/sdp

Response Body: SDP

推流测试页面

/webrtc/test/publish

  • 可增加参数?streamPath=xxx指定推流地址,默认为live/webrtc
  • 可以增加其他推流参数

屏幕分享测试

/webrtc/test/screenshare

  • 可增加参数?streamPath=xxx指定推流地址,默认为live/webrtc
  • 可以增加其他推流参数

播放测试页面

/webrtc/test/subscribe

  • 可增加参数?streamPath=xxx指定播放地址,默认为live/webrtc
  • 可以增加其他播放参数

WHIP

WebRTC-HTTP ingestion protocol 用于WebRTC交换SDP信息的规范

WHIP ietf

plugin-webrtc's People

Contributors

langhuihui avatar bigbeer1 avatar dependabot[bot] avatar jianglieshan avatar zykilled avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.