Display method, device and equipment for WEB page small video and storage medium

By calculating the layout tree and obtaining a collection of key layout objects, the problem of small and small videos in IP TV set-top boxes are solved, simplifying the development process and reducing costs, and realizing the normal display of small videos in any area.

CN119046556APending Publication Date: 2024-11-29FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410941700.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the prior art, when the IP TV set-top box displays EPG content, it is difficult to display WEB pages and small videos at the same time, resulting in the small videos being blocked by the WEB page, and the labor cost to solve this problem is relatively high.

Method used

By calculating the layout tree of the WEB page and the display area information of the small video, we obtain the key layout object collection. If it is not empty, we calculate the new layout tree to draw the WEB page to ensure the normal display of the small video, and even if there is no reserved display. The area can also be displayed if there is irregular writing method.

Benefits of technology

It greatly simplifies the development process of EPG front-end developers, reduces labor costs, realizes the normal display of small videos, and decouples the display area of ​​small videos and EPG pages, supporting the display of small videos in any area of ​​the page.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046556A_ABST
    Figure CN119046556A_ABST
Patent Text Reader

Abstract

The invention discloses a WEB page small video display method, device and equipment and a storage medium, and the method comprises the steps: calculating a layout tree based on each WEB component of a WEB page and display region information of each WEB component; obtaining a key layout object set based on the layout tree and the display area information of the small video picture; if the key layout object set is not empty, calculating to obtain a new layout tree based on each key layout object in the key layout object set; the WEB page is drawn on the basis of the new layout tree so that the small video can be displayed, even if an EPG page does not reserve a small video image display area or the EPG page has a non-standard writing method, the small video can be normally displayed and displayed, the development process of EPG front-end developers is greatly simplified, and the development efficiency is improved. The technical problem that the labor cost for normally displaying the small video picture is relatively high in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video display technology, and in particular to a method, device, equipment and storage medium for displaying a small video on a WEB page. Background Art

[0002] At present, when IPTV (Internet Protocol Television, IPTV / interactive network television) set-top boxes display EPG (Electronic Program Guide, Electronic Program Guide) content, they often encounter the situation where they need to display a web page and play a video in a small area of ​​the screen. Since the level of the video layer is lower than the web layer, the small video screen played will be blocked by the content of the web page.

[0003] In the related art, the EPG front-end developers perform special processing on the small video display area when developing the WEB page, so that the small video picture can be normally displayed in the specially processed display area. This has a strong dependence on the EPG front-end developers, resulting in high labor costs. Summary of the invention

[0004] The present invention provides a method, device, equipment and storage medium for displaying a small video on a WEB page, which can solve the technical problem of high labor cost in the prior art for displaying a small video normally.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present invention provides a method for displaying a small video on a web page, the method comprising:

[0007] Based on each WEB component of the WEB page and the display area information of each WEB component, a layout tree is calculated;

[0008] Obtaining a key layout object set based on the layout tree and display area information of the small video screen;

[0009] If the key layout object set is not empty, a new layout tree is calculated based on each key layout object in the key layout object set;

[0010] A WEB page is drawn based on the new layout tree for displaying the small video.

[0011] In a second aspect, an embodiment of the present invention provides a device for displaying a small video on a web page, the device comprising:

[0012] A first calculation module is configured to calculate a layout tree based on each WEB component of the WEB page and display area information of each WEB component;

[0013] A key layout object acquisition module is configured to obtain a key layout object set based on the layout tree and the display area information of the small video screen;

[0014] A second calculation module is configured to calculate a new layout tree based on each key layout object in the key layout object set if the key layout object set is not empty;

[0015] The page drawing module is configured to draw a WEB page based on the new layout tree for displaying the small video.

[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor; the processor is used to read and execute a computer program stored in the memory to implement the aforementioned method for displaying a small video on a WEB page.

[0017] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are executed, the aforementioned method for displaying a small video on a WEB page is implemented.

[0018] The beneficial effects brought by the technical solution provided by the embodiment of the present invention include:

[0019] Based on each WEB component of the WEB page and the display area information of each WEB component, a layout tree is calculated; based on the layout tree and the display area information of the small video screen, a key layout object set is obtained; if the key layout object set is not empty, a new layout tree is calculated based on each key layout object in the key layout object set; based on the new layout tree, a WEB page is drawn for small video display, even if the EPG page does not reserve a small video screen display area, or the EPG page has an irregular writing method, resulting in the small video screen being blocked by the WEB component, the small video can be normally displayed and displayed, which greatly simplifies the development process of EPG front-end developers. Through this embodiment, the technical problem of high labor cost for normal display of small video screens in the related technology is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0021] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for displaying a small video on a WEB page of the present invention;

[0022] Figure 2 A schematic diagram of an embodiment of the intersection of a page component on a WEB page and a small video display area of ​​the present invention;

[0023] Figure 3 A schematic diagram of an embodiment of a cutting path of the present invention;

[0024] Figure 4 A schematic diagram of another embodiment of the cutting path of the present invention;

[0025] Figure 5 This is a schematic diagram of functional modules of an embodiment of a device for displaying a small video on a WEB page according to the present invention;

[0026] Figure 6 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0028] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0029] In a first aspect, an embodiment of the present invention provides a method for displaying a short video on a WEB page.

[0030] In one embodiment, referring to Figure 1 , Figure 1 FIG. 1 is a flow chart of an embodiment of a method for displaying a small video on a web page according to the present invention. Figure 1 As shown, the method for displaying a small video on a WEB page includes:

[0031] Step S10, calculating and obtaining a layout tree based on each WEB component of the WEB page and display area information of each WEB component;

[0032] In this embodiment, CSS (Cascading Style Sheets) style calculation is performed on each WEB component in the WEB page to obtain a rendering tree, and the display area information of each WEB component is input into the rendering tree to obtain a layout tree. Among them, Cascading Style Sheets (CSS) is a language specifically used to describe the style of files such as html / xml.

[0033] Optionally, in one embodiment, the display area information includes: the height and width of the display area, a first distance between either left or right side of the display area and the WEB page boundary, and a second distance between either upper or lower side of the display area and the WEB page boundary.

[0034] In this embodiment, if the first distance between the left side of the display area of ​​the WEB component and the right border of the WEB page, or the first distance between the right side of the display area of ​​the WEB component and the right border of the WEB page, or the first distance between the right side of the display area of ​​the WEB component and the left border of the WEB page is obtained, it needs to be converted into the first distance between the left side of the display area of ​​the WEB component and the left border of the WEB page.

[0035] If the first distance between the upper side of the display area of ​​the WEB component and the lower border of the WEB page, or the first distance between the lower side of the display area of ​​the WEB component and the lower border of the WEB page, or the first distance between the lower side of the display area of ​​the WEB component and the upper border of the WEB page is obtained, it needs to be converted into the second distance between the upper side of the display area of ​​the WEB component and the upper border of the WEB page.

[0036] Reference Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a first embodiment of the intersection of a page component on a WEB page and a small video display area of ​​the present invention. Figure 2 As shown, if the rectangle B formed by vertices B1, B2, B3 and B4 is the small video screen display area, then h2 is the height of the small video screen display area, w2 is the width of the small video screen display area, l2 is the first distance between the left side of the small video screen display area and the left border of the WEB page, and t2 is the second distance between the upper side of the small video screen display area and the upper border of the WEB page.

[0037] If the rectangle A formed by vertices A1, A2, A3 and A4 is a WEB component on a WEB page, then h1 is the height of the display area of ​​the WEB component, w1 is the width of the display area of ​​the WEB component, l1 is the first distance between the left side of the display area of ​​the WEB component and the left border of the WEB page, and t1 is the second distance between the upper side of the display area of ​​the WEB component and the upper border of the WEB page.

[0038] Optionally, in one embodiment, the step S10 includes:

[0039] Perform cascading style sheet style calculation on each WEB component in the WEB page to obtain a rendering tree;

[0040] The display area information of each WEB component is input into the rendering tree to obtain a layout tree.

[0041] In this embodiment, the browser kernel parses the HTML file according to the W3C specification to generate a DOM (Document Object Model) tree and parses the CSS file to generate a style sheet; the DOM tree consists of DOM elements and attribute nodes, and its elements and HTML file tags are basically one-to-one corresponding, and the style sheet determines the final display form of each DOM element; while the browser kernel generates the DOM tree, the style sheet is attached (attach operation) to the DOM tree to generate a corresponding render tree.

[0042] The rendering tree is traversed, and based on the CSS style information of each node, the exact size and position of each rendering node (object) in the rendering tree (i.e. the display area information of each WEB component) is obtained, and the entire layout of the rendering tree is converted into a layout tree. A node (object) of the layout tree corresponds to a special rendering object of the rendering tree, and the child nodes of the layout tree nodes will correspond to the child nodes of the rendering objects of the rendering tree.

[0043] Step S20, obtaining a key layout object set based on the layout tree and the display area information of the small video screen;

[0044] In this embodiment, the front-end page corresponding to the EPG (Electronic Program Guide) is obtained through the browser kernel playback module based on the JavaScript extension object, and the display area information of the small video screen set by the player interface is called. Based on the display area information of the small video screen and the display area information of each layout object in the layout tree, the key layout object that meets the intersection condition is determined, and based on all the key layout objects that meet the intersection condition, a key layout object set can be obtained.

[0045] Step S30, if the key layout object set is not empty, a new layout tree is calculated based on each key layout object in the key layout object set;

[0046] In this embodiment, if the key layout object set is not empty, that is, there are key layout objects that meet the intersection condition, then a new layout tree is calculated based on each key layout object in the key layout object set. If the key layout object set is empty, that is, there are no key layout objects that meet the intersection condition, it means that there is no small video screen display area in the WEB page that intersects or overlaps with the display area of ​​the layout object, then the WEB page is drawn based on the current layout tree, and the small video screen can be displayed normally.

[0047] Step S40: drawing a WEB page based on the new layout tree for displaying the small video.

[0048] In this embodiment, since in the new layout tree, the rendering object corresponding to each key layout object is added with a CSS style whose parameter values ​​are the coordinate values ​​of each point in the cutting path, the WEB page can be redrawn based on the new layout tree, so that the small video display screen can be prevented from being blocked by the WEB component, and the normal display of the small video screen can be achieved. Even if the EPG page does not have a reserved small video screen display area, or the EPG page has an irregular writing method, resulting in the small video screen being blocked by the WEB component, the small video can be normally displayed, which greatly simplifies the development process of EPG front-end developers, and the small video screen display area is decoupled from the EPG page content, so that the EPG small video can be set in any area of ​​the page, which can be used as an implementation entry for a global video window.

[0049] In this embodiment, a layout tree is calculated based on each WEB component of the WEB page and the display area information of each WEB component; a key layout object set is obtained based on the layout tree and the display area information of the small video screen; if the key layout object set is not empty, a new layout tree is calculated based on each key layout object in the key layout object set; based on the new layout tree, a WEB page is drawn for small video display, even if the EPG page does not have a small video screen display area reserved, or the EPG page has an irregular writing method, resulting in the small video screen being blocked by the WEB component, the small video can be normally displayed and displayed, which greatly simplifies the development process of EPG front-end developers. Through this embodiment, the technical problem of high labor cost for normal display of small video screens in related technologies is solved.

[0050] Optionally, in one embodiment, the step of obtaining a set of key layout objects based on the layout tree and the display area information of the small video screen includes:

[0051] Traversing the layout tree, and obtaining display area information of each layout object in the layout tree;

[0052] Determine the key layout objects that meet the intersection condition based on the display area information of each layout object and the display area information of the small video screen;

[0053] Based on all key layout objects that meet the intersection condition, a key layout object set is obtained.

[0054] In this embodiment, the layout object is a WEB component in a WEB page, and the layout tree is traversed to obtain the display area information of each WEB component in the layout tree.

[0055] Based on the display area information of the small video screen and the display area information of each WEB component, determine whether the display area of ​​the small video screen and the display area of ​​the WEB component meet the intersection condition. If the intersection condition is met, the WEB component is the key layout object. All key layout objects that meet the intersection condition are screened out to obtain a key layout object set.

[0056] Optionally, in one embodiment, the step of determining the key layout objects satisfying the intersection condition based on the display area information of each layout object and the display area information of the small video screen includes:

[0057] Based on the display area information of each layout object, determine the center point coordinates of the display area of ​​each layout object;

[0058] Based on the display area information of the small video screen, determine the coordinates of the center point of the display area of ​​the small video screen;

[0059] Combine small video images and layout objects in pairs to obtain multiple combinations;

[0060] Select any combination from the multiple combinations as a target combination, use the small video screen included in the target combination as the target small video screen, and use the layout object included in the target combination as the target layout object;

[0061] Calculate a first absolute value of a difference between the horizontal coordinate of the center point of the target small video screen display area and the horizontal coordinate of the center point of the target layout object display area, and a second absolute value of a difference between the vertical coordinate of the center point of the target small video screen display area and the vertical coordinate of the center point of the target layout object display area;

[0062] Calculate the sum of the width of the target small video screen display area and the width of the target layout object display area, and the sum of the height of the target small video screen display area and the height of the target layout object display area;

[0063] If the absolute value of the first difference is smaller than half of the sum of the widths, and the absolute value of the second difference is smaller than half of the sum of the heights, it is determined that the target layout object is a key layout object that meets the intersection condition.

[0064] In this embodiment, the layout objects are WEB components in a WEB page. The center point coordinates of the display area of ​​each WEB component are determined based on the height and width of the display area of ​​each WEB component, the first distance between the left and right sides of the display area and the WEB page boundary, and the second distance between the upper and lower sides of the display area and the WEB page boundary.

[0065] Specifically, continue to refer to Figure 2 , if the rectangle A formed by vertices A1, A2, A3 and A4 is a WEB component on a WEB page, if the upper left corner of the WEB page is taken as the origin, and if the first distance between the left side of the display area of ​​the WEB component and the right border of the WEB page, or the first distance between the right side of the display area of ​​the WEB component and the right border of the WEB page, or the first distance between the right side of the display area of ​​the WEB component and the left border of the WEB page is obtained, it needs to be converted into the first distance between the left side of the display area of ​​the WEB component and the left border of the WEB page. If the first distance between the upper side of the display area of ​​the WEB component and the lower border of the WEB page, or the first distance between the lower side of the display area of ​​the WEB component and the lower border of the WEB page, or the first distance between the lower side of the display area of ​​the WEB component and the upper border of the WEB page is obtained, it needs to be converted into the second distance between the upper side of the display area of ​​the WEB component and the upper border of the WEB page. That is, l1 represents the first distance between the left side of the display area of ​​the WEB component and the left border of the WEB page, and t1 represents the second distance between the upper side of the display area of ​​the WEB component and the upper border of the WEB page.

[0066] Then, based on the height h1 and width w1 of the display area of ​​the WEB component, the first distance l1 between the left side of the display area and the left border of the WEB page, and the second distance t1 between the upper side of the display area and the upper border of the WEB page, the center point coordinates of the display area of ​​the WEB component can be calculated.

[0067] Similarly, based on the height h2 and width w2 of the display area of ​​the small video screen, the first distance l2 between the left side of the display area of ​​the small video screen and the left border of the WEB page, and the second distance t2 between the upper side of the display area of ​​the small video screen and the upper border of the WEB page, the coordinates of the center point of the display area of ​​the small video screen can be calculated.

[0068] There are one or more small video screens and one or more layout objects. Combining small video screens and layout objects in pairs will result in multiple combinations, that is, each combination includes a small video screen and a layout object.

[0069] Select any combination from multiple combinations as the target combination, take the small video screen included in the target combination as the target small video screen, and the layout object included in the target combination as the target layout object. If the display area information of the target small video screen and the display area information of the target layout object meet the intersection condition, then determine that the target layout object that meets the intersection condition is the key layout object. Figure 2 As shown, draw perpendicular lines through AO and BO to the right and upper boundaries of the page, intersecting at point MO. If rectangles A and B intersect, the distances between AO, BO and MO must satisfy the following formulas:

[0070]

[0071] Where l1 represents the first distance between the left side of the display area of ​​the target WEB component and the left border of the WEB page, w1 represents the width of the display area of ​​the target WEB component, l2 represents the first distance between the left side of the display area of ​​the target small video screen and the left border of the WEB page, w2 represents the width of the display area of ​​the target small video screen, L AO-MO Indicates the distance between AO and MO, L BO-MO Indicates the distance between BO and MO, t1 indicates the first distance between the upper side of the display area of ​​the target WEB component and the upper boundary of the WEB page, h1 indicates the height of the display area of ​​the target WEB component, t2 indicates the second distance between the upper side of the display area of ​​the small video screen and the upper boundary of the WEB page, and h2 indicates the height of the display area of ​​the small video screen.

[0072] Optionally, in one embodiment, the step of calculating a new layout tree based on each key layout object in the key layout object set includes:

[0073] Selecting any key layout object from the key layout object set as a target key layout object, and obtaining a cutting path corresponding to the target key layout object;

[0074] Adding a cascading style sheet style to a rendering object corresponding to the target key layout object by binding a function of cascading style sheet style information to the rendering object layer, wherein a parameter value of the cascading style sheet style is a coordinate value of each vertex in a cutting path corresponding to the target key layout object;

[0075] Deleting the target key layout object from the key layout object set, and returning to execute the step of selecting any key layout object from the key layout object set as the target key layout object until the key layout object set is empty;

[0076] Get a new layout tree based on all render objects.

[0077] In this embodiment, the key layout objects in the key layout object set are all layout objects that meet the intersection condition. If the key layout object set is not empty, any key layout object is selected from the key layout object set as the target key layout object. Based on the vertex coordinates of the overlapping area between the display area of ​​the target key layout object and the display area of ​​the small video screen corresponding to the target key layout object, the cutting path corresponding to the target key layout object is determined.

[0078] If the cutting path corresponding to rectangle A is: A1→A2→G2→G1→G3→A3→A1.

[0079] Substituting the coordinates of each point, we get:

[0080] (l1,t1)→(l1+w1,t1)→(l1+w1,t2)→(l2,t2)→(l2,t1+h1)→(l1,t1+h1)→(l1,t1)

[0081] Substitute the vertex coordinates in the cutting path into the clip-path function, and finally get the CSS style and parameters added to the rendering object corresponding to the key layout object:

[0082] clip-path:polygon(l1 t1,l1+w1 t1,l1+w1 t2,l2 t2,l2 t1+h1,l1 t1+h1,l1 t1).

[0083] In another embodiment, if the cutting path corresponding to rectangle A is:

[0084] A1→A2→A4→G4→G2→G1→G3→A3→A1.

[0085] Substituting the coordinates of each point, we get:

[0086] (l1,t1)→(l1+w1,t1)→(l1+w1,t1+h1)→(l2+w2,t1+h1)

[0087] →(l2+w2,t2)→(l2,t2)→(l2,t1+h1)→(l1,t1+h1)→(l1,t1)

[0088] Substitute the vertex coordinates in the cutting path into the clip-path function, and finally get the CSS style and parameters added to the rendering object corresponding to the key layout object:

[0089] clip-path:polygon(l1 t1,l1+w1 t1,l1+w1 t1+h1,l2+w2 t1+h1,l2+w2 t2,l2 t2,l2t1+h1,l1 t1+h1,l1 t1). The clip-path function is a built-in function of CSS, which allows developers to decide which parts of an element are visible and which parts are hidden by defining a clipping path.

[0090] If the function for binding the cascading style sheet style information to the rendering object layer is the setStyle() function, the CSS style and parameters can be added to the rendering object corresponding to the target key layout object through the setStyle() function.

[0091] Then the target key layout object is deleted from the key layout object set, and any key layout object is selected from the key layout object set as the target key layout object, that is, the step of selecting any key layout object from the key layout object set as the target key layout object is returned to execute until the key layout object set is empty.

[0092] At this time, the rendering object corresponding to each key layout object is added with a CSS style whose parameter values ​​are the coordinate values ​​of each point in the cutting path. Based on the rendering object corresponding to each key layout object, all rendering objects are traversed to obtain a new layout tree.

[0093] Optionally, in one embodiment, the step of obtaining a cutting path corresponding to the target layout object includes:

[0094] Determine the vertex coordinates of the overlapping area between the display area of ​​the target layout object and the display area of ​​the target small video screen corresponding to the target layout object based on the display area information of the target layout object and the display area information of the target small video screen;

[0095] Any vertex is selected from the vertices of the overlapping area as a starting cutting point, and the vertices of the overlapping area are sequentially connected from the starting cutting point in a preset direction to obtain a cutting path corresponding to the target layout object.

[0096] In this embodiment, refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram of an embodiment of the cutting path of the present invention. Figure 3As shown, rectangle A is the display area of ​​the WEB component (i.e., the key layout object), rectangle B is the display area of ​​the small video screen, and the lower right display area of ​​the WEB component intersects with the small video screen display area. Rectangle G is the overlapping area of ​​the two rectangles, that is, the area where the WEB component is to be cut off. In this embodiment, the right boundary of the small video can overlap with the right boundary of the component, and the lower boundary of the small video can also overlap with the lower boundary of the component, which does not affect the cutting logic. According to the relative positions of the two rectangles, the conditions are obtained:

[0097]

[0098] Substituting this condition into the formula:

[0099]

[0100] The coordinates of the four vertices of rectangle G are obtained:

[0101]

[0102] If any vertex selected from the vertices of the overlapping area is vertex A1, and the preset direction is clockwise, vertex A1 is used as the starting cutting point, and the vertices of the overlapping area are connected in sequence from the starting cutting point A1 in the clockwise direction to obtain the target layout object, that is, the cutting path corresponding to rectangle A is: A1→A2→G2→G1→G3→A3→A1.

[0103] In another embodiment, referring to Figure 4 , Figure 4 FIG. 2 is a schematic diagram of another embodiment of the cutting path of the present invention. Figure 4 As shown, rectangle A is the display area of ​​the WEB component (i.e., the key layout object), rectangle B is the display area of ​​the small video screen, and the lower display area of ​​the WEB component intersects with the display area of ​​the small video screen. Rectangle G is the overlapping area of ​​the two rectangles, that is, the area where the WEB component is to be cut off. According to the relative positions of the two rectangles, the conditions are obtained:

[0104]

[0105] Substituting this condition into the formula:

[0106]

[0107] The coordinates of the four vertices of rectangle G are obtained:

[0108]

[0109] If any vertex selected from the vertices of the overlapping area is vertex A1, and the preset direction is clockwise, then in this example, vertex A1 is used as the starting cutting point, and the vertices of the overlapping area are connected sequentially from the starting cutting point A1 in a clockwise direction to obtain the target layout object, that is, the cutting path corresponding to rectangle A is: A1→A2→A4→G4→G2→G1→G3→A3→A1.

[0110] In a second aspect, an embodiment of the present invention further provides a device for displaying a short video on a WEB page.

[0111] In one embodiment, referring to Figure 5 , Figure 5 Schematic diagram of functional modules of an embodiment of a display device for a small video on a web page of the present invention. Figure 5 As shown, the display device of the small video on the WEB page includes:

[0112] The first calculation module 10 is configured to calculate and obtain a layout tree based on each WEB component of the WEB page and display area information of each WEB component;

[0113] A key layout object acquisition module 20 is configured to obtain a key layout object set based on the layout tree and the display area information of the small video screen;

[0114] A second calculation module 30 is configured to calculate a new layout tree based on each key layout object in the key layout object set if the key layout object set is not empty;

[0115] The page drawing module 40 is configured to draw a WEB page based on the new layout tree for displaying the small video.

[0116] Optionally, in one embodiment, the display area information includes: the height and width of the display area, a first distance between either left or right side of the display area and the WEB page boundary, and a second distance between either upper or lower side of the display area and the WEB page boundary.

[0117] Optionally, in one embodiment, the first calculation module 10 is configured to:

[0118] Perform cascading style sheet style calculation on each WEB component in the WEB page to obtain a rendering tree;

[0119] The display area information of each WEB component is input into the rendering tree to obtain a layout tree.

[0120] Optionally, in one embodiment, the key layout object acquisition module 20 is configured to:

[0121] Traversing the layout tree, and obtaining display area information of each layout object in the layout tree;

[0122] Determine the key layout objects that meet the intersection condition based on the display area information of each layout object and the display area information of the small video screen;

[0123] Based on all key layout objects that meet the intersection condition, a key layout object set is obtained.

[0124] Optionally, in one embodiment, the key layout object acquisition module 20 is configured to:

[0125] Based on the display area information of each layout object, determine the center point coordinates of the display area of ​​each layout object;

[0126] Based on the display area information of the small video screen, determine the coordinates of the center point of the display area of ​​the small video screen;

[0127] Combine small video images and layout objects in pairs to obtain multiple combinations;

[0128] Select any combination from the multiple combinations as a target combination, use the small video screen included in the target combination as the target small video screen, and use the layout object included in the target combination as the target layout object;

[0129] Calculate a first absolute value of a difference between the horizontal coordinate of the center point of the target small video screen display area and the horizontal coordinate of the center point of the target layout object display area, and a second absolute value of a difference between the vertical coordinate of the center point of the target small video screen display area and the vertical coordinate of the center point of the target layout object display area;

[0130] Calculate the sum of the width of the target small video screen display area and the width of the target layout object display area, and the sum of the height of the target small video screen display area and the height of the target layout object display area;

[0131] If the absolute value of the first difference is smaller than half of the sum of the widths, and the absolute value of the second difference is smaller than half of the sum of the heights, it is determined that the target layout object is a key layout object that meets the intersection condition.

[0132] Optionally, in one embodiment, the second calculation module 30 is configured to:

[0133] Selecting any key layout object from the key layout object set as a target key layout object, and obtaining a cutting path corresponding to the target key layout object;

[0134] Adding a cascading style sheet style to a rendering object corresponding to the target key layout object by binding a function of cascading style sheet style information to the rendering object layer, wherein a parameter value of the cascading style sheet style is a coordinate value of each vertex in a cutting path corresponding to the target key layout object;

[0135] Deleting the target key layout object from the key layout object set, and returning to execute the step of selecting any key layout object from the key layout object set as the target key layout object until the key layout object set is empty;

[0136] Get a new layout tree based on all render objects.

[0137] Optionally, in one embodiment, the second calculation module 30 is further configured to:

[0138] Determine the vertex coordinates of the overlapping area between the display area of ​​the target layout object and the display area of ​​the target small video screen corresponding to the target layout object based on the display area information of the target layout object and the display area information of the target small video screen;

[0139] Any vertex is selected from the vertices of the overlapping area as a starting cutting point, and the vertices of the overlapping area are sequentially connected from the starting cutting point in a preset direction to obtain a cutting path corresponding to the target layout object.

[0140] Among them, the functional implementation of each module in the above-mentioned WEB page short video display device corresponds to the various steps in the above-mentioned WEB page short video display method embodiment, and its functions and implementation processes will not be repeated here one by one.

[0141] In a third aspect, an embodiment of the present invention further provides an electronic device, whose structure is as follows: Figure 6 As shown, it includes: a memory and a processor, and the processor is used to read and execute the computer program stored in the memory to implement the aforementioned method for displaying a small video on a WEB page.

[0142] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are executed, the aforementioned method for displaying a small video on a WEB page is implemented.

[0143] In a fifth aspect, an embodiment of the present invention provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned method for displaying a small video on a WEB page, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0144] Finally, it should be noted that: in some processes described in the embodiments of the present invention, multiple operations or steps appearing in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present invention or may be executed in parallel, and the sequence number of the operation is only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0145] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for displaying a short video on a WEB page, characterized in that: The method comprises: Based on each WEB component of the WEB page and the display area information of each WEB component, a layout tree is calculated; Obtaining a key layout object set based on the layout tree and display area information of the small video screen; If the key layout object set is not empty, a new layout tree is calculated based on each key layout object in the key layout object set; A WEB page is drawn based on the new layout tree for displaying the small video.

2. A method for displaying a short video on a WEB page according to claim 1, characterized in that: The display area information includes: the height and width of the display area, a first distance between the left and right sides of the display area and the border of the web page, and a second distance between the top and bottom sides of the display area and the border of the web page.

3. A method for displaying a small video on a WEB page according to claim 2, characterized in that: The step of calculating the layout tree based on each WEB component of the WEB page and the display area information of each WEB component includes: Perform cascading style sheet style calculation on each WEB component in the WEB page to obtain a rendering tree; The display area information of each WEB component is input into the rendering tree to obtain a layout tree.

4. A method for displaying a small video on a WEB page according to claim 2, characterized in that: The step of obtaining a key layout object set based on the layout tree and the display area information of the small video screen includes: Traversing the layout tree, and obtaining display area information of each layout object in the layout tree; Determine the key layout objects that meet the intersection condition based on the display area information of each layout object and the display area information of the small video screen; Based on all key layout objects that meet the intersection condition, a key layout object set is obtained.

5. A method for displaying a short video on a WEB page according to claim 4, characterized in that: The step of determining the key layout objects satisfying the intersection condition based on the display area information of each layout object and the display area information of the small video screen includes: Based on the display area information of each layout object, determine the center point coordinates of the display area of ​​each layout object; Based on the display area information of the small video screen, determine the coordinates of the center point of the display area of ​​the small video screen; Combine small video images and layout objects in pairs to obtain multiple combinations; Select any combination from the multiple combinations as a target combination, use the small video screen included in the target combination as the target small video screen, and use the layout object included in the target combination as the target layout object; Calculate a first absolute value of a difference between the horizontal coordinate of the center point of the target small video screen display area and the horizontal coordinate of the center point of the target layout object display area, and a second absolute value of a difference between the vertical coordinate of the center point of the target small video screen display area and the vertical coordinate of the center point of the target layout object display area; Calculate the sum of the width of the target small video screen display area and the width of the target layout object display area, and the sum of the height of the target small video screen display area and the height of the target layout object display area; If the absolute value of the first difference is smaller than half of the sum of the widths, and the absolute value of the second difference is smaller than half of the sum of the heights, it is determined that the target layout object is a key layout object that meets the intersection condition.

6. A method for displaying a short video on a WEB page according to claim 1, characterized in that: The step of calculating a new layout tree based on each key layout object in the key layout object set includes: Selecting any key layout object from the key layout object set as a target key layout object, and obtaining a cutting path corresponding to the target key layout object; Adding a cascading style sheet style to a rendering object corresponding to the target key layout object by binding a function of cascading style sheet style information to the rendering object layer, wherein a parameter value of the cascading style sheet style is a coordinate value of each vertex in a cutting path corresponding to the target key layout object; Deleting the target key layout object from the key layout object set, and returning to execute the step of selecting any key layout object from the key layout object set as the target key layout object until the key layout object set is empty; Get a new layout tree based on all render objects.

7. A method for displaying a short video on a WEB page according to claim 6, characterized in that: The step of obtaining the cutting path corresponding to the target layout object includes: Determine the vertex coordinates of the overlapping area between the display area of ​​the target layout object and the display area of ​​the target small video screen corresponding to the target layout object based on the display area information of the target layout object and the display area information of the target small video screen; Any vertex is selected from the vertices of the overlapping area as a starting cutting point, and the vertices of the overlapping area are sequentially connected from the starting cutting point in a preset direction to obtain a cutting path corresponding to the target layout object.

8. A device for displaying a short video on a web page, characterized in that: The device comprises: A first calculation module is configured to calculate a layout tree based on each WEB component of the WEB page and display area information of each WEB component; A key layout object acquisition module is configured to obtain a key layout object set based on the layout tree and the display area information of the small video screen; A second calculation module is configured to calculate a new layout tree based on each key layout object in the key layout object set if the key layout object set is not empty; The page drawing module is configured to draw a WEB page based on the new layout tree for displaying the small video.

9. An electronic device, characterized in that: include: Memory and processor; The processor is used to read and execute the computer program stored in the memory to implement the steps of the method for displaying a small video on a WEB page as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the steps of the method for displaying a small video on a WEB page as described in any one of claims 1-7 are implemented.