Coder Social home page Coder Social logo

aeinstein / webrtmp Goto Github PK

View Code? Open in Web Editor NEW
21.0 1.0 0.0 5.01 MB

A javascript RTMP client for browsers

License: Apache License 2.0

HTML 1.21% JavaScript 98.44% Shell 0.36%
rtmp-player aac rtmp rtmp-client websocket-server h264 h264-streamer hls html5 streaming

webrtmp's Introduction

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:

<script src="dist/webrtmp.js"></script>
<video id="videoElement"></video>
<script>
    const videoElement = document.getElementById('videoElement');
    
    const rtmp_player = webrtmpjs.createWebRTMP();
    
    rtmp_player.attachMediaElement(videoElement);

    rtmp_player.open(document.location.host, 9001).then(()=>{   // Host, Port of WebRTMP Proxy
        rtmp_player.connect("demo").then(()=>{                  // Application name  
            rtmp_player.play("your streanname").then(()=>{      // Stream name
                console.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

webrtmp's People

Contributors

aeinstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

webrtmp's Issues

myNetConnectionObject.call

Hi great work thanks. Then tell me how can I also call a remoteMethod or receive a call remotely. In as3 it was the NetConnection.call().
Thank you

Error connect

what the problem going on, is this client side or rtmp server?

WebSocket server settings:
  - Listen on :9107
  - Flash security policy server
  - SSL/TLS support
  - Deny non-SSL/TLS connections
  - proxying from :9107 to 127.0.0.1:1935
36.68.223.195 - - [24/Feb/2024 14:56:45] code 400, message Client must support 'binary' or 'base64' protocol
36.68.223.195 - - [24/Feb/2024 14:56:45] code 405, message Method Not Allowed

Another error

36.68.223.195 - - [24/Feb/2024 15:07:48] code 400, message Bad request syntax ('\x88\x8f\x89*\xe6L\x8a\xc2\xb2-\xfbM\x838\xa9I\x8a#\xfaO\x82')
36.68.223.195 - - [24/Feb/2024 15:07:58] 36.68.223.195: SSL/TLS (wss://) WebSocket connection
36.68.223.195 - - [24/Feb/2024 15:07:58] 36.68.223.195: Version hybi-13, base64: 'False'
36.68.223.195 - - [24/Feb/2024 15:07:58] connecting to: 127.0.0.1:1935
36.68.223.195 - - [24/Feb/2024 15:08:10] code 400, message Bad HTTP/0.9 request type ('\x88\x8f\x0e\xf6\xdf\x01')

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.