A video playing method and an electronic device

By introducing a publish-subscribe pattern in the proxy layer to handle video events, the problem of not being able to operate multiple online videos simultaneously in existing technologies is solved, thus simplifying operations and reducing loading time.

CN118524262BActive Publication Date: 2026-05-19GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU SHIYUAN ELECTRONICS CO LTD
Filing Date
2023-02-20
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, users cannot watch multiple online videos simultaneously, the operation is complex, and the video loading time is too long, making it impossible to operate on two video resources at the same time.

Method used

A proxy layer is introduced to handle video events using a publish-subscribe pattern. The proxy layer receives video events generated by video resources and publishes notifications to the UI layer. The UI layer then modifies the video status and updates the display interface based on the notifications.

Benefits of technology

This allows users to operate on at least two video resources simultaneously, reducing operational complexity and video loading time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118524262B_ABST
    Figure CN118524262B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a video playing method and an electronic device, the method comprises the following steps: a proxy layer receives a video event generated by a video resource, and publishes a notification to a UI layer according to the video event; the UI layer modifies a video state in response to the notification; and the UI layer updates a display interface in response to the change of the video state. In the method, the proxy layer is added, the direct observer mode is changed into the subscription publishing mode, the video state is not strongly associated with a specific video resource, and the events sent by all video resources are uniformly processed by the proxy layer, so that the video state only pays attention to the notification sent from the proxy layer and does not pay attention to the specific video event sent by the video resource. In the video playing method, a user can simultaneously operate at least two video resources, so that the operation complexity is reduced, and the video loading time is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video playback technology, and in particular to a video playback method and an electronic device. Background Technology

[0002] When a user interface (UI) displays an online video, the display (playing, pausing, or loading) of the video is determined by the video state in the user interface layer. Currently, the video events generated by the video resources and the UI layer adopt the "direct observer pattern", that is, the video events generated by the video resources are directly responded to by the UI layer, which modifies the video state.

[0003] In this mode, users cannot watch multiple online videos at the same time. For example, when watching two video resources with the same content from two different perspectives, users need to click back and forth to switch between the video resources and operate on the two video resources separately when reviewing them. This operation is complicated, the video loading time is too long, and users cannot operate on two video resources at the same time. Summary of the Invention

[0004] The purpose of this application is to provide a video playback method and an electronic device that can operate on at least two video resources simultaneously, reducing operational complexity and video loading time.

[0005] In a first aspect, one technical solution adopted in the embodiments of this application is: providing a video playback method, the method comprising: a proxy layer receiving video events generated by video resources, and publishing a notification to a UI layer based on the video events; in response to the notification, the UI layer modifying the video state; and in response to the change in the video state, the UI layer updating the display interface.

[0006] In some embodiments, the video events include merge events, mutual events, and a main event. The step of publishing a notification to the UI layer based on the video events includes: publishing a first notification to the UI layer if each of the video resources generates the same merge event; and / or publishing a second notification to the UI layer if at least one of the video resources generates the mutual event; and / or publishing a third notification to the UI layer if the main video resource generates the main event.

[0007] In some embodiments, the mutual event includes a waiting event, the second notification includes a waiting event notification, and the step of publishing a second notification to the UI layer if at least one of the video resources generates the mutual event includes: if at least one of the video resources generates the waiting event, and other video resources that generate the waiting event are playing normally, the proxy layer controls each of the video resources to pause playback and publishes the waiting event notification to the UI layer.

[0008] In some embodiments, the main event includes a playback position change event, and the step of publishing a notification to the UI layer based on the video event further includes: if the video resource does not generate the playback position change event, the proxy layer publishes the waiting event notification to the UI layer.

[0009] In some embodiments, the merged event includes a playable event, and the step of publishing a second notification to the UI layer if at least one of the video resources generates the mutual event includes: if each of the video resources generates the playable event, the proxy layer controls each of the video resources to replay, and publishes the first notification to the UI layer.

[0010] In some embodiments, the mutual event includes an error event, and the second notification includes an error event notification. If at least one of the video resources generates the mutual event, a second notification is published to the UI layer, including: if the proxy layer receives the error event, the proxy layer controls the video resource that generated the error event to pause playback and publishes the error event notification to the UI layer.

[0011] In some embodiments, the main event includes a playback end event, the third notification includes a playback end notification, and the step of publishing a third notification to the UI layer if the main video resource generates the main event includes: if the main video resource generates the playback end event, the proxy layer publishes the playback end notification to the UI layer.

[0012] In some embodiments, the method further includes: in response to a user inputting operation information in the UI layer, the proxy layer controls the playback of each of the video resources according to the operation information.

[0013] In a second aspect, embodiments of this application provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect above.

[0014] Thirdly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method described in the first aspect above.

[0015] Fourthly, embodiments of this application also provide a computer program product, the computer program product including a computer program stored on a computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in the first aspect above.

[0016] Compared with existing technologies, the beneficial effects of this application are as follows: Unlike existing technologies, embodiments of this application provide a video playback method and an electronic device. The method includes: a proxy layer receiving video events generated by video resources; publishing notifications to a UI layer based on the video events; the UI layer modifying the video state in response to the notifications; and the UI layer updating the display interface in response to changes in the video state. In this method, by adding a proxy layer, the direct observer pattern is transformed into a publish-subscribe pattern, so that the video state is not strongly associated with specific video resources. Instead, the proxy layer uniformly handles the events emitted by each video resource, allowing the video state to focus only on the notifications ultimately issued by the proxy layer, without paying attention to the specific video events emitted by the video resources. Under this video playback method, users can operate on at least two video resources simultaneously, thereby reducing operational complexity and video loading time. Attached Figure Description

[0017] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements / modules and steps with the same reference numerals in the drawings are represented as similar elements / modules and steps. Unless otherwise stated, the figures in the drawings do not constitute a limitation on scale.

[0018] Figure 1 This is a schematic diagram illustrating the relationship between video status and video resources provided in existing technology;

[0019] Figure 2 This is a schematic diagram illustrating an application scenario of a video playback method provided in an embodiment of this application;

[0020] Figure 3 This is a flowchart illustrating a video playback method provided in an embodiment of this application;

[0021] Figure 4 This is a schematic diagram illustrating the relationship between video status and video resources provided in an embodiment of this application;

[0022] Figure 5 This is one of the embodiments provided in this application. Figure 3 A flowchart illustrating step S10;

[0023] Figure 6 This is one of the embodiments provided in this application. Figure 5 A flowchart illustrating step S11;

[0024] Figure 7 This is another embodiment provided in this application. Figure 5 A partial flowchart of step S11;

[0025] Figure 8 This is yet another embodiment provided in this application. Figure 5 A partial flowchart of step S11;

[0026] Figure 9 This is another embodiment provided in this application. Figure 5 A partial flowchart of step S11;

[0027] Figure 10 This is the fifth type provided in the embodiments of this application. Figure 5 A partial flowchart of step S11;

[0028] Figure 11 This is a partial flowchart illustrating a video playback method provided in an embodiment of this application;

[0029] Figure 12 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] The present application will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.

[0031] To facilitate understanding of this application, a more detailed description is provided below with reference to the accompanying drawings and specific embodiments. Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.

[0032] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram, in some cases, they can be divided differently from those in the device. In addition, the terms "first" and "second" used herein do not limit the data or execution order, but only distinguish between identical or similar items with essentially the same function and effect.

[0033] Currently, please refer to Figure 2 When the electronic device 30 plays at least two videos from the resource terminal 20, the direct observer pattern between the video state and the video resource requires the user to manually switch between video resources to watch at least two videos, which is cumbersome. To solve the above problem, this application provides a video playback method and an electronic device 30 that decouples the video state from specific video resources, allowing the user to operate on at least two video resources simultaneously, thereby reducing the complexity of operation.

[0034] Firstly, one technical solution adopted in the embodiments of this application is: providing a video playback method, please refer to... Figure 3 The method includes:

[0035] Step S10: The proxy layer receives video events generated by video resources and publishes a notification to the UI layer based on the video events.

[0036] Step S20: In response to the notification, the UI layer modifies the video state.

[0037] Step S30: In response to the change in video state, the UI layer updates the display interface.

[0038] Specifically, when playing at least two video resources with the same video content from at least two different perspectives through a browser, the browser will generate corresponding video events based on the current state of each video resource.

[0039] For example, a video resource will generate a `play` event when playback has started; a `pause` event when playback has paused; a `canplay` event when the browser can play the video resource but estimates there isn't enough data to support playback to the end and doesn't need to stop further buffering; a `canplaythrough` event when the browser estimates the video resource can play the media until the end without stopping content buffering; a `loadeddate` event when the first frame of the video resource has finished loading; a `loadedmetadata` event when the video resource has loaded metadata; a `loadstart` event when the video resource starts loading; a `waiting` event when playback has stopped due to a temporary lack of data; a `playing` event when playback is ready to start after being paused or delayed due to a lack of data; an `error` event when the video resource encounters an error; a `started` event when the browser attempts to retrieve video resource data but the data is unavailable; and a `t` event when the playback position of the video resource changes. The video resource generates several events: `imeupdate`, `seeked`, `seeking`, and `ended`. These events occur when the video resource completes a frame skipping operation, begins a frame skipping operation, and stops playing when it reaches its end point. Existing technologies explain how video resources generate corresponding video events based on their current state; details are omitted here.

[0040] After a video event is generated by each video resource, the video event will be sent to the proxy layer. After receiving the video event, the proxy layer will process the video event according to preset rules, and then publish a notification to the UI layer.

[0041] After receiving the subscription notification, the UI layer determines whether to modify the video status based on the notification. For example, it can choose not to modify the video status, change it to play, pause, or load. Then, the UI layer responds according to the video status. If the video status is loading, a loading screen is displayed on the UI to remind the user that all video resources are currently loading.

[0042] In this embodiment, please refer to Figure 4By adding a proxy layer 13, the model shifts from a direct observer pattern to a publish-subscribe pattern. This prevents the video state 12 from being strongly associated with specific video resources 11. Instead, the proxy layer 13 handles all events emitted by each video resource 11, allowing the video state 12 to focus only on the notifications ultimately sent from the proxy layer, rather than the specific video events emitted by the video resources 11. In this video playback method, when video resources 11 generate video events and send them to the proxy layer 13, the proxy layer 13 can send notifications to the video state 12 and modify the video state. This allows the UI layer to update the display of at least two video resources, enabling simultaneous operation on at least two video resources, reducing operational complexity, and decreasing video loading time.

[0043] In some embodiments, video events include merge events, mutual events, and a main event; see [link to relevant documentation]. Figure 5 The step of publishing a notification to the UI layer based on the video event includes:

[0044] Step S11: If each of the video resources generates the same merge event, a first notification is sent to the UI layer; and / or, if at least one of the video resources generates the mutual event, a second notification is sent to the UI layer; and / or, if the main video resource generates the main event, a third notification is sent to the UI layer.

[0045] When processing video events generated by various video resources at the proxy layer, the video events can be classified and processed according to preset rules, and different notification strategies can be adopted for different categories of video events.

[0046] Specifically, merge events can be plan events, pause events, canplan events, canplanthrough events, loadeddata events, loadedmetadate events, and loadstart events; mutual events can be waiting events, planning events, error events, and stopped events; and main events can be timeupdate events, sought events, seeking events, and ended events.

[0047] Specifically, for merge events, the proxy layer only sends the first notification to the UI layer when it receives the same merge event from all video resources. For example, if all video resources send a play event, indicating that playback of all video resources has started, the proxy layer sends the first notification corresponding to the play event to the UI layer. If the video status of the UI layer is not playing at this time, the video status of the UI layer can be changed to playing. Alternatively, if all video resources send a loadeddata event, indicating that initialization of all video resources has been completed, the proxy layer sends the first notification corresponding to the loadeddata event to the UI layer.

[0048] For mutual events, the proxy layer sends a second notification to the UI layer as soon as at least one video resource generates a mutual event. For example, if a video resource generates a stopped event multiple times, and the number reaches a certain threshold (e.g., five times), the proxy layer sends a second notification corresponding to the stopped event to the UI layer. At the same time, the proxy layer controls that video resource to stop playing, while the other video resources continue to play.

[0049] For main events, the proxy layer only publishes a third notification to the UI layer when the main video resource generates a main event. For example, the proxy layer only publishes the third notification corresponding to the ended event to the UI layer after the main video resource generates an ended event.

[0050] As can be seen, in this embodiment, the proxy layer has different strategies for determining whether to publish a notification to the UI layer for merged events, mutual events, and main events, thereby decoupling video events generated by video resources from video states, improving operational efficiency, and reducing unnecessary development costs.

[0051] In some embodiments, the mutual event includes a wait event, and the second notification includes a wait event notification; see [link to relevant documentation]. Figure 6 The step of publishing a second notification to the UI layer if at least one of the video resources generates the mutual event includes:

[0052] Step S111: If at least one of the video resources generates the waiting event, and other video resources that did not generate the waiting event play normally, then the proxy layer controls each of the video resources to pause playback and publishes the waiting event notification to the UI layer.

[0053] Specifically, the waiting event is called the `waiting` event. If there are two video resources currently being played, a first video resource and a second video resource, and the first video resource generates a `waiting` event, then the proxy layer will determine whether the second video resource is playing normally. If the second video resource is playing normally, the proxy layer will control both the first and second video resources to pause playback. At the same time, the proxy layer will publish a `waiting` event notification to the UI layer, which can then change the video status to "loading". Subsequently, the UI layer will display a loading animation on the display interface to remind the user that the current video resource is loading.

[0054] As can be seen, in this embodiment, if video resources generate mutual events, the proxy layer will not only send the corresponding second notification to the UI layer, but will also affect the playback status of other video resources.

[0055] In some embodiments, the main event includes a playback position change event; see [link to relevant documentation]. Figure 7 The step of publishing a notification to the UI layer based on the video event also includes:

[0056] Step S112: If the video resource does not generate the playback position change event, the proxy layer publishes the waiting event notification to the UI layer.

[0057] It's understandable that various video events can occur with any video resource. For example, the `timeupdate` event in the main event, i.e., the playback position change event, can occur with any video resource. Specifically, when a video resource skips frames, in a weak network environment, or when the video is choppy, a certain video resource might not generate a `waiting` event. In this case, the proxy layer can determine whether to trigger the `waiting` event processing flow based on whether a certain video resource generates a `timeupdate` event. Specifically, when the first video resource does not generate a `timeupdate` event, the proxy layer can determine that the first video resource is not playing normally. At this time, the proxy layer can automatically trigger a `waiting` event. That is, the proxy layer determines that the first video resource has generated a "waiting" event. In this way, the proxy layer will publish a `waiting` event notification to the UI layer. At the same time, the proxy layer will determine whether the remaining video resources are playing normally. If the remaining video resources are playing normally, the proxy layer will control all video resources to pause playback.

[0058] As can be seen, in this embodiment, in a weak network environment or when the video is stuck, the timeupdate event generated by each video resource determines whether the waiting event needs to be automatically triggered, so that each video resource is paused synchronously, to ensure that the actual playback state of at least two video resources is the same, and to ensure the synchronous playback of each video resource.

[0059] In some embodiments, the merged event includes a play-start event; see [link to relevant documentation]. Figure 8 The step of publishing a second notification to the UI layer if at least one of the video resources generates the mutual event includes:

[0060] Step S113: If each of the video resources generates the start-play event, the proxy layer controls each of the video resources to replay and publishes the first notification to the UI layer.

[0061] The event that allows playback to begin is the `canplay` event. Specifically, if there are two video resources currently being played, after the first video resource triggers the `waiting` event, the proxy layer will continue to receive video events from each video resource. If each video resource generates a `canplay` event, the proxy layer will control each video resource to replay. During playback control, the playback time of each video resource should be calibrated to ensure synchronized playback. Simultaneously, the proxy layer also publishes a first notification corresponding to the `canplay` event to the UI layer. If the current video state in the UI layer is paused, the UI layer can change the current video state to play.

[0062] As can be seen, in this embodiment, after a video resource triggers a waiting event, the proxy layer can subsequently determine whether it is necessary to re-control the playback of each video resource based on the video events generated by each video resource, and calibrate the playback time during playback to ensure that each video resource plays synchronously.

[0063] In some embodiments, the mutual events include error events, and the second notification includes error event notifications; see [link to relevant documentation]. Figure 9 If at least one of the video resources generates the mutual event, a second notification is published to the UI layer, including:

[0064] Step S114: If the proxy layer receives the error event, the proxy layer controls the video resource that generated the error event to pause playback and publishes the error event notification to the UI layer.

[0065] Among them, the error event is called the error event. If an error event is generated for a video resource, it indicates that the video resource has encountered an error. The proxy layer then stops playing the video resource that generated the error event and controls other video resources to play normally. At the same time, the proxy layer publishes an error event notification to the UI layer.

[0066] Specifically, if there are two video resources currently being played, if the first video resource triggers a waiting event and then generates an error event, it indicates that the first video resource has encountered an error. In order not to affect the user experience, the proxy layer will control the second video resource to play normally and prevent the first video resource from playing. At the same time, the proxy layer will send an error event notification to the UI layer.

[0067] As can be seen, in this embodiment, when an error event occurs in a certain video resource, the proxy layer will control the video resource to stop playing in order to ensure that the other video resources that can play normally continue to play normally, and ensure that the other video resources can play synchronously, so as to avoid the error event affecting the other playable video resources and improve the user experience.

[0068] In some embodiments, the main event includes a playback end event, and the third notification includes a playback end notification; see [link to relevant documentation]. Figure 10 If the main video resource generates the main event, a third notification is published to the UI layer, including:

[0069] Step S115: If the main video resource generates the playback end event, the proxy layer publishes the playback end notification to the UI layer.

[0070] The playback end event is designated as the `ended` event. The main video resource is typically the one with the longest or shortest total video duration. For example, if the main video resource is the shortest, and it generates an `ended` event, the proxy layer publishes an `ended` notification to the UI layer. The UI layer then changes the video status to "ended," and can respond to this "ended" status by stopping playback of all video resources. Additionally, the UI layer can display "Playback Ended" on the display interface to remind the user that playback has finished. Therefore, in this embodiment, the main video can be selected according to the actual needs of the application scenario to ensure that all video resources can play synchronously.

[0071] In some of these embodiments, please refer to Figure 11 The method further includes:

[0072] Step S40: In response to the user inputting operation information in the UI layer, the proxy layer controls the playback of each video resource according to the operation information.

[0073] Specifically, when a user stops playing a video resource on the UI layer's interactive interface, the proxy layer receives the operation information and controls all video resources to stop playing. Alternatively, when a user performs a frame skipping operation on a video resource on the UI layer's interactive interface, the proxy layer receives the operation information and controls all video resources to skip frames synchronously.

[0074] As can be seen, in this embodiment, user operations performed on the UI layer are also uniformly sent to each video resource through the proxy layer, and synchronized operations are performed on each video resource to ensure that each video resource plays synchronously and reduce the user's operation time.

[0075] Secondly, this application also provides an electronic device, please refer to... Figure 12 It demonstrates the ability to execute Figure 3 , Figures 4 to 11 The hardware structure of the electronic device for the video playback method.

[0076] The electronic device includes: at least one processor 31; and a memory 32 communicatively connected to the at least one processor 31. Figure 12 Taking a processor 31 as an example, the memory 32 stores instructions that can be executed by the at least one processor 31. These instructions are executed by the at least one processor 31 to enable the at least one processor 31 to perform the aforementioned... Figures 2 to 6 The video playback method described above. The processor 31 and the memory 32 can be connected via a bus or other means. Figure 12 Taking the example of a connection between China and Israel via a bus.

[0077] The memory 32, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the video playback method in the embodiments of this application. The processor 31 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 32, thereby implementing the video playback method of the above-described method embodiments.

[0078] The memory 32 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the pixel correction device, etc. Furthermore, the memory 32 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include memory remotely located relative to the processor 31, and this remote memory can be connected to the video playback device 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.

[0079] The one or more modules are stored in the memory 32. When executed by the one or more processors 31, they perform the video playback method in any of the above method embodiments, for example, the method described above. Figure 3 , Figures 4 to 11 The method and steps.

[0080] The above-described product can perform the methods provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for performing the methods. Technical details not described in detail in this embodiment can be found in the methods provided in the embodiments of this application.

[0081] This application also provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example, to execute the instructions described above. Figure 3 , Figures 4 to 11 The method and steps.

[0082] This application also provides a computer program product, including a computing program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the video playback method described in any of the above method embodiments, for example, to perform the above-described... Figure 3 , Figures 4 to 11 The method and steps.

[0083] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0084] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general-purpose hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for at least one computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments.

[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A video playback method, characterized in that, The method includes: The proxy layer receives video events generated by video resources and publishes notifications to the UI layer based on the video events. The video events include merge events, mutual events, and a main event. Publishing notifications to the UI layer based on the video events includes: publishing a first notification to the UI layer if all the video resources generate the same merge event; and / or publishing a second notification to the UI layer if at least one video resource generates the mutual event; and / or publishing a third notification to the UI layer if a main video resource generates the main event. In response to the notification, the UI layer modifies the video state; In response to the change in video state, the UI layer updates the display interface.

2. The method according to claim 1, characterized in that, The mutual events include waiting events, the second notification includes waiting event notifications, and the step of publishing a second notification to the UI layer if at least one of the video resources generates the mutual event includes: If at least one of the video resources generates the waiting event, and other video resources that did not generate the waiting event play normally, then the proxy layer controls each of the video resources to pause playback and publishes the waiting event notification to the UI layer.

3. The method according to claim 2, characterized in that, The main event includes a playback position change event, and the step of publishing a notification to the UI layer based on the video event also includes: If the video resource does not generate the playback position change event, the proxy layer publishes the waiting event notification to the UI layer.

4. The method according to claim 1, characterized in that, The merged event includes a playable event, and the step of publishing a second notification to the UI layer if at least one of the video resources generates the mutual event includes: If each of the video resources generates the start-play event, the proxy layer controls the replay of each video resource and publishes the first notification to the UI layer.

5. The method according to claim 1, characterized in that, The mutual events include error events, and the second notification includes error event notifications. If at least one of the video resources generates the mutual event, a second notification is published to the UI layer, including: If the proxy layer receives the error event, the proxy layer controls the video resource that generated the error event to pause playback and publishes the error event notification to the UI layer.

6. The method according to claim 1, characterized in that, The main event includes a playback end event, and the third notification includes a playback end notification. If the main video resource generates the main event, a third notification is sent to the UI layer, including: If the main video resource generates the playback end event, the proxy layer publishes the playback end notification to the UI layer.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: In response to user input of operation information in the UI layer, the proxy layer controls the playback of each video resource based on the operation information.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method as described in any one of claims 1-7.