Skip to content

Repository files navigation

WebRTMP

A HTML5 Flash Video (RTMP) Player written in pure JavaScript without Flash. LONG LIVE RTMP ;-)

For those who really miss RTMP in Browser, cause HLS sucks. This will be a part of avideo.

heavily inspired bei bilibi`s FlvPlayer

Introduction

This project consists of 2 parts.

  • Websockify for wrapping TCP in WSS
  • WebRTMP Client library

Demo

https://bunkertv.org/webrtmp/index.html

Features

  • RTMP container with H.264 + AAC / MP3 codec playback
  • RTMP over Websocket low latency live stream playback <= 3 sec.
  • Compatible with Chrome, FireFox, Safari 10, IE11 and Edge
  • Extremely low overhead and hardware accelerated by your browser!
  • Use of promises

Getting Started

ClientSide:

<scriptsrc="dist/webrtmp.js"></script><videoid="videoElement"></video><script>constvideoElement=document.getElementById('videoElement');constrtmp_player=webrtmpjs.createWebRTMP();rtmp_player.attachMediaElement(videoElement);rtmp_player.open(document.location.host,9001).then(()=>{// Host, Port of WebRTMP Proxyrtmp_player.connect("demo").then(()=>{// Application name rtmp_player.play("your streanname").then(()=>{// Stream nameconsole.log("playing");})})})</script>

ServerSide:

Prerequisites:

apt install websockify

Launch WSS RTMP-Wrapper (Don't forget to get certificates)

websockify -D --cert fullchain.pem --key privkey.pem --ssl-only 9001 127.0.0.1:1935

TODO

a lot of error and exception handling

Design

serverSide

arch

About

A javascript RTMP client for browsers

Topics

Resources

Stars

37 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages