Method and playback component for customizing playback window division based on HTML webpage
By initializing the custom playback components on the html web page and binding the event response mechanism, the merge and recovery of playback windows are achieved, and the problem of not being able to customize the partitioning of playback windows in the existing technology is solved, and the user's custom layout and key attention needs are met. It realizes flexible configuration of the video playback window.
Patent Information
- Application Number
- CN202210340887.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-04-02
AI Technical Summary
The existing html web-based monitoring video playback system cannot meet the user's needs for customizing the partitioning of playback windows, especially when it is necessary to enlarge a certain video playback window and shrink the rest of the windows.
The play component is initialized by customizing the number of play windows, and the play component is bound to the listening event, the number of rows and columns input boxes, and the mouse/touch events, so as to realize the merge and recovery of the play windows, and support the support User-defined partition playback window.
It realizes the user-defined video playback window layout, supports monitoring video display at any number of channels, and can enlarge the specified playback window to meet the user's key needs, while maintaining the normal display of the video screen proportion.
Smart Images

Figure CN114896530B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video playback, in particular to a method and a playback component for user-defined partitioning of playback windows based on an HTML web page. Background Art
[0002] As a social security system, security monitoring systems have been widely used in daily life. As modern browsers become more and more powerful, they support the playback of multiple mainstream video formats. At the same time, web applications have the advantages of no need to install additional plug-ins, cross-platform, and easy to update. Therefore, the playback tools of surveillance videos are gradually shifting from desktop software to browser web pages.
[0003] At present, the surveillance video playback system based on HTML webpage has several fixed split screen schemes preset on the playback page for users to choose from, which cannot meet the user's need to customize the playback window division. For example, when a user uses a four-way split screen to watch four surveillance videos, if he wants to focus on one of the videos, he needs to enlarge the playback window of this video and reduce the playback windows of the other three videos. The surveillance video playback system with a preset fixed split screen scheme cannot meet this demand.
[0004] How to customize and divide the video playback window based on the web page is a technical problem that needs to be solved. Summary of the invention
[0005] The technical task of the present invention is to address the above shortcomings and provide a method and a playback component for customizing the division of playback windows based on HTML web pages to solve the technical problem of how to customize the division of video playback windows based on web pages.
[0006] In a first aspect, the method for customizing the partitioning of playback windows based on an HTML webpage of the present invention comprises the following steps:
[0007] Initialize the playback component by customizing the number of playback windows;
[0008] Based on the event response mechanism of HTML5, the playback component is bound to listen for events, including binding value change events for the row and column number input box, binding mouse events and touch events for each playback window, listening to and responding to row and column number modification operations through row and column number input box events, listening to and responding to PC-side mouse click operations through mouse events, and listening to and responding to mobile-side finger touch operations through touch events;
[0009] After the playback component monitors the value change in the row and column number input box, it destroys the existing playback window DOM element and the bound web page event, and reinitializes the playback component according to the modified value in the row and column number input box;
[0010] After the playback component detects a mouse operation or a finger touch, it performs a playback window merging operation;
[0011] After the playback windows are merged, the playback component listens to the restore button being triggered and restores the playback window to the state before the merge.
[0012] Preferably, the playback component is initialized by customizing the number of playback windows, including the following operations:
[0013] The playback component initializes the operation interface based on the default split-screen mode;
[0014] The playback component reads the width and height of the parent container to calculate the width and height of each video playback window. Each playback window fills the parent container using CSS absolute positioning.
[0015] Preferably, the event response mechanism based on HTML5 is used to bind the playback component to the listening event, including:
[0016] When the current browser is a PC, bind the mousedown event, mousemove event, and mouseup event for each playback window;
[0017] Currently, for a mobile browser, a touchstart event when a finger touches the screen, a touchmove event when a finger moves after touching the screen, and a touchend event when a finger leaves the screen are bound to each playback window.
[0018] Preferably, after the playback component detects a mouse operation or a finger touch, it performs a playback window merging operation, including:
[0019] When the current browser is a PC, when the mouse is pressed in a certain playback window, the window ID1 is recorded. When the mouse is moved to another playback window and the mouse is released, the current window ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, the merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0020] Currently, it is a mobile browser. When a finger is pressed on a playback window, the window number ID1 is recorded. When the finger is moved to another playback window and the finger is released, the current window number ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0021] Preferably, after each playback window merging operation is completed, the original serial numbers of the merged windows are stored in the new window object in the form of an array, which is used to determine whether the area selected by the user is allowed to be merged during the next merging.
[0022] In a second aspect, a playback component based on a custom division of a playback window by an HTML webpage of the present invention is used to execute the method based on a custom division of a playback window by an HTML webpage as described in any one of the first aspects, wherein the playback component comprises:
[0023] An initialization module, the initialization module is used to initialize the corresponding playback component by customizing the number of playback windows;
[0024] An event binding module, which is used to bind listening events to the playback component based on the event response mechanism of HTML5, including binding value change events to the row and column number input box, binding mouse events and touch events to each playback window, monitoring and responding to row and column number modification operations through row and column number input box events, monitoring and responding to PC-side mouse click operations through mouse events, and monitoring and responding to mobile-side finger touch operations through touch events;
[0025] A row and column number monitoring response module, wherein the row and column number monitoring response module is used to monitor changes in the values in the row and column number input box, and after monitoring changes in the values in the row and column number input box, is used to destroy the existing playback window DOM elements and bound web page events, and reinitialize the playback component according to the modified values in the row and column number input box;
[0026] A merge monitoring response module, wherein the merge monitoring response module is used to monitor mouse and finger operations, and after monitoring the execution of mouse operations or finger touches, perform a playback window merging operation;
[0027] The window recovery module is used to monitor the recovery button. After the playback windows are merged, the window recovery module monitors that the recovery button is triggered and is used to restore the playback windows to the state before the merging.
[0028] Preferably, the initialization module is used to initialize its corresponding playback component through the following steps:
[0029] Initialize the operation interface based on the default split-screen mode;
[0030] The width and height of the parent container are read to calculate the width and height of each video playback window. Each playback window fills the parent container using CSS absolute positioning.
[0031] Preferably, the event binding module is used to bind the listening event to the corresponding playback component through the following steps:
[0032] When the current browser is a PC, bind the mousedown event, mousemove event, and mouseup event for each playback window;
[0033] Currently, for a mobile browser, a touchstart event when a finger touches the screen, a touchmove event when a finger moves after touching the screen, and a touchend event when a finger leaves the screen are bound to each playback window.
[0034] Preferably, the merge monitoring response module is used to perform the playback window merging operation through the following steps:
[0035] When the current browser is a PC, when the mouse is pressed in a certain playback window, the window ID1 is recorded. When the mouse is moved to another playback window and the mouse is released, the current window ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, the merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0036] Currently, it is a mobile browser. When a finger is pressed on a playback window, the window number ID1 is recorded. When the finger is moved to another playback window and the finger is released, the current window number ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0037] Preferably, after each playback window merging operation is completed, the merge monitoring response module is used to store the original serial numbers of the merged windows in the form of an array in the object of the new window, which is used to determine whether the area selected by the user is allowed to be merged during the next merging.
[0038] The method and playback component for customizing the playback window division based on HTML webpage of the present invention have the following advantages:
[0039] 1. By setting the number of rows and columns of the custom-divided playback components and merging the playback window operation, it supports the simultaneous display of any number of surveillance videos, which can meet the user's needs for playing a specified number of surveillance videos;
[0040] 2. By merging the playback windows, you can enlarge the specified playback window, which can meet the needs of users to focus on the specified monitoring screen;
[0041] 3. By merging the playback windows, the aspect ratio of the playback window is made consistent with that of the output screen of the monitoring device, so as to achieve the purpose of displaying the video screen with a specific ratio normally;
[0042] 4. Its implementation based on HTML5 standards is the future development trend of WEB, and it can be well supported by mainstream browsers and terminals such as PC, Phone and Pad. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only 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.
[0044] The present invention is further described below in conjunction with the accompanying drawings.
[0045] Figure 1 This is a flowchart of a method for customizing the division of playback windows based on an HTML web page according to Embodiment 1;
[0046] Figure 2 This is a diagram of the initialization interface of the playback component in the method for customizing the partitioning of playback windows based on an HTML web page in Example 1;
[0047] Figure 3 In the method for customizing the division of the playback window based on the HTML webpage in Example 1, the playback component is not allowed to merge the interface diagram;
[0048] Figure 4 This is an interface diagram after merging windows in the playback component in the method for customizing the division of playback windows based on an HTML web page in Example 1. DETAILED DESCRIPTION
[0049] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0050] The embodiment of the present invention provides a method for customizing the division of a playback window based on an HTML web page and a playback component, which are used to solve the technical problem of how to customize the division of a video playback window based on a web page.
[0051] Embodiment 1:
[0052] The method for customizing the partitioning of playback windows based on an HTML webpage of the present invention comprises the following steps:
[0053] S100, initializing the playback component by customizing the number of playback windows;
[0054] S200, binding listening events for the playback component based on the event response mechanism of HTML5, including binding value change events for the row and column number input box, binding mouse events and touch events for each playback window, monitoring and responding to row and column number modification operations through row and column number input box events, monitoring and responding to PC-side mouse click operations through mouse events, and monitoring and responding to mobile-side finger touch operations through touch events;
[0055] S300, after the playback component monitors the value change in the row and column number input box, it destroys the existing playback window DOM element and the bound web page event, and reinitializes the playback component according to the modified value in the row and column number input box;
[0056] S400: After the playback component detects a mouse operation or a finger touch, it performs a playback window merging operation;
[0057] S500: After the playback windows are merged, the playback component detects that a restore button is triggered and restores the playback windows to the state before the merge.
[0058] In step S100 of this embodiment, the efficient rendering of DOM elements and rich APIs in HTML5 are used to initialize the playback component. Specifically, the operation interface is initialized according to the 4x4 split-screen mode by default. The playback component reads the width and height of the parent container to calculate the width and height of each video playback window. Each playback window fills the parent container in an absolute positioning manner using CSS (see Figure 2 ).
[0059] Step S200: After the playback component is initialized, a value change event is bound to the row and column number input box, and a mouse or touch event is bound to each playback window. The specific process is as follows:
[0060] (1) When the current browser is a PC, bind the mousedown event, mousemove event, and mouseup event for each playback window.
[0061] (2) Currently, for a mobile browser, a touchstart event when a finger touches the screen, a touchmove event when a finger moves after touching the screen, and a touchend event when a finger leaves the screen are bound to each playback window.
[0062] Step S300 changes the number of rows and columns. After the playback component monitors that the user modifies the value in the row and column number input box, it destroys the existing playback window DOM element and bound web page events, and then reinitializes the playback component according to the latest row and column number.
[0063] Step S400 merges the playback windows. Merging the playback windows can be divided into the following two situations:
[0064] (1) When the current browser is a PC, when the mouse is pressed in a certain playback window, the window ID1 is recorded. When the mouse is moved to another playback window and the mouse is released, the current window ID2 is recorded. If there is a rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively, which does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0065] (2) The current browser is a mobile browser. When a finger is pressed on a certain playback window, the window ID1 is recorded. When the finger is moved to another playback window and the finger is released, the current window ID2 is recorded. If there is a rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively, which does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0066] After each merge operation is completed, the original numbers of the merged windows are stored in the new window object in the form of an array, which is used to determine whether the area selected by the user is allowed to be merged during the next merge. Figure 3 The interface that does not allow merging windows for custom partitioning playback components, Figure 4 The interface after merging windows multiple times for custom-divided playback components.
[0067] Step S500 restores the window. If the user wants to cancel the merge operation after merging the playback windows, he can click the restore button, and the entire playback component will be restored to the view before the merge.
[0068] The method of this embodiment mainly uses HTML5, JavaScript and CSS3 technologies, and is implemented with modern browsers as carriers. The efficient rendering of DOM elements and rich APIs in HTML5 are fully utilized to initialize the playback component, and the event response mechanism of HTML5 is used to monitor and respond to mouse clicks on the PC side and finger touches on the mobile side, and the number of video playback windows monitored in each row and column is customized, while supporting the merging operation of video playback windows through mouse dragging on the PC side and multi-finger sliding on the mobile side.
[0069] The method of this embodiment is based on HTML5, JavaScript and CSS3 adaptive layout, and the playback component can be encapsulated into various front-end plug-ins, which is scalable, inheritable and integrable.
[0070] Embodiment 2;
[0071] The present invention discloses a playback component for dividing a playback window based on a custom HTML webpage, comprising an initialization module, an event binding module, a row and column number monitoring response module, a merging monitoring response module and a window recovery module.
[0072] The initialization module is used to initialize the corresponding playback component by customizing the number of playback windows.
[0073] The initialization module utilizes the efficient rendering of DOM elements in HTML5 and rich APIs to initialize the playback component. Specifically, the operation interface is initialized in 4x4 split-screen mode by default. The playback component reads the width and height of the parent container to calculate the width and height of each video playback window. Each playback window fills the parent container with CSS absolute positioning.
[0074] The event binding module is used to bind listening events to the playback component based on the event response mechanism of HTML5, including binding value change events to the row and column number input box, binding mouse events and touch events to each playback window, listening to and responding to row and column number modification operations through row and column number input box events, listening to and responding to PC mouse click operations through mouse events, and listening to and responding to mobile finger touch operations through touch events.
[0075] The event binding module binds the value change event to the row and column number input box, and binds the mouse or touch event to each playback window. The specific process is as follows:
[0076] (1) When the current browser is a PC, bind the mousedown event, mousemove event, and mouseup event for each playback window.
[0077] (2) Currently, for a mobile browser, a touchstart event when a finger touches the screen, a touchmove event when a finger moves after touching the screen, and a touchend event when a finger leaves the screen are bound to each playback window.
[0078] The row and column number monitoring response module is used to monitor the changes in the values in the row and column number input box. After monitoring the changes in the values in the row and column number input box, it is used to destroy the existing playback window DOM elements and bound web page events, and reinitialize the playback component according to the modified values in the row and column number input box.
[0079] The merge monitoring response module is used to monitor mouse and finger operations, and after monitoring the execution of mouse operations or finger touches, perform the playback window merging operation.
[0080] The merge monitoring response module is used to merge playback windows, which can be divided into the following two cases:
[0081] (1) When the current browser is a PC, when the mouse is pressed in a certain playback window, the window ID1 is recorded. When the mouse is moved to another playback window and the mouse is released, the current window ID2 is recorded. If there is a rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively, which does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0082] (2) The current browser is a mobile browser. When a finger is pressed on a certain playback window, the window ID1 is recorded. When the finger is moved to another playback window and the finger is released, the current window ID2 is recorded. If there is a rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively, which does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
[0083] After each merge operation is completed, the original numbers of the merged windows are stored in the new window object in the form of an array, which is used to determine whether the area selected by the user is allowed to be merged during the next merge. Figure 3 The interface that does not allow merging windows for custom partitioning playback components, Figure 4 The interface after merging windows multiple times for custom-divided playback components.
[0084] The window recovery module is used to monitor the recovery button. After the playback windows are merged, the window recovery module monitors that the recovery button is triggered and is used to restore the playback window to the state before the merger.
[0085] The playback component disclosed in this embodiment can execute the method disclosed in Example 1, customize the number of monitoring video playback windows in each row and column, and support the merging operation of video playback windows through mouse dragging on the PC and multi-finger sliding on the mobile terminal.
[0086] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A method for customizing the partitioning of playback windows based on HTML web pages, characterized in that The steps include: Initialize the playback component by customizing the number of playback windows; Based on the event response mechanism of HTML5, the playback component is bound to listen for events, including binding value change events for the row and column number input box, binding mouse events and touch events for each playback window, listening to and responding to row and column number modification operations through row and column number input box events, listening to and responding to PC-side mouse click operations through mouse events, and listening to and responding to mobile-side finger touch operations through touch events; After the playback component monitors the value change in the row and column number input box, it destroys the existing playback window DOM element and the bound web page event, and reinitializes the playback component according to the modified value in the row and column number input box; After the playback component detects a mouse operation or a finger touch, it performs a playback window merging operation; After the playback windows are merged, the playback component listens to the restore button being triggered and restores the playback window to the state before the merge.
2. The method for customizing the partitioning of playback windows based on HTML web pages according to claim 1, characterized in that Initialize the playback component by customizing the number of playback windows, including the following operations: The playback component initializes the operation interface based on the default split-screen mode; The playback component reads the width and height of the parent container to calculate the width and height of each video playback window. Each playback window fills the parent container using CSS absolute positioning.
3. The method for customizing the partitioning of playback windows based on HTML web pages according to claim 1, characterized in that The event response mechanism based on HTML5 is used to bind listener events to the playback component, including: When the current browser is a PC, bind the mousedown event, mousemove event, and mouseup event for each playback window; Currently, for a mobile browser, a touchstart event when a finger touches the screen, a touchmove event when a finger moves after touching the screen, and a touchend event when a finger leaves the screen are bound to each playback window.
4. The method for customizing the partitioning of playback windows based on HTML web pages according to claim 1, characterized in that After the playback component detects a mouse operation or finger touch, it performs playback window merging operations, including: When the current browser is a PC, when the mouse is pressed in a certain playback window, the window ID1 is recorded. When the mouse is moved to another playback window and the mouse is released, the current window ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, the merge operation can be performed, and the entire rectangular selection is merged into one playback window. Currently, it is a mobile browser. When a finger is pressed on a playback window, the window number ID1 is recorded. When the finger is moved to another playback window and the finger is released, the current window number ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
5. The method for customizing the partitioning of playback windows based on HTML web pages according to claim 4, characterized in that After each playback window merging operation is completed, the original numbers of the merged windows are stored in the new window object in the form of an array, which is used to determine whether the area selected by the user is allowed to be merged during the next merging.
6. Based on the HTML page, the player component is divided into play windows, which is characterized by Used to execute the method for customizing the division of playback windows based on an HTML webpage as described in any one of claims 1 to 5, the playback component comprising: An initialization module, the initialization module is used to initialize the corresponding playback component by customizing the number of playback windows; An event binding module, which is used to bind listening events to the playback component based on the event response mechanism of HTML5, including binding value change events to the row and column number input box, binding mouse events and touch events to each playback window, monitoring and responding to row and column number modification operations through row and column number input box events, monitoring and responding to PC-side mouse click operations through mouse events, and monitoring and responding to mobile-side finger touch operations through touch events; A row and column number monitoring response module, wherein the row and column number monitoring response module is used to monitor changes in the values in the row and column number input box, and after monitoring changes in the values in the row and column number input box, is used to destroy the existing playback window DOM elements and bound web page events, and reinitialize the playback component according to the modified values in the row and column number input box; A merge monitoring response module, wherein the merge monitoring response module is used to monitor mouse and finger operations, and after monitoring the execution of mouse operations or finger touches, perform a playback window merging operation; The window recovery module is used to monitor the recovery button. After the playback windows are merged, the window recovery module monitors that the recovery button is triggered and is used to restore the playback windows to the state before the merging.
7. The playback component according to claim 6, characterized in that The initialization module is used to initialize its corresponding playback component through the following steps: Initialize the operation interface based on the default split-screen mode; The width and height of the parent container are read to calculate the width and height of each video playback window. Each playback window fills the parent container using CSS absolute positioning.
8. The playback component according to claim 6, characterized in that The event binding module is used to bind the listening event to the corresponding playback component through the following steps: When the current browser is a PC, bind the mousedown event, mousemove event, and mouseup event for each playback window; Currently, for a mobile browser, a touchstart event when a finger touches the screen, a touchmove event when a finger moves after touching the screen, and a touchend event when a finger leaves the screen are bound to each playback window.
9. The playback component according to claim 6, characterized in that The merge monitoring response module is used to perform the playback window merging operation through the following steps: When the current browser is a PC, when the mouse is pressed in a certain playback window, the window ID1 is recorded. When the mouse is moved to another playback window and the mouse is released, the current window ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, the merge operation can be performed, and the entire rectangular selection is merged into one playback window. Currently, it is a mobile browser. When a finger is pressed on a playback window, the window number ID1 is recorded. When the finger is moved to another playback window and the finger is released, the current window number ID2 is recorded. If the rectangular area with ID1 and ID2 as the upper left corner and lower right corner respectively does not pass through other windows, a merge operation can be performed, and the entire rectangular selection is merged into one playback window.
10. The playback component according to claim 9, characterized in that After each playback window merging operation is completed, the merging monitoring response module is used to store the original serial number of the merged window in the form of an array in the object of the new window, which is used to determine whether the area selected by the user is allowed to be merged during the next merging.
