### Install Player via NPM Source: https://streamedian.com/docs Command to install the player source files from the GitHub repository. ```bash npm install git://github.com/Streamedian/html5_rtsp_player.git ``` -------------------------------- ### Install NGINX Web Server Source: https://streamedian.com/docs Command to install the NGINX web server on Ubuntu/Debian systems. ```bash sudo apt install nginx ``` -------------------------------- ### Install Python Websockets Library Source: https://streamedian.com/docs Required dependency for the Python logging implementation. ```bash pip install websockets ``` -------------------------------- ### Install libssl on Raspberry Pi Source: https://streamedian.com/docs Adds the repository source and installs the required libssl version for Raspberry Pi environments. ```bash deb http://archive.raspbian.org/raspbian stretch main contrib non-free ``` ```bash sudo apt update sudo apt install libssl1.0.0 ``` -------------------------------- ### Start recording Source: https://streamedian.com/docs Initiates continuous or event-based recording by calling the record method with a true parameter. ```javascript player.continuousRecording.record(true); player.eventRecording.record(true); ``` -------------------------------- ### Real-time Statistic Message Example Source: https://streamedian.com/docs Example of the JSON message received when a connection event occurs. ```json { "connectionTime": "1611850234", "disconnectionTime": "1611850242", "reason": "Connection closed", "rtsp": {"host": "demo..net", "port": "554"}, "session_id": "127.0.0.1-6 41", "user": {"address": "127.0.0.1", "requestedDomain": "http://127.0.0.1:8088"}, "videoFormat": "h264" } ``` -------------------------------- ### Example Statistics Response Source: https://streamedian.com/docs A sample JSON response containing license details and active session information. ```json [ { "license": { "key": "277f7886-1ca5-4429-9463-e14a063044cb", "expiresAt": "Mon Jul 26 07:00:00 2021\n", "maxWatchers": "3" }, "sessions": [ { "rtsp": "host": "demo..net", "port": "554" }, "user": { "address": "127.0.0.1", "requestedDomain": "http://127.0.0.1:8088" }, "connectionTime": "1611942677", "session_id": "127.0.0.1-2 18467", "videoFormat": "h264" } ], "sessionNumber": "1" } ] ``` -------------------------------- ### Recording Control Methods Source: https://streamedian.com/docs Methods to start, stop, and configure the recording duration for continuous and event-based recording. ```APIDOC ## player.continuousRecording.record(state) ## player.eventRecording.record(state) ### Description Starts or stops the recording process for the specified recording type. ### Parameters - **state** (boolean) - Required - Set to true to start recording, false to stop recording. --- ## player.continuousRecording.setFileLength(ms) ## player.eventRecording.setFileLength(ms) ### Description Sets the duration of one recorded file fragment in milliseconds. Must be called before recording starts. ### Parameters - **ms** (number) - Required - The duration in milliseconds. --- ## player.continuousRecording.fileLength ## player.eventRecording.fileLength ### Description Property to retrieve the current file length setting in milliseconds. ``` -------------------------------- ### Set file length dynamically Source: https://streamedian.com/docs Updates the recording fragment duration using the setFileLength method. Must be called before recording starts. ```javascript player.continuousRecording.setFileLength(180000); // 3 minutes player.eventRecording.setFileLength(10000); // 10 seconds ``` -------------------------------- ### Run Activation Application Source: https://streamedian.com/docs Execute the activation tool to begin the online or offline license registration process. ```bash /usr/bin/wsp/activation_app ``` -------------------------------- ### Configure data handler and player options Source: https://streamedian.com/docs Sets up a data handler callback to process recorded MP4 blobs and initializes the player with the required options. ```javascript // Create the html link element. We will use it to download the file further down the line var link = document.createElement('a'); // Callback to receive and handle recorded video file var dataHandler = function(data, prefix) { // Create the Blob so we can download the video as a file let blob = new Blob([data], {type: "application/mp4"}); // Create object link and set it to the HTML link element link.href = window.URL.createObjectURL(blob); // Set file name link.download = `${prefix}_${new Date()}.mp4`; // Call click method. Like a user clicked on a download link link.click(); } // Options for HTML5 RTSP Player var playerOptions = { socket: "ws://localhost:8088/ws/", // Set callback to receive recorded video **dataHandler**: dataHandler, }; // Set the player options to the HTML5 RTSP player player = Streamedian.player("VideoElementId", playerOptions); ``` -------------------------------- ### Run Windows Activation Tool Source: https://streamedian.com/docs Path to the activation application executable on Windows. ```text C:\Program Files\Streamedian\WS RTSP Proxy Server\activation_app.exe ``` -------------------------------- ### Locate Configuration File Source: https://streamedian.com/docs Path to the index.html file where the WebSocket URL is configured. ```text C:\Users\Public\Documents\Streamedian\WS RTSP Player\nginx\html\index.html ``` -------------------------------- ### Locate Configuration File Source: https://streamedian.com/docs Path to the proxy server configuration file on Linux. ```text /etc/ws_rtsp.ini ``` -------------------------------- ### Run Online Activation Tool Source: https://streamedian.com/docs Path to the activation application executable for online activation. ```text C:\Program Files\Streamedian\WS RTSP Proxy Server\activation_app ``` -------------------------------- ### Activate License Source: https://streamedian.com/docs Activate a license for a specific machine. Requires base64 encoded domain and machine ID from the local machine_info.bin file. ```json { "email": "user.email@mail.com", "password": "userpassword", "domains": "c3RyZWFtZWRpYW4uY29t", "licese_id": "eeec5567-bd7c-48dc-bd84-28d265b8d361", "machine_id": "Nkl1QA85aHF2aX9CYUxsTQxTeFoNXRYHYlprcgspagIKL2JBfhc6RH9SAzQ=" } ``` ```json {"error": "NoErrors", "message": "Activation successfully", "license": "TMxYDNxgj..."} ``` ```json {"error": 'AlreadyError', 'message':'License already has an active machine id'} ``` ```json {"error": 'LimitError', 'message':'Maximum activation amount'} ``` ```json {"error": 'NoLicenseError', 'message':'User license not found'} ``` -------------------------------- ### Configure Apache Web Server Source: https://streamedian.com/docs Commands to enable the proxy configuration and reload the Apache service. ```bash sudo a2enconf ws_rtsp_proxy_stream.conf sudo service apache2 reload ``` -------------------------------- ### WSP/1.1 INIT Source: https://streamedian.com/docs Initializes a connection to the RTSP channel via a WebSocket with the 'rtsp' protocol. ```APIDOC ## WSP/1.1 INIT ### Description Establishes the initial connection to the RTSP stream host and port to obtain a channel ID. ### Request ``` WSP/1.1 INIT seq: host: port: ``` ### Response ``` WSP/1.1 200 OK seq: channel: ``` ``` -------------------------------- ### Initialize Player in JavaScript Source: https://streamedian.com/docs Configuration and initialization of the Streamedian player instance. ```javascript if (window.Streamedian) { var playerOptions = { socket: "ws://localhost:8088/ws/", redirectNativeMediaErrors : true, bufferDuration: 30, }; player = Streamedian.player("test_video", playerOptions); } ``` -------------------------------- ### Load p5 and ml5 libraries Source: https://streamedian.com/docs Include these script tags in the HTML head or body to load the necessary dependencies for machine learning and DOM manipulation. ```html ``` -------------------------------- ### POST /account/api/activate/ Source: https://streamedian.com/docs Activates a license for a specific machine and domain. ```APIDOC ## POST /account/api/activate/ ### Description Activates a license using the license ID, machine ID, and domain. ### Method POST ### Endpoint https://streamedian.com/account/api/activate/ ### Request Body - **email** (string) - Required - User email - **password** (string) - Required - User password - **domains** (string) - Required - Base64 encoded domain - **licese_id** (string) - Required - License ID - **machine_id** (string) - Required - Machine ID ### Request Example { "email": "user.email@mail.com", "password": "userpassword", "domains": "c3RyZWFtZWRpYW4uY29t", "licese_id": "eeec5567-bd7c-48dc-bd84-28d265b8d361", "machine_id": "Nkl1QA85aHF2aX9CYUxsTQxTeFoNXRYHYlprcgspagIKL2JBfhc6RH9SAzQ=" } ### Response #### Success Response (200) - **error** (string) - Status code - **message** (string) - Success message - **license** (string) - Activation result string ``` -------------------------------- ### Initialize object detection logic Source: https://streamedian.com/docs JavaScript functions to load the Yolo model, set up the detection interval, and draw results on the canvas. ```javascript let yolo; let ctx; let width; let height; function initObjectsDetection(playerId, canvasId, rtspLink) { const updateTime = 3000; // Interval in milliseconds between image capture for objects detection const video = document.getElementById(playerId); const canvas = document.getElementById(canvasId); ctx = canvas.getContext('2d'); width = video.offsetWidth; height = video.offsetHeight; // Resize canvas canvas.width = width; canvas.height = height; // Load Yolo model const ml = new ml5.YOLO(video); ml.loadModel().then(function(model) { yolo = model; // Start RTSP link playback setPlayerSource(rtspLink); // Set interval for objects detection setInterval(objectDetect, updateTime); }); } function objectDetect() { yolo.detect(function(err, results) { if (results !== undefined) { // Draw results on canvas draw(results); } }); } function draw(results) { ctx.clearRect(0, 0, width, height); ctx.font = "24px helvetica"; ctx.textBaseline = "top"; for (let i = 0; i < results.length; i++) { //Iterating through all results // Bounding box drawing ctx.strokeStyle = "#2fff00"; ctx.lineWidth = 1; ctx.strokeRect(results[i].x * width, results[i].y * height, results[i].w * width, results[i].h * height); // Text drawing is last to ensure that it's on top const textWidth = ctx.measureText(results[i].label).width; const textHeight = parseInt("24px helvetica", 10); ctx.fillStyle = "#000000"; ctx.fillText(results[i].label, results[i].x * width, results[i].y * height - 5); } } ``` -------------------------------- ### Retrieve License List Source: https://streamedian.com/docs Fetch available licenses for an authenticated user. Includes details like license ID, status, and remaining activation attempts. ```json { "error": "NoErrors", "message": "User authentication successfully", "licenses": [ { "licese_id": "eeec5567-bd7c-48dc-bd84-28d265b8d361", "license_connections": 2, "license_expire": "2020-09-29T09:10:50.005Z", "machine_id": "", "activation_count": 0, "license_status": false, "version": "3.1", "domains": [], "attempts_remained": 10 } ] } ``` -------------------------------- ### POST /account/api/licenses/ Source: https://streamedian.com/docs Retrieves the list of available licenses for the authenticated user. ```APIDOC ## POST /account/api/licenses/ ### Description Retrieves the list of licenses associated with the user account. ### Method POST ### Endpoint https://streamedian.com/account/api/licenses/ ### Request Body - **email** (string) - Required - User email - **password** (string) - Required - User password ### Request Example { "email": "user.email@mail.com", "password": "userpassword" } ### Response #### Success Response (200) - **error** (string) - Status code - **message** (string) - Success message - **licenses** (array) - List of license objects ``` -------------------------------- ### Configure rtsp_ws_tunnel_client.ini Source: https://streamedian.com/docs Configuration file structure for defining proxy settings and RTSP camera sources. ```ini [General] //RTSP WS tunnel client client id client_id=RTSP WS tunnel client //websocket proxy access token - should be the same as on your proxy side proxy_token=OWJlN2FiMDMtZGEyMC00NGM1LTg5ZDItOGVlMjM // websocket proxy address - should look to your ws:// //if wss:// - set up "ssl=on" below proxy_url=ws://192.168.1.180:8088/tunnel/ // RTSP WS tunnel client plugin dir plugin_path=/usr/lib/rwtc/ // wss connection off - for ws:// | on - for wss:// ssl=off [CAMERAS] - list your rtsp sources - should be TCP type url=rtsp://192.168.1.185:554/h264 example rtsp url url=rtsp://192.168.1.186:554/h264 example rtsp url url=rtsp://192.168.1.187:554/h264 example rtsp url url=rtsp://192.168.1.188:554/h264 example rtsp url url=rtsp://192.168.1.189:554/h264 example rtsp url ``` -------------------------------- ### Configure file length in player options Source: https://streamedian.com/docs Sets the duration for recorded file fragments during player initialization. ```javascript var playerOptions = { socket: "ws://localhost:8088/ws/", bufferDuration: 30, errorHandler: errHandler, infoHandler: infHandler, dataHandler: dataHandler, **continuousFileLength:** 180000, // 3 minutes **eventFileLength:** 10000, // 10 seconds }; ``` -------------------------------- ### Log Statistics to File with Python Source: https://streamedian.com/docs Asynchronous implementation to subscribe to statistics and append them to a local text file. ```python #!/usr/bin/env python import asyncio import websockets import base64 def write_to_file(path, response): with open(path, '+a', encoding='utf-8') as file: file.write(response) async def statistic(): uri = 'ws://localhost:8088/ws/' password = base64.b64encode(b'streamedian').decode('utf-8') path = 'ws_proxy_statistic.txt' async with websockets.connect(uri, subprotocols=['statistic']) as websocket: cmd = 'WSP/1.1 SUBSCRIBE\nAuthorization: {}\nseq: 1\n\n'.format(password) await websocket.send(cmd) while True: response = await websocket.recv() write_to_file(path, response) asyncio.get_event_loop().run_until_complete(statistic()) ``` -------------------------------- ### Request Detailed Statistics Source: https://streamedian.com/docs Send a WSP/1.1 GET_INFO command with Base64 encoded authorization. ```text WSP/1.1 GET_INFO Authorization: c3RyZWFtZWRpYW4= seq: 1 ``` -------------------------------- ### WSP RTSP Channel Initialization Source: https://streamedian.com/docs Protocol handshake to establish an RTSP connection via WebSocket. ```text c>s: WSP/1.1 INIT\r\n seq: host: \r\n port: \r\n\r\n s>c: WSP/1.1 200 OK\r\n seq: channel: \r\n\r\n Error codes >= 400 means error ``` -------------------------------- ### Configure Multiple Licenses in ws_rtsp.ini Source: https://streamedian.com/docs Specifies multiple license file paths for the WS RTSP Proxy Server. ```ini # path to license file license_path=C:\Users\Public\Documents\Streamedian\WS RTSP Proxy Server\wsp.lic license_path=C:\Users\Public\Documents\Streamedian\WS RTSP Proxy Server\wsp_two.lic license_path=C:\Users\Public\Documents\Streamedian\WS RTSP Proxy Server\wsp_three.lic ``` -------------------------------- ### License File Path Source: https://streamedian.com/docs Location of the license file used by the proxy server. ```text /usr/share/wsp/wsp.lic ``` -------------------------------- ### Log Statistics to File with Node.js Source: https://streamedian.com/docs Implementation using the 'ws' library to stream statistics data to a file. ```javascript const WebSocket = require('ws'); const fs = require('fs'); const stream = fs.createWriteStream("ws_proxy_statistic.txt", {flags:'a'}); const ws = new WebSocket('ws://localhost:8088/ws/', ['statistic']); const password = Buffer.from('streamedian').toString('base64'); ws.on('open', function open() { ws.send(`WSP/1.1 SUBSCRIBE\nAuthorization: ${password}\nseq: 1\n\n`); }); ws.on('message', function incoming(data) { stream.write(data); console.log(data); }); ``` -------------------------------- ### Restart Proxy Service Source: https://streamedian.com/docs Command to restart the service after applying a new license. ```bash /usr/share/wsp/restart_service.sh ``` -------------------------------- ### POST /account/api/assign_activation_key/ Source: https://streamedian.com/docs Assigns an activation key to a user account. ```APIDOC ## POST /account/api/assign_activation_key/ ### Description Assigns an activation key to the user account. The key must be base64 encoded. ### Method POST ### Endpoint https://streamedian.com/account/api/assign_activation_key/ ### Request Body - **email** (string) - Required - User email - **password** (string) - Required - User password - **activation_key** (string) - Required - Base64 encoded activation key ### Request Example { "email": "user.email@mail.com", "password": "userpassword", "activation_key": "YWN0aXZhdGlvb***iBrZXk=" } ### Response #### Success Response (200) - **error** (string) - Status code - **message** (string) - Success message ``` -------------------------------- ### WSP/1.1 JOIN Source: https://streamedian.com/docs Connects to the RTP channel using a previously obtained channel ID. ```APIDOC ## WSP/1.1 JOIN ### Description Connects to the RTP channel via a WebSocket with the 'rtp' protocol using the channel ID from the INIT step. ### Request ``` WSP/1.1 JOIN seq: channel: ``` ### Response ``` WSP/1.1 200 OK seq: ``` ``` -------------------------------- ### Locate HTML Index File Source: https://streamedian.com/docs Path to the index.html file used for local network streaming. ```text /var/www/ws_rtsp_proxy/index.html ``` -------------------------------- ### Configure WebSocket URL Source: https://streamedian.com/docs Configuration snippet for the WebSocket connection URL. ```javascript socket: "ws://localhost:8088/ws/", ``` -------------------------------- ### GET_INFO Source: https://streamedian.com/docs Retrieves detailed statistics about licenses and active RTSP sessions from the proxy server. ```APIDOC ## GET_INFO ### Description Sends a request to the WebSocket proxy to retrieve current license information and active session details. ### Endpoint ws://localhost:8088/ws/ (requires 'statistic' subprotocol) ### Request Format WSP/1.1 GET_INFO Authorization: [Base64 encoded password] seq: [sequence number] ### Response Returns an array of objects containing license details (key, expiresAt, maxWatchers) and session details (rtsp, user, connectionTime, session_id, videoFormat). ``` -------------------------------- ### POST /account/api/login/ Source: https://streamedian.com/docs Verifies user credentials using email and password. ```APIDOC ## POST /account/api/login/ ### Description Verifies user credentials to authenticate the user. ### Method POST ### Endpoint https://streamedian.com/account/api/login/ ### Request Body - **email** (string) - Required - User email address - **password** (string) - Required - User password ### Request Example { "email": "user.email@mail.com", "password": "userpassword" } ### Response #### Success Response (200) - **error** (string) - Status code - **message** (string) - Success message ``` -------------------------------- ### Locate Windows License File Source: https://streamedian.com/docs Default file path for the Streamedian license file on Windows. ```text C:\Users\Public\Documents\Streamedian\WS RTSP Proxy Server\wsp.lic ``` -------------------------------- ### WSP/1.1 WRAP Source: https://streamedian.com/docs Wraps standard RTSP protocol commands within the WSP protocol for transmission. ```APIDOC ## WSP/1.1 WRAP ### Description Sends RTSP protocol commands wrapped in the WSP protocol format. ### Request ``` WSP/1.1 WRAP seq: ``` ### Response ``` WSP/1.1 200 OK channel: ``` ``` -------------------------------- ### Invoke object detection after player initialization Source: https://streamedian.com/docs Call the initialization function once the Streamedian player is ready. ```javascript var player = Streamedian.player('test_video', playerOptions); var nativePlayer = document.getElementById('test_video'); var statusText = document.getElementById('statusText'); initObjectsDetection("test_video", "test_canvas", 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov'); ``` -------------------------------- ### Define video and canvas overlay Source: https://streamedian.com/docs Use a relative container to stack the canvas over the video element for rendering bounding boxes. ```html
``` -------------------------------- ### WSP RTSP Command Wrapping Source: https://streamedian.com/docs Format for wrapping RTSP commands within the WSP protocol. ```text c>s: WSP/1.1 WRAP\r\n seq: \r\n \r\n s>c: WSP/1.1 200 OK\r\n channel: \r\n Error codes >= 400 means error ``` -------------------------------- ### Assign Activation Key Source: https://streamedian.com/docs Assign an activation key to a user account. The key must be provided as a base64 encoded string. ```json {"error": "NoErrors", "message": "Key assigned successfully"} ``` ```json {"error": 'FormatError', 'message': 'Key does not match the format'} ``` ```json {"error": "NoKeyError", "message": "Key not found"} ``` ```json {"error": "AlreadyError", "message": "Key already assigned another user"} ``` -------------------------------- ### Restart Windows Proxy Service Source: https://streamedian.com/docs Batch script to restart the proxy service after applying a new license. ```batch C:\Program Files\Streamedian\WS RTSP Proxy Server\restart_service.bat ``` -------------------------------- ### Manage Tunnel Client Service Source: https://streamedian.com/docs Standard systemctl commands to control the tunnel client service. ```bash systemctl start rtsp_ws_tunnel_client systemctl stop rtsp_ws_tunnel_client ``` ```bash systemctl stop rtsp_ws_tunnel_client ``` ```bash systemctl start rtsp_ws_tunnel_client ``` -------------------------------- ### Authenticate User Source: https://streamedian.com/docs Verify user credentials via POST request. Returns success or specific error codes for mismatch or inactive accounts. ```json {"error": "NoErrors", "message": "User authentication successfully"} ``` ```json {"error": "EmailOrPasswordIsMismatch", "message": "Incorrect email or password."} ``` ```json {"error": 'UserIsNotActive', 'message':'User account is not activated'} ``` -------------------------------- ### Retrieve current file length Source: https://streamedian.com/docs Accesses the current file length configuration property for recording instances. ```javascript continuousFileLengthInput.value = player.continuousRecording.fileLength; eventFileLengthInput.value = player.eventRecording.fileLength; ``` -------------------------------- ### SUBSCRIBE Source: https://streamedian.com/docs Subscribes to real-time statistic updates from the proxy server. ```APIDOC ## SUBSCRIBE ### Description Establishes a subscription to receive continuous statistic updates from the proxy server. ### Endpoint ws://localhost:8088/ws/ (requires 'statistic' subprotocol) ### Request Format WSP/1.1 SUBSCRIBE Authorization: [Base64 encoded password] seq: [sequence number] ``` -------------------------------- ### Include Player Scripts Source: https://streamedian.com/docs Required JavaScript files to be included in the HTML document. ```html ``` -------------------------------- ### Player Configuration Source: https://streamedian.com/docs Configuration options for the Streamedian player, including the data handler callback and file length settings. ```APIDOC ## Player Configuration Options ### Description Configuration object passed to the Streamedian player constructor. ### Parameters - **dataHandler** (function) - Optional - Callback function (data, prefix) triggered when a recording fragment is ready. - **continuousFileLength** (number) - Optional - File length for continuous recording in milliseconds (default: 180000). - **eventFileLength** (number) - Optional - File length for event recording in milliseconds (default: 10000). ``` -------------------------------- ### Connect to Statistic WebSocket Source: https://streamedian.com/docs The endpoint URL for establishing a connection to the proxy server for statistics. ```text ws://localhost:8088/ws/ ``` -------------------------------- ### WebSocket Statistic API Source: https://streamedian.com/docs Provides real-time information about license status and connections between the HTML5 RTSP player and the proxy server. ```APIDOC ## WebSocket /ws/ ### Description Connect to the proxy websocket using the 'statistic' subprotocol to receive real-time connection events. ### Endpoint ws://localhost:8088/ws/ ### Subscription Command WSP/1.1 SUBSCRIBE Authorization: [Base64_Encoded_Password] seq: 1 ### Response Data Fields - **connectionTime** (string) - Epoch timestamp of connection - **disconnectionTime** (string) - Epoch timestamp of disconnection - **reason** (string) - Reason for the message (e.g., Connection open, Connection closed) - **rtsp** (object) - Host and port of remote RTSP source - **session_id** (string) - Unique session identifier - **user** (object) - User address and requested domain - **videoFormat** (string) - h264 or h265 ### Response Example { "connectionTime": "1611850234", "disconnectionTime": "1611850242", "reason": "Connection closed", "rtsp": {"host": "demo..net", "port": "554"}, "session_id": "127.0.0.1-6 41", "user": {"address": "127.0.0.1", "requestedDomain": "http://127.0.0.1:8088"}, "videoFormat": "h264" } ``` -------------------------------- ### Embed RTSP Stream in HTML Source: https://streamedian.com/docs Methods for embedding RTSP streams using the video tag, including standard and source-element approaches. ```html ``` ```html ``` ```html ``` -------------------------------- ### Subscribe to Statistics Updates Source: https://streamedian.com/docs Command sent over the WebSocket to subscribe to updates, requiring Base64 encoded authorization. ```text WSP/1.1 SUBSCRIBE Authorization: c3RyZWFtZWRpYW4= seq: 1 ``` -------------------------------- ### WSP RTP Channel Connection Source: https://streamedian.com/docs Protocol handshake to establish an RTP channel for media streaming. ```text c>s: WSP/1.1 JOIN\r\n seq: \r\n channel: \r\n\r\n s>c: WSP/1.1 200 OK\r\n seq: \r\n\r\n Error codes >= 400 means error ``` -------------------------------- ### License Deactivation Responses Source: https://streamedian.com/docs Expected JSON responses for successful deactivation and various error scenarios. ```json {"error": "NoErrors", "message": "Deactivation successfully"} ``` ```json {"error": 'AlreadyError', 'message':'machine id already deactivated'} ``` ```json {"error": 'MachineIdMismatchError', 'message':'Incorrect machine id'} ``` ```json {"error": 'NoLicenseError', 'message':'User license not found'} ``` -------------------------------- ### POST /account/api/deactivate/ Source: https://streamedian.com/docs Deactivates a user license using the provided credentials and machine information. ```APIDOC ## POST /account/api/deactivate/ ### Description Deactivates a specific license associated with a user account and machine ID. ### Method POST ### Endpoint https://streamedian.com/account/api/deactivate/ ### Request Body - **email** (string) - Required - User email used for registration - **password** (string) - Required - User password used for registration - **licese_id** (string) - Required - ID of the user license activation key - **machine_id** (string) - Required - Machine ID from machine_info.bin ### Request Example { "email": "user.email@mail.com", "password": "userpassword", "licese_id": "eeec5567-bd7c-48dc-bd84-28d265b8d361", "machine_id": "Nkl1QA85aHF2aX9CYUxsTQxTeFoNXRYHYlprcgspagIKL2JBfhc6RH9SAzQ=" } ### Response #### Success Response (200) - **error** (string) - Status code identifier - **message** (string) - Success message #### Response Example { "error": "NoErrors", "message": "Deactivation successfully" } ``` -------------------------------- ### Handle Chrome Browser Playback Delay Source: https://streamedian.com/docs JavaScript snippet to force the player to the end of the buffer when the tab becomes visible again in Chrome-based browsers. ```javascript // Tab switching and window minimization processing // for browsers that use the chrome rendering engine. if (!!window.chrome) { document.addEventListener('visibilitychange', function() { if(document.visibilityState === 'hidden') { nativePlayer.pause() } else { nativePlayer.play(); // Automatic jump to buffer end to watch live video when returning to the web page. setTimeout(function() { nativePlayer.currentTime = nativePlayer.buffered.end(0) }, 3000); // Few seconds delay is required so the player would have time to update the timeline. } }); } ``` -------------------------------- ### License Deactivation Request Source: https://streamedian.com/docs Use this JSON payload in a POST request to the /account/api/deactivate/ endpoint to deactivate a license. ```json { "email": "user.email@mail.com", "password": "userpassword", "licese_id": "eeec5567-bd7c-48dc-bd84-28d265b8d361", "machine_id": "Nkl1QA85aHF2aX9CYUxsTQxTeFoNXRYHYlprcgspagIKL2JBfhc6RH9SAzQ=" } ``` -------------------------------- ### Configure Nginx for RTSP WS Tunnel Source: https://streamedian.com/docs Defines the server block to route WebSocket and tunnel traffic to the appropriate local services. ```nginx server { listen 80; server_name ; location / { root /srv/proxy/; index index.html; } location = /ws/ { proxy_pass http://localhost:8080/ws/; } location = /tunnel/ { proxy_pass http://localhost:4000/tunnel/; } } ``` -------------------------------- ### Unauthorized Statistics Response Source: https://streamedian.com/docs Response received when the provided authorization password is incorrect. ```text WSP/1.1 401 Unauthorized seq: 1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.