Video playback methods, devices, systems, storage media, and electronic devices
By working together with the browser and player, the target video window is determined and object information is transferred, enabling the overlay display of multi-layered videos. This solves the problem of the inability to overlay videos in existing technologies and achieves a dynamic overlay display effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies cannot achieve the overlay display of multi-layered videos. For example, when playing a full-screen video on an electronic program guide page, the background video cannot be overlaid with the advertising video and layers when it is paused.
The system retrieves target page information from the browser, determines the target video window, and sends the object information to the player to play the video in the target video window. The main window displays the target page, and multiple video windows are superimposed on the main window, achieving dynamic overlay display of layers and video layers.
It enables the overlay display of multi-layered videos, solving the problem that existing technologies cannot overlay multi-layered videos, and achieving a dynamic overlay display effect.
Smart Images

Figure CN117319712B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computers, and more specifically, to a video playback method and apparatus, system, storage medium, and electronic device. Background Technology
[0002] In existing technology, set-top boxes have a dedicated video layer for displaying video and a graphics layer for displaying graphics. The graphics layer and video layer have a strict order, generally with the video layer below and the graphics layer above, for overlay display. However, this method prevents the overlay of multiple video layers. For example, when playing a full-screen video on an Electronic Program Guide (EPG) page, with the EPG page displaying related graphic information semi-transparently overlaid on top of the full-screen video, and an advertisement video pops up during playback while the background video pauses, the overlay display of the advertisement video, graphics layer, and background video is not possible.
[0003] Therefore, it can be concluded that the relevant technology cannot overlay and display multi-layered videos. Summary of the Invention
[0004] This invention provides a video playback method, apparatus, system, storage medium, and electronic device to at least solve the problem in related technologies that multi-layered video overlay display is not possible.
[0005] According to an embodiment of the present invention, a video playback method is provided, comprising: sending page information of an acquired target page to a player to instruct the player to determine target video window information corresponding to the target page; receiving first request information sent by the player, wherein the first request information includes the target video window information; responding to the first request information, determining a target video window corresponding to the target video window information from N video windows, wherein the N video windows are superimposed on a main window, the main window is used to display the target page, the video windows are used to play videos, and N is a natural number greater than or equal to 1; sending object information of the target video window to the player to instruct the player to play the target video in the target page in the target video window using the object information.
[0006] According to another embodiment of the present invention, a video playback method is provided, comprising: receiving page information of a target page sent by a browser; determining target video window information corresponding to the target page based on the page information; sending first request information to the browser, wherein the first request information includes the target video window information; receiving object information of the target video window sent by the browser, wherein the target video window is a video window determined by the browser from N video windows that corresponds to the target video window information, the N video windows are superimposed on a main window, the main window is used to display the target page, the video window is used to play video, and N is a natural number greater than or equal to 1; and playing the target video in the target page in the target video window using the object information.
[0007] According to another embodiment of the present invention, a video playback device is provided, comprising: a sending module, configured to send page information of an acquired target page to a player, thereby instructing the player to determine target video window information corresponding to the target page; a first receiving module, configured to receive first request information sent by the player, wherein the first request information includes the target video window information; a first response module, configured to respond to the first request information and determine a target video window corresponding to the target video window information from N video windows, wherein the N video windows are superimposed on a main window, the main window is used to display the target page, and the video windows are used to play videos, wherein N is a natural number greater than or equal to 1; and a second sending module, configured to send object information of the target video window to the player, thereby instructing the player to play the target video in the target page in the target video window using the object information.
[0008] In one exemplary embodiment, the first sending module includes: a first parsing unit, configured to parse the loaded target page; a first acquisition unit, configured to acquire page information of the target page when it is determined that the target page includes the target video to be played, wherein the page information includes the location information of the target page and the video information of the target video; and a first sending unit, configured to send the page information to the player.
[0009] In an exemplary embodiment, the first response module includes: a first query unit, configured to query from the N video windows the video window corresponding to the window type, window position and playback identifier information in the target video window information, and obtain the target video window.
[0010] In one exemplary embodiment, the second sending module includes one of the following: a second sending unit, configured to send object information of the target video window to the player when it is determined that the target video window includes object viewport information with playback identifier information; a first creating unit, configured to create object viewport information of the target video window, bind the object viewport information to the playback identifier information, and send the object information of the target video window to the player when it is determined that the target video window does not include object viewport information with playback identifier information; wherein the playback identifier information is included in the target video window information.
[0011] In one exemplary embodiment, the apparatus further includes: a first processing module, configured to send the acquired page information of the target page to the player, so as to instruct the player to initialize the main window before determining the target video window information corresponding to the target page, so as to instruct the main window to display the target page.
[0012] In an exemplary embodiment, the apparatus further includes: a fourth receiving module, configured to send the acquired page information of the target page to the player to instruct the player to determine the target video window information corresponding to the target page; the method further includes: a fifth receiving module, configured to receive second request information sent by the player, wherein the second request information is used to request the initialization of N video windows; a second processing module, configured to respond to the second request information and perform initialization operations on the N video windows, wherein the initialization operations include at least one of the following: determining M video windows set below the main window, determining K video windows set above the main window, determining P floating video windows, wherein M, K, and P are all natural numbers less than N; and a first defining module, configured to define the arrangement relationship between each video window.
[0013] According to another embodiment of the present invention, a video playback device is provided, comprising: a second receiving module for receiving page information of a target page sent by a browser; a first determining module for determining target video window information corresponding to the target page based on the page information; a third sending module for sending first request information to the browser, wherein the first request information includes the target video window information; a third receiving module for receiving object information of the target video window sent by the browser, wherein the target video window is a video window determined by the browser from N video windows that corresponds to the target video window information, the N video windows are superimposed on a main window, the main window is used to display the target page, and the video windows are used to play videos, wherein N is a natural number greater than or equal to 1; and a first playback module for playing the target video in the target page in the target video window using the object information.
[0014] In an exemplary embodiment, the first determining module includes: a first determining unit, configured to determine, from the video information in the page information, the window type, window position information and playback identifier information corresponding to the video information, to obtain the target video window information.
[0015] In one exemplary embodiment, the first playback module includes: a first download unit, configured to download the target video according to the object information; a third sending unit, configured to send the target video and the object information to a decoder to instruct the decoder to decode the target video and backfill the decoded target video into the object information; and a first playback unit, configured to play the decoded target video using the backfilled object information.
[0016] In one exemplary embodiment, the apparatus further includes a fourth sending module, configured to send a second request message to the browser before receiving page information of the target page sent by the browser, wherein the second request message is used to request the browser to initialize N video windows.
[0017] In one exemplary embodiment, the above-described apparatus further includes: a first setting module, configured to set the number of N video windows before receiving page information of the target page sent by the browser.
[0018] According to another embodiment of the present invention, a video playback system is provided, comprising: a browser, wherein the browser includes the video playback device described in claim 12; and a player, wherein the player includes the video playback device described in claim 13.
[0019] In one exemplary embodiment, the system further includes a decoder connected to the player for decoding the target video.
[0020] In one exemplary embodiment, the system further includes a manager for sorting the N video windows.
[0021] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0022] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0023] This invention involves a browser sending page information of a target page to a player, which then determines the target video window information corresponding to the target page. The browser receives a first request from the player, which includes the target video window information. Responding to the first request, the browser determines the target video window corresponding to the target video window information from N video windows. These N video windows are superimposed on a main window, which displays the target page, while the video windows play the video. The browser sends object information of the target video window to the player, instructing the player to play the target video from the target page within the target video window. In this method, the main window displays graphics from the target page, and multiple video windows are superimposed on the main window to display the video. This allows multiple video windows to be superimposed, achieving the goal of dynamically superimposing layers and multiple video layers. Therefore, it solves the problem of not being able to superimpose multi-layered video displays in related technologies, achieving the effect of superimposing multi-layered video displays. Attached Figure Description
[0024] Figure 1 This is a hardware structure block diagram of a mobile terminal for a video playback method according to an embodiment of the present invention.
[0025] Figure 2 This is a flowchart (a) of a video playback method according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the window arrangement relationship according to an embodiment of the present invention;
[0027] Figure 4 This is a flowchart (II) of a video playback method according to an embodiment of the present invention;
[0028] Figure 5 This describes the workflow of each module in the video playback system according to an embodiment of the present invention.
[0029] Figure 6 This is the initialization process according to an embodiment of the present invention;
[0030] Figure 7 This is a page playback process according to an embodiment of the present invention;
[0031] Figure 8 This is the application process for Surface according to an embodiment of the present invention;
[0032] Figure 9 This is the process of playing video in full screen according to an embodiment of the present invention;
[0033] Figure 10 This is a four-channel small video playback and stop process according to an embodiment of the present invention;
[0034] Figure 11 This is a structural block diagram (a) of a video playback device according to an embodiment of the present invention;
[0035] Figure 12 This is a structural block diagram (II) of a video playback device according to an embodiment of the present invention. Detailed Implementation
[0036] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0038] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a video playback method according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0039] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the video playback method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0040] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0041] This embodiment provides a method for playing video. Figure 2 This is a flowchart (a) of a video playback method according to an embodiment of the present invention, as shown below. Figure 2 As shown, the process includes the following steps:
[0042] Step S202: Send the obtained page information of the target page to the player to instruct the player to determine the target video window information corresponding to the target page;
[0043] Step S204: Receive first request information sent by the player, wherein the first request information includes target video window information;
[0044] Step S206: In response to the first request information, determine the target video window corresponding to the target video window information from N video windows, wherein the N video windows are superimposed on the main window, the main window is used to display the target page, and the video windows are used to play the video, and N is a natural number greater than or equal to 1.
[0045] Step S208: Send the object information of the target video window to the player to instruct the player to play the target video in the target page using the object information.
[0046] This embodiment includes, but is not limited to, business scenarios requiring the overlay display of multiple videos in IPTV smart set-top boxes or Android systems, such as full-screen video display, advertising video display, preview video display, and business demonstration scenarios. Optionally, the IPTV smart set-top box is equipped with a video layer and a layer, and the video layer can be flexibly displayed above or below the layer to achieve the overlay display of the video layer and the layer.
[0047] In this embodiment, the page information of the target page includes, but is not limited to, the page location information of the target page, the video information of the target video to be played on the target page, the location information of the target video on the target page, and the playback type of the target video (e.g., large window playback, small window playback, or playback according to a predetermined window ratio). After receiving the page information, the player determines the target video window information corresponding to the playback type of the target video from the page information. The target video window information includes, but is not limited to, the identification information of the target video window and the type information of the target video window (e.g., small window or large window). For example, the window type corresponding to playing an advertising video is a small window. The window type corresponding to playing a business display video is a large window.
[0048] In this embodiment, the value of N is not limited and can be selected based on the actual situation. The N video windows include large video windows and small video windows. For example, in... Figure 3 As shown, the system displays two large video windows, four smaller video windows below the image window, four smaller video windows above the image window, the image window displaying the EPG page, and a floating window. The timeline of the windows is determined by the browser. Optionally, the player can set the maximum number of smaller video windows.
[0049] In this embodiment, the object information includes, but is not limited to, the Surface information of the target video window. The Surface information is used to obtain the target video in the buffer.
[0050] The entity performing the above steps may be a server or a specific processor set in the server, or a processor or processing device set up relatively independently of the server (e.g., a browser), but is not limited to these.
[0051] Through the above steps, the browser sends the page information of the target page to the player, and the player determines the target video window information corresponding to the target page. The browser receives a first request from the player, which includes the target video window information. The browser responds to the first request by determining the target video window corresponding to the target video window information from N video windows. These N video windows are superimposed on the main window, which displays the target page, while the video windows play the video. The browser sends the object information of the target video window to the player, instructing the player to play the target video from the target page using the object information within the target video window. In this method, the main window displays graphics from the target page, and multiple video windows are superimposed on the main window to display the video. This allows multiple video windows to be superimposed, achieving the goal of dynamically superimposing layers and multiple video layers. Therefore, it solves the problem of not being able to superimpose multi-layered video displays in related technologies, achieving the effect of superimposing multi-layered video displays.
[0052] In one exemplary embodiment, sending the acquired page information of the target page to the player includes:
[0053] S1, parse the loaded target page;
[0054] S2, if it is determined that the target page contains the target video to be played, obtain the page information of the target page, wherein the page information includes the location information of the target page and the video information of the target video;
[0055] S3 sends the page information to the player.
[0056] In this embodiment, parsing the loaded target page includes: parsing video information, JS script information, and other playback elements (e.g., the location of the target page, the location of the target video, etc.) in the target page.
[0057] In this embodiment, by sending the page information to the player, the player can be instructed to quickly determine the window type corresponding to the target video.
[0058] In one exemplary embodiment, in response to a first request message, determining the target video window corresponding to the target video window information from N video windows includes:
[0059] S1: Query the video window corresponding to the window type, window position and playback identifier information in the target video window information from N video windows to obtain the target video window.
[0060] In this embodiment, the type of video played in the target video window corresponds to the type of the target video. For example, if the target video is an advertisement video, it is suitable to select a small window for playback. This allows different video information to correspond to different playback windows, achieving the purpose of overlaying and displaying multiple videos.
[0061] In one exemplary embodiment, sending object information of the target video window to the player includes one of the following:
[0062] S1, if the viewport information of the target video window includes the playback identifier information, the object information of the target video window is sent to the player;
[0063] S2, if it is determined that the target video window does not include the object viewport information of the playback identifier, create the object viewport information of the target video window, bind the object viewport information and the playback identifier information, and send the object information of the target video window to the player.
[0064] The playback identifier information is included in the target video window information.
[0065] In this embodiment, the object viewport information includes, but is not limited to, a SurfaceView. A SurfaceView is a view of a Surface, through which part or all of the content of the Surface can be viewed. In other words, the Surface displays content through a SurfaceView. This embodiment enables rapid playback of the target video using the object viewport information.
[0066] In one exemplary embodiment, before sending the acquired page information of the target page to the player to instruct the player to determine the target video window information corresponding to the target page, the method further includes:
[0067] S1, Initialize the main window to indicate that the main window is used to display the target page.
[0068] In this embodiment, when the browser process starts, it initializes the main window for displaying the graphical page and starts the service for communicating with the player.
[0069] In one exemplary embodiment, before sending the acquired page information of the target page to the player to instruct the player to determine the target video window information corresponding to the target page, the method further includes:
[0070] S1, receive the second request information sent by the player, wherein the second request information is used to request the initialization of N video windows;
[0071] S2, responding to the second request information, perform initialization operations on N video windows, wherein the initialization operations include at least one of the following: determining M video windows set below the main window, determining K video windows set above the main window, determining P floating video windows, where M, K, and P are all natural numbers less than N;
[0072] S3 defines the arrangement relationship between each video window.
[0073] In this embodiment, the browser's initialization operations for the video window include adding a FrameLayout of the main window (TYPE_APPLICATION_MEDIA), a child window (TYPE_APPLICATION_MEDIA) below the main window, a child window (TYPE_APPLICATION_MEDIA) above the main window, and a floating window (TYPE_SYSTEM_OVERLAY) using the AddView method. The FrameLayout defines the Z-order relationship of each video window. Subsequently, multiple SurfaceViews can be added to the corresponding FrameLayout, and callbacks for the SurfaceViews can be set. Multiple SurfaceViews can be added to different FrameLayouts for video display.
[0074] This embodiment can determine the arrangement relationship between the main window and the video window by initializing the main window and the video window, so as to quickly determine the video window type corresponding to the type of the video to be played when the video is playing.
[0075] This embodiment provides a method for playing video. Figure 4 This is a flowchart (II) of a video playback method according to an embodiment of the present invention, as shown below. Figure 4 As shown, the process includes the following steps:
[0076] Step S402: Receive page information of the target page sent by the browser;
[0077] Step S404: Determine the target video window information corresponding to the target page based on the page information;
[0078] Step S406: Send a first request message to the browser, wherein the first request message includes target video window information;
[0079] Step S408: Receive the object information of the target video window sent by the browser. The target video window is the video window that the browser determines from N video windows that corresponds to the target video window information. The N video windows are superimposed on the main window. The main window is used to display the target page, and the video windows are used to play the video. N is a natural number greater than or equal to 1.
[0080] Step S410: Use the object information to play the target video in the target page in the target video window.
[0081] This embodiment includes, but is not limited to, business scenarios requiring the overlay display of multiple videos in IPTV smart set-top boxes or Android systems, such as full-screen video display, advertising video display, preview video display, and business demonstration scenarios. Optionally, the IPTV smart set-top box is equipped with a video layer and a layer, and the video layer can be flexibly displayed above or below the layer to achieve the overlay display of the video layer and the layer.
[0082] In this embodiment, the page information of the target page includes, but is not limited to, the page location information of the target page, the video information of the target video to be played on the target page, the location information of the target video on the target page, and the playback type of the target video (e.g., large window playback, small window playback, or playback according to a predetermined window ratio). After receiving the page information, the player determines the target video window information corresponding to the playback type of the target video from the page information. The target video window information includes, but is not limited to, the identification information of the target video window and the type information of the target video window (e.g., small window or large window). For example, the window type corresponding to playing an advertising video is a small window. The window type corresponding to playing a business display video is a large window.
[0083] In this embodiment, the value of N is not limited and can be selected based on the actual situation. The N video windows include large video windows and small video windows. For example, in... Figure 3 As shown, the system displays two large video windows, four smaller video windows below the image window, four smaller video windows above the image window, the image window displaying the EPG page, and a floating window. The timeline of the windows is determined by the browser. Optionally, the player can set the maximum number of smaller video windows.
[0084] In this embodiment, the object information includes, but is not limited to, the Surface information of the target video window. The Surface information is used to obtain the target video in the buffer.
[0085] The entity performing the above steps may be a server or a specific processor set in the server, or a processor or processing device set relatively independently of the server (e.g., a media player), but is not limited to these.
[0086] Through the above steps, the process involves receiving page information of the target page sent by the browser; determining the target video window information corresponding to the target page based on the page information; sending a first request to the browser, wherein the first request information includes the target video window information; receiving object information of the target video window sent by the browser, wherein the target video window is the video window corresponding to the target video window information determined by the browser from N video windows, and the N video windows are superimposed on the main window, the main window is used to display the target page, and the video windows are used to play the video, where N is a natural number greater than or equal to 1; and playing the target video in the target page in the target video window using the object information. Because in the above method, the main window displays the graphics in the target page, and multiple video windows are superimposed on the main window to display the video, multiple video windows can be superimposed to display the video, achieving the purpose of dynamically superimposing layers and multiple video layers. Therefore, it can solve the problem of not being able to superimpose multi-layered video displays in related technologies, achieving the effect of superimposing multi-layered video displays.
[0087] In one exemplary embodiment, determining the target video window information corresponding to the target page based on page information includes:
[0088] S1. Determine the window type, window position information, and playback identifier information corresponding to the video information from the video information in the page information to obtain the target video window information.
[0089] This embodiment can quickly determine the window type corresponding to the target video through the page information player.
[0090] In one exemplary embodiment, playing a target video from a target page in a target video window using object information includes:
[0091] S1, Download the target video according to the object information;
[0092] S2, send the target video and object information to the decoder to instruct the decoder to decode the target video and fill the decoded target video back into the object information;
[0093] S3 uses the backfilled object information to play the decoded target video.
[0094] In this embodiment, after the decoder decodes the target video, it fills the corresponding image information back into the object information Surface. The player can then request the browser to adjust settings such as showing / hiding, resizing, and positioning the SurfaceView, thereby enabling the overlay display of all Surfaces.
[0095] In one exemplary embodiment, before receiving page information of the target page sent by the browser, the method further includes:
[0096] S1, send a second request message to the browser, whereby the second request message is used to request the browser to initialize N video windows.
[0097] In this embodiment, the browser's initialization operations for the video window include adding a FrameLayout of the main window (TYPE_APPLICATION_MEDIA), a child window (TYPE_APPLICATION_MEDIA) below the main window, a child window (TYPE_APPLICATION_MEDIA) above the main window, and a floating window (TYPE_SYSTEM_OVERLAY) using the AddView method. The FrameLayout defines the Z-order relationship of each video window. Subsequently, multiple SurfaceViews can be added to the corresponding FrameLayout, and callbacks for the SurfaceViews can be set. Multiple SurfaceViews can be added to different FrameLayouts for video display.
[0098] This embodiment can determine the arrangement relationship between the main window and the video window by initializing the main window and the video window, so as to quickly determine the video window type corresponding to the type of the video to be played when the video is playing.
[0099] In one exemplary embodiment, before receiving page information of the target page sent by the browser, the method further includes:
[0100] S1 sets the number of video windows (N). Multiple video windows can be used to overlay and display videos.
[0101] This embodiment provides a video playback system, which includes:
[0102] Browser, wherein the browser is used to perform the above Figure 2 The steps in;
[0103] The player, which is used to perform the above... Figure 4 The steps in the process.
[0104] In this embodiment, the target page can be a web page, which describes the content to be displayed, defines the video business process, and defines the element information related to playing the video.
[0105] In this embodiment, the browser is primarily responsible for parsing and displaying the web page, and for calling related JavaScript scripts. It provides the specific implementation of the SurfaceView's related interfaces, video window management, and surface passing between the browser and the player.
[0106] The player is responsible for acquiring and playing relevant audio and video files. In this embodiment, playback identifier information (AIDL) is also provided to interact with the browser, requesting SurfaceView, showing or hiding windows, and controlling their size or position, among other related business logic.
[0107] In one exemplary embodiment, the system further includes:
[0108] The decoder connects to the player and is used to decode the target video.
[0109] In this embodiment, the decoder is primarily responsible for decoding audio and video. It is also used to retrieve graphical information from the Surface via the player.
[0110] In one exemplary embodiment, the system further includes:
[0111] The manager is used to sort N video windows.
[0112] In this embodiment, the AndroidWindowManager can be a module in the Android system that manages windows, responsible for overlaying and displaying the contents of each window in Z order.
[0113] For example, such as Figure 5 As shown, the workflow of each module in the video playback system includes the following interactive steps:
[0114] S1, the browser requests the Android WindowManager to create a window. After Android WindowManager responds to the request and creates the window, it returns the surface information of the created window to the browser.
[0115] S2, the browser parses the information in the web page to load the page information of the web page;
[0116] S3, the player requests the browser to obtain the surface information of various types of windows, and the browser returns the surface information of various types of windows to the player.
[0117] S4: After receiving the surface information of the video being played, the player sends the surface information to the decoder.
[0118] S5, the decoder decodes the video information. Then, through the player, it retrieves the Surface to fill in the graphical information.
[0119] Furthermore, the adjustment method for video layers in this system includes the following process:
[0120] 1) Initialization process
[0121] like Figure 6 The diagram shows the specific steps of the initialization process in this embodiment:
[0122] S601, after the player starts, it requests to bind to the browser.
[0123] S602: When the browser process starts, it initializes the main window for displaying the graphical page and starts the service for communicating with the player.
[0124] S603, the player process starts, binds to the browser's services through the Android Interface Definition Language (AIDL), and requests the browser to perform initialization operations on the video playback window.
[0125] S604: After receiving the request, the browser completes the initialization of the video window. It adds the FrameLayout of the main window (TYPE_APPLICATION_MEDIA), the child window (TYPE_APPLICATION_MEDIA) below the main graphics window, the child window (TYPE_APPLICATION_MEDIA) above the main graphics window, and the floating window (TYPE_SYSTEM_OVERLAY) using the addView method. The FrameLayout defines the Z-order relationship of each video window.
[0126] In S605, multiple SurfaceViews can be added to the corresponding FrameLayout, and callbacks for the SurfaceViews can be set. Multiple SurfaceViews can be added to different FrameLayouts for video display.
[0127] The S606 player allows setting the maximum number of small video windows and sending the number of small videos that can be displayed in the small video window to the browser;
[0128] S607, the browser returns the Surface of each video window to the player.
[0129] 2) Page playback process
[0130] like Figure 7 The diagram shows the specific steps of the page playback process in this embodiment:
[0131] In S701, when the browser loads a page and initializes playback elements, it passes the relevant position and playback information to the player, requesting the player to play the corresponding video. The player receives this information, processes it internally, and determines which type of window to use for video display. The player then sends the playerid, window type, and window position information to the browser, requesting a Surface to be returned.
[0132] S702: After receiving a request for a surface from the player, the browser checks whether a SurfaceView with the corresponding playerid for the window type has been created. If it has been created, the browser returns the corresponding Surface to the player; otherwise, it creates and adds the SurfaceView and completes the binding of the SurfaceView with the specific playerid.
[0133] In S703, after the system successfully creates the corresponding Surface, it calls the `surfaceCreated` callback. In the callback, the browser passes the Surface and its corresponding playerid to the player.
[0134] In this embodiment, the application process for Surface is as follows: Figure 8 As shown, it includes the following steps:
[0135] S801, determine if the window type exists; if not, go to S802, determine if it is an invalid window type, and return NULL;
[0136] S803, if a window type exists, determine whether the corresponding window type already has a SurfaceView list;
[0137] S804: If the corresponding window type does not have a SurfaceView list, create a SurfaceView.
[0138] S805, Add the SurfaceView to the SurfaceView list of the corresponding window;
[0139] S806, binds the playerid of the SurfaceView;
[0140] S807, if a SurfaceView list already exists for the corresponding window type, determine whether the SurfaceView list has a SurfaceView with the same playerid;
[0141] S808: Given SurfaceViews with the same playerid, determine if there is an idle SurfaceView.
[0142] S809: If an idle SurfaceView is available, use the idle SurfaceView.
[0143] S810, binds the playerid of the SurfaceView;
[0144] S811, if there is no free SurfaceView, determine whether the number of SurfaceViews that can be added has reached the current limit;
[0145] S812 creates a SurfaceView if the limit is not reached;
[0146] S813, Add a SurfaceView to the SurfaceView list of the corresponding window;
[0147] S814, binds to the playerid of the SurfaceView;
[0148] S815 returns NULL if the upper limit is reached;
[0149] S816, if there is no SurfaceView with the same playerid in the SurfaceView list, reuse the Surface with the corresponding playerid and change its state as needed.
[0150] In this embodiment, the process of playing video in full screen is as follows: Figure 9 As shown, the playback and stopping process for the four small videos is as follows: Figure 10 As shown, the interaction process between the browser and the player is the same as in the above embodiments, and will not be repeated here.
[0151] 3) Other processes (e.g., the encoder's decoding process)
[0152] S1, the player then returns the Surface to the decoder.
[0153] S2, the player downloads the relevant video and requests the decoder to decode it.
[0154] S3, after the decoder finishes decoding, it fills the corresponding image information back into the Surface.
[0155] S4, the player can continue to request the browser to make settings such as showing or hiding the SurfaceView, adjusting its size or position.
[0156] S5 displays all Surfaces overlaid.
[0157] In summary, this embodiment allows for more flexible control over the display of individual videos, including their size, position, and even alpha, thus meeting a wider range of application scenarios without affecting the refresh performance of the current graphics window.
[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0159] This embodiment also provides an optical axis adjustment device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0160] Figure 11 This is a structural block diagram (a) of a video playback device according to an embodiment of the present invention, as shown below. Figure 11 As shown, the device includes:
[0161] The first sending module 1102 is used to send the page information of the acquired target page to the player, so as to instruct the player to determine the target video window information corresponding to the target page;
[0162] The first receiving module 1104 is used to receive the first request information sent by the player, wherein the first request information includes the target video window information.
[0163] The first response module 1106 is used to respond to the first request information and determine the target video window corresponding to the target video window information from N video windows, wherein the N video windows are superimposed on the main window, the main window is used to display the target page, and the video windows are used to play videos, and N is a natural number greater than or equal to 1.
[0164] The second sending module 1108 is used to send the object information of the target video window to the player, so as to instruct the player to play the target video in the target page in the target video window using the object information.
[0165] In one exemplary embodiment, the first transmitting module described above includes:
[0166] The first parsing unit is used to parse the loaded target page mentioned above;
[0167] The first acquisition unit is configured to acquire page information of the target page when it is determined that the target page includes the target video to be played, wherein the page information includes the location information of the target page and the video information of the target video.
[0168] The first sending unit is used to send the aforementioned page information to the aforementioned player.
[0169] In one exemplary embodiment, the first response module described above includes:
[0170] The first query unit is used to query the video window corresponding to the window type, window position and playback identifier information in the target video window information from the above N video windows, and obtain the above target video window.
[0171] In one exemplary embodiment, the second transmitting module described above includes one of the following:
[0172] The second sending unit is used to send the object information of the target video window to the player when it is determined that the target video window includes the object viewport information of the playback identifier.
[0173] The first creation unit is used to create object viewport information of the target video window, bind the object viewport information to the playback identifier information, and send the object information of the target video window to the player when it is determined that the object viewport information of the target video window does not include the playback identifier information.
[0174] The aforementioned playback identifier information is included in the aforementioned target video window information.
[0175] In one exemplary embodiment, the above-described apparatus further includes:
[0176] The first processing module is used to send the page information of the acquired target page to the player, so as to instruct the player to initialize the main window before determining the target video window information corresponding to the target page, so as to instruct the main window to display the target page.
[0177] In one exemplary embodiment, the above-described apparatus further includes:
[0178] The fourth receiving module is used to send the acquired page information of the target page to the player. Before the player determines the target video window information corresponding to the target page, the method further includes:
[0179] The fifth receiving module is used to receive the second request information sent by the aforementioned player, wherein the second request information is used to request the initialization of N video windows;
[0180] The second processing module is used to respond to the second request information and perform initialization operations on the N video windows, wherein the initialization operations include at least one of the following: determining M video windows set below the main window, determining K video windows set above the main window, and determining P floating video windows, wherein M, K, and P are all natural numbers less than N.
[0181] The first definition module is used to define the arrangement relationship between each of the above video windows.
[0182] Figure 12 This is a structural block diagram (II) of a video playback device according to an embodiment of the present invention, as shown below. Figure 12 As shown, the device includes:
[0183] The second receiving module 1202 is used to receive page information of the target page sent by the browser;
[0184] The first determining module 1204 is used to determine the target video window information corresponding to the target page based on the above page information;
[0185] The third sending module 1206 is used to send first request information to the browser, wherein the first request information includes the target video window information.
[0186] The third receiving module 1208 is used to receive the object information of the target video window sent by the browser. The target video window is the video window that the browser determines from N video windows and corresponds to the target video window information. The N video windows are superimposed on the main window. The main window is used to display the target page, and the video window is used to play the video. N is a natural number greater than or equal to 1.
[0187] The first playback module is used to play the target video in the target page in the target video window using the aforementioned object information.
[0188] In one exemplary embodiment, the first determining module described above includes:
[0189] The first determining unit is used to determine the window type, window position information, and playback identifier information corresponding to the video information from the video information in the page information, so as to obtain the target video window information.
[0190] In one exemplary embodiment, the first playback module includes:
[0191] The first download unit is used to download the target video according to the aforementioned object information;
[0192] The third sending unit is used to send the target video and the object information to the decoder, so as to instruct the decoder to decode the target video and fill the decoded target video back into the object information;
[0193] The first playback unit is used to play the decoded target video using the backfilled object information.
[0194] In one exemplary embodiment, the above-described apparatus further includes:
[0195] The fourth sending module is used to send a second request message to the browser before receiving the page information of the target page sent by the browser. The second request message is used to request the browser to initialize N video windows.
[0196] In one exemplary embodiment, the above-described apparatus further includes:
[0197] The first settings module is used to set the number of the aforementioned video windows (N) before receiving the page information of the target page sent by the browser.
[0198] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0199] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0200] In this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the above steps.
[0201] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0202] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0203] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0204] In one exemplary embodiment, the processor described above may be configured to perform the above steps via a computer program.
[0205] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0206] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0207] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method of playing a video, characterized by, The method comprises the following steps: sending the page information of the target page to the player to instruct the player to determine the target video window information corresponding to the target page; receiving first request information sent by the player, wherein the first request information comprises the target video window information; determining a target video window corresponding to the target video window information from N video windows in response to the first request information, wherein the N video windows and a main window are stacked according to a Z sequence relationship determined based on frame layouts of the N video windows and the main window, the main window is used to display the target page, the video window is used to play a video, and N is a natural number greater than or equal to 1; sending object information of the target video window to the player to instruct the player to play a target video in the target video window using the object information. The step of sending the object information of the target video window to the player comprises the following steps:
2. The method of claim 1, wherein, in a case where it is determined that the target video window comprises an object viewport information list, judging whether the object viewport information list comprises object viewport information corresponding to player identification information; in a case where it is determined that the object viewport information list comprises idle object viewport information corresponding to the player identification information, binding the idle object viewport information and the player identification information; and sending the object information of the target video window to the player, wherein the object information comprises the idle object viewport information. The step of sending the page information of the target page to the player comprises the following steps:
3. The method of claim 1, wherein, parsing the target page; in a case where it is determined that the target page comprises a target video to be played, obtaining page information of the target page, wherein the page information comprises position information of the target page and video information of the target video; 4. The method of claim 1, wherein, sending the page information to the player. The step of determining a target video window corresponding to the target video window information from N video windows in response to the first request information comprises the following steps: querying a video window corresponding to window type, window position and player identification information in the target video window information from the N video windows to obtain the target video window.
5. The method of claim 1, wherein, The step of sending the object information of the target video window to the player further comprises the following steps: in a case where it is determined that the target video window does not comprise object viewport information of the player identification information, creating object viewport information of the target video window, binding the object viewport information and the player identification information, and sending the object information of the target video window to the player; wherein the player identification information is included in the target video window information. Before the step of sending the page information of the target page to the player to instruct the player to determine the target video window information corresponding to the target page, the method further comprises the following step: initializing the main window to instruct the main window to display the target page.
6. The method of claim 1, wherein, The method further comprises the following steps before sending the obtained page information of the target page to the player to instruct the player to determine target video window information corresponding to the target page: receiving second request information sent by the player, wherein the second request information is used to request initialization of N video windows; performing initialization operation on N video windows in response to the second request information, wherein the initialization operation comprises at least one of the following: determining M video windows arranged below the main window, determining K video windows arranged above the main window, and determining P video windows in suspension, wherein M, K and P are natural numbers less than N; defining arrangement relationship between each video window.
7. A method of playing a video, characterized by, The method comprises the following steps: receiving page information of a target page sent by a browser; determining target video window information corresponding to the target page based on the page information; sending first request information to the browser, wherein the target video window information is included in the first request information; receiving object information of a target video window sent by the browser, wherein the target video window is a video window corresponding to the target video window information determined by the browser from N video windows, N video windows and a main window are superimposed according to Z sequence relationship determined based on frame layout of N video windows and the main window, the main window is used to display the target page, the video window is used to play video, and N is a natural number greater than or equal to 1; playing a target video in the target page in the target video window by using the object information; wherein the browser sending object information of the target video window to the player comprises: determining whether there is object viewport information corresponding to the player's playback identification information in the object viewport information list; in the case of determining that there is idle object viewport information corresponding to the playback identification information in the object viewport information list, binding the idle object viewport information with the playback identification information; sending the object information of the target video window to the player, wherein the object information comprises the idle object viewport information.
8. The method of claim 7, wherein, Determining target video window information corresponding to the target page based on the page information comprises: determining window type, window position information and playback identification information corresponding to the video information from the video information in the page information to obtain the target video window information.
9. The method of claim 7, wherein, Playing a target video in the target page in the target video window by using the object information comprises: downloading the target video according to the object information; sending the target video and the object information to a decoder to instruct the decoder to decode the target video and backfill the decoded target video into the object information; playing the decoded target video by using the backfilled object information.
10. The method of claim 7, wherein, Before receiving the page information of the target page sent by the browser, the method further comprises: sending second request information to the browser, wherein the second request information is used to request the browser to initialize N video windows.
11. The method of claim 7, wherein, Before receiving the page information of the target page sent by the browser, the method further comprises: setting the number of the N video windows.
12. A video playing apparatus, characterized by comprising: Comprise: The first sending module is used to send the acquired page information of the target page to a player to instruct the player to determine target video window information corresponding to the target page; The first receiving module is used to receive first request information sent by the player, wherein the target video window information is included in the first request information; The first response module is used to respond to the first request information to determine a target video window corresponding to the target video window information from N video windows, wherein the N video windows and a main window are stacked according to a Z sequence relationship determined based on a frame layout FrameLayout of the N video windows and the main window, the main window is used to display the target page, the video window is used to play a video, and N is a natural number greater than or equal to 1; The second sending module is used to send object information of the target video window to the player to instruct the player to play a target video in the target video window by using the object information; The device is further used to send the object information of the target video window to the player by the following manner: in a case where it is determined that the target video window includes an object viewport information list, it is judged whether the object viewport information list has object viewport information corresponding to the player's playback identification information; in a case where it is determined that the object viewport information list has idle object viewport information corresponding to the playback identification information, the idle object viewport information is bound with the playback identification information; and the object information of the target video window is sent to the player, wherein the object information includes the idle object viewport information.
13. A video playing apparatus, characterized by comprising: Comprise: The second receiving module is used to receive page information of a target page sent by a browser; The first determining module is used to determine target video window information corresponding to the target page based on the page information; The third sending module is used to send first request information to the browser, wherein the target video window information is included in the first request information; The third receiving module is used to receive object information of a target video window sent by the browser, wherein the target video window is a video window corresponding to the target video window information determined by the browser from N video windows, the N video windows and a main window are stacked according to a Z sequence relationship determined based on a frame layout FrameLayout of the N video windows and the main window, the main window is used to display the target page, the video window is used to play a video, and N is a natural number greater than or equal to 1; The first playing module is configured to play a target video in the target page in the target video window by using the object information. The browser sends the object information of the target video window to the player by the following method: determining whether the object viewport information list in the target video window includes object viewport information corresponding to the playing identification information of the player; in the case that the object viewport information list includes idle object viewport information corresponding to the playing identification information, binding the idle object viewport information and the playing identification information; and sending the object information of the target video window to the player, wherein the object information includes the idle object viewport information.
14. A video playback system, characterized by comprising: The browser comprises: The browser comprises the video playing device in claim 12. The player comprises the video playing device in claim 13.
15. The system of claim 14, wherein, The decoder is connected to the player and is configured to decode the target video. The manager is configured to sort the N video windows.
16. The system of claim 14, wherein, The computer program is stored in the computer readable storage medium, and when executed by the processor, the computer program implements the method in any one of claims 1 to 6, or when executed by the processor, the computer program implements the method in any one of claims 7 to 11. The computer program is stored in the memory, and the processor is configured to execute the computer program to implement the method in any one of claims 1 to 6, or the processor is configured to execute the computer program to implement the method in any one of claims 7 to 11.
17. A computer-readable storage medium, characterized in that, 18.An electronic device comprising a memory and a processor, the electronic device characterized by,
Citation Information
Patent Citations
Video playing method and system for realizing multi-screen different display, computer equipment and application
CN113965800A
Video playing method and device, electronic equipment and storage medium
CN114071243A