Skip to content

Commit

Permalink
version 0.0.10
Browse files Browse the repository at this point in the history
* add link to live test stream server
* add list of browsers where player was tested successfully
* using 80 port only
  • Loading branch information
victorgrenke committed Mar 25, 2016
1 parent c265c9f commit e7e880f
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'));
```
Expand Down Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
</head>
<body>
<video id="test_video" controls autoplay src="rtsp://192.168.10.162/H264"></video>
<video id="test_video" controls autoplay src="rtsp://127.0.0.1:8554/test"></video>
<script src="test.bundle.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/test.js
Original file line number Diff line number Diff line change
@@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/rtsp/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/util/websocket_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)=>{
Expand Down

0 comments on commit e7e880f

Please sign in to comment.