Git Product home page Git Product logo

wtn-demos's Introduction

WTN-Demos

WTN(WebRTC Transmission Network) Demos

HOW TO USE

1, Create your own TRTC app in Tencent Cloud.

2, Change your own sdkappid and secret in server/config.ts.

Note that WTN is not for public for now, you should contact me to add your sdkappid to white list

3, Run the server.

cd server/ && npm install 
npx ts-node server.ts

4, Run the client.

cd client/ && npm install
npm run dev

WTN(WebRTC Transmission Network)

WTN(WebRTC Transmission Network) is based on Tencent's RTC(TRTC), providing a high-quality WebRTC service.

It provides a simple http signaling api based on WHIP, and extend WHIP to support WebRTC playback.

WHIP ietf

Push stream

Push URL

https://signaling.rtc.qcloud.com/v1/push/streamid?sdkappid=xxx&userid=xxx&usersig=xxxx

Params Description Required
sdkappid current sdkappid YES
userid current userid YES
usersig current usersig YES
streamid streamid YES
prefervcodec 'h264' or 'vp8', h264 default NO

Method: POST

Body: SDP

Content-Type: application/sdp

Resonse Code:

200/201: OK
400: Bad Request
403: Unauthorized
404: Not Found
409: Conflict, the steam exist

Response Header:

Location: https://signaling.rtc.qcloud.com/v1/push/streamid?sdkappid=xxx&userid=xxxx&usersig=xxxxx&relay=xxxxx

Location is the url used to stop the stream

Response Body: SDP

Stop push stream

Stop URL

https://signaling.rtc.qcloud.com/v1/push/streamid?sdkappid=xxx&userid=xxx&usersig=xxxx?relay=xxxx

Params Description Required
sdkappid current sdkappid YES
userid current userid YES
usersig current usersig YES
streamid streamid YES
relay relay id YES

Method: DELETE

Resonse Code:

200/201: OK
400: Bad Request
403: Unauthorized
404: Not Found

Play stream

Push URL

https://signaling.rtc.qcloud.com/v1/play/streamid?sdkappid=xxx&userid=xxx&usersig=xxxx

Params Description Required
sdkappid current sdkappid YES
userid current userid YES
usersig current usersig YES
streamid streamid YES

Method: POST

Body: SDP

Content-Type: application/sdp

Resonse Code:

200/201: OK
400: Bad Request
403: Unauthorized
404: Not Found

Response Header:

Location: https://signaling.rtc.qcloud.com/v1/play/streamid?sdkappid=xxx&userid=xxxx&usersig=xxxxx&relay=xxxxx

Location is the url used to stop the stream

Response Body: SDP

Stop Play stream

Stop URL

https://signaling.rtc.qcloud.com/v1/play/streamid?sdkappid=xxx&userid=xxx&usersig=xxxx?relay=xxxx

Params Description Required
sdkappid current sdkappid YES
userid current userid YES
usersig current usersig YES
streamid streamid YES
relay relay id YES

Method: DELETE

Resonse Code:

200/201: OK
400: Bad Request
403: Unauthorized
404: Not Found

wtn-demos's People

Contributors

cloudwebrtc avatar notedit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.