forked from Streamedian/html5_rtsp_player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.js
27 lines (24 loc) · 811 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {LogLevel, getTagged, setDefaultLogLevel} from 'bp_logger';
import * as streamedian from 'streamedian/player.js';
import WebsocketTransport from 'streamedian/transport/websocket.js';
import RTSPClient from 'streamedian/client/rtsp/client.js';
import {isSafari} from "streamedian/core/util/browser.js";
setDefaultLogLevel(LogLevel.Debug);
getTagged("transport:ws").setLevel(LogLevel.Error);
getTagged("client:rtsp").setLevel(LogLevel.Error);
let wsTransport = {
constructor: WebsocketTransport,
options: {
socket: "wss://specforge.com/ws/"
}
};
let p = new streamedian.WSPlayer('test_video', {
// url: `${STREAM_UNIX}${STREAM_URL}`,
// type: wsp.StreamType.RTSP,
modules: [
{
client: RTSPClient,
transport: wsTransport
}
]
});