Capability Integration¶
This section introduces how to integrate FIRERAP remote desktop and its related capabilities, allowing you to embed them into your own front-end pages for operations, display, and other functions. We will not go into detailed explanations here; instead, please refer to our APIFOX documentation for further details and testing. However, we will cover some prerequisite configurations and fundamental information.
Hint
The following content requires basic knowledge of WebSockets, Canvas rendering, H.264, and similar technologies.
Prerequisites¶
To facilitate interface testing, first ensure that the device is connected to your computer via USB and that login certificate verification (HTTPS) is disabled on the device. After completing these two steps, you must also configure the relevant settings on the Apifox platform. Since WebSocket (ws) interfaces are involved, you need to install the Apifox desktop client (not the web version) and import the related project into your client. We will not provide instructions on installation or importing—please figure this out independently.
Real-Time Video¶
Real-time video is transmitted via WebSocket and supports two transmission formats: MJPEG (MOTION JPEG) and H.264 NALU.
MJPEG is the simplest to use. The actual data transmitted in MJPEG consists of screenshots of the device screen. When transmitted rapidly enough, it creates a smooth real-time view of the device screen. Your only task is to render each frame received over the WebSocket as a JPEG image onto the screen.
H.264, on the other hand, requires more foundational knowledge, as you must perform a decoding step before rendering frames onto the canvas. You may search for or integrate existing H.264 decoders for decoding and rendering.
The key difference between H.264 and MJPEG is that H.264 typically reduces bandwidth usage by at least half and offers faster transmission. However, it may not be suitable for all devices—some devices may have limited H.264 encoding performance. In such cases, you should fall back to using MJPEG. Note that MJPEG has its drawbacks: since each frame is a full image, it demands higher bandwidth.
Real-Time Touch Control¶
Real-time touch control also uses WebSocket for transmission. There’s nothing particularly complex about it—you simply need to send three types of actions (“press”, “move”, “release”) in a specific format. You can capture these actions using standard web events like mousedown, mouseup, etc. The main payload includes the event type and coordinates. One important point: you must convert the user’s interaction coordinates on the canvas to actual screen coordinates, based on the canvas size and the real screen resolution.
Key Operations¶
Key operations are relatively straightforward. You just need to send POST requests to the corresponding API endpoints in the specified format. This functionality allows you to control the device’s navigation keys and input plain English text.
Command Terminal¶
The command terminal operates over WebSocket. You need to integrate using technologies such as xterm.js. Simply follow the API documentation to format input and output data into the required structure, then send commands or retrieve xterm output accordingly.