Capability Integration

This chapter introduces you to how to integrate FIRERPA remote desktop and its related capabilities. You can integrate it into your frontend pages for operations, display, and various other functions. We will not introduce this chapter here; you can go to our APIFOX documentation to view and test it. However, we need to introduce you to some advanced settings and other basic information.

Hint

The following content requires you to have some basic understanding of Websocket, Canvas drawing, H.264, etc.

Advanced Settings

To make it easier for you to test the interfaces, first make sure the device is connected to the current computer via USB, and ensure that the device has not enabled login certificate verification (https). After completing these two steps, you also need to complete the relevant settings on the apifox platform. Since it involves ws interfaces, you need to install the apifox desktop client (not the web version) and import the relevant project into your client. We will not tell you how to install or import; please explore on your own.

Real-time Video

Real-time video uses Websocket for transmission. Video supports two transmission formats: MJPEG (MOTION JPEG) and H.264 NALU. MJPEG is the easiest to use. The actual content transmitted by MJPEG is the screenshot of the current device screen. When transmitted fast enough, it becomes a dynamic real-time device screen. The only processing you need to do is to draw each frame of messages received by Ws as JPEG to the screen. The other one, H.264, has relatively higher requirements for your basic knowledge, because before rendering to canvas, you still need to perform a decoding operation. You can search or integrate existing h264 decoders for decoding and drawing.

The difference between H264 and MJPEG is that H264 can reduce at least half of the traffic and is faster, but it is not suitable for all devices. Some devices themselves may not have high H264 encoding performance, in which case you should use MJPEG for transmission. Of course, MJPEG also has its disadvantages. Since each frame is a pure image, it requires higher bandwidth.

Real-time Touch Control

Real-time touch control also uses Websocket for transmission. There is nothing special about it; you just need to send three operations: press, move, and release in a specific format. You can use mousedown, up, and other events on the web side. The main data transmitted is events and coordinates. The only thing to note here is that you need to convert using canvas and the size of the actual screen, calculating the coordinates of the user’s operation on the canvas corresponding to the coordinates of the actual screen.

Key Operations

Key operations are relatively the simplest part. You only need to POST to the relevant interface in a specific format. Key operations support you controlling the device’s navigation keys and performing normal English input.

Command Terminal

The command terminal uses Websocket. You need to use xterm.js and other related technologies for docking operations. You only need to format the input and output into a specific format according to the API documentation and send or request xterm output.

Real-time Instructions