diff --git a/README.md b/README.md index 3308346..3974e3b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,22 @@ It works by muxing RTP h.264 payload into ISO BMFF (MP4) fragments. html5_rtsp_player.js is written in ECMAScript6, and transpiled in ECMAScript5 using Babel. +## Live test stream + +Link to server running with websock_rtsp_proxy and test page http://srv.tom.ru + +Browser support: + +* Firefox v.42+ +* Chrome v.23+ +* OSX Safari v.8+ +* MS Edge v.13+ +* Opera v.15+ +* Android browser v.5.0+ +* IE Mobile v.11+ + +Not supported in iOS Safari and Internet Explorer + ## Install npm install git://github.com/SpecForge/html5_rtsp_player.git @@ -29,7 +45,7 @@ Setup player in your js: ``` import * as rtsp from 'rtsp_player'; -rtsp.RTSP_CONFIG['websocket.url'] = "ws://websocket_proxy_address/ws"; +rtsp.RTSP_CONFIG['websocket.url'] = "ws://websocket_proxy_address/ws"; // You should specify address of proxy described below let player = rtsp.attach(document.getElementById('test_video')); ``` @@ -102,6 +118,8 @@ Include compiled script into your HTML: 2. Configure port in /etc/ws_rtsp.ini + This port should be open in your firewall. Also you can pass request to this port from your proxy. (for example: http://nginx.org/en/docs/http/websocket.html) + 3. Run it ``` diff --git a/examples/index.html b/examples/index.html index 01508c2..59cca72 100644 --- a/examples/index.html +++ b/examples/index.html @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/examples/package.json b/examples/package.json index c935dc4..566f0c1 100644 --- a/examples/package.json +++ b/examples/package.json @@ -22,7 +22,7 @@ "webpack": "^1.12.14" }, "dependencies": { - "html5_rtsp": "*", + "html5_rtsp_player": "*", "bp_event": "^1.0.1", "bp_logger": "^1.0.3", "bp_statemachine": "^1.0.0" diff --git a/examples/test.js b/examples/test.js index 1a1391b..4fcc286 100644 --- a/examples/test.js +++ b/examples/test.js @@ -1,7 +1,7 @@ import {LogLevel} from 'bp_logger'; import * as rtsp from 'rtsp/rtsp_player'; -rtsp.RTSP_CONFIG['websocket.url'] = "ws://127.0.0.1:8000/ws"; +rtsp.RTSP_CONFIG['websocket.url'] = "ws://srv.tom.ru:8080/ws"; setTimeout(()=>{ let player = rtsp.attach(document.getElementById('test_video')); diff --git a/examples/webpack.config.js b/examples/webpack.config.js index b145a8a..b1afb1e 100644 --- a/examples/webpack.config.js +++ b/examples/webpack.config.js @@ -27,7 +27,7 @@ module.exports = { }, resolve: { alias: { - rtsp: path.join(__dirname,'node_modules/html5_rtsp/src') + rtsp: path.join(__dirname,'node_modules/html5_rtsp_player/src') } } }; \ No newline at end of file diff --git a/package.json b/package.json index b3317fe..23968ab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "specforge", "name": "html5_rtsp_player", - "version": "0.0.8", + "version": "0.0.10", "description": "HTML5 MSE RTSP player over websockets", "license": "Apache2", "devDependencies": { diff --git a/src/rtsp/connection.js b/src/rtsp/connection.js index f839d50..3e81118 100644 --- a/src/rtsp/connection.js +++ b/src/rtsp/connection.js @@ -15,7 +15,7 @@ export class RTSPWebsocketBackend { this.ready = this.connect(); } - setEndpoint(host, port, auth) { + setEndpoint({host, port, auth}) { this.host = host; this.port = port; this.auth = auth; diff --git a/src/util/websocket_proxy.js b/src/util/websocket_proxy.js index 2a508cb..9a7924b 100644 --- a/src/util/websocket_proxy.js +++ b/src/util/websocket_proxy.js @@ -21,7 +21,7 @@ export class WebSocketProxy { } initConnection() { - this._send(`INIT 1.0 SERVER\r\nhost ${this.data.host}\r\nport ${this.data.port}\r\n\r\n`); + this._send(`WSP 1.0 INIT\r\nhost ${this.data.host}\r\nport ${this.data.port}\r\n\r\n`); } connect(protocol) { @@ -34,7 +34,7 @@ export class WebSocketProxy { if (protocol=="rtsp") { this.initConnection(); } else if (protocol == "rtp") { - this._send(`INIT ${this.data.sock_id}`); + this._send(`WSP 1.0 INIT\r\nRTSP ${this.data.sock_id}`); } }; this.sock.onmessage = (ev)=>{