Media content display method and device, equipment and storage medium
By separating the media content display function from the container into an independent component and using the overall context and subcontext to forward event information, the problems of bloated code and severe coupling are solved, and efficient iteration and maintenance are achieved.
Patent Information
- Application Number
- CN202410295197.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2025-09-16
AI Technical Summary
In the existing technology, the code of the media content display function is bloated, resulting in high maintenance costs and low iteration efficiency. In addition, different functions are severely coupled and prone to errors.
The implementation logic of the media content display function is separated from the container and independently developed as a functional component. Event information is forwarded through the overall context and subcontext to achieve decoupling of the media content display function and the container.
The amount of code inside the container is reduced, each functional component can be developed independently, and the iteration process does not interfere with each other, which reduces the difficulty of code maintenance, reduces the probability of errors, and improves iteration efficiency.
Smart Images

Figure CN120653855A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for displaying media content. Background Art
[0002] With the continuous development of Internet technology, users can browse a variety of media content through the Internet.
[0003] Media content can be displayed in containers on a page, such as videos played in a video player on the page. As the types of media content, display formats, and interactive methods based on this content become increasingly diverse, different display functions need to be developed accordingly. The increasing number of display functions carried by containers leads to increasingly bloated code, high maintenance costs, prone to errors, and low iteration efficiency. Summary of the Invention
[0004] The embodiments of the present disclosure provide a media content display method, apparatus, device, and storage medium, which can optimize existing media content display solutions.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for displaying media content, including:
[0006] Displaying the media content in the target container based on the first display function;
[0007] In response to a preset event being triggered, sending event information of the preset event to the overall context through the target container;
[0008] Forwarding the event information to a first subcontext corresponding to the first presentation function through the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is used to implement the first presentation function;
[0009] The event information is forwarded to the first functional component through the first subcontext to instruct the first functional component to respond to the preset event according to the event information and internal implementation logic of the first functional component.
[0010] In a second aspect, the embodiments of the present disclosure further provide a media content display device, including:
[0011] a media content display module, configured to display the media content in the target container based on the first display function;
[0012] a first forwarding module, configured to, in response to a preset event being triggered, send event information of the preset event to the overall context through the target container;
[0013] a second forwarding module, configured to forward the event information to a first subcontext corresponding to the first presentation function via the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is configured to implement the first presentation function;
[0014] A third forwarding module is configured to forward the event information to the first functional component through the first subcontext, so as to instruct the first functional component to respond to the preset event according to the event information and internal implementation logic of the first functional component.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the media content display method provided by the embodiment of the present disclosure.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the media content presentation method provided by an embodiment of the present disclosure.
[0020] The media content display solution provided by the embodiment of the present disclosure displays media content in a target container based on a first display function. In response to a preset event being triggered, the target container sends event information of the preset event to the general context, and the general context forwards the event information to the first sub-context corresponding to the first display function. The first sub-context has a binding relationship with the first functional component, and the first functional component is used to implement the first display function. The event information is forwarded to the first functional component through the first sub-context to instruct the first functional component to respond to the preset event based on the event information and the internal implementation logic of the first functional component. By adopting the above technical solution, the decoupling of the media content display function and the container can be achieved, the amount of code inside the container can be reduced, each functional component can be developed independently, and the iterative process does not interfere with each other, effectively reducing the difficulty of code maintenance and the probability of errors, thereby improving the iterative efficiency of the media content display function. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0022] Figure 1 A flowchart of a media content display method provided by an embodiment of the present disclosure;
[0023] Figure 2 A flowchart of another media content display method provided by an embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram of a framework of a media content display solution provided by an embodiment of the present disclosure;
[0025] Figure 4 A class diagram of a media content display solution provided by an embodiment of the present disclosure;
[0026] Figure 5 A schematic structural diagram of a media content display device provided by an embodiment of the present disclosure;
[0027] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0031] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0033] In order to facilitate understanding of the technical solutions of the embodiments of the present disclosure, the following is an introduction to the relevant technologies. In the relevant technologies, different display functions of media content are all implemented in the same code file. Taking a video player as an example, it is necessary to implement multiple playback functions, such as playing movies and TV series, playing live streams, and playing user-posted video works, etc. The codes developed for these playback functions exist in the same code file. When iteration is required, it is necessary to modify the code file. With the emergence of more and more functional implementation requirements, the access of more functions leads to serious coupling between the functions, the maintenance cost is getting higher and higher, and it is easy to make mistakes, and the iteration efficiency is low.
[0034] In the disclosed embodiment, the implementation logic for implementing the media content display function is separated from the container for displaying the media content and independently developed as a functional component, thereby decoupling the media content display function from the container, reducing the amount of code within the container, and allowing each functional component to be developed independently.
[0035] Figure 1 This is a flow chart of a media content display method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to situations where media content display and event response are performed in a container. The method can be executed by a media content display device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal such as a mobile phone, smart watch, tablet computer, and personal digital assistant, or a personal computer (PC) or server.
[0036] like Figure 1 As shown, the method includes:
[0037] Step 101: Display media content in a target container based on a first display function.
[0038] Exemplarily, the target container is a container for displaying media content. The specific type is not limited. For example, it can be a video player container or a view display container, and can be specifically divided into vertical screen players and horizontal screen players. The media content displayed in the embodiments of the present disclosure is not limited and can include, for example, image content, graphic content, video content, etc.
[0039] In the disclosed embodiments, the display functions can be divided according to preset dimensions, which can be set according to actual needs, such as the type of media content, the display form of the media content, and the interactive method based on the media content. Taking video content as an example, it can be divided into a video work playback function and a live stream playback function. Among them, the video work playback function can be further divided according to the source of the work, such as a film and television drama playback function and a user-posted video work playback function. The video work playback function can also be divided according to the length of the video into a short video playback function, a medium video playback function, and a long video playback function, etc. (the specific length division threshold is not limited).
[0040] In the disclosed embodiment, the implementation logic for realizing the media content display function is separated from the container for displaying the media content, and independently developed as a functional component, and each display function is implemented by the corresponding functional component. The first display function is the display function currently applied in the target container, and the function is implemented by the corresponding first functional component, such as the live streaming playback function, which can be implemented by the live component. Before displaying the media content based on the first display function in the target container, the first functional component can be loaded in the target container. Generally, different display functions are applied independently in the target container, that is, a single display function is generally applied in the target container at the same time, and the functional components of the display functions that are not currently needed do not need to be loaded in the target container, which can improve the loading speed of the page containing the target container and reduce the time consumed in page loading. In addition, when the newly developed functional component causes problems such as page crashes, the loading of the newly added component can be blocked to ensure the stability of the page operation.
[0041] Step 102: In response to a preset event being triggered, event information of the preset event is sent to the overall context through the target container.
[0042] In the embodiment of the present disclosure, the context is also called context, which can act as an information transfer station. A general context and sub-contexts that are one-to-one bound to each functional component are set, and event information of preset events can be forwarded through the context.
[0043] For example, preset events may include events related to data management, lifecycle, and display status (such as video playback status). Event information may include information related to the preset event and the specific event type. Whether the preset event is triggered can be detected by the target container in the page. For example, during video playback, the user enters a pause operation based on the page input. The preset event is a playback status change event, specifically a change from playing to paused playback. The event information may include information used to indicate the changed playback status, such as a string used to indicate paused playback.
[0044] Illustratively, when the target container is initialized, it establishes a holding relationship with the overall context. When detecting that a preset event is triggered, the target container can send event information of the preset event to the overall context because it holds the overall context.
[0045] Step 103: Forward the event information to a first subcontext corresponding to the first presentation function through the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is used to implement the first presentation function.
[0046] Exemplarily, after receiving event information, the general context determines the first subcontext bound to the currently loaded first functional component and forwards the event information to the first subcontext. Optionally, a holding relationship exists between the general context and the first subcontext, that is, the general context holds the first subcontext, and the general context forwards the event information to the first subcontext based on this holding relationship. Since functional components other than the first functional component are not loaded and there are no subcontexts bound to them, the general context does not need to forward event information to other subcontexts. Compared to a solution that only sets one context, this can reduce the forwarding of event information, and other functional components do not need to determine whether to respond to preset events, thereby improving event response efficiency.
[0047] Step 104: Forward the event information to the first functional component through the first subcontext to instruct the first functional component to respond to the preset event according to the event information and the internal implementation logic of the first functional component.
[0048] For example, after receiving the event information, the first subcontext sends the event information to the first functional component. The first functional component then responds to the preset event based on the event information and its internal implementation logic. For example, in the internal implementation logic of the first functional component, when the playback state changes to pause, a floating layer can be displayed, and a preset image can be displayed in the floating layer, thereby responding to the preset event.
[0049] Optionally, the first functional component may internally implement logic to determine whether a corresponding operation needs to be performed for a preset event. If no corresponding operation needs to be performed, the currently received event information may be ignored.
[0050] The media content display method provided by the embodiment of the present disclosure displays media content based on a first display function in a target container. In response to a preset event being triggered, event information of the preset event is sent to a general context through the target container, and the event information is forwarded to a first subcontext corresponding to the first display function through the general context. The first subcontext is bound to a first functional component, and the first functional component is used to implement the first display function. The event information is forwarded to the first functional component through the first subcontext to instruct the first functional component to respond to the preset event according to the event information and the internal implementation logic of the first functional component. By adopting the above technical solution, the implementation logic for implementing the media content display function is separated from the container for displaying the media content and is independently formed into a functional component. The general context and the subcontext bound to the functional component are set. The event information of the preset event is forwarded through the context, so that the functional component can receive the event information and respond to the preset event according to the internal implementation logic of the functional component, thereby decoupling the media content display function from the container, reducing the amount of code within the container, and each functional component can be independently developed without interfering with each other in the iteration process, effectively reducing the difficulty of code maintenance and the probability of error, thereby improving the iteration efficiency of the media content display function.
[0051] In some embodiments, before displaying media content in the target container based on the first display function, the method further includes: loading the first functional component via a component manager, wherein the target container holds the component manager; establishing a holding relationship between the overall context and the first sub-context via the component manager, wherein the overall context forwards the event information to the first sub-context based on the holding relationship. Thus, by adding a component manager, allowing the target container to hold the component manager, and loading the functional components via the component manager, effective management of each functional component is achieved.
[0052] Exemplarily, a container protocol corresponding to a target container can be set, the container protocol can be instantiated to obtain a target container, and a component manager can be held through the container protocol, and the member variables of the container protocol include the component manager. Optionally, during the instantiation of the container protocol, a preset initialization method is used to load a first functional component through the component manager, so that the first functional component is registered in the component manager. Wherein, the display function of the current application is determined to be the first display function, and a preset initialization method is used to load a first functional component for implementing the first display function through the component manager. After loading the first functional component, a holding relationship between the overall context and the first subcontext is established through the component manager, so that the overall context holds the first subcontext.
[0053] In some embodiments, before displaying media content in the target container based on the first display function, the process further includes: loading a basic component through the component manager, wherein the basic component is used to be called by a preset functional component in a preset functional component set, and the preset functional component set includes the first functional component and at least one currently unloaded component different from the first functional component for implementing the media content display function. Thus, the basic component can be called by multiple functional components, so that the functional components can implement some common basic capabilities by calling the basic component, thereby reducing the development cost of each functional component. At the same time, the basic component is managed by the component manager, so that each component can be managed globally, thereby improving the stability of the media content display process.
[0054] Exemplarily, the basic components can realize basic capabilities, such as split-screen capabilities (such as displaying the video playback area and the comment panel at the same time), transition capabilities and automatic rotation capabilities, etc. The number of basic components is not limited and can be set according to actual needs. Optionally, in the process of instantiating the container protocol, the basic components are loaded through the component manager using a preset initialization method, so that the basic components are registered in the component manager. The preset function component can be understood as an independently developed component for realizing the media content display function. The preset function component set includes the currently loaded preset function component (first function component) and the currently unloaded preset function component.
[0055] In some embodiments, after the event information of the preset event is sent to the general context via the target container in response to the triggering of the preset event, the process further includes: forwarding the event information to the component manager via the general context; and forwarding the event information to the basic component via the component manager to instruct the basic component to respond to the preset event based on the event information and the internal implementation logic of the basic component. Thus, by forwarding the event information to the component manager via the general context and the component manager forwarding the event information to the registered basic components, the basic components can respond to the preset event based on their own internal implementation logic, ensuring the correct implementation of the basic capabilities corresponding to the basic components.
[0056] Exemplarily, the component manager holds multiple basic components, and the member variables of the component manager include a basic component array, the basic component array includes the multiple basic components, and the basic components hold the overall context.
[0057] In some embodiments, the method further includes: in response to a display function switching operation, unloading the first functional component and loading the second functional component via the component manager; and establishing a holding relationship between the overall context and the second subcontext via the component manager, wherein the second subcontext and the second functional component are bound to each other. Thus, when the display function needs to be switched, the functional component can be dynamically unloaded and loaded, avoiding the container from mounting too many components simultaneously, reducing the occupation of system resources, and improving page response efficiency.
[0058] Exemplarily, the display function switching operation can be, for example, a swipe operation based on user input on the page. The second functional component is a preset functional component different from the first functional component. For example, the first functional component is a live stream playback component, and the second functional component is a long video playback component. Assume that a video stream is playing in a video player, and the video stream includes a live stream and a long video. While watching the live stream, the user inputs an upward swipe operation to switch to playing the long video. In this case, the live stream playback component is uninstalled, and the long video playback component is loaded, and the long video is then played through the long video playback component.
[0059] In some embodiments, it also includes: receiving a function call request sent by the first functional component through the first subcontext, and forwarding the function call request to the general context; forwarding the function call request to the target container through the general context, so that the target container responds to the function call request. Thus, two-way communication between the functional component and the target container is achieved through the subcontext and the general context, allowing the functional component to call the function (or method) in the target container to achieve corresponding capabilities, and by binding an independent subcontext to each functional component, the opening policy of the function in the target container to different functional components can be flexibly set. For example, for a first function dedicated to a first functional component, it can only be provided to the first functional component for calling, and the second subcontext bound to the second functional component cannot call the first function, thereby achieving isolation between functions in the target container and further ensuring the stability of the container.
[0060] Figure 2 This is a flow chart of another method for displaying media content provided by an embodiment of the present disclosure. The embodiment of the present disclosure is optimized based on the various optional solutions in the above embodiments. Specifically, the method includes the following steps:
[0061] Step 201: Load the first functional component through a component manager, wherein the target container holds the component manager.
[0062] Figure 3 A schematic diagram of a media content display solution provided by an embodiment of the present disclosure is shown in FIG. Figure 3As shown, the display functions may include functions such as medium video playback, long video playback, and live streaming playback, and the corresponding functional components, such as medium video components, long video components, and live streaming components, are developed independently. The target container includes basic components and basic containers. The basic components are used to implement basic capabilities such as split screen, transitions, and automatic rotation. The basic containers are used to implement the distribution of related events such as data management, life cycle, and playback status. The target container also includes modules for implementing other capabilities such as logging. In addition, the framework also provides related underlying capabilities such as storage and network to the target container.
[0063] Figure 4 This is a class diagram of a media content display solution provided by the embodiment of the present disclosure. Figure 4 As shown, the container view controller is obtained by instantiating the container protocol using the initialization method. It serves as the target container and holds the total context, which is used to distribute events to the total context. The container protocol holds a component manager. The member variables of the component manager include basic component data. The component manager is responsible for loading components and distributing components. The member variables of the basic components include the total context, and hold the total context, as well as weakly hold the target container (which can be used to call functions in the target container). The total context is responsible for distributing and receiving events, and holds multiple sub-contexts, which are respectively recorded as long video context, medium video context and live broadcast context. Each sub-context is bound to the corresponding functional component and is responsible for distributing and receiving events.
[0064] Step 202: Establish a holding relationship between the overall context and the first subcontext through the component manager.
[0065] Step 203: Display the media content in the target container based on the first display function.
[0066] Exemplarily, assuming that the current first display function is a live stream playback function, the live stream is played through the live broadcast component loaded in the target container.
[0067] Step 204: In response to the preset event being triggered, event information of the preset event is sent to the overall context through the target container.
[0068] For example, assuming that the preset event is that the broadcast has been on for xx minutes, the event information of the preset event, such as xx minutes, is sent to the overall context through the target container.
[0069] Step 205: Forward the event information to the component manager and the first sub-context corresponding to the first presentation function through the overall context.
[0070] Exemplarily, the event information is forwarded to the component manager and the first sub-context corresponding to the live stream playback function through the overall context.
[0071] Step 206: Forward the event information to the first functional component through the first subcontext to instruct the first functional component to respond to the preset event according to the event information and the internal implementation logic of the first functional component.
[0072] Exemplarily, the event information is forwarded to the live broadcast component through the first subcontext. The live broadcast component determines that a virtual resource issuance operation needs to be performed according to xx minutes and internal implementation logic, and then performs the virtual resource issuance operation to respond to the preset event.
[0073] Step 207: Forward the event information to the basic component through the component manager to instruct the basic component to respond to the preset event according to the event information and the internal implementation logic of the basic component.
[0074] For example, the component manager forwards event information to the basic components. When each basic component determines that it does not need to perform a corresponding operation based on the event information and the internal implementation logic of the basic component, it can ignore the event information. Assuming that the current preset event is to trigger the comment area display event, the split-screen component can perform the corresponding operation to achieve split-screen display of the live broadcast image and the comment area in response to the preset event.
[0075] Step 208: Receive the function call request sent by the first functional component through the first sub-context, and forward the function call request to the overall context.
[0076] Step 209: Forward the function call request to the target container through the general context, so that the target container responds to the function call request.
[0077] Step 210 : In response to the display function switching operation, the first functional component is uninstalled and the second functional component is loaded through the component manager, and a holding relationship between the overall context and the second subcontext is established through the component manager.
[0078] For example, if the live stream is switched to a long video according to a user operation, it is necessary to load the long video component and establish a holding relationship between the overall context and the second subcontext bound to the long video component.
[0079] For example, if a preset event is triggered, assuming that the preset event has been played for xx minutes, the event information of the preset event, such as xx minutes, is sent to the overall context through the target container, and the event information is forwarded to the second sub-context through the overall context. The second sub-context forwards the event information to the long video component. The long video component can perform operations such as displaying a preset screen to respond to the preset event. Its specific processing logic is different from that of the live broadcast component and can be developed independently.
[0080] The media content display method provided by the embodiment of the present disclosure containerizes and splits the horizontal screen view manager, adds a component manager, and dynamically loads and registers different functional components into the horizontal screen view manager according to the current actual application situation, so as to solve the problem of increased overall page loading time caused by too many mounted components. The splitting based on the granularity of the component class can solve the mutual dependence and coupling of different playback functions within the container. Different functional components each hold a sub-context of this function. When the sub-context is modified, it does not affect other functions. The communication between the component and the container depends on the transmission of the context, and the relevant events such as the container's life cycle, data and playback status are distributed to the functional components. The functional components that do not need to be applied do not need to be loaded, so they will not receive the event information sent by the total context, which reduces the time consumption of message transmission, can efficiently realize the playback function in different scenarios, and the iterative process does not interfere with each other, effectively reducing the difficulty of code maintenance and the probability of error, thereby improving the iterative efficiency of the media content display function.
[0081] Figure 5 This is a structural diagram of a media content display device provided by an embodiment of the present disclosure, such as Figure 5 As shown, the device includes:
[0082] A media content display module 501 is configured to display media content in a target container based on a first display function;
[0083] A first forwarding module 502 is configured to, in response to a preset event being triggered, send event information of the preset event to the overall context via the target container;
[0084] A second forwarding module 503 is configured to forward the event information to a first subcontext corresponding to the first presentation function via the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is configured to implement the first presentation function;
[0085] The third forwarding module 504 is configured to forward the event information to the first functional component through the first subcontext, so as to instruct the first functional component to respond to the preset event according to the event information and internal implementation logic of the first functional component.
[0086] The media content display device provided in the embodiments of the present disclosure separates the implementation logic for implementing the media content display function from the container for displaying media content, making it an independent functional component. A general context and a subcontext bound to the functional component are set. Event information of preset events is forwarded through the context, allowing the functional component to receive event information and respond to the preset event according to the internal implementation logic of the functional component. This decouples the media content display function from the container, reduces the amount of code within the container, and allows each functional component to be developed independently without interfering with each other during the iteration process. This effectively reduces the difficulty of code maintenance and the probability of errors, thereby improving the iteration efficiency of the media content display function.
[0087] Optionally, the device further includes:
[0088] a first component loading module, configured to load the first functional component through a component manager before presenting the media content based on the first presentation function in the target container, wherein the target container holds the component manager;
[0089] The first establishing module is configured to establish a holding relationship between the overall context and the first sub-context through the component manager, wherein the overall context forwards the event information to the first sub-context based on the holding relationship.
[0090] Optionally, the device further includes:
[0091] The second component loading module is used to load a basic component through the component manager before displaying the media content based on the first display function in the target container, wherein the basic component is used to be called by a preset functional component in a preset functional component set, and the preset functional component set includes the first functional component and at least one component that is not currently loaded and is different from the first functional component and is used to implement the media content display function.
[0092] Optionally, the device further includes:
[0093] a fourth forwarding module, configured to forward the event information to the component manager through the general context after sending the event information of the preset event to the general context through the target container in response to the preset event being triggered;
[0094] A fifth forwarding module is configured to forward the event information to the basic component through the component manager, so as to instruct the basic component to respond to the preset event according to the event information and the internal implementation logic of the basic component.
[0095] Optionally, the device further includes:
[0096] a component switching module, configured to, in response to a display function switching operation, uninstall the first functional component through the component manager and load a second functional component;
[0097] The second establishing module is configured to establish a holding relationship between the overall context and a second sub-context through the component manager, wherein the second sub-context has a binding relationship with the second functional component.
[0098] Optionally, the device further includes:
[0099] a sixth forwarding module, configured to receive a function call request sent by the first functional component through the first subcontext, and forward the function call request to the overall context;
[0100] A seventh forwarding module is configured to forward the function call request to the target container through the overall context, so that the target container responds to the function call request.
[0101] Optionally, the target container is a video player container, and the media content includes video content.
[0102] The media content display device provided in the embodiments of the present disclosure can execute the media content display method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0103] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0104] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg Figure 6 The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0105] like Figure 6As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An edit / output (I / O) interface 605 is also connected to the bus 604.
[0106] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0107] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0108] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0109] The electronic device provided by the embodiment of the present disclosure and the media content display method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0110] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the media content display method provided in the above embodiment is implemented.
[0111] An embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the media content display method provided in the above embodiment.
[0112] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0113] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0114] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: displays media content based on the first display function in the target container; in response to a preset event being triggered, sends event information of the preset event to the general context through the target container; forwards the event information to the first sub-context corresponding to the first display function through the general context, wherein the first sub-context has a binding relationship with the first functional component, and the first functional component is used to implement the first display function; forwards the event information to the first functional component through the first sub-context to instruct the first functional component to respond to the preset event according to the event information and the internal implementation logic of the first functional component.
[0115] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a module does not limit the module itself. For example, a media content display module may also be described as a "module that displays media content in a target container based on a first display function."
[0118] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0119] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] According to one or more embodiments of the present disclosure, a method for presenting media content is provided, including:
[0121] Displaying the media content in the target container based on the first display function;
[0122] In response to a preset event being triggered, sending event information of the preset event to the overall context through the target container;
[0123] Forwarding the event information to a first subcontext corresponding to the first presentation function through the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is used to implement the first presentation function;
[0124] The event information is forwarded to the first functional component through the first subcontext to instruct the first functional component to respond to the preset event according to the event information and internal implementation logic of the first functional component.
[0125] According to one or more embodiments of the present disclosure, before presenting the media content in the target container based on the first presentation function, the method further includes:
[0126] Loading the first functional component through a component manager, wherein the target container holds the component manager;
[0127] A holding relationship between the overall context and the first sub-context is established through the component manager, wherein the overall context forwards the event information to the first sub-context based on the holding relationship.
[0128] According to one or more embodiments of the present disclosure, before presenting the media content in the target container based on the first presentation function, the method further includes:
[0129] A basic component is loaded through the component manager, wherein the basic component is used to be called by a preset functional component in a preset functional component set, and the preset functional component set includes the first functional component and at least one component that is not currently loaded and is different from the first functional component and is used to implement a media content display function.
[0130] According to one or more embodiments of the present disclosure, after sending the event information of the preset event to the overall context through the target container in response to the preset event being triggered, the method further includes:
[0131] forwarding the event information to the component manager via the overall context;
[0132] The component manager forwards the event information to the basic component to instruct the basic component to respond to the preset event according to the event information and the internal implementation logic of the basic component.
[0133] According to one or more embodiments of the present disclosure, the present invention further includes:
[0134] In response to a display function switching operation, uninstalling the first functional component and loading a second functional component through the component manager;
[0135] A holding relationship between the overall context and a second sub-context is established through the component manager, wherein a binding relationship exists between the second sub-context and the second functional component.
[0136] According to one or more embodiments of the present disclosure, the present invention further includes:
[0137] receiving a function call request sent by the first functional component through the first subcontext, and forwarding the function call request to the overall context;
[0138] The function call request is forwarded to the target container through the overall context, so that the target container responds to the function call request.
[0139] According to one or more embodiments of the present disclosure, the target container is a video player container, and the media content includes video content.
[0140] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0141] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0142] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for displaying media content, characterized in that: include: Displaying the media content in the target container based on the first display function; In response to a preset event being triggered, sending event information of the preset event to the overall context through the target container; Forwarding the event information to a first subcontext corresponding to the first presentation function through the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is used to implement the first presentation function; The event information is forwarded to the first functional component through the first subcontext to instruct the first functional component to respond to the preset event according to the event information and internal implementation logic of the first functional component.
2. The method according to claim 1, characterized in that Before displaying the media content in the target container based on the first display function, the method further includes: Loading the first functional component through a component manager, wherein the target container holds the component manager; A holding relationship between the overall context and the first sub-context is established through the component manager, wherein the overall context forwards the event information to the first sub-context based on the holding relationship.
3. The method according to claim 2, characterized in that Before displaying the media content in the target container based on the first display function, the method further includes: A basic component is loaded through the component manager, wherein the basic component is used to be called by a preset functional component in a preset functional component set, and the preset functional component set includes the first functional component and at least one component that is not currently loaded and is different from the first functional component and is used to implement a media content display function.
4. The method according to claim 3, characterized in that After the method sends the event information of the preset event to the overall context through the target container in response to the preset event being triggered, the method further includes: forwarding the event information to the component manager via the overall context; The component manager forwards the event information to the basic component to instruct the basic component to respond to the preset event according to the event information and the internal implementation logic of the basic component.
5. The method according to claim 2, characterized in that Also includes: In response to a display function switching operation, uninstalling the first functional component and loading a second functional component through the component manager; A holding relationship between the overall context and a second sub-context is established through the component manager, wherein a binding relationship exists between the second sub-context and the second functional component.
6. The method according to claim 1, wherein Also includes: receiving a function call request sent by the first functional component through the first subcontext, and forwarding the function call request to the overall context; The function call request is forwarded to the target container through the overall context, so that the target container responds to the function call request.
7. The method according to any one of claims 1 to 6, characterized in that: The target container is a video player container, and the media content includes video content.
8. A media content display device, characterized in that: include: a media content display module, configured to display the media content in the target container based on the first display function; a first forwarding module, configured to, in response to a preset event being triggered, send event information of the preset event to the overall context through the target container; a second forwarding module, configured to forward the event information to a first subcontext corresponding to the first presentation function via the general context, wherein the first subcontext is bound to a first functional component, and the first functional component is configured to implement the first presentation function; A third forwarding module is configured to forward the event information to the first functional component through the first subcontext, so as to instruct the first functional component to respond to the preset event according to the event information and internal implementation logic of the first functional component.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the media content display method according to any one of claims 1 to 7.
10. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the media content presentation method according to any one of claims 1 to 7.