Network video playing method and device for web browser

By building a video playback method in a web browser, using Jessibuca and Web Browser controls to process video streams, the repetition and readability of video surveillance functions in the prior art are solved, and efficient video streaming playback and video playback are achieved. Improve development efficiency and security.

CN119211657APending Publication Date: 2024-12-27WUHAN HONGXIN TECH SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411377517.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing technology has too many repetitive codes and poor readability in real-time video playback and video playback, which leads to lack of uniformity and reusability of video surveillance functions, and cannot fully utilize the GPU hardware acceleration capabilities of terminal computers, resulting in multiple channels. Or it is difficult to stream HD videos.

Method used

Provide a network video playback method for web browsers, build a player object instance by obtaining video metadata, generate http request to pull the video stream, and call the player object's play method when successful to perform playback operations, supporting video The stream state display, error handling, double-speed playback and video playback are used to realize video playback using Jessibuca and Web Browser controls.

Benefits of technology

By unifying the packaged video playback process, we can reduce project coupling, improve development and maintenance efficiency, shorten development cycles, reduce costs, and improve the security and reusability of video surveillance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211657A_ABST
    Figure CN119211657A_ABST
Patent Text Reader

Abstract

The invention provides a network video playing method and device for a web browser, and relates to the field of video playing, and the method comprises the steps: obtaining video metadata, and constructing a player object instance; generating an http request to pull the video stream, and calling a corresponding text display method of the player object instance to present the first state information and the video point location information; under the condition that the video stream request fails, calling a corresponding text display method of the player object instance to present the second state information and / or error information returned by the failure of the http request; and under the condition that the video stream request is successful, calling a play method corresponding to the player object instance according to the returned real-time video stream address information to execute playing operation. According to the invention, unified packaging is carried out in the same process of the video playing process, coupling between projects is greatly reduced, the development efficiency and the maintenance efficiency of front-end developers are improved, the development period is shortened, and the project cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video playback, and in particular to a network video playback method and device for a web browser. Background Art

[0002] Jessibuca is an open source pure JavaScript live player based on MediaSource / Webcodec / WebAssembly (wasm). It compiles the audio and video decoding library into Js (wasm) through Emscripten and runs it in the browser. Limited by the inherent defects of WASM, such as poor multi-threading support and limited memory size, it cannot fully utilize the hardware acceleration capabilities (GPU) of the terminal computer graphics card. This makes it difficult to play multiple or high-definition RTSP streams at the same time, and it occupies a large amount of CPU and memory resources of the terminal computer. Other operations are basically impossible, and the compatibility with audio and video formats is also limited.

[0003] At present, the complete process of video playback includes starting to request streaming data, processing streaming data, calling the corresponding player method of Jessibuca to respond to streaming data, handling related exceptions that may occur during the request, calling the corresponding player method of Jessibuca to feedback the abnormal information, etc. This process is repetitive in real-time video playback and video playback. If multiple modules in the system contain video functions, a large amount of repeated code will appear, which is poor in readability. It will also become complicated and difficult to maintain if you want to reuse video functions in other systems, making the video surveillance function not unified and reusable. Summary of the invention

[0004] The present invention provides a network video playback method and device for a web browser, which is used to solve the technical defects in the prior art that there is duplication in real-time video playback and video playback. If multiple modules in the system include video functions, a large amount of repeated codes will appear, which is poor in readability. It will also become complicated and difficult to maintain if the video function is to be reused in other systems, making the video monitoring function not unified and reusable.

[0005] In a first aspect, the present invention provides a network video playing method for a web browser, comprising:

[0006] Get video metadata and build a player object instance;

[0007] Generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and the video point information;

[0008] In the case of a video stream request failure, calling a corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request;

[0009] When the video stream request is successful, the play method corresponding to the player object instance is called according to the returned real-time video stream address information to perform the playback operation.

[0010] According to the network video playing method for a web browser, the player object includes Jessibuca and Web Browser controls.

[0011] According to the network video playing method for a web browser, after calling the play method of the player object instance according to the returned real-time video stream address information to perform the playing operation, it also includes:

[0012] After receiving the stop playback instruction, calling the stop streaming API, call the destroy method of the player object instance to destroy the video playback window and close the video window.

[0013] According to the network video playing method for a web browser, when the video stream request is successful, the acquisition further includes:

[0014] Call the play method of the player object instance according to the returned video information to perform the playback operation;

[0015] When receiving the speed playback instruction, call the speed video playback API and then call the forward method of the player object instance to set the current video playback rate to adjust the current video playback rate;

[0016] When receiving the pause playback instruction, call the pause video playback API and then call the playbackStop method of the player object instance to pause the current video playback;

[0017] When receiving the resume playback instruction, the resume playback API is called and then the forward method of the player object instance is called to set the current video playback rate to adjust the current video playback rate.

[0018] According to the network video playback method for a web browser, the step of obtaining video metadata includes:

[0019] Select surveillance video points, generate surveillance video playback requirements, and obtain video metadata;

[0020] Based on the video metadata, a video client window is opened and embedded into a video playback window position preset by a web browser; the video metadata includes video point information and video window information.

[0021] According to the network video playing method for a web browser, the constructing of a player object instance includes:

[0022] Based on the video metadata, it is determined whether a jessibuca instance exists, and if so, the jessibuca instance is updated; if not, the jessibuca instance is constructed.

[0023] According to the network video playback method for a web browser, before the corresponding text display method of calling the player object instance to present the first state information and the video point information, it also includes:

[0024] The http request is token authenticated based on the video metadata.

[0025] In a second aspect, the present invention further provides a network video playback device for a web browser, comprising: an initialization module, for acquiring video metadata and constructing a player object instance;

[0026] A processing module, used to generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and the video point information;

[0027] In the case of a video stream request failure, calling a corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request;

[0028] When the video stream request is successful, the play method corresponding to the player object instance is called according to the returned real-time video stream address information to perform the playback operation.

[0029] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described network video playback methods for a web browser are implemented.

[0030] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described network video playback methods for a web browser.

[0031] The network video playing method and device for a web browser provided by the present invention have the following better technical effects compared with the prior art.

[0032] Obtain video metadata and construct a player object instance; generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and video point information; in the case of a video stream request failure, call the corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request; in the case of a successful video stream request, call the corresponding play method of the player object instance according to the returned real-time video stream address information to perform the playback operation. The present invention uniformly encapsulates the same process of the video playback process, greatly reduces the coupling between projects, improves the development efficiency and maintenance efficiency of front-end developers, shortens the development cycle, and reduces project costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 It is a flow chart of a network video playing method for a web browser provided by the present invention;

[0035] Figure 2 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] It should be noted that, in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0038] The present invention provides a network video playback method and device for a web browser, which is used to improve the web client playback performance and improve the efficiency of playback plug-in development. Figure 1-Figure 2 The present invention provides a method and device for playing network videos in a web browser.

[0039] Figure 1 This is one of the flow charts of the network video playback method for a web browser provided by the present invention. The following is an example of the method being applied to an audio and video playback plug-in. Figure 1 As shown, including but not limited to the following steps (STEP, referred to as S):

[0040] S101: Obtain video metadata and construct a player object instance.

[0041] The video metadata includes video playback environment configuration information such as video point information and video window information.

[0042] S102: Generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and the video point information.

[0043] In the case of a video stream request failure, calling a corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request;

[0044] When the video stream request is successful, the play method corresponding to the player object instance is called according to the returned real-time video stream address information to perform the playback operation.

[0045] The player objects include Jessibuca and Web Browser controls.

[0046] Furthermore, before calling the corresponding text display method of the player object instance to present the first state information and the video point information, the method further includes:

[0047] The http request is token authenticated based on the video metadata.

[0048] The following is an example of calling the player object as Jessibuca.

[0049] In one embodiment, a series of parameters such as authentication information, decoder path, video container DOM, and jessibuca player custom parameters required for monitoring video playback are initialized; identity authentication is performed based on the obtained authentication parameters and a token is added to the http request; a monitoring video point is selected on the web page to initiate the monitoring video playback demand. The currently existing jessibuca player instance is destroyed; a jessibuca player instance is constructed based on the jessibuca player custom parameters; based on the incoming video point information, the jessibuca display text method is called to display the text information of the first status information, such as "requesting video stream..."; a request to pull the video stream is initiated to the backend API; if the video stream request is successful, the jessibuca video playback method is called to play the video screen; if the video stream request fails, the jessibuca text display method is called to display the text information of the second status information, such as "device is not online" / "on-demand timeout" / "on-demand abnormality" and other specific abnormal information.

[0050] The following example takes the case where the player object is called as a Web Browser control.

[0051] In one embodiment, a suitable WebBrowser control is selected to satisfy the requirements of a desktop application control that can interact with Javascript and adapt to a Web browser, and the control is preferably Cefsharp.

[0052] Then develop the host program. Borrow open source code or develop a host program with C / S architecture by yourself, run it in the .Net environment, so that it can be used as a browser. By configuring the URL address, you can view the web page, and support interactive operations with the Web page. Build an application with C / S architecture as the host program, let the Web program run on it, and at the same time, the C / S host program can call the SDK of the underlying video surveillance to play the surveillance video, collect the voice of the voice intercom, etc. A WebBrowser control.

[0053] Specifically, the construction method includes: S1.2, organizing the video device configuration file to be played into an XML or JSON file and placing it in the host program running path. This step is mainly for the porting and reuse of the host program, and different configurations of different projects are used to achieve reuse.

[0054] S1.3. Optimize the UI effect of the host program, hide the main window, and maximize the window at the same time, so that the host program only plays the role of host and not the display role. The final presentation is still the UI effect of the Web itself.

[0055] S1.4. Define environment variables and callback functions that interact with Javascript. The parameters of the callback function should generally include device point information and window position information (relative to the page position), and include methods for calling the video service playback interface.

[0056] S1.5. Configure the web address to be loaded. This step is also to prepare for the future porting and reuse of the host program.

[0057] Then, the Web Browser control is initialized by passing in initialization parameters including authentication information, container DOM, websocket connection address parameters, and video metadata.

[0058] After the Web Browser control is initialized, the host program is started. The host program writes the video surveillance call method in advance and waits for the Web call. The parameters of the video surveillance call method should include video point information (point device name information, channel number information, IP address information, etc.), video window information (window relative position information, window size information), etc. At startup, the host program will read the video surveillance point configuration, which mainly contains the information of all video point devices, such as name, channel, IP, etc. The configuration file is placed in the operating environment in XML or JSON format, and the host program reads it and loads it into its cache.

[0059] After starting the host program, identity authentication can be performed based on the authentication parameters and a token can be added to the http request; a video point can be selected on the web page to initiate a video playback request; based on the input video point information and video window information, the video client window is opened and embedded into the preset video playback window position of the web browser.

[0060] According to the input video point information and window information, the display text method of the Web Browser control is called to display the text information of the first status information, such as "requesting video stream..."; a request for pulling the video stream is initiated to the backend API.

[0061] If the video stream request is successful, the stream address and point information are passed in to call the play video method of the Web Browser control to play the video screen; if the video stream request fails, the display text method of the Web Browser control is called to display the second status information such as "device is not online" / "on-demand timeout" / "on-demand abnormality" and other specific abnormal information.

[0062] Start the video service. After the host program is started, the video service startup script (pre-written) will be executed to start the video service. There can be multiple video services here (suitable for scenarios with multiple manufacturers' devices). The video service can also be flexibly configured through the configuration file to suit different application scenarios.

[0063] The video service can be an independent process developed based on the SDK provided by the manufacturer, which can include the following functions: viewing real-time video, viewing recorded video, closing video playback, adjusting video playback rate, etc. After the host program is started, the pre-written startup script will be called to start the video service. Here, SDKs from different manufacturers can be encapsulated into different services to prepare for the reuse of video services in the future.

[0064] In one embodiment, the constructed player object instance js library (Player.js) is introduced through the script tag. The necessary parameters required for initializing the player object instance are defined: user name, password, request IP, port, video playback container DOM, and the json object is constructed and passed in as the parameters for instantiating the Player instance.

[0065] After receiving the passed parameters, a player object is generated and returned to the web end for calling public methods exposed to the outside world.

[0066] Select a monitoring point on the web page, and call the real-time video playback method of the player object instance of the player object with the signaling server ID, channel ID, and device ID information of the monitoring point to initiate video playback.

[0067] Further, constructing a player object instance based on the above includes:

[0068] Based on the video metadata, it is determined whether a jessibuca instance exists, and if so, the jessibuca instance is updated; if not, the jessibuca instance is constructed.

[0069] Specifically, the player instance will determine whether there is a jessibuca instance based on the passed information. If it exists, it will destroy the current jessibuca instance first, and then start a new jessibuca instance. From the web end, you can see the appearance of a blank video window;

[0070] Then, it starts to initiate an HTTP request to pull the video stream, and at the same time calls the corresponding method of the jessibuca instance to display the text "Requesting video stream..." and the currently selected point information on the player screen;

[0071] If the video stream request fails, the corresponding method of the jessibuca instance will be called to display "Video playback exception" or other specific error information returned by the failed http request on the player screen;

[0072] If the video stream request is successful, the player will process the returned video stream address information, then call the play method of the jessibuca instance, pass in the processed video stream address information, and the player window will render the currently pulled video stream information;

[0073] Based on the content of the above embodiment, as an optional embodiment, the network video playback method for a web browser provided by the present invention, after calling the play method of the player object instance according to the returned real-time video stream address information to perform the playback operation, further includes:

[0074] After receiving the stop playback instruction, calling the stop streaming API, call the destroy method of the player object instance to destroy the video playback window and close the video window.

[0075] In this embodiment, when the playback is stopped, the hfpLivePlay Stop real-time video playback stop method of the player object is called with the signaling server ID, channel ID, and device ID information of the monitoring point;

[0076] The player instance first calls the backend to stop streaming API based on the passed information, and then calls the destroy method of the jessibuca instance to destroy the video playback window. The video window can be seen to be closed from the web end.

[0077] Based on the content of the above embodiment, as an optional embodiment, the network video playback method for a web browser provided by the present invention obtains, when the video stream request is successful, the method further includes:

[0078] Call the play method of the player object instance according to the returned video information to perform the playback operation;

[0079] When receiving the speed playback instruction, call the speed video playback API and then call the forward method of the player object instance to set the current video playback rate to adjust the current video playback rate;

[0080] When receiving the pause playback instruction, call the pause video playback API and then call the playbackStop method of the player object instance to pause the current video playback;

[0081] When receiving the resume playback instruction, the resume playback API is called and then the forward method of the player object instance is called to set the current video playback rate to adjust the current video playback rate.

[0082] In this embodiment, the monitoring point, recording time, signaling server ID carrying the monitoring point, channel ID, device ID information, and recording playback time are selected on the web page to call the recording playback method of the player object instance of the player object to initiate video playback.

[0083] Specifically, the player instance will determine whether there is a jessibuca instance based on the information passed in. If so, the current jessibuca instance will be destroyed first, and then a new jessibuca instance will be started. From the web end, a blank video window can be seen. Then, an http request for pulling the video stream is initiated, and the corresponding method of the jessibuca instance is called to display the text "Requesting video stream..." and the currently selected point information on the player screen.

[0084] If the video stream request fails, the corresponding method of the jessibuca instance will be called to display "Video playback exception" or other specific error information returned by the failed http request on the player screen.

[0085] If the video stream request is successful, the player will process the returned video stream address information, then call the play method of the jessibuca instance and pass in the processed video stream address information. The player window will render the currently pulled video stream information and return the detailed information of the current video stream to the web end (recording time, point information, and video stream information).

[0086] When playing a high-speed video, the hfpPlaybackSpeed ​​playback pause method of the player object is called with the signaling server ID, channel ID, device ID information of the monitoring point, the stream information of the currently playing video, and the high-speed rate information.

[0087] The player instance first calls the backend double-speed video playback API based on the passed information, and then calls the forward method of the player object instance to set the current video playback rate. From the web end, you can see that the video is playing at the selected rate.

[0088] When pausing the video playback, the signaling server ID, channel ID, and device ID information of the monitoring point are carried, and the currently playing video stream information is used to call the hfpPlaybackPause method of the player object. The player instance first calls the backend pause video playback API based on the passed information, and then calls the playbackStop method of the jessibuca instance to pause the current video playback. The video playback can be seen paused from the web end.

[0089] When resuming video playback, the signaling server ID, channel ID, and device ID information of the monitoring point are carried, and the hfpPlaybackResume method of the player object is called with the stream information of the currently playing video stream; the player instance first calls the backend resume video playback API based on the passed-in information, and then calls the playbackResume method of the player object instance to pause and resume video playback. From the web end, you can see that the video resumes playback from the paused time point.

[0090] When stopping the video playback, the signaling server ID, channel ID, and device ID information of the monitoring point are carried, and the currently playing video stream information is used to call the hfpPlaybackStop method of the player object to stop the playback. The player instance first calls the backend stop video playback API based on the passed information, and then calls the destroy method of the jessibuca instance to destroy the video playback window. The video window can be seen to be closed from the web end.

[0091] The entire video playback function includes the ability to initiate video playback, start video playback, double-speed video playback, pause video playback, resume video playback, and stop video playback.

[0092] Based on the content of the above embodiment, as an optional embodiment, the method for playing a network video in a web browser provided by the present invention, wherein the step of obtaining video metadata includes:

[0093] Select surveillance video points, generate surveillance video playback requirements, and obtain video metadata;

[0094] A video client window is opened based on the video metadata and embedded into a video playback window position preset by the web browser.

[0095] In summary, the present invention has unified the encapsulation of the same process of the video playback process, greatly reducing the coupling between projects, improving the development efficiency and maintenance efficiency of front-end developers, shortening the development cycle, and reducing project costs; at the same time, by unified management and control of calling the video stream project API, the security of video monitoring is improved;

[0096] In addition, by using the present invention, only the parameters related to the video device point are input to quickly see the video playback effects based on the BS and CS modes, which is beneficial to the debugging and demonstration of developers and also beneficial to the use of ordinary users.

[0097] In addition, the product produced by the present invention can be used as a web plug-in in projects that require video playback functions, is not limited by the front-end project development language, and has strong reusability and portability.

[0098] The present invention also provides a network video playback device for a web browser, comprising:

[0099] Initialization module, used to obtain video metadata and build a player object instance;

[0100] A processing module, used to generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and the video point information;

[0101] In the case of a video stream request failure, calling a corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request;

[0102] When the video stream request is successful, the play method corresponding to the player object instance is called according to the returned real-time video stream address information to perform the playback operation.

[0103] It should be noted that the network video playback device for a web browser provided in an embodiment of the present invention can execute the network video playback method for a web browser described in any of the above embodiments during specific operation, which will not be described in detail in this embodiment.

[0104] Figure 2 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 2 As shown, the electronic device may include: a processor 210, a communication interface 220, a memory 230 and a communication bus 240, wherein the processor 210, the communication interface 220 and the memory 230 communicate with each other through the communication bus 240. The processor 210 may call the logic instructions in the memory 230 to execute a network video playback method for a web browser, including: obtaining video metadata and constructing a player object instance; generating an http request to pull a video stream, and calling a corresponding text display method of the player object instance to present first state information and video point information; in the case of a video stream request failure, calling a corresponding text display method of the player object instance to present a second state information and / or an error message returned by a failed http request; in the case of a successful video stream request, calling a play method corresponding to the player object instance according to the returned real-time video stream address information to perform a playback operation.

[0105] In addition, the logic instructions in the above-mentioned memory 230 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0106] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the network video playback method of the web browser provided in the above-mentioned embodiments, including: obtaining video metadata and constructing a player object instance; generating an http request to pull the video stream, and calling the corresponding text display method of the player object instance to present first status information and video point information; in the event of a video stream request failure, calling the corresponding text display method of the player object instance to present the second status information and / or the error information returned by the http request failure; in the event of a successful video stream request, calling the play method corresponding to the player object instance according to the returned real-time video stream address information to perform the playback operation.

[0107] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the network video playback method of the web browser provided in the above-mentioned embodiments, including: obtaining video metadata and constructing a player object instance; generating an http request to pull the video stream, and calling the corresponding text display method of the player object instance to present the first status information and the video point information; in the event that the video stream request fails, calling the corresponding text display method of the player object instance to present the second status information and / or the error information returned by the http request failure; in the event that the video stream request is successful, calling the corresponding play method of the player object instance according to the returned real-time video stream address information to perform the playback operation.

[0108] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A network video playing method for a web browser, characterized in that: include: Get video metadata and build a player object instance; Generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and the video point information; In the case of a video stream request failure, calling a corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request; When the video stream request is successful, the play method corresponding to the player object instance is called according to the returned real-time video stream address information to perform the playback operation.

2. The network video playing method for a web browser according to claim 1, characterized in that: The player object includes Jessibuca and Web Browser controls.

3. The network video playing method for a web browser according to claim 2, characterized in that: After calling the play method of the player object instance according to the returned real-time video stream address information to perform the play operation, it also includes: After receiving the stop playback instruction, calling the stop streaming API, call the destroy method of the player object instance to destroy the video playback window and close the video window.

4. The network video playing method for a web browser according to claim 2, characterized in that: When the video stream request is successful, the acquisition further includes: Call the play method of the player object instance according to the returned video information to perform the playback operation; When receiving the speed playback instruction, call the speed video playback API and then call the forward method of the player object instance to set the current video playback rate to adjust the current video playback rate; When receiving the pause playback instruction, call the pause video playback API and then call the playbackStop method of the player object instance to pause the current video playback; When receiving the resume playback instruction, the resume playback API is called and then the forward method of the player object instance is called to set the current video playback rate to adjust the current video playback rate.

5. The network video playing method for a web browser according to claim 1, characterized in that: The obtaining of video metadata includes: Select surveillance video points, generate surveillance video playback requirements, and obtain video metadata; Based on the video metadata, a video client window is opened and embedded into a video playback window position preset by a web browser; the video metadata includes video point information and video window information.

6. The network video playing method for a web browser according to claim 2, characterized in that: The construction of the player object instance includes: Based on the video metadata, it is determined whether a jessibuca instance exists, and if so, the jessibuca instance is updated; if not, the jessibuca instance is constructed.

7. The network video playing method for a web browser according to claim 2, characterized in that: Before calling the corresponding text display method of the player object instance to present the first state information and the video point information, the method further includes: The http request is token authenticated based on the video metadata.

8. A network video playback device for a web browser, characterized in that: include: Initialization module, used to obtain video metadata and build a player object instance; A processing module, used to generate an http request to pull the video stream, and call the corresponding text display method of the player object instance to present the first state information and the video point information; In the case of a video stream request failure, calling a corresponding text display method of the player object instance to present the second state information and / or the error information returned by the failed http request; When the video stream request is successful, the play method corresponding to the player object instance is called according to the returned real-time video stream address information to perform the playback operation.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the network video playback method for a web browser as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the network video playback method for a web browser as claimed in any one of claims 1 to 7 are implemented.