Embedded device video preview method and device suitable for various browsers and medium
By building a web server and WebSocket service on the embedded device, and combining ActiveX and WS plugins, the video preview problem of embedded devices in different browser modes was solved, achieving stable video preview in both compatibility and high-speed modes, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-10
AI Technical Summary
Embedded devices have difficulty in previewing videos using multiple browsers in compatibility and speed modes, especially due to the decreasing security vulnerabilities and plugin support of browsers in compatibility mode, resulting in poor video preview quality.
A web server and WebSocket service supporting concurrent access by multiple users are built on the embedded device. Combined with ActiveX plugins and WS plugins, video preview is provided according to browser mode, and video stream is transmitted through the WebSocket protocol to achieve video preview in both compatibility and high-speed modes.
It achieves compatibility and efficiency for video preview in different browser modes, reduces network load, and improves the stability of video playback and user experience.
Smart Images

Figure CN121841932A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video preview, specifically to a method, apparatus, and medium for video preview on embedded devices applicable to multiple browsers. Background Technology
[0002] Compatibility mode browsers mainly refer to Trident-based browsers, such as early versions of Internet Explorer, whose advantage in previewing videos lies in their support for the Flash plugin; browser speed mode mainly refers to other kernel browsers, currently the mainstream browser kernels, which have abandoned support for the Flash plugin.
[0003] Embedded devices are typically limited by CPU, memory, and storage space, requiring efficient operation within these constraints. Due to limited storage and CPU capabilities, web servers built into embedded devices have far less computing power than cloud computing servers. When previewing videos on a webpage, a local decoding plugin is usually installed to assist with the preview; however, many plugins currently require the browser to run in compatibility mode. Because compatibility mode browsers have security vulnerabilities and poor compatibility, fewer and fewer browsers support compatibility mode. Therefore, to enable embedded devices to adapt to both current browser operating modes, a method is needed that allows video previewing in both high-speed and compatibility modes. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides an embedded device video preview method, apparatus, and medium applicable to multiple browsers, enabling video preview in different modes across various browser types.
[0005] To solve the aforementioned technical problem, the technical solution adopted by the present invention is: a video preview method for embedded devices applicable to multiple browsers, comprising the following steps: S01. Build a web server that supports concurrent access by multiple users on the embedded device, and write a websocket service that supports concurrent access by multiple users. The web server is used to provide HTTP service and video preview page, and the websocket service is used to provide real-time bidirectional communication and transmit video stream data. The websocket service is bound to the web server. When a user accesses the web server to preview the video, a connection is established with the websocket service at the same time. S02. Write a video plugin, which includes an ActiveX plugin and a WS plugin. The ActiveX plugin runs in compatibility mode and embeds the video window into the webpage, enabling real-time video preview when the user visits the page. The WS plugin is used to acquire and decode the video stream in high-speed mode and then redirect to the webpage to enable real-time video playback. S03. When a user requests a video preview, first determine whether the user has installed the video plugin. If the user has not installed the video plugin, proceed to step S04. If the user has installed the video plugin, proceed to step S05. S04. Determine the current browser mode. If the current browser is in compatibility mode, redirect to the plugin download page. After downloading the plugin, redirect to S05. If the current browser is in high-speed mode, the webpage initiates the connection process with the Websocket service. After completing the login interaction, the video stream is pulled and previewed for playback via the Websocket protocol. S05. Determine the current browser mode. If the browser is in compatibility mode, first check the ActiveX plugin's running status. If the ActiveX plugin is not running, prompt the user to download or restart it. If the ActiveX plugin is running, embed and display the ActiveX plugin video window directly in the page for preview. If the webpage is in high-speed mode, first check the ActiveX plugin's running status. If the ActiveX plugin is not running, the webpage directly connects to the WebSocket service for video preview. If the ActiveX plugin is running, the webpage establishes a connection with the WebSocket plugin, and the WebSocket plugin transcodes the video stream retrieved from the embedded device and sends it to the webpage for preview.
[0006] Furthermore, the ActiveX plugin and WS plugin are packaged into a plugin package and placed on the web server.
[0007] Furthermore, the WS plugin is written based on WebSocket and can be installed and run directly on the local machine.
[0008] Furthermore, in step S04, if multiple users initiate the connection process with the WebSocket service and pull video streams through the WebSocket protocol, the users who access the service later will be prompted to download the plugin package.
[0009] Furthermore, the WebSocket service is integrated with the web server in the same process.
[0010] Furthermore, the embedded device is a surveillance camera or an infrared thermal imager.
[0011] Furthermore, users are authenticated before accessing the web server.
[0012] The present invention also discloses an embedded device video preview apparatus applicable to multiple browsers, including a processor and a memory storing program instructions, wherein the processor is configured to execute the embedded device video preview method applicable to multiple browsers as described above when running the program instructions.
[0013] The present invention also discloses a storage medium storing program instructions, which, when executed, perform the embedded device video preview method applicable to multiple browsers as described above.
[0014] The beneficial effects of this invention are as follows: Traditional embedded webpage video previews almost all rely on ActiveX controls. As support for ActiveX is decreasing, this method optimizes traditional plugins. At the same time, to prevent plugin malfunctions, a WebSocket server is deployed on the embedded device. Based on the plugin download status and network load on the user's computer, the system prompts the user to change the preview mode in real time, enabling video preview in different modes for various types of browsers. Attached Figure Description
[0015] Figure 1 This diagram illustrates how to preview video on computers with and without the plugin installed. Detailed Implementation
[0016] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0017] Example 1 This embodiment discloses a video preview method for embedded devices applicable to multiple browsers. This method mainly involves three parts: embedded device, video plugin, and web browser. The embedded device is an imaging device that generates images or video streams, such as a surveillance camera or an infrared thermal imager. The web browser is the medium for realizing video preview. The video plugin is the relay station between the embedded device and the web browser. Depending on the browser type and network status, the embedded device can directly send the video stream to the web browser, or it can send the video stream to the web browser through the video plugin.
[0018] Specifically, this method includes the following steps: S01. Build a web server supporting concurrent access by multiple users on the embedded device, and simultaneously write a WebSocket service supporting concurrent access by multiple users. The web server provides HTTP services and a video preview page, while the WebSocket service provides real-time bidirectional communication and transmits video stream data. The WebSocket service is bound to the web server; when a user accesses the web server to preview the video, a connection is simultaneously established with the WebSocket service. In this embodiment, the WebSocket service can send the video stream to the webpage through a video plugin, or it can directly forward the video stream captured by the device to the webpage without plugin support. However, due to the large data volume, too many user accesses will increase the device's network load and cause video stuttering.
[0019] In this embodiment, the web server acts as the content provider, responsible for offering the user interface and API. Its specific functions include providing HTTP services, processing static resources (HTML, CSS, JavaScript files), providing video preview pages, authentication and authorization, and returning device status information. The WebSocket service serves as the data channel, responsible for real-time data transmission. Its specific functions include providing real-time bidirectional communication, transmitting video stream data (H.264 / H.265, etc.), and supporting full-duplex communication. The two services work closely together, allowing users to easily access the embedded device through a browser, both to view live video and to perform control operations. In this embodiment, the WebSocket service and the web server are integrated into the same process, sharing resources and improving efficiency.
[0020] S02. Develop video plugins, including an ActiveX plugin and a WS plugin. The ActiveX plugin runs in compatibility mode, directly embedding the video window into the webpage, enabling real-time video preview when the user visits the page. The WS plugin is written based on WebSockets, installed and running locally. When the user previews the video using the browser's high-speed mode, the WS plugin obtains the device's video stream, decodes it, and then redirects to the webpage for real-time playback. In this embodiment, the two plugins are packaged into a single plugin package and placed on the server for users to download and install.
[0021] S03. When a user requests a video preview, first determine if the user has the video plugin installed. If the user has not installed the video plugin, proceed to step S04; if the user has installed the video plugin, proceed to step S05. The process for video preview on computers with and without the plugin is as follows: Figure 1 As stated above.
[0022] S04. Determine the current browser mode. If the current browser is in compatibility mode, redirect to the plugin download page. After downloading the plugin, proceed to S05. If the current browser is in high-speed mode, since no plugin is detected, the webpage initiates the connection process with the WebSocket service. After completing the login interaction, the video stream is retrieved for preview and playback via the WebSocket protocol. This method does not require any decoding on the webpage, so the network load on the WS device is relatively high. When too many users access the site, to reduce the network load on the WS device, subsequent users will be prompted to download the plugin, and then the process will proceed to step S05.
[0023] S05. Determine the current browser mode. If the browser is in compatibility mode, first check the ActiveX plugin's running status. If the ActiveX plugin is not running, prompt the user to download or restart it. If the ActiveX plugin is running, embed and display the ActiveX plugin video window directly in the page for preview. If the webpage is in high-speed mode, first check the ActiveX plugin's running status. If the ActiveX plugin is not running, the webpage directly connects to the WebSocket service for video preview. If the ActiveX plugin is running, the webpage establishes a connection with the WebSocket plugin, and the WebSocket plugin transcodes the video stream retrieved from the embedded device and sends it to the webpage for preview. When the plugin is running, it retrieves the network stream from the embedded device. This network stream is encoded data, with a small data volume and minimal loss of image quality, avoiding the heavy network load issue described in step S04.
[0024] To ensure that users are authenticated before accessing the web server when the embedded device is installed.
[0025] Example 2 This disclosure provides an embedded device video preview apparatus applicable to multiple browsers, including a processor and a memory. Optionally, the apparatus may further include a communication interface and a bus. The processor, communication interface, and memory can communicate with each other via the bus. The communication interface can be used for information transmission. The processor can invoke logical instructions in the memory to execute the embedded device video preview method applicable to multiple browsers described in the above embodiments.
[0026] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0027] Memory, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor executes the program instructions / modules stored in the memory to perform functional applications and data processing, thereby implementing the embedded device video preview method applicable to multiple browsers as described in the above embodiments.
[0028] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory may include high-speed random access memory and may also include non-volatile memory.
[0029] Example 3 This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to execute the above-described embedded device video preview method applicable to multiple browsers.
[0030] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0031] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.
[0032] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for descriptive purposes only and is not intended to limit the scope of protection. As used in the description herein, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used herein means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0033] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
Claims
1. A method for video previewing on embedded devices applicable to multiple browsers, characterized in that: Includes the following steps: S01. Build a web server that supports concurrent access by multiple users on the embedded device, and write a websocket service that supports concurrent access by multiple users. The web server is used to provide HTTP service and video preview page, and the websocket service is used to provide real-time bidirectional communication and transmit video stream data. The websocket service is bound to the web server. When a user accesses the web server to preview the video, a connection is established with the websocket service at the same time. S02. Write a video plugin, which includes an ActiveX plugin and a WS plugin. The ActiveX plugin runs in compatibility mode and embeds the video window into the webpage, enabling real-time video preview when the user visits the page. The WS plugin is used to acquire and decode the video stream in high-speed mode and then redirect to the webpage to enable real-time video playback. S03. When a user requests a video preview, first determine whether the user has installed the video plugin. If the user has not installed the video plugin, proceed to step S04. If the user has installed the video plugin, proceed to step S05. S04. Determine the current browser mode. If the current browser is in compatibility mode, redirect to the plugin download page. After downloading the plugin, redirect to S05. If the current browser is in high-speed mode, the webpage initiates the connection process with the Websocket service. After completing the login interaction, the video stream is pulled and previewed for playback via the Websocket protocol. S05. Determine the current browser mode. If the browser is in compatibility mode, first check the ActiveX plugin's running status. If the ActiveX plugin is not running, prompt the user to download or restart it. If the ActiveX plugin is running, embed and display the ActiveX plugin video window directly in the page for preview. If the webpage is in high-speed mode, first check the ActiveX plugin's running status. If the ActiveX plugin is not running, the webpage directly connects to the WebSocket service for video preview. If the ActiveX plugin is running, the webpage establishes a connection with the WebSocket plugin, and the WebSocket plugin transcodes the video stream retrieved from the embedded device and sends it to the webpage for preview.
2. The embedded device video preview method applicable to multiple browsers according to claim 1, characterized in that: ActiveX plugins and WS plugins are packaged into a plugin package and placed on a web server.
3. The embedded device video preview method applicable to multiple browsers according to claim 1, characterized in that: The WS plugin is written based on WebSocket and can be installed and run directly on the local machine.
4. The embedded device video preview method applicable to multiple browsers according to claim 1, characterized in that: In step S04, if multiple users initiate the connection process with the WebSocket service and pull video streams through the WebSocket protocol, the users who access the service later will be prompted to download the plugin package.
5. The embedded device video preview method applicable to multiple browsers according to claim 1, characterized in that: The WebSocket service is integrated into the same process as the web server.
6. The embedded device video preview method applicable to multiple browsers according to claim 1, characterized in that: Embedded devices are surveillance cameras or infrared thermal imagers.
7. The embedded device video preview method applicable to multiple browsers according to claim 1, characterized in that: Users must authenticate themselves before accessing the web server.
8. An embedded device video preview device applicable to multiple browsers, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute, when running the program instructions, the embedded device video preview method applicable to multiple browsers as described in any one of claims 1 to 7.
9. A storage medium storing program instructions, characterized in that, When the program instructions are executed, they perform the embedded device video preview method applicable to multiple browsers as described in any one of claims 1 to 7.