Method, electronic device and storage medium for playing videos based on quick application cards
By introducing video playback function in the fast application card, the problem of only static images being displayed in the prior art is solved, rich video content display is realized, and user experience is improved.
Patent Information
- Application Number
- CN202410294642.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-27
- Filing Date
- 2024-03-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-03-14
AI Technical Summary
Existing fast application cards can only display static images, and the user's application scenarios are limited, which cannot meet the display needs of rich content.
By introducing video playback function in the fast application card, the VideoView component and player management module are used to display and switch multiple video contents, ensuring that only one video can be played on the same card at the same time.
Improve user experience and meet users' needs for dynamic information through rich video content display, ensuring that information display is more intuitive and controllable.
Smart Images

Figure CN118301402B_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on September 27, 2023, with application number 202311288104.2 and application name “Method, electronic device and storage medium for playing videos based on quick application cards”, the entire contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a method for playing videos based on a quick application card, an electronic device, and a storage medium. Background Art
[0003] Quick apps are a new form of mobile apps that can be used instantly without downloading or installing. Quick app cards can be embedded and displayed in native apps in various usage scenarios, such as the negative one screen, desktop, quick service center, etc. Currently, quick app cards only support the display of static images, and user application scenarios are relatively limited. Summary of the invention
[0004] The present application provides a method for playing videos based on quick application cards, an electronic device, and a storage medium, which can display one or more video contents based on quick application cards, display richer content, and improve user experience.
[0005] In a first aspect, the present application provides a method for playing videos based on quick application cards, which is applied to electronic devices, and the method includes: displaying at least one card on a desktop, a first card in the at least one card including a first display area and a corresponding first video view VideoView component, a second display area and a corresponding second VideoView component; receiving a first operation of a user on the second display area, the first operation being an operation to trigger playing a video; in response to the first operation, determining whether the second VideoView component is associated with a player; if it is determined that the second VideoView component is not associated with a player, determining whether other VideoView components in the first card are associated with a player; if it is determined that the first VideoView component is associated with the first player, disassociating the first VideoView component from the first player, and associating the second VideoView component with the first player; calling the first player through the second VideoView component, and playing the first video in the second display area.
[0006] Among them, the first card is a quick application card implemented by JavaScript, and this type of card can be called a JS card.
[0007] The desktop supports displaying multiple video cards. Each card may include one or more display areas. Different display areas correspond to different VideoView components. Based on the VideoView component, the player may be called to display the video content in the corresponding display area.
[0008] It should be noted that the current Quick App Alliance limits the maximum number of videos (denoted as M) that can be played in the interface of the card host application such as the negative first screen / desktop / quick service center. For example, the maximum number of videos played M is 3. Since the current Quick App Alliance does not impose any restrictions on the playback of videos on the same card, in actual use, the same card may play multiple videos at the same time, affecting the user experience.
[0009] According to the method for playing videos based on quick application cards provided by the embodiment of the present application, the video card includes one or more display areas, which correspond to different VideoView components respectively. Based on the VideoView component, the player can be called to display the video content in the corresponding display area. When a user triggers a card to play a video, when it is determined that the VideoView component of the card is not associated with a player, it will be determined whether the card has occupied the player, so as to determine whether to reuse the player. In the case that a VideoView component of a card has occupied the player, the VideoView component is unbound from the player, and then another VideoView component of the card is bound to the player. In this way, the unbound VideoView component stops the original playback action, and the newly bound VideoView component uses the player to start a new playback of another video, thereby achieving the effect that a card can only play one video at a time, and the information display is more intuitive and controllable, thereby improving the user experience.
[0010] When the first video is played in the second display area, the first display area stops playing the video.
[0011] It should be noted that the current Quick App Alliance does not impose any restrictions on playing videos on the same card, and only controls the maximum number of videos played on one host (negative screen / desktop / quick service center) to 3. Through this application solution, for a quick app video card, only one video stream / live stream can be played at the same time, and the new video / live broadcast can be played directly, and the original content playback will be automatically stopped, making the video content display more intuitive and controllable.
[0012] Here, association can be understood as binding, and disassociation can be understood as unbinding or unbinding.
[0013] In the embodiment of the present application, each card may include one or more display areas, each display area corresponds to a VideoView component, that is, each card may include one or more VideoView components. A VideoView component can be associated / bound to a player. The present application scheme may include the following two application scenarios:
[0014] Scenario 1: The desktop includes multiple cards, and multiple cards share three players. Since one VideoView component is associated / bound to one player, the VideoView components of each card will occupy the player alternately. In other words, the three players will be associated and occupied alternately by the VideoView components of different cards. It can be guaranteed that the maximum number of playable videos in the card host interface such as the negative one screen / desktop / quick service center is 3.
[0015] Scenario 2: For cards with multiple display areas, each card can be bound to a player, and the player bound to the card can be reused by the VideoView components corresponding to different display areas.
[0016] In some embodiments, the present application determines whether the card has occupied the player through the hybrid view HyBridView object, thereby determining whether to reuse the player. Among them, the HyBridView object can contain multiple VideoView components, and the multiple VideoView components correspond to different player proxies PlayerProxy.
[0017] In the embodiment of the present application, when the bind action is performed through the player proxy PlayerProxy, the corresponding hybrid view HyBridView is obtained through the current Target (VideoView component), and the instance mInstances array is searched to see whether there is a hybrid view HyBridView that is the same as the current Target. If there is a same, it is determined that the current card has been bound to the player.
[0018] In this case, the player bound to the current card is paused and the original player proxy of the current card is set to empty (i.e., unbinding), and the current Target points to the mTarget object of the original holder object (i.e., rebinding), thereby reusing the current card player and stopping the original playback content.
[0019] It can be understood that, when the VideoView component is bound to a player, the bound player can be called through the VideoView component to play the video in the display area corresponding to the VideoView component.
[0020] In some possible implementations, the method provided in the present application also includes: when it is determined that other VideoView components of the first card are not associated with a player, associating the second VideoView component with a second player that meets preset conditions; calling the second player through the second VideoView component to play the first video in the second display area.
[0021] The first operation may be a click operation of the user on the second display area.
[0022] In some possible implementations, the second player may be a player that is associated with and in an idle state among the M players; or, when the M players are all associated with and in an occupied state, the second player may be the player that is associated earliest among the M players.
[0023] In some possible implementations, before associating the second VideoView component with the second player that meets the preset conditions, the method provided in the present application further includes: determining whether there is a player among the M players that has been associated and is in an idle state.
[0024] Case 1: When it is determined that there is a player that is associated and in an idle state among the M players, the one player that is associated and in an idle state is disassociated, and the disassociated player is determined as the second player.
[0025] Case 2: When it is determined that there is no associated and idle player among the M players, determine whether the number of associated and occupied players is equal to M; when it is determined that the number of associated and occupied players is equal to M, disassociate and release the earliest associated player among the M players, and determine the released player as the second player that meets the preset condition.
[0026] In some possible implementations, the method provided in the present application further includes: updating a player association order whenever a player among the M players is associated; and determining the earliest associated player among the M players based on the updated player association order.
[0027] For example, a possible player association order is: (Player 1, VideoView component 1), (Player 2, VideoView component 2), (Player 3, VideoView component 3). Among them, the player that is associated first among the three players is Player 1. In this case, Player 1 can be released for reuse by other VideoView components (such as VideoView component 4).
[0028] The updated player association order may be: (Player 2, VideoView component 2), (Player 3, VideoView component 3), (Player 1, VideoView component 4). Among them, the player that is associated earliest among the three players becomes Player 2. In this case, Player 2 can be released for reuse by other VideoView components.
[0029] Through the above solution, in actual implementation, one VideoView component can be associated / bound to one player, and the three players will be alternately associated and occupied by different VideoView components. The order in which the three players are associated is recorded and updated, and based on the updated player association order, the players can be disassociated and reassociated in an orderly manner to avoid conflicts.
[0030] In some other possible implementations, the method provided by the present application further includes: whenever a player among the M players is occupied, updating the player occupation order; determining the earliest occupied player among the M players according to the updated player occupation order. The order in which the three players are occupied is recorded and updated, and based on the updated player occupation order, the player unbinding and rebinding can be completed in an orderly manner to avoid conflicts.
[0031] In some possible implementations, the at least one card also includes a second card, and the second card corresponds to a third VideoView component; the method provided in the present application also includes: calling the associated player through the third VideoView component to play the second video in the display area of the second card; when the player associated with the third VideoView component is different from the player associated with the second VideoView component, when the first video is played in the second display area, the second video continues to be played in the display area of the second card.
[0032] In some possible implementations, before displaying at least one card on the desktop, the method provided in the present application also includes: receiving a second operation of a user to add the first card to the desktop; in response to the second operation, calling a desktop application to load the first card to the desktop; creating the first VideoView component for a first display area of the first card, and creating the second VideoView component for a second display area of the first card.
[0033] The second operation may be a click confirmation operation or a drag operation for the user to add the first card to the desktop.
[0034] In some possible implementations, the method provided by the present application also includes: when calling a desktop application to load a first card to the desktop, detecting whether the first card carries attribute information of automatic playback; when detecting that the first VideoView component carries attribute information of automatic playback, associating the first VideoView component with a first player among M players that meets preset conditions.
[0035] In some possible implementations, displaying at least one card on the desktop includes: displaying a first card on the desktop, and based on the first VideoView component carrying automatic play attribute information, calling the first player through the first VideoView component to play the second video in the first display area of the first card.
[0036] Through the above scheme, in response to the user's operation of adding a card to the desktop, the card is loaded through the desktop application; the first card is drawn; the first VideoView component of the first card and the first player agent are created; when the first card carries the attribute information of automatic playback, the player management module binds the first VideoView component to the first player and stores the mapping relationship between the first player and the first VideoView component; the first VideoView component can be called to play the video through the first player.
[0037] In some possible implementations, after associating the second VideoView component with the first player, the method provided in the present application further includes: storing a first mapping relationship between the second display area, the second VideoView component, the first player, and the first video.
[0038] In some possible implementations, calling the first player through the second VideoView component and playing the first video in the second display area includes: based on the first mapping relationship, calling the first player through the second VideoView component and playing the first video in the second display area.
[0039] In some possible implementations, the electronic device includes a player management module. When it is determined that the first VideoView component is associated with a first player, the first VideoView component is disassociated from the first player and the second VideoView component is associated with the first player, comprising: when the player management module determines that the first VideoView component is associated with the first player, the player management module disassociates the first VideoView component from the first player and associates the second VideoView component with the first player.
[0040] Through this application solution, the quick application video card is displayed on the desktop or negative one screen interface, and the bound player is called to display the video in the quick application video card. Through the quick application video card, various services are displayed and recommended to users, the information display is more intuitive, and the service recommendation is more comprehensive.
[0041] In a second aspect, the present application provides a device for playing videos based on a quick application card, the device comprising a unit for executing the method in the first aspect. The device may correspond to executing the method described in the first aspect, and the relevant description of the unit in the device can refer to the description of the first aspect, which will not be repeated here for the sake of brevity.
[0042] The method described in the first aspect above can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a processing module or unit, a display module or unit, etc.
[0043] In a third aspect, the present application provides an electronic device, comprising a processor, a computer program or instructions stored in the processor and a memory, wherein the processor is configured to execute the computer program or instructions so that the method in the first aspect is executed.
[0044] In a fourth aspect, the present application provides a computer-readable storage medium on which a computer program (also referred to as instructions or codes) for implementing the method in the first aspect is stored. For example, when the computer program is executed by a computer, the computer can perform the method in the first aspect.
[0045] In a fifth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof. Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.
[0046] In a sixth aspect, the present application provides a chip system, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof. Optionally, the chip system also includes a memory, and the memory is connected to the processor via a circuit or wire.
[0047] In a seventh aspect, the present application provides a computer program product, which includes a computer program (also referred to as instructions or codes). When the computer program is executed by an electronic device, the electronic device implements the method in the first aspect.
[0048] It can be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of an interface for displaying a quick application card on an electronic device provided in an embodiment of the present application;
[0050] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0052] Figure 4A A schematic diagram of an interface for adding a quick application card to the desktop provided in an embodiment of the present application;
[0053] Figure 4B A schematic diagram of an interface for adding a quick application card to the negative one screen provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of a quick application video card provided in an embodiment of the present application;
[0055] Fig. 6A A schematic diagram of a process of adding a video card in a method for playing a video based on a quick app card provided in an embodiment of the present application;
[0056] Figure 6B The embodiments of this application are based on Fig. 6A The provided interface diagram for adding a video card;
[0057] Fig. 7A A schematic diagram of a process of switching to play videos on the same card in a method for playing videos based on a quick app card provided in an embodiment of the present application;
[0058] Figure 7B The embodiments of this application are based on Fig. 7A The schematic diagram of the interface for switching video playback on the same card is provided;
[0059] Fig. 8A An interactive schematic diagram of a method for playing videos based on a quick app card provided in an embodiment of the present application;
[0060] Figure 8B The embodiments of this application are based on Fig. 8A A schematic diagram of the control flow of multiple card playback in the method of playing videos based on quick application cards is provided;
[0061] Fig. 9AA schematic diagram of a process of sequentially binding a player and occupying the player in a method for playing videos based on a quick application card provided in an embodiment of the present application;
[0062] Fig. 9B The embodiments of this application are based on Fig. 9A A schematic diagram of the interface in which the multiple cards provided are bound to the player in sequence and occupy the player;
[0063] Fig. 10A A schematic diagram of a process in which a player is cyclically occupied in a method for playing a video based on a quick application card provided in an embodiment of the present application;
[0064] Fig. 10B The embodiments of this application are based on Fig. 10A A schematic diagram of the interface in which the provided players are bound and occupied in a loop. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0066] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0067] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of objects. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two, for example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0068] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0069] Quick apps are a new type of application. In the past, there were two main types of mobile applications: web pages and native apps. Web pages do not require installation, but the experience is not very good; native apps have a smooth experience, but they need to be downloaded and installed from the app store, making it difficult to reach users in one step. The emergence of quick apps allows users to experience the application content smoothly without downloading and installing, and can be used immediately.
[0070] A quick app card is a page defined in a quick app. It is an information carrier that is embedded in other apps for display. Quick app cards can be embedded and displayed in native apps in various usage scenarios, such as the negative first screen, desktop, quick service center, global search, etc.
[0071] For example, Figure 1 (a) in the figure shows a schematic diagram of displaying the quick application card "Top News List" in the quick service center interface.
[0072] For example, Figure 1 (b) in the figure shows a schematic diagram of displaying the quick application card "Travel Navigation" in the negative one screen interface.
[0073] For example, Figure 1 (c) in the figure shows a schematic diagram of displaying the quick application card "Flight Schedule" in the desktop interface.
[0074] At present, quick application cards can only display static images, and the user application scenarios are relatively limited. There is an urgent need for a method that can display videos through quick application cards.
[0075] Based on this, the embodiments of the present application provide a method and electronic device for playing videos based on quick application cards, which improve the user experience by making improvements at the bottom layer of the mobile phone system.
[0076] For ease of explanation, a card that plays a video based on a quick app card is called a quick app video card.
[0077] It should be noted that the current quick application alliance does not impose any restrictions on playing videos on the same card, and only controls a host (negative screen / desktop / quick service center) with a maximum number of videos played of 3. In the embodiment of the present application, for a quick application video card, only one video stream / live stream is supported at the same time, and the new video / live stream is played directly, and the original content playback is automatically stopped.
[0078] In the embodiment of the present application, when the bind action is performed in PlayerProxy, the corresponding HyBridView is obtained through the current target, and the HyBridView of the PlayerProxy object is found in the mInstances array to be the same as the target. If the HyBridView is the same as the target, it proves that the current card already has a player. Then the player in the current card is paused first, the original PlayerProxy of the current card is set to empty, and the current target is pointed to the mTarget object of the original holder object, thereby achieving the effect of reusing the current card player and stopping the original playback. The details will be described in detail below.
[0079] Hereinafter, an electronic device to which the method for playing videos based on quick application cards provided in an embodiment of the present application is applied will be described with reference to the accompanying drawings.
[0080] For example, taking the electronic device as a mobile phone, Figure 2 FIG. 1 is a schematic diagram showing the structure of an electronic device provided by an embodiment of the present application. Figure 2 As shown, the mobile phone may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver (i.e., an earpiece) 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0081] Exemplarily, the sensor module may include sensors such as a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor. In an embodiment of the present application, the electronic device may detect whether the user's ear is close to the receiver through sensors such as a proximity light sensor (i.e., a light sensor) and a distance sensor. For example, the electronic device may detect whether there is an obstruction in front of the front panel (or screen) of the mobile phone, and the distance between the obstruction and the screen through a distance sensor to determine whether the current user's ear is close to the receiver.
[0082] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone. In other embodiments, the mobile phone may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0083] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0084] According to the method for playing videos based on quick application cards provided by an embodiment of the present application, at least one card is displayed on the desktop, and the first card in the at least one card includes a first display area and a corresponding first video view VideoView component, a second display area and a corresponding second VideoView component; a first operation of the user on the second display area is received, and the first operation is an operation to trigger the playback of the video; in response to the first operation, it is determined whether the second VideoView component is associated with a player; if it is determined that the second VideoView component is not associated with the player, it is determined whether other VideoView components in the first card are associated with the player; if it is determined that the first VideoView component is associated with the first player, the first VideoView component is disassociated from the first player, and the second VideoView component is associated with the first player; the first player is called through the second VideoView component, and the first video is played in the second display area.
[0085] The controller can be the nerve center and command center of the mobile phone. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0086] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0087] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0088] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the mobile phone. In other embodiments, the mobile phone may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0089] The wireless communication function of the mobile phone can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0090] The mobile phone can realize the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 194 is used to display images, videos, etc.
[0091] In the embodiment of the present application, the display screen 194 is used to display quick application cards.
[0092] In an embodiment of the present application, the electronic device can set the entrance of the quick application card on different interfaces of the display screen, which can be preset by the system or customized by the user. For example, the quick application card can be displayed on the desktop of the display screen, or on the negative one screen of the display screen, or in the quick service center of the display screen, or in the lock screen interface. For a folding screen electronic device with a small screen, the quick application card can be displayed on the small screen.
[0093] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone. The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the mobile phone by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0094] The mobile phone can realize audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver (ie, the handset) 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0095] The above is a specific description of the embodiments of the present application using an electronic device as an example. It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. The electronic device may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0096] The electronic device provided in the embodiments of the present application may be a user equipment (UE), for example, a mobile terminal (such as a user's mobile phone), a tablet computer, a desktop computer, a laptop computer, a handheld computer, a netbook, a personal digital assistant (PDA), and the like.
[0097] In addition, an operating system is running on the above hardware. The operating system of the operating system layer can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system or Windows operating system, etc. Applications can be installed and run on the operating system.
[0098] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0099] Figure 3 It is a software structure block diagram of the electronic device according to an embodiment of the present application.
[0100] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer (applications), application framework layer (application framework), Android runtime (AndroidRuntime) and system library, and kernel layer (kernel).
[0101] The application layer may include a series of application packages. For example, the application layer may include system desktop APP, negative one screen APP, quick service center APP and other applications (applications may be referred to as applications for short), and the present application embodiment does not impose any restrictions on this.
[0102] For example, the negative one screen APP can serve as the host of the quick application card.
[0103] For example, the system desktop APP can also serve as the host of the quick application card.
[0104] Exemplarily, the quick service center APP can also serve as the host of the quick application card.
[0105] For example, the negative one screen APP serves as the host of the quick application card. The negative one screen APP includes a card software development kit (SDK). The negative one screen APP can load, render and display the quick application card on the negative one screen through the card SDK.
[0106] For example, for For electronic devices with operating systems, cards can be generated based on the JavaScript programming language and displayed on the screen. For example, flight information, train information, meeting information or schedule information can be presented through cards.
[0107] Among them, JavaScript, referred to as "JS", is a lightweight, interpreted or just-in-time compiled programming language with function priority. JavaScript is a dynamic scripting language based on prototype programming and multiple paradigms, and supports object-oriented, imperative, declarative, and functional programming paradigms. JavaScript can be widely used in devices such as servers, PCs, laptops, tablets, and smartphones. It is often used to add a variety of dynamic functions to web pages to provide users with a smoother and more beautiful browsing experience.
[0108] Card SDK is a set of tools for software development. It contains various components, libraries, APIs, etc. required in the software development process. For example, Card SDK provides a complete application framework, including UI components, data storage, network communication, etc., so that developers can build applications more conveniently. For another example, Card SDK provides a series of API interfaces to help developers implement various functions.
[0109] In the embodiment of the present application, the application layer may further include a quick application engine APP. The quick application engine APP includes a quick application RPK file, and the suffix of the file is .rpk.
[0110] The quick application engine APP is an application pre-installed in the electronic device, which is used to download, install and update the quick application card. The quick application engine APP is also used to create cards, load cards and load pages. The process of creating cards includes creating JS threads, binding JS services, and binding V8. The quick application engine APP is also used to perform card rendering actions. The quick application engine APP is also used to request cards from the network.
[0111] In the embodiment of the present application, the application layer may also include a context awareness module, a business logic processing module, a business presentation module, etc. The context awareness module, the business logic processing module, and the business presentation module may be independent APPs, or may be integrated in different APPs, or may be integrated in the same APP, which is not limited in the present application.
[0112] Among them, the context awareness module, which runs permanently or in a low-power form, has the ability to perceive external facts or environments. The context awareness module can detect related events and obtain the status of events from other applications in the application layer or the application framework layer or the system layer or the kernel layer through the application programming interface (API), such as detecting Bluetooth connections, network connections, monitoring user text messages, custom timers, etc. In an embodiment of the present application, the main function of the context awareness module is to monitor whether a quick application video card is added. The context awareness module can also be used to obtain the player occupancy information of the quick application video card. The context awareness module can notify the business logic processing module of the monitored quick application video card and player occupancy information.
[0113] The business logic processing module (such as the computing engine) has business logic processing capabilities, and is used to perform data processing or logic judgment based on the quick application video card and player occupancy information monitored by the context awareness module and the preset logic algorithm, bind the VideoView component of the quick application video card to the appropriate player, and instruct the business presentation module to implement the card display task.
[0114] The business presentation module (such as YOYO Suggestion) is used to display the quick application video card on the desktop or the negative one screen interface according to the instructions of the business logic processing module, and call the bound player to display the video in the quick application video card. Through the quick application video card, various services are displayed and recommended to users, the information display is more intuitive, and the service recommendation is more comprehensive.
[0115] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3 As shown, the application framework layer may include a window manager, JS (JavaScript) service, a view system, a resource manager, etc., and the embodiments of the present application do not impose any restrictions on this.
[0116] The JS service is used to provide services such as card creation and card rendering for the quick app engine. A quick app card implemented using JavaScript can be called a JS card.
[0117] The window manager is used to manage window programs, for example, to manage window programs suggested by YOYO.
[0118] The resource manager provides various resources for applications, such as localized strings, icons, images, etc.
[0119] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. The display interface can be composed of one or more views.
[0120] For example, in an embodiment of the present application, the view system can be used to display quick application cards on the desktop.
[0121] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.
[0122] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0123] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0124] The system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as openGL ES), 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0125] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0126] For the convenience of explanation, the figure also shows a hardware layer that interacts with the above software structure. For example, the hardware layer may include a display screen.
[0127] It should be noted that although the embodiments of the present application are based on The system is used as an example, but the basic principles are also applicable to or Electronic devices with other operating systems.
[0128] The execution subject of the method for playing videos based on quick application cards provided in the embodiment of the present application can be the above-mentioned electronic device, or it can be a functional module and / or functional entity in the electronic device that can implement the method for playing videos based on quick application cards, and the present application scheme can be implemented in hardware and / or software, which can be determined according to actual use requirements, and the embodiment of the present application is not limited. Taking an electronic device as an example, the method for playing videos based on quick application cards provided in the embodiment of the present application is exemplarily described in combination with the accompanying drawings.
[0129] The following will be combined with the accompanying drawings to illustrate the embodiments of the present application through the following multiple exemplary embodiments. The methods in the following embodiments can be implemented in an electronic device with the above hardware structure and software architecture. The hardware structure diagram of the electronic device can be as follows: Figure 2 As shown, the software structure diagram of the electronic device can be as follows Figure 3 For the sake of convenience, the embodiments of the present application are all based on electronic devices as shown in FIG. Figure 2 Take the mobile phone shown as an example.
[0130] The following first describes the application scenario of the present application scheme in conjunction with the accompanying drawings, and then introduces the method for playing videos based on quick application cards provided by the present application embodiment in conjunction with specific embodiments.
[0131] Figure 4A A schematic diagram of an interface for finding a quick application video card through a quick service center entrance and adding the quick application video card to the desktop is shown.
[0132] like Figure 4A As shown in (a) of FIG. 1 , the electronic device displays an interface of the negative one screen, and the interface of the negative one screen displays an entry control 41 of the quick service center. The electronic device receives the user's operation on the entry control 41. Figure 4A As shown in (b), the electronic device jumps from the negative one screen interface to the quick service center interface in response to the user operation. The quick service center interface displays the quick application video card recommended by the system and the "add" control 42. The quick application video card recommended by the system includes one or more areas. When the quick application video card includes multiple areas, the multiple areas can display different video content respectively. Here, an example is taken that the quick application video card recommended by the system includes two areas. The electronic device receives the user's operation on the control 42. As shown in FIG. Figure 4A As shown in (c), the electronic device jumps from the quick service center interface to the add settings interface in response to the user operation, and the add settings interface displays the quick application video card, the "Add to Desktop" control 43 and the "Add to Negative One Screen" control 44.
[0133] For example, Figure 4AAs shown in (c) in FIG. 4 , the electronic device receives the user's operation on the control 43. Figure 4A As shown in (d) in FIG. 1 , the electronic device jumps from the add setting interface to the desktop in response to the user operation, and a quick application video card is newly displayed on the desktop. It should be noted that in this case, the quick application video card is displayed with the desktop as the host.
[0134] Figure 4B The figure shows an interface diagram of finding a quick application video card through the quick service center entrance and adding the quick application video card to the negative one screen. Figure 4B As shown in (a) to (d) in the figure, the quick application video card recommended by the system includes an area. The electronic device receives the user's operation on the control 42, and the electronic device jumps from the quick service center interface to the add settings interface in response to the user operation. The electronic device receives the user's operation on the "Add to negative one screen" control 44 in the add settings interface, and the electronic device jumps from the add settings interface to the negative one screen in response to the user operation, and the quick application video card is newly displayed on the negative one screen. It should be noted that in this case, the quick application video card is displayed with the negative one screen as the host.
[0135] It should also be noted that the embodiment of the present application does not limit the size of the quick application video card. For example, the size of the quick application video card can be 2*4, where 2*4 means 2 rows and 4 columns. For ease of explanation, the following embodiment takes the size of the quick application video card as 2*4 as an example for exemplary explanation.
[0136] It should also be noted that when a quick application video card includes two or more partitions, the arrangement of the two or more partitions is not limited. Figure 5 As shown in (a) in FIG. 1 , when the quick application video card includes two partitions, the two partitions may be upper and lower partitions, each of which has a size of 1*4; or Figure 5 As shown in (b), the two partitions can be left and right partitions, and the size of each partition is 2*2.
[0137] First embodiment
[0138] Fig. 6A Schematic diagram of a method for playing a video based on a quick application card provided in an embodiment of the present application. Fig. 6A As shown, the method includes the following steps S101-S128.
[0139] The following is an example of adding a quick application video card to the desktop. This embodiment describes the process of adding and displaying a quick application video card on the desktop, and switching to play a video when clicking different areas in the quick application video card.
[0140] S101, in response to a user adding a quick application video card 1 to a desktop, a desktop application downloads and installs the quick application video card.
[0141] The installation package of the quick application video card 1 (referred to as video card 1 or card 1 for short) carries the attribute information of the video card 1.
[0142] In some embodiments, the attribute information of the video card 1 includes attribute information of whether to play automatically.
[0143] In some embodiments, the video card 1 includes a card SDK module. The card SDK module includes various components, libraries, APIs, etc. required in the card development process, and can assist the desktop application to complete the task of adding a card to the desktop.
[0144] In some embodiments, the attribute information of the video card 1 includes the video view (VideoView) component information of the card 1. The electronic device can apply the VideoView component to the video card to implement a simple video playback function. In this way, the electronic device can dynamically present service content through the video card.
[0145] In some embodiments, video card 1 may include one or more VideoView components. The present application does not limit the number of VideoView components of card 1.
[0146] This application exemplifies the following three possible situations:
[0147] Case 1: Video card 1 may include a VideoView component. In this case, the electronic device dynamically or statically presents the video content in the entire area of video card 1 through the VideoView component.
[0148] Case 2: Video card 1 may include two VideoView components, which are respectively denoted as VideoView component 1 and VideoView component 2. In this case, the electronic device dynamically or statically presents two video contents in two areas in video card 1 through VideoView component 1 and VideoView component 2 respectively. In some embodiments, the two VideoView components can be played simultaneously. In other embodiments, the two VideoView components can be switched and played alternately. For example, when a video is played through VideoView component 1, VideoView component 2 stops playing the video; or, when a video is played through VideoView component 2, VideoView component 1 stops playing the video.
[0149] For example, reference Figure 6BIn (a), the above “user adds the quick app video card to the desktop” may be an operation of the user clicking the “Add to Desktop” control. The video card includes two areas, display area 1 and display area 2. In display area 1, one type of video content (called video A) may be displayed through VideoView component 1, and in display area 2, another type of video content (called video B) may be displayed through VideoView component 2.
[0150] Case 3: Video card 1 may include three VideoView components, and the electronic device presents three video contents in three areas of video card 1 through the three VideoView components respectively. In some embodiments, the three VideoView components can be played simultaneously. In other embodiments, the three VideoView components can be switched and played alternately. For example, when a video is played through one of the three VideoView components, the other two VideoView components stop playing the video.
[0151] Among them, the VideoView component can also be called a video view class or a VideoView class.
[0152] S102 , the desktop application sends a message 1 to the card SDK module. The message 1 is used to instruct the drawing of the video card 1 . The message 1 also carries the attribute information of the video card 1 .
[0153] S103, the card SDK module draws a video card in response to the message 1, for example, draws and creates a VideoView component 1 and a VideoView component 2. The attribute information of the video card 1 includes attribute information that the VideoView component 1 is automatically played.
[0154] This embodiment is described by taking the example of creating two VideoView components by video card 1. In actual implementation, three VideoView components may also be created, and the implementation process of the three VideoView components is similar to the implementation process of the two VideoView components, which will not be described in detail here.
[0155] S104, the card SDK module creates a player agent 1 for the VideoView component 1 according to the attribute information of the VideoView component 1 for automatic playback.
[0156] Among them, the player agent 1 is used to proxy the video playback service of the VideoView component 1.
[0157] Exemplarily, the player agent 1 is used to process the binding / unbinding task between the VideoView component 1 and the player. For example, the player agent 1 is used to determine whether the VideoView component 1 has been bound to the player, and if it is determined that the player has been bound, instruct to complete the video playback service for the VideoView component 1 through the bound player, or, if it is determined that the player has not been bound, request to bind the player to the VideoView component 1.
[0158] S105, the card SDK module instructs the player agent 1 to bind the player.
[0159] S106, the player agent 1 determines whether the VideoView component 1 has been bound to the player according to the instruction of the card SDK module.
[0160] S107A: If the player agent 1 determines that the VideoView component 1 is bound to a player, the player agent 1 instructs the VideoView component 1 to play the video through the bound player. Accordingly, the VideoView component 1 plays the video through the bound player.
[0161] S107B, if the player agent 1 determines that the VideoView component 1 is not bound to the player, the player agent 1 sends a message 2 to the player management module, where the message 2 is used to request that the VideoView component 1 of the video card 1 be bound to the player.
[0162] Among them, the player management module is used to manage the binding and unbinding (ie, release) services of multiple players and VideoView components.
[0163] The player management module is also used to record whether multiple players are occupied and the order in which they are occupied.
[0164] For the sake of convenience, it is taken as an example that the player management module manages three players in total. The three players are respectively called player 1, player 2 and player 3.
[0165] After S107B, S108 to S116 are continued to be executed. The following illustrates that the player management module binds the VideoView component 1 of the card 1 to a suitable player based on a preset logical judgment.
[0166] S108, the player management module determines whether the video card 1 has been bound to the player according to the instruction of the player agent 1.
[0167] S109: If the player management module determines that the video card 1 is not bound to a player, the player management module continues to determine whether there is a bound but idle player.
[0168] If the player is bound and currently being used, the player management module can confirm that there are no bound but idle players.
[0169] If the player is bound but not currently in use, the player management module can confirm that there is a bound but idle player. In the case where the player management module determines that there is a bound but idle player, the player management module can release the mapping relationship of the player. Furthermore, the player management module can bind the VideoView component 1 to the released player.
[0170] S110, if the player management module determines that there is no bound but idle player, then the player management module continues to determine whether the number of bound players is less than 3.
[0171] When the number of bound players is less than 3, it means that there are unbound players among the 3 players. It may be that 1 player is unbound, 2 players are unbound, or all 3 players are unbound.
[0172] S111, if the player management module determines that the number of bound players is less than 3, the player management module binds the VideoView component 1 of the video card 1 to any unbound player (here taking player 1 as an example), and stores the mapping relationship between player 1 and VideoView component 1.
[0173] It can be understood that when there is a mapping relationship between player 1 and VideoView component 1, VideoView component 1 can call player 1 to complete the video playback task.
[0174] It should be noted that the player 1 is bound to the VideoView component 1 of the video card 1, which means that the player 1 and the video card 1 are also bound, that is, a mapping relationship is established.
[0175] For the sake of convenience, the mapping relationship between player 1 and VideoView component 1 is recorded as (player 1, VideoView component 1).
[0176] S112, the player management module returns a message indicating successful binding to the player agent 1.
[0177] The message indicating successful binding includes a mapping relationship (player 1, VideoView component 1).
[0178] S113, the player agent 1 instructs the VideoView component 1 to use the player 1 to play the video according to the mapping relationship (player 1, VideoView component 1).
[0179] S114 , after receiving the instruction from the player agent 1 , the VideoView component 1 calls the player 1 to play the video in the display area 1 .
[0180] S115, the video card 1 returns a message indicating that the video card has been successfully added to the desktop application through the card SDK module.
[0181] S116, the electronic device successfully adds and displays the video card 1 on the desktop, the display area 1 of the video card 1 plays the video, and the display area 2 of the video card 1 does not play the video.
[0182] The video card 1 includes two areas, assuming that the display area 1 corresponds to the VideoView component 1, and the display area 2 corresponds to the VideoView component 2. It should be noted that when the video card 1 is displayed on the desktop, the display area 1 corresponding to the VideoView component 1 automatically plays the video, and the display area 2 corresponding to the VideoView component 2 does not play the video.
[0183] For example, Figure 6B Schematic diagram of a method for playing a video based on a quick application card provided in an embodiment of the present application. Figure 6B In (a) and (b), in response to the user adding a video card to the desktop, the desktop application downloads and installs the video card, and the electronic device successfully adds the video card to the desktop and displays the video card, and the video card displays different video source contents through display area 1 and display area 2, respectively. For example, in display area 1, one type of video content can be statically / dynamically displayed through VideoView component 1, and in display area 2, another type of video content can be statically / dynamically displayed through VideoView component 2.
[0184] For example, assuming that VideoView component 1 carries the attribute information of automatic play, and VideoView component 2 does not carry the attribute information of automatic play, in this case, when the video card is added to the desktop, the video will be automatically played in display area 1, and the video will not be automatically played in display area 2 at this time.
[0185] The above exemplifies the process of adding a video card 1 to the desktop and displaying the video card 1, wherein the video A is automatically played in the display area 1 of the video card 1, and the video B is not played in the display area 2 of the video card 1. It should be noted that if the user wants to watch the dynamic content of the display area 2, the user can click the display area 2 to trigger the dynamic display of the video B in the display area 2.
[0186] Combine the following Fig. 7AThe following describes a process in which, when a user clicks on display area 2, the electronic device controls VideoView component 2 to play video B in display area 2, and controls VideoView component 1 to stop playing video A in display area 1. Fig. 6A ,like Fig. 7A As shown, after S116, the method provided by the present application further includes the following steps.
[0187] S117: The desktop application receives an operation of the user clicking on display area 2.
[0188] For example, Figure 7B As shown in (a) in FIG. 1 , a video card is displayed on the desktop, and the video card includes a display area 1 and a display area 2. The user can trigger the playing of video B in the display area 2 by clicking the display area 2.
[0189] Among them, display area 1 corresponds to VideoView component 1, VideoView component 1 has created player agent 1 and bound player 1.
[0190] Among them, display area 2 corresponds to VideoView component 2, VideoView component 1 does not create a player agent and does not bind a player.
[0191] S118, the desktop application sends a message 3 to the card SDK module, instructing the VideoView component 2 corresponding to the display area 2 to start playing.
[0192] S119, the card SDK module creates a player agent 2 for the VideoView component 2 according to the message 3.
[0193] Among them, player agent 2 is used to proxy the video playback business of VideoView component 2.
[0194] Exemplarily, the player agent 2 is used to process the binding / unbinding task between the VideoView component 2 and the player. For example, the player agent 2 is used to determine whether the VideoView component 2 has been bound to the player, and if it is determined that the player has been bound, instruct to complete the video playback service for the VideoView component 2 through the bound player, or, if it is determined that the player has not been bound, request to bind the VideoView component 2 to a certain player.
[0195] S120, the card SDK module sends a message 4 to the player agent 2, where the message 4 is used to indicate that the player is bound to the VideoView component 2.
[0196] S121, the player agent 2 determines whether the VideoView component 2 has been bound to the player according to the instruction of the card SDK module.
[0197] S122A: If the player agent 2 determines that the VideoView component 2 has been bound to a player, the player agent 2 instructs the VideoView component 2 to play the video through the bound player. Accordingly, the VideoView component 2 plays the video by calling the bound player.
[0198] S122B, if the player agent 2 determines that the VideoView component 2 is not bound to a player, the player agent 2 sends a message 5 to the player management module, where the message 5 is used to request that the VideoView component 2 be bound to a player.
[0199] After S122B, S123 to S130 are continuously executed.
[0200] S123, the player management module determines whether the video card 1 has been bound to the player according to the message 5.
[0201] It should be noted that, referring to the above process, video card 1 has been bound to player 1, and VideoView component 1 of video card 1 has been bound to player 1.
[0202] S124, when the player management module determines that video card 1 is bound to player 1, the player management module updates the mapping relationship between player 1 and VideoView component 1 (player 1, VideoView component 1) to the mapping relationship between player 1 and VideoView component 2 (player 1, VideoView component 2).
[0203] In this case, player 1 is unbound from VideoView component 1 of video card 1, and player 1 is bound to VideoView component 2 of video card 1. After S124, S125-S127 and S128-S130 are respectively executed.
[0204] S125, the player management module sends an unbinding message to the player agent 1, where the unbinding message is used to notify that the player 1 and the VideoView component 1 have been unbound successfully.
[0205] S126, the player agent 1 instructs the VideoView component 1 to stop playing.
[0206] S127, after receiving the instruction from the player agent 1, the VideoView component 1 stops playing.
[0207] S128, the player management module sends a binding success message to the player agent 2, where the binding success message is used to notify that the player 1 and the VideoView component 2 have been successfully bound.
[0208] S129, the player agent 2 instructs the VideoView component 2 to start playing.
[0209] S130 , after receiving the instruction from the player agent 2 , the VideoView component 2 calls the player 1 to play the video in the display area 2 .
[0210] It should be noted that the present application does not limit the execution order of S125-S127 and S128-S130. For example, S125-S127 may be executed first, and then S128-S130; or S128-S130 may be executed first, and then S125-S127; or S125-S127 and S128-S130 may be executed simultaneously. Fig. 7A The following is an example of first executing S125-S127 and then executing S128-S130.
[0211] For example, Figure 7B Schematic diagram of a method for playing videos based on a quick application card provided in an embodiment of the present application. Figure 7B As shown in (a) of FIG. 1 , a video card is displayed on the desktop, wherein video A is played in display area 1 and is not played in display area 2. When the user clicks on display area 2, as shown in FIG. Figure 7B As shown in (b) in FIG. 1 , the electronic device controls the display area 1 to pause the playing of video A, and controls the display area 2 to start playing video B.
[0212] The above describes a process in which when display area 1 is playing a video, the user clicks display area 2, triggering VideoView component 2 corresponding to display area 2 to play the video, and VideoView component 1 corresponding to display area 1 to stop playing the video.
[0213] Second embodiment
[0214] The first embodiment described above introduces the process of completing video playback by alternately binding VideoView components to a player when a card includes multiple VideoView components. The second embodiment will introduce the process of completing video playback by unbinding and binding VideoView components to a player when there are multiple cards on the desktop.
[0215] The current Quick App Alliance limits the maximum number of videos that can be played on a host (negative screen / desktop / quick service center), for example, the maximum number of videos that can be played is 3. In actual implementation, three players are set, one VideoView component can be bound to one player, and the three players will be occupied alternately by different VideoView components. Since the current Quick App Alliance does not impose any restrictions on playing videos on the same card, in actual use, the same card may play multiple videos at the same time, affecting the user experience.
[0216] This application uses the HyBridView object to determine whether the card has occupied the player, so as to determine whether to reuse the player. When a VideoView component of a card has occupied the player, the VideoView component is unbound from the player, and then another VideoView component of the card is bound to the player. In this way, the unbound VideoView component stops the original playback action, and the newly bound VideoView component uses the player to start playing another video, thereby achieving the effect that a card can only play one video at a time.
[0217] Fig. 8A A schematic diagram of a scenario of a method for playing videos based on a quick application card provided in an embodiment of the present application. Fig. 8A As shown, the desktop includes three cards, Card 1, Card 2 and Card 3, and these three cards are bound to different players. Among them, Card 1 includes VideoView component 1, and VideoView component 1 is bound to player 1 through player agent 1 (i.e., a mapping relationship is established). Card 2 includes VideoView component 2, and VideoView component 2 is bound to player 2 through player agent 2. Card 3 includes VideoView component 3 and VideoView component 4, and VideoView component 3 is bound to player 3 through player agent 3.
[0218] It should be noted that after the VideoView component is bound to the player, the VideoView component can call the bound player to play the video. After the VideoView component is unbound from the player, the VideoView component can no longer call the player to play the video.
[0219] In some embodiments, the player management module is responsible for managing the binding and unbinding between the VideoView component and the player.
[0220] In some embodiments, the player management module includes a playback controller, which is responsible for receiving instructions such as binding, starting playback, pausing / stopping playback, or unbinding sent by the VideoView component, and controlling the player to complete tasks such as binding, starting playback, pausing / stopping playback, or unbinding according to the instructions.
[0221] It should be noted that the current technical problem is: referring to 8A, when the VideoView component 3 of card 3 is bound to the player 3 through the player agent 3, if the VideoView component 4 of card 3 needs to be bound to the player, then which player should the VideoView component 4 be bound to meet the actual needs.
[0222] In view of this situation, the embodiment of the present application provides a solution, which limits a card to be bound to at most one player at a time. When the VideoView component 3 of card 3 is bound to player 3 through player agent 3, card 3 has occupied player 3. If the VideoView component 4 of card 3 needs to be bound to a player, in order to avoid the same card occupying multiple players at the same time, the VideoView component 3 needs to be unbound from player 3 first, and then the VideoView component 4 needs to be bound to player 3. In this way, the effect of playing only one video at a time is achieved.
[0223] Combine the following Figure 8B Describes how to bind and unbind cards to players. Figure 8B As shown, card 1 is bound to player 1, card 2 is bound to player 2, and card 3 (specifically VideoView component 3) is bound to player 3.
[0224] S201. In response to a play operation, the VideoView component 4 of the card 3 sends a request for binding a player to the player management module through the player agent 4.
[0225] The play operation may be that the user clicks a play control in an area corresponding to the VideoView component 4 in the card 3 .
[0226] S202: After the player management module receives the request, the player management module first determines whether card 3 has been bound to the player.
[0227] It should be noted that if the same card occupies multiple players at the same time, the same card will play multiple videos at the same time, which will result in a poor user experience. Therefore, when the VideoView component 3 of card 3 is bound to player 3, this application will first unbind the VideoView component 3 from player 3, so that player 3 changes from an occupied state to an idle state, and then bind the VideoView component 4 to player 3.
[0228] S203: When it is determined that the VideoView component 3 of the card 3 has been bound to the player 3, the player management module instructs the VideoView component 3 to unbind.
[0229] S204 . After the VideoView component 3 receives the instruction, the VideoView component 3 is unbound from the player 3 .
[0230] The unbinding of the VideoView component 3 from the player 3 refers to deleting the mapping relationship between the VideoView component 3 and the player 3.
[0231] S205. VideoView component 3 returns an unbinding completion message to the player management module.
[0232] S206 . The player management module instructs the VideoView component 4 to bind to the player 3 .
[0233] S207 . After the VideoView component 4 receives the instruction, the VideoView component 4 is bound to the player 3 .
[0234] The binding of the VideoView component 4 and the player 3 refers to establishing a mapping relationship between the VideoView component 4 and the player 3 .
[0235] S208. VideoView component 4 returns a binding completion message to the player management module.
[0236] S209 , the player management module sends the parameters of the player 3 to the VideoView component 4 .
[0237] S210 , the VideoView component 4 is initialized based on the player 3 , for example, setting the playback source, progress, mute or monitor, etc.
[0238] S211. After completing initialization, the VideoView component 4 sends a preload / play instruction to the player management module.
[0239] S212: The player management module starts to use the player to play the video based on the preload / play instruction.
[0240] In this way, the video starts playing in the area corresponding to the VideoView component 4 in the card 3.
[0241] S213: The player management module updates the player occupancy information.
[0242] In some embodiments, the player occupancy information is information about which cards the player is occupied by. For example, the player occupancy information includes that player 1 is occupied by card 1, player 2 is occupied by card 2, and player 3 is occupied by card 3 (VideoView component 4).
[0243] In some embodiments, the player occupancy information is the player occupancy order, and the player occupancy order is: 1. (Player 1, Card 1), 2. (Player 2, Card 2), 3. (Player 3, Card 3-VideoView component 4).
[0244] Here, the player occupancy information is taken as the player occupancy order as an example for illustrative explanation. In actual implementation, the player occupancy information can also be the player association / binding order.
[0245] It should be noted that this application limits a card to be bound to at most one player at a time, unbinding VideoView component 3 from player 3, and then binding VideoView component 4 to player 3, that is, switching from VideoView component 3 occupying player 3 to VideoView component 4 occupying player 3. In this case, VideoView component 4 can use player 3 to play the video, while VideoView component 12 plays the video, because VideoView component 3 has been unbound from player 3, VideoView component 3 does not play. This achieves the effect that a card can only play one video at a time.
[0246] The above steps illustrate possible implementations of playing a video through a card, the following steps S214 and S215 illustrate possible implementations of pausing playback of a card, and steps S216-S218 illustrate possible implementations of removing a card.
[0247] S214. In response to the stop / pause operation, the VideoView component 4 sends a stop / pause instruction to the player management module.
[0248] The stop / pause operation may be that the user clicks a stop / pause control in an area corresponding to the VideoView component 4 in the card 3 .
[0249] S215. The player management module controls the player 3 to stop / pause playing based on the stop / pause instruction.
[0250] In this way, the playback is stopped / paused in the area corresponding to the VideoView component 4 in the card 3.
[0251] S216. In response to the removal operation, the VideoView component 4 sends an unbinding and releasing instruction to the player management module.
[0252] S217. The player management module unbinds the VideoView component 4 from the player 3 based on the unbinding and releasing instructions, and releases the player 3.
[0253] S218. The player management module returns a message to the VideoView component 4 indicating that the unbinding and player release has been completed.
[0254] Third embodiment
[0255] The following is an exemplary description using the example of displaying multiple quick application video cards on the desktop. This embodiment describes the process of each quick application video card playing a video when the user clicks on each quick application video card on the desktop in sequence.
[0256] It should be noted that the multiple quick application video cards can interact with the player management module respectively, and the player management module manages the mapping relationship between the multiple players and the multiple quick application video cards.
[0257] Exemplarily, the multiple quick application video cards may include video card 1, video card 2, and video card 3.
[0258] The video card 1 includes two display areas, the display area 11 corresponds to the VideoView component 11, and the display area 12 corresponds to the VideoView component 12. For the VideoView component 11, the player agent 11 has been created. For the VideoView component 12, the player agent 12 has been created.
[0259] The video card 2 includes a display area, which corresponds to the VideoView component 2. For the VideoView component 2, a player agent 2 has been created.
[0260] The video card 3 includes a display area, which corresponds to the VideoView component 3. For the VideoView component 3, a player agent 3 has been created.
[0261] Assume that VideoView component 12 is bound to player 1, VideoView component 2 is bound to player 2, and VideoView component 3 is bound to player 3.
[0262] Video card 1, video card 2, and video card 3 are displayed on the desktop. The user can click on the three quick application video cards on the desktop in sequence. The following is an example of first clicking on video card 3, then clicking on video card 1, and then clicking on video card 2.
[0263] In the third embodiment, referring to Fig. 9A As shown, the method provided by the present application includes the following steps S301-S321.
[0264] S301, the desktop application receives an operation of the user clicking on the video card 3.
[0265] S302, the desktop application instructs video card 3 to start playing.
[0266] S303, the player agent 3 of the video card 3 receives the indication message, and the player agent 3 determines whether the VideoView component 3 has been bound to the player.
[0267] S304 , when the player agent 3 determines that the VideoView component 3 has been bound to the player 3 , the player agent 3 instructs the VideoView component 3 to play the video through the player 3 .
[0268] S305, VideoView component 3 plays the video through player 3.
[0269] S306, the player agent 3 also sends a message to the player management module that the player 3 is occupied by the VideoView component 3.
[0270] S307, the player management module stores the player occupancy order: 1. (Player 3, Card 3, VideoView component 3).
[0271] Through the above steps, in response to the user clicking on the video card 3 on the desktop, the electronic device can display the video content of the video source corresponding to the video card 3 on the video card 3 .
[0272] After the user clicks on the video card 3 on the desktop to trigger the video card 3 to start playing, the user then clicks on the video card 1 on the desktop to trigger the video card 1 to start playing.
[0273] S308 , the desktop application receives an operation of the user clicking on area 12 of the video card 1 .
[0274] S309, the desktop application instructs area 12 of video card 1 to start playing.
[0275] S310, the player agent 12 corresponding to the area 12 of the video card 1 receives the indication message, and the player agent 12 determines whether the VideoView component 12 has been bound to the player.
[0276] S311 , when the player agent 12 determines that the VideoView component 12 has been bound to the player 1 , the player agent 12 instructs the VideoView component 12 to play the video through the player 1 .
[0277] S312, VideoView component 12 calls player 1 to play the video.
[0278] S313, the player agent 2 also sends a message to the player management module that the player 1 is occupied by the VideoView component 12.
[0279] S314, the player management module stores the player occupancy order:
[0280] 1. (Player 3, Card 3, VideoView component 3);
[0281] 2. (Player 1, Card 1, VideoView component 12).
[0282] Through the above steps, in response to the user clicking on area 12 of video card 1 on the desktop, the electronic device can display the video content of the video source corresponding to area 12 of video card 1 in area 12 of video card 1. It should be noted that area 11 of video card 1 does not play the video at this time.
[0283] After the user clicks on video card 1 on the desktop to trigger video card 1 to start playing, the user then clicks on card 2 on the desktop to trigger card 2 to start playing.
[0284] S315: The desktop application receives an operation of the user clicking on the video card 2.
[0285] S316, the desktop application instructs video card 2 to start playing.
[0286] S317, the player agent 2 of the video card 2 receives the indication message, and the player agent 2 determines whether the VideoView component 2 has been bound to the player.
[0287] S318 , when the player agent 2 determines that the VideoView component 2 has been bound to the player 2 , the player agent 2 instructs the VideoView component 2 to play the video through the player 2 .
[0288] S319, VideoView component 2 calls player 2 to play the video.
[0289] Through the above steps, in response to the user clicking on the video card 2 on the desktop, the electronic device can display the video content of the video source corresponding to the video card 2 on the video card 2 .
[0290] S320, the player agent 2 also sends a message "Player 2 is occupied by VideoView component 2" to the player management module.
[0291] S321, the player management module stores the player occupancy order:
[0292] 1. (Player 3, Card 3, VideoView component 3);
[0293] 2. (Player 1, Card 1, VideoView component 12);
[0294] 3.(Player 2, Card 2, VideoView component 2).
[0295] For example, Fig. 9B Schematic diagram of a method for playing videos based on a quick application card provided in an embodiment of the present application. Fig. 9B As shown in (a) in FIG. 1 , video card 1, video card 2, and video card 3 are displayed on the desktop. Among them, video card 1 corresponds to VideoView component 11 and VideoView component 12, video card 2 corresponds to VideoView component 2, and video card 3 corresponds to VideoView component 3. Fig. 9B As shown in (a) to (d), the user first clicks on video card 3, then clicks on video card 1, and then clicks on video card 2, which triggers video card 3, video card 1, and video card 2 to play the video content in sequence, and the electronic device stores the player occupancy order: (1) card 3 occupies player 3, (2) card 1 occupies player 1, and (3) card 2 occupies player 2.
[0296] In the third embodiment, a total of three players are used as an example for illustration. All three players are occupied, and the player management module stores the order in which the players are occupied. Fig. 10A This section describes the process of unbinding and rebinding players in the player management module according to the player occupancy order.
[0297] In response to the user operation, the electronic device adds a new video card 4 on the desktop, which corresponds to the VideoView component 4 and the player agent 4. The user can click on the video card 4 on the desktop to trigger the video card 4 to start playing. The following describes the process of player unbinding and rebinding in this case. Fig. 10A As shown, the method includes the following steps S322-S333.
[0298] S322, the desktop application receives an operation of the user clicking on the video card 4.
[0299] S323, the desktop application instructs the video card 4 to start playing.
[0300] S324, the player agent 4 of the video card 4 receives the indication message, and the player agent 4 determines whether the VideoView component 4 has been bound to the player.
[0301] S325 , when the player agent 4 determines that the VideoView component 4 is not bound to a player, the player agent 4 sends a message 6 to the player management module, where the message 6 is used to request that the VideoView component 4 be bound to a player.
[0302] It should be noted that, when the player agent 4 determines that the VideoView component 4 is bound to a player, the player agent 4 instructs the VideoView component 4 to call the bound player to start playing.
[0303] S326, the player management module determines whether the video card 4 has been bound to the player according to the message 6.
[0304] S327, when the player management module determines that the video card 4 is not bound to a player, the player management module continues to determine whether there is a bound but idle player.
[0305] In some embodiments, if a player is in an idle state and is not bound, the player management module can confirm that there is an idle player. The player management module can then bind the VideoView component 4 to the idle player.
[0306] In some embodiments, if the player management module detects that a player is bound but not currently in use, the player management module can confirm that there is a bound but idle player. In this case, the player management module can release the bound but idle player. The player management module can then bind the VideoView component 4 to the released player.
[0307] In some embodiments, if all players are bound and currently being used, the player management module can confirm that there are no bound but idle players. In this case, the following S228 is executed.
[0308] S328, when the player management module determines that there is no bound but idle player, the player management module continues to determine whether the number of occupied players is equal to 3.
[0309] Among them, when the number of occupied players is equal to 3, it means that all 3 players are bound / occupied, and one of the players needs to be released.
[0310] S329, when the player management module determines that the number of occupied players is equal to 3, the player management module releases the earliest bound player in the occupation order of the three players according to the occupation order of the three players.
[0311] The three players occupy the following order:
[0312] 1. (Player 3, Card 3, VideoView component 3);
[0313] 2. (Player 1, Card 1, VideoView component 12);
[0314] 3.(Player 2, Card 2, VideoView component 2).
[0315] Among them, player 3 is occupied first, and player 3 is released first.
[0316] The player management module releases the mapping relationship (player 3, VideoView component 3), and binds the released player 3 to the VideoView component 4.
[0317] S330, the player management module updates the player occupancy order.
[0318] The updated player occupancy order is:
[0319] 1 (Player 1, Card 1, VideoView component 12);
[0320] 2. (Player 2, Card 2, VideoView component 2);
[0321] 3.(Player 3, card 4, VideoView component 4).
[0322] S331, the player management module indicates to the player agent 4 that the player 3 and the VideoView component 4 have been successfully bound.
[0323] S332, the player agent 4 instructs the VideoView component 4 to call the player 3 to play the video.
[0324] S333, VideoView component 4 of card 4 calls player 3 to start playing the video.
[0325] For example, Fig. 10B Schematic diagram of a method for playing videos based on a quick application card provided in an embodiment of the present application. Fig. 10BAs shown in (a) of FIG. 1 , four video cards are displayed on the desktop, and three of the video cards occupy three players respectively, and the occupancy order is: (1) video card 3 occupies player 3, (2) video card 1 occupies player 1, and (3) video card 2 occupies player 2. Fig. 10B As shown in (a) and (b), when the user clicks on video card 4, all three players are occupied, the electronic device releases player 3 that was occupied earliest, and video card 4 occupies player 3, and the occupancy order is updated as follows: (1) video card 1 occupies player 1, (2) video card 2 occupies player 2, and (3) video card 4 occupies player 3.
[0326] It should be noted that, in the embodiments of the present application, "greater than" can be replaced by "greater than or equal to", "less than or equal to" can be replaced by "less than", or "greater than or equal to" can be replaced by "greater than", and "less than" can be replaced by "less than or equal to".
[0327] The various embodiments described herein may be independent solutions or may be combined according to internal logic, and all of these solutions fall within the protection scope of this application.
[0328] The above mainly describes the solution provided by the embodiment of the present application from the perspective of method steps. It is understandable that, in order to achieve the above functions, the electronic device implementing the method includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should be aware that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of protection of the present application.
[0329] The present application also provides a chip, which is coupled to a memory and is used to read and execute computer programs or instructions stored in the memory to execute the methods in the above embodiments.
[0330] The present application also provides an electronic device, which includes a chip, and the chip is used to read and execute a computer program or instruction stored in a memory, so that the method in each embodiment is executed.
[0331] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method for playing videos based on quick application cards in the above-mentioned embodiment.
[0332] This embodiment also provides a computer program product, in which a computer-readable storage medium stores program code. When the computer program product runs on a computer, the computer executes the above-mentioned related steps to implement the method for playing videos based on quick application cards in the above-mentioned embodiment.
[0333] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the method of playing videos based on quick application cards in the above-mentioned method embodiments.
[0334] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0335] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0336] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for playing videos based on a quick application card, characterized in that: Applied to an electronic device, the electronic device comprises a first player, a second player and a third player; the method comprises: Displaying at least one quick application card on the desktop, wherein the at least one quick application card includes a first card, a second card, and a third card; the first card includes a first display area and a second display area; In response to a user's operation on the third card, playing a video at the third card through the third player; In response to a user operation on the first display area, playing a video in the first display area through the first player; In response to a user's operation on the second card, playing the video at the second card through the second player; When a user operation on the second display area is received, the video is played in the second display area through the first player, and the video playback in the first display area is stopped.
2. The method according to claim 1, characterized in that The at least one quick app card further includes a fourth card; after playing the video through the second player at the second card, the method further includes: When receiving the user's operation on the fourth card, the video is played at the fourth card through the third player, and the video is stopped at the third card.
3. The method according to claim 1, characterized in that The first card includes a first VideoView component and a second VideoView component, the first display area corresponds to the first VideoView component, and the second display area corresponds to the second VideoView component; The step of playing the video in the first display area by using the first player in response to the user's operation on the first display area includes: In response to a user operation on the first display area, determining whether the first VideoView component is associated with a player; When the first VideoView component is not associated with a player, determining whether the first card is associated with a player; When the first card is not associated with a player, the first VideoView component is associated with a first player that meets preset conditions; the first player is called through the first VideoView component to play the video in the first display area.
4. The method according to claim 3, characterized in that The step of playing the video in the second display area by using the first player when receiving an operation of the user on the second display area includes: Receiving a first operation of the user on the second display area, where the first operation is an operation of triggering video playback; In response to the first operation, determining whether the second VideoView component is associated with a player; When it is determined that the second VideoView component is not associated with a player, determining whether the first card is associated with a player; When it is determined that the first VideoView component in the first card is associated with the first player, the first VideoView component is disassociated from the first player, and the second VideoView component is associated with the first player; the first player is called through the second VideoView component, and the first video is played in the second display area.
5. The method according to claim 3, characterized in that: The first player that meets the preset condition is a player that is in an idle state among the M players; or, when the M players are all associated and in an occupied state, the first player is the player that is associated earliest among the M players.
6. The method according to claim 3, characterized in that: Before associating the first VideoView component with the first player that meets the preset condition, the method further includes: Determine whether there is a player that has been associated and is in an idle state among the M players; When it is determined that there is a player that has been associated and is in an idle state among the M players, disassociating the player that has been associated and is in an idle state, and determining the disassociated player as the first player; When it is determined that there is no associated player in the M players that is in an idle state, determine whether the number of associated players that is in an occupied state is equal to M; when it is determined that the number of associated players that is in an occupied state is equal to M, disassociate and release the earliest associated player among the M players, and determine the released player as the first player that meets the preset condition.
7. The method according to claim 5 or 6, characterized in that: The method further comprises: Whenever a player among the M players is associated, updating the player association order; The earliest associated player among the M players is determined according to the updated player association order.
8. The method according to any one of claims 1 to 6, characterized in that Before displaying at least one quick app card on the desktop, the method further includes: receiving a second operation of a user adding the first card to the desktop; In response to the second operation, calling a desktop application to load the first card to the desktop; A first VideoView component is created for a first display area of the first card, and a second VideoView component is created for a second display area of the first card.
9. The method according to claim 8, characterized in that The method further comprises: In the case of calling a desktop application to load the first card onto the desktop, detecting whether the first card carries automatic play attribute information; When it is detected that the first VideoView component carries the attribute information of automatic play, the first VideoView component is associated with a first player that meets a preset condition among the M players.
10. The method according to claim 9, characterized in that The displaying of at least one card on the desktop includes: The first card is displayed on the desktop, and based on the automatic play attribute information carried by the first VideoView component, the first player is called through the first VideoView component to play the second video in the first display area of the first card.
11. The method according to claim 4, characterized in that After associating the second VideoView component with the first player, the method further includes: A first mapping relationship between the second display area, the second VideoView component, the first player, and the first video is stored.
12. The method according to claim 11, characterized in that The calling the first player through the second VideoView component to play the first video in the second display area includes: Based on the first mapping relationship, the first player is called through the second VideoView component to play the first video in the second display area.
13. The method according to claim 4, characterized in that The electronic device includes a player management module; The step of, when it is determined that the first VideoView component is associated with the first player, disassociating the first VideoView component from the first player and associating the second VideoView component with the first player includes: When the player management module determines that the first VideoView component is associated with the first player, the player management module disassociates the first VideoView component from the first player and associates the second VideoView component with the first player.
14. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory, wherein the processor is configured to execute the computer program so that the electronic device implements the method according to any one of claims 1 to 13.
15. A chip system, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Interaction method, mobile terminal and storage medium
CN112068744A
Method and device for playing video, medium and program product
CN114666652A