Picture-in-picture display method, device, electronic device and storage medium

By receiving the P-P Switching instructions of the target software, running the P-P page container, and putting the video interface and interactive interface in a keep-alive state, the problem of unsmooth picture-in-picture display in the prior art is solved, and richer page elements and interactive operations are achieved.

CN115834961BActive Publication Date: 2025-04-18北京自如信息科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211382961.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2025-04-18
Estimated Expiration
2042-11-04

AI Technical Summary

Technical Problem

In the prior art, the API capabilities provided by the iOS system can only display audio and video playback, resulting in the video interface not being smooth during the picture-in-picture switching process, and the playback interface interaction is limited, so that more page elements and interaction operations cannot be displayed.

Method used

By receiving the target software's picture-in-picture switching instructions, running the picture-in-picture page container, obtaining the video interface and interactive interface, and putting it in a keep-alive state, displaying the video interface and interactive interface, achieving richer page elements and interactive operations.

Benefits of technology

It realizes displaying more page elements and interactions in picture-in-picture display, ensuring that users can perform normal interactions and avoiding lags in the video interface and interactive interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834961B_ABST
    Figure CN115834961B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and in particular to a picture-in-picture display method, device, electronic device and storage medium. It includes: receiving a picture-in-picture switching instruction corresponding to a target software; running a picture-in-picture page container according to the picture-in-picture switching instruction to display the interface corresponding to the target software in a picture-in-picture manner; obtaining a video interface and an interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface; controlling the video interface and the interactive interface to be in a keep-alive state; and displaying the video interface and the interactive interface according to the picture-in-picture page container. The above method, by controlling the video interface and the interactive interface corresponding to the target software to be in a keep-alive state, enables all the contents displayed by the interface of the target software to be displayed in a picture-in-picture manner, thereby ensuring that the user can perform the same interactive operations on the contents displayed in the picture-in-picture as in the target software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a picture-in-picture display method, device, electronic equipment and storage medium. Background Art

[0002] App picture-in-picture (play in a small window outside the App) video playback is a very important function in video and live broadcast related apps. It can satisfy users to watch the video normally when switching to the background, and is also one of the main means to increase users' viewing time.

[0003] However, the API capabilities provided by the iOS system can only display audio and video playback. Not only does the video interface appear to be loading and waiting during the picture-in-picture switching process, but the playback interface interaction is completely limited by the system and cannot display more page elements and interactive operations. For the commonly used App playback, for example: the gift effects, lucky bag draws, likes operations and other interactions in the live broadcast screen, users cannot use them normally. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a picture-in-picture display method, which aims to solve the problem that the picture-in-picture display method in the prior art cannot display more page elements and interactive operations.

[0005] According to a first aspect, an embodiment of the present invention provides a picture-in-picture display method, including:

[0006] Receiving a picture-in-picture switching instruction corresponding to the target software; the picture-in-picture switching instruction is used to instruct to display the interface corresponding to the target software in a picture-in-picture manner;

[0007] According to the picture-in-picture switching instruction, the picture-in-picture page container is run to realize displaying the corresponding interface of the target software in a picture-in-picture manner;

[0008] Obtaining a video interface and an interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface;

[0009] Control the video interface and the interactive interface to be kept alive;

[0010] The video interface and the interactive interface are displayed according to the picture-in-picture page container.

[0011] The picture-in-picture display method provided by the embodiment of the present invention receives the picture-in-picture switching instruction corresponding to the target software, and runs the picture-in-picture page container according to the picture-in-picture switching instruction, so that the interface corresponding to the target software can be displayed in a picture-in-picture manner. Then, the video interface and the interactive interface corresponding to the target software are obtained, and the video interface and the interactive interface are controlled to be in a keep-alive state, so that the video interface and the interactive interface can feedback the user's interactive operation at any time, so that more page elements and interactive operations can be displayed. Then, according to the picture-in-picture page container, the video interface and the interactive interface are displayed, so that more page elements and interactive operations can be displayed, ensuring that the user's interactive operation can be completed. The above method, by controlling the video interface and the interactive interface corresponding to the target software to be in a keep-alive state, so that all the contents displayed by the interface of the target software can be displayed in a picture-in-picture manner, and the contents displayed by the interface of the target software are not selectively displayed. Thereby ensuring that the user can perform the same interactive operation on the content displayed in the picture-in-picture as in the target software. In addition, since the video interface and the interactive interface are not paused or captured during the picture-in-picture display, the smoothness of the process of displaying the video interface and the interactive interface in the picture-in-picture manner is guaranteed, avoiding the occurrence of lag.

[0012] In combination with the first aspect, in a first implementation of the first aspect, before receiving a picture-in-picture switching instruction corresponding to the target software, the method further includes:

[0013] Initialize the picture-in-picture page container and the player in the picture-in-picture page container;

[0014] Modify specific parameters corresponding to the picture-in-picture page container to prohibit interactive operations corresponding to the picture-in-picture page container.

[0015] The picture-in-picture display method provided by the embodiment of the present invention initializes a picture-in-picture page container and a player in the picture-in-picture page container, thereby ensuring that the picture-in-picture page container and the player in the picture-in-picture page container can operate normally, and further can realize displaying the interface corresponding to the target software in a picture-in-picture manner, and then, modifying specific parameters corresponding to the picture-in-picture page container, prohibiting interactive operations corresponding to the picture-in-picture page container, thereby avoiding confusion between the interactive operations corresponding to the picture-in-picture page container and the interactive operations corresponding to the interactive interface of the target software, resulting in failure to accurately complete the user's interactive instructions.

[0016] In combination with the first implementation of the first aspect, in the second implementation of the first aspect, running a picture-in-picture page container according to a picture-in-picture switching instruction includes:

[0017] According to the picture-in-picture switching instruction, the player is controlled to play wirelessly in a loop to run the picture-in-picture page container;

[0018] Mute the player's volume.

[0019] The picture-in-picture display method provided by the embodiment of the present invention controls the player to play wirelessly in a loop according to the picture-in-picture switching instruction, thereby ensuring that the picture-in-picture page container can operate normally. Then, the volume of the player is set to mute, thereby preventing the volume of the player from interfering with the volume of the target software.

[0020] In combination with the first aspect, in a third implementation of the first aspect, controlling the video interface and the interactive interface to be in a keep-alive state includes:

[0021] A loop mechanism is set for the target software, and a timer is set for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state.

[0022] The picture-in-picture display method provided by the embodiment of the present invention sets a loop mechanism for the target software and sets a timer for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state. This ensures that the thread corresponding to the target software is in a keep-alive state, and can respond to the user's interactive operation in a timely manner to complete the user's interactive operation.

[0023] In combination with the first aspect, in a fourth implementation of the first aspect, a video interface and an interactive interface are displayed according to a picture-in-picture page container, including:

[0024] Get the visualization page display container, which is used to display the interface;

[0025] Add the video interface and the interactive interface to the visualization page display container to display the video interface and the interactive interface;

[0026] The visual page display container is used to cover the picture-in-picture page container to display only the video interface and the interactive interface.

[0027] The picture-in-picture display method provided by the embodiment of the present invention obtains a visualization page display container, adds a video interface and an interactive interface to the visualization page display container, and displays the video interface and the interactive interface, thereby ensuring that the video interface and the interactive interface corresponding to the target software are displayed in a picture-in-picture manner. Then, the picture-in-picture page container is covered with the visualization page display container to display only the video interface and the interactive interface, so that only the video interface and the interactive interface corresponding to the target software can be displayed in the picture-in-picture interface, ensuring that the user only sees the video interface and the interactive interface corresponding to the target software in the picture-in-picture.

[0028] In combination with the fourth implementation of the first aspect, in the fifth implementation of the first aspect, a video interface and an interactive interface are added to a visualization page display container, and the video interface and the interactive interface are displayed, including:

[0029] Get the height-to-width ratio of the video interface and the interactive interface;

[0030] According to the aspect ratio and the size of the visualization page display container, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

[0031] The picture-in-picture display method provided in the embodiment of the present invention obtains the aspect ratio corresponding to the video interface and the interactive interface; according to the aspect ratio and the size of the visualization page display container, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface, thereby ensuring the accuracy of the visualization page display container in displaying the video interface and the interactive interface.

[0032] In combination with the fifth implementation of the first aspect, in the sixth implementation of the first aspect, according to the aspect ratio and the size of the visualization page display container, the video interface and the interactive interface are added to the visualization page display container, and the video interface and the interactive interface are displayed, including:

[0033] According to the aspect ratio and the size of the visualization page display container, determine the target height and target width corresponding to adding the video interface and the interactive interface to the visualization page display container;

[0034] According to the target height and target width, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

[0035] The picture-in-picture display method provided by the embodiment of the present invention determines the target height and target width corresponding to adding the video interface and the interactive interface to the visual page display container according to the aspect ratio and the size of the visual page display container, thereby ensuring the accuracy of the determined target height and target width. Then, according to the target height and target width, the video interface and the interactive interface are added to the visual page display container to display the video interface and the interactive interface, thereby ensuring the accuracy of the visual page display container in displaying the video interface and the interactive interface.

[0036] According to a second aspect, an embodiment of the present invention further provides a picture-in-picture display device, including:

[0037] A receiving module, used for receiving a picture-in-picture switching instruction corresponding to the target software; the picture-in-picture switching instruction is used for instructing to display the interface corresponding to the target software in a picture-in-picture manner;

[0038] A running module, used to run the picture-in-picture page container according to the picture-in-picture switching instruction, so as to display the interface corresponding to the target software in a picture-in-picture manner;

[0039] An acquisition module is used to acquire the video interface and interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface;

[0040] A control module, used to control the video interface and the interactive interface to be in a keep-alive state;

[0041] The display module is used to display the video interface and the interactive interface according to the picture-in-picture page container.

[0042] The picture-in-picture display device provided by the embodiment of the present invention receives the picture-in-picture switching instruction corresponding to the target software, and runs the picture-in-picture page container according to the picture-in-picture switching instruction, so that the interface corresponding to the target software can be displayed in a picture-in-picture manner. Then, the video interface and the interactive interface corresponding to the target software are obtained, and the video interface and the interactive interface are controlled to be in a keep-alive state, so that the video interface and the interactive interface can feedback the user's interactive operation at any time, so that more page elements and interactive operations can be displayed. Then, according to the picture-in-picture page container, the video interface and the interactive interface are displayed, so that more page elements and interactive operations can be displayed, ensuring that the user's interactive operation can be completed.

[0043] According to the third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the picture-in-picture display method in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.

[0044] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the picture-in-picture display method in the first aspect or any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 is a flow chart of a picture-in-picture display method in the prior art provided by an embodiment of the present invention;

[0047] Figure 2 is a flow chart of a picture-in-picture display method in the prior art provided by another embodiment of the present invention;

[0048] Figure 3 is a flow chart of a picture-in-picture display method provided by another embodiment of the present invention;

[0049] Figure 4 is a flow chart of a picture-in-picture display method provided by another embodiment of the present invention;

[0050] Figure 5 is a flow chart of a picture-in-picture display method provided by another embodiment of the present invention;

[0051] Figure 6 is a flow chart of an implementation method of a self-developed or third-party player provided by another embodiment of the present invention;

[0052] Figure 7 is a flow chart of event processing at each opportunity in the life cycle of a picture-in-picture page container provided by another embodiment of the present invention;

[0053] Figure 8 This is a functional module diagram of a picture-in-picture display device provided by an embodiment of the present invention;

[0054] Fig. 9 This is a functional module diagram of a picture-in-picture display device provided by an embodiment of the present invention;

[0055] Fig.10 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0057] App picture-in-picture (play in a small window outside the App) video playback is a very important function in video and live broadcast related apps. It can satisfy users to watch the video normally when switching to the background, and is also one of the main means to increase users' viewing time.

[0058] In the prior art, one of the solutions is as follows: Figure 1 As shown, the AVPlayer player is used in the App and the picture-in-picture page container. When the picture-in-picture switch is triggered, the player in the App is first paused, a frame is quickly generated in the video stream, and then the player is moved to the picture-in-picture page container, and then the frame just captured is adapted to the picture-in-picture page container, and finally played again.

[0059] Among them, another solution, such as Figure 2 As shown, a third-party player is used in the App, and the picture-in-picture page container uses the AVPlayer player. When the picture-in-picture switch is triggered, the third-party player is first paused and a frame of the current video is captured. Then the video playback address, playback progress, volume and other information are synchronized. Then the AVPlayer player is initialized, the captured frame is adapted to the picture-in-picture page container, the progress and volume of the AVPlayer player are set, and finally, after the player starts playing, the screenshot frame is removed.

[0060] In the above-mentioned prior art, the API capability provided by the iOS system can only display audio and video playback. Not only does the video interface have loading and waiting and unsmooth phenomena during the picture-in-picture switching process, but the playback interface interaction is completely restricted by the system and cannot display more page elements and interactive operations. There is a phenomenon that the interface information of the App playback we commonly use cannot be displayed and cannot be interacted with. For example: the gift effects, lucky bag draws, likes operations and other interactions in the live broadcast screen are not normally used by users.

[0061] It should be noted that the execution subject of the picture-in-picture display method provided in the embodiment of the present application may be a picture-in-picture display device, and the picture-in-picture display device may be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware, wherein the electronic device may be a server or a terminal, wherein the server in the embodiment of the present application may be a single server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application may be a smart phone, a personal computer, a tablet computer, a wearable device, an intelligent robot, or other intelligent hardware devices. In the following method embodiments, the execution subject is an electronic device as an example for explanation.

[0062] In one embodiment of the present application, Figure 3 As shown, a picture-in-picture display method is provided, and the method is applied to an electronic device as an example for description, including the following steps:

[0063] S11, receiving a picture-in-picture switching instruction corresponding to the target software.

[0064] The picture-in-picture switching instruction is used to instruct to display the interface corresponding to the target software in a picture-in-picture manner.

[0065] Optionally, when the target software in the electronic device plays a video based on a self-developed or third-party player, the electronic device can receive a picture-in-picture switching instruction corresponding to the target software input by the user. The target software can be an App related to video, live broadcast, etc., and the embodiment of the present application does not specifically limit the target software.

[0066] Among them, self-developed or third-party players: This player is more flexible and separates the entire player into: data layer, rendering layer, and interactive control layer. According to business requirements, the corresponding layers can be modified to achieve different functions.

[0067] Optionally, when the target software in the electronic device plays a video based on a self-developed or third-party player, the electronic device may also receive a picture-in-picture switching instruction corresponding to the target software sent by other devices.

[0068] The embodiment of the present application does not specifically limit the source of the picture-in-picture switching instruction corresponding to the target software received by the electronic device.

[0069] S12. According to the picture-in-picture switching instruction, run the picture-in-picture page container to display the interface corresponding to the target software in a picture-in-picture manner.

[0070] Specifically, after receiving the picture-in-picture switching instruction corresponding to the target software, the electronic device can control the picture-in-picture page container to run, thereby realizing the display of the interface corresponding to the target software in a picture-in-picture manner.

[0071] This step will be described in detail below.

[0072] S13, obtaining the video interface and interactive interface corresponding to the target software.

[0073] Among them, the interactive interface is displayed on the video interface.

[0074] Specifically, after receiving the picture-in-picture switching instruction corresponding to the target software and running the picture-in-picture page container, the electronic device can obtain the video interface and interactive interface corresponding to the target software in the corresponding player in the target software.

[0075] S14, controlling the video interface and the interactive interface to be in a keep-alive state.

[0076] In an optional implementation of the present application, the electronic device can control the video interface and the interactive interface to be in a keep-alive state by continuously refreshing the video interface and the interactive interface. That is, the electronic device can control the video interface and the interactive interface to be in the main field by continuously refreshing the video interface and the interactive interface, so as to receive the interactive instructions input by the user for the video interface and the interactive interface, and perform interactive operations on the interactive instructions input by the user.

[0077] Exemplarily, the electronic device may receive interactive instructions for lucky bag drawing and like operations input by the user, and complete the interactive operations based on the received interactive instructions.

[0078] This step will be described in detail below.

[0079] S15. Display a video interface and an interactive interface according to the picture-in-picture page container.

[0080] In an optional implementation, when controlling the video interface and the interactive interface to be in a keep-alive state, the electronic device can place a self-developed player or a third-party player into a picture-in-picture page container, and use the self-developed player or the third-party player to display the video interface and the interactive interface.

[0081] This step will be described in detail below.

[0082] The picture-in-picture display method provided by the embodiment of the present invention receives the picture-in-picture switching instruction corresponding to the target software, and runs the picture-in-picture page container according to the picture-in-picture switching instruction, so that the interface corresponding to the target software can be displayed in a picture-in-picture manner. Then, the video interface and the interactive interface corresponding to the target software are obtained, and the video interface and the interactive interface are controlled to be in a keep-alive state, so that the video interface and the interactive interface can feedback the user's interactive operation at any time, so that more page elements and interactive operations can be displayed. Then, according to the picture-in-picture page container, the video interface and the interactive interface are displayed, so that more page elements and interactive operations can be displayed, ensuring that the user's interactive operation can be completed. The above method, by controlling the video interface and the interactive interface corresponding to the target software to be in a keep-alive state, so that all the contents displayed by the interface of the target software can be displayed in a picture-in-picture manner, and the contents displayed by the interface of the target software are not selectively displayed. Thereby ensuring that the user can perform the same interactive operation on the content displayed in the picture-in-picture as in the target software. In addition, since the video interface and the interactive interface are not paused or captured during the picture-in-picture display, the smoothness of the process of displaying the video interface and the interactive interface in the picture-in-picture manner is guaranteed, avoiding the occurrence of lag.

[0083] In one embodiment of the present application, Figure 4 As shown, a picture-in-picture display method is provided, and the method is applied to an electronic device as an example for description, including the following steps:

[0084] S21: Initialize a picture-in-picture page container and a player in the picture-in-picture page container.

[0085] Specifically, the electronic device may clear other contents in the picture-in-picture page container, initialize some parameters in the picture-in-picture page container, and clear the contents played by the player in the picture-in-picture page container.

[0086] For example, the picture-in-picture page container may be AVPictureInPictureController. AVPictureInPictureController is a container with PIP (picture-in-picture) capability provided by Apple. It can only display audio and video through the AVPlayer player, and cannot display other custom interfaces.

[0087] The player can be AVPlayer. AVPlayer is a player provided by Apple specifically for playing audio and video. The player does not have a clear data layer, rendering layer, and interactive control layer, and developers cannot modify it.

[0088] S22: Modify specific parameters corresponding to the picture-in-picture page container to prohibit interactive operations corresponding to the picture-in-picture page container.

[0089] Specifically, the electronic device may modify specific parameters corresponding to the interactive operation in the picture-in-picture page container through the KVC method, and prohibit the interactive operation corresponding to the picture-in-picture page container.

[0090] Exemplarily, the interactive operations corresponding to the picture-in-picture page container may include operations such as zooming in and closing.

[0091] Among them, KVC (Key-value-coding) is an informal protocol that provides a mechanism to indirectly access the properties of an object, rather than calling setter and getter methods. That is, in iOS development, developers can directly access the properties of an object through the key name, or assign values ​​to the properties of an object without calling explicit access methods.

[0092] S23, receiving a picture-in-picture switching instruction corresponding to the target software.

[0093] The picture-in-picture switching instruction is used to instruct to display the interface corresponding to the target software in a picture-in-picture manner.

[0094] For more information about this step, see Figure 3 The introduction of S11 will not be elaborated here.

[0095] S24. According to the picture-in-picture switching instruction, the picture-in-picture page container is run to display the interface corresponding to the target software in a picture-in-picture manner.

[0096] In an optional implementation manner of the present application, the above S24 “running the picture-in-picture page container according to the picture-in-picture switching instruction” may include the following steps:

[0097] S241. According to the picture-in-picture switching instruction, control the player to play wirelessly in a loop to run the picture-in-picture page container.

[0098] Specifically, the electronic device can control the player to wirelessly loop play according to the picture-in-picture switching instruction, thereby controlling the operation of the picture-in-picture page container.

[0099] S242. Set the volume of the player to mute.

[0100] Specifically, the electronic device can set the volume of the player to mute by adjusting the volume parameter corresponding to the player to 0.

[0101] S25, obtaining the video interface and interactive interface corresponding to the target software.

[0102] Among them, the interactive interface is displayed on the video interface.

[0103] For more information about this step, see Figure 3 The introduction of S13 will not be repeated here.

[0104] S26, controlling the video interface and the interactive interface to be in a keep-alive state.

[0105] In an optional implementation manner of the present application, the above S26 “controlling the video interface and the interactive interface to be in a keep-alive state” may include the following steps:

[0106] S261, setting a loop mechanism for the target software and setting a timer for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state.

[0107] Specifically, the electronic device may set a loop mechanism for the target software, and then set a timer for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state.

[0108] The loop mechanism can be NSRunLoop. NSRunLoop: RunLoop is an event processing loop, which is a mechanism that allows a thread to process events at any time without exiting. Its purpose is to allow the thread to be awakened immediately to perform tasks when a message arrives, and to put the thread to sleep to avoid resource occupation when there is no message.

[0109] The function of the timer is to wake up the thread corresponding to the target software at set intervals. The timer setting time can be 0.1S or 0.2S, and the application does not specifically limit the time set by the timer.

[0110] S27. Display a video interface and an interactive interface according to the picture-in-picture page container.

[0111] For more information about this step, see Figure 3 The introduction of S15 will not be elaborated here.

[0112] The picture-in-picture display method provided by the embodiment of the present invention initializes a picture-in-picture page container and a player in the picture-in-picture page container, thereby ensuring that the picture-in-picture page container and the player in the picture-in-picture page container can operate normally, and further can realize displaying the interface corresponding to the target software in a picture-in-picture manner, and then, modifying specific parameters corresponding to the picture-in-picture page container, prohibiting interactive operations corresponding to the picture-in-picture page container, thereby avoiding confusion between the interactive operations corresponding to the picture-in-picture page container and the interactive operations corresponding to the interactive interface of the target software, resulting in failure to accurately complete the user's interactive instructions.

[0113] In addition, according to the picture-in-picture switching instruction, the player is controlled to play wirelessly in a loop, ensuring that the picture-in-picture page container can run normally. Then, the volume of the player is set to mute to avoid the player's volume interfering with the volume of the target software.

[0114] The picture-in-picture display method provided by the embodiment of the present invention sets a loop mechanism for the target software and sets a timer for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state. This ensures that the thread corresponding to the target software is in a keep-alive state, and can respond to the user's interactive operation in a timely manner to complete the user's interactive operation.

[0115] In one embodiment of the present application, Figure 5 As shown, a picture-in-picture display method is provided, and the method is applied to an electronic device as an example for description, including the following steps:

[0116] S31, receiving a picture-in-picture switching instruction corresponding to the target software.

[0117] The picture-in-picture switching instruction is used to instruct to display the interface corresponding to the target software in a picture-in-picture manner.

[0118] For more information about this step, see Figure 4 The introduction of S23 will not be elaborated here.

[0119] S32. According to the picture-in-picture switching instruction, run the picture-in-picture page container to display the interface corresponding to the target software in a picture-in-picture manner.

[0120] For more information about this step, see Figure 4 The introduction of S24 will not be elaborated here.

[0121] S33, obtaining a video interface and an interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface.

[0122] For more information about this step, see Figure 4 The introduction of S25 will not be elaborated here.

[0123] S34, controlling the video interface and the interactive interface to be in a keep-alive state.

[0124] For more information about this step, see Figure 4 The introduction of S26 will not be elaborated here.

[0125] S35. Display the video interface and the interactive interface according to the picture-in-picture page container.

[0126] In an optional implementation manner of the present application, the above S35 “displaying the video interface and the interactive interface according to the picture-in-picture page container” may include the following steps:

[0127] S351. Obtain a visualization page display container.

[0128] Among them, the visual page display container is used to display the interface.

[0129] Specifically, the electronic device can take out the visualization page display container, wherein the visualization page display container can be the first window or other. The embodiment of the present application does not specifically limit the visualization page display container.

[0130] S352: Add the video interface and the interactive interface to the visualization page display container to display the video interface and the interactive interface.

[0131] In an optional implementation manner of the present application, the above S352 “adding the video interface and the interactive interface to the visualization page display container to display the video interface and the interactive interface” may include the following steps:

[0132] (1) Obtain the corresponding aspect ratios of the video interface and the interactive interface.

[0133] (2) According to the aspect ratio and the size of the visualization page display container, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

[0134] Specifically, the electronic device may obtain the video interface and the interactive interface, and calculate the height-to-width ratios corresponding to the video interface and the interactive interface according to the video interface and the interactive interface.

[0135] Then, the electronic device reduces the video interface and the interactive interface by a preset multiple according to their corresponding aspect ratios, and places the reduced video interface and the interactive interface into a visual page display container to display the video interface and the interactive interface.

[0136] In an optional implementation of the present application, the above step (2) "adding the video interface and the interactive interface to the visual page display container according to the aspect ratio and the size of the visual page display container, and displaying the video interface and the interactive interface" may include the following steps:

[0137] (21) According to the aspect ratio and the size of the visualization page display container, determine the target height and target width corresponding to adding the video interface and the interactive interface to the visualization page display container.

[0138] (22) According to the target height and target width, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

[0139] Specifically, the electronic device may determine the target height and target width corresponding to adding the video interface and the interactive interface to the visual page display container according to the aspect ratio and the size of the visual page display container.

[0140] Then, the electronic device adds the video interface and the interactive interface to the visualization page display container according to the target height and the target width, and displays the video interface and the interactive interface.

[0141] S353: Use the visualization page display container to cover the picture-in-picture page container to display only the video interface and the interactive interface.

[0142] Specifically, the electronic device may cover the picture-in-picture page container with the visual page display container to display only the video interface and the interactive interface.

[0143] The picture-in-picture display method provided by the embodiment of the present invention obtains a visual page display container. The aspect ratio corresponding to the video interface and the interactive interface is obtained, and according to the aspect ratio and the size of the visual page display container, the target height and target width corresponding to adding the video interface and the interactive interface to the visual page display container are determined, thereby ensuring the accuracy of the determined target height and target width. Then, according to the target height and target width, the video interface and the interactive interface are added to the visual page display container to display the video interface and the interactive interface, thereby ensuring the accuracy of the visual page display container in displaying the video interface and the interactive interface. Then, the visual page display container is used to cover the picture-in-picture page container to display only the video interface and the interactive interface, so that only the video interface and the interactive interface corresponding to the target software can be displayed in the picture-in-picture interface, thereby ensuring that the user only sees the video interface and the interactive interface corresponding to the target software in the picture-in-picture.

[0144] In order to better introduce the picture-in-picture display method provided in the embodiment of the present application, Figure 6As shown, an embodiment of the present application provides a flow chart of a picture-in-picture display method. Exemplarily, when the App is in the foreground, the self-developed or third-party player in the live page container in the App plays the live broadcast or video corresponding to the App. And before receiving the picture-in-picture display instruction, initialize the picture-in-picture page container and the AVPlayer player in the picture-in-picture page container. After receiving the picture-in-picture display instruction, trigger the App to switch to background operation. At this time, the electronic device starts the App's keep-alive capability and takes out the user interaction interface view, that is, the video interface and interaction interface corresponding to the App. Adapt the video interface and interaction interface.

[0145] When the App is in the background, the AVPlayer player starts wireless loop playback in the picture-in-picture page container. When the user triggers the corresponding interactive interface of the App, the interface view event is triggered and the touch event processing mechanism is activated.

[0146] like Figure 7 The figure shows the event processing at each time in the life cycle of the picture-in-picture page container (PIP). Before the PIP starts, the first window is taken out, the video interface and interactive interface corresponding to the App are added to the corresponding one of the App, and the interactive capabilities of the PIP part are disabled. When the PIP starts, a timer is initialized for the App, and NSRunLoop is added to start the App's keep-alive capability. When the PIP ends, NSRunLoop stops, and the video interface and interactive interface corresponding to the App are switched to the App page.

[0147] It should be understood that although Figure 3-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3-5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0148] like Figure 8 As shown, this embodiment provides a picture-in-picture display device, including:

[0149] The receiving module 41 is used to receive a picture-in-picture switching instruction corresponding to the target software; the picture-in-picture switching instruction is used to instruct to display the interface corresponding to the target software in a picture-in-picture manner;

[0150] The running module 42 is used to run the picture-in-picture page container according to the picture-in-picture switching instruction to display the interface corresponding to the target software in a picture-in-picture manner;

[0151] The acquisition module 43 is used to acquire the video interface and the interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface;

[0152] A control module 44, used to control the video interface and the interactive interface to be in a keep-alive state;

[0153] The display module 45 is used to display the video interface and the interactive interface according to the picture-in-picture page container.

[0154] like Fig. 9 As shown, this embodiment provides a picture-in-picture display device, further comprising:

[0155] An initialization module 46, used to initialize the picture-in-picture page container and the player in the picture-in-picture page container;

[0156] The modification module 47 is used to modify specific parameters corresponding to the picture-in-picture page container to prohibit interactive operations corresponding to the picture-in-picture page container.

[0157] In one embodiment of the present application, the operating module 42 is specifically used to control the player to wirelessly loop play according to the picture-in-picture switching instruction to run the picture-in-picture page container; and set the volume of the player to mute.

[0158] In one embodiment of the present application, the control module 44 is specifically used to set a loop mechanism for the target software and set a timer for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state.

[0159] In one embodiment of the present application, the above-mentioned display module 45 is specifically used to obtain a visual page display container, which is used to display the interface; add the video interface and the interactive interface to the visual page display container to display the video interface and the interactive interface; and use the visual page display container to cover the picture-in-picture page container to display only the video interface and the interactive interface.

[0160] In one embodiment of the present application, the above-mentioned display module 45 is specifically used to obtain the aspect ratio corresponding to the video interface and the interactive interface; according to the aspect ratio and the size of the visualization page display container, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

[0161] In one embodiment of the present application, the above-mentioned display module 45 is specifically used to determine the target height and target width corresponding to adding the video interface and the interactive interface to the visual page display container according to the aspect ratio and the size of the visual page display container; according to the target height and target width, the video interface and the interactive interface are added to the visual page display container to display the video interface and the interactive interface.

[0162] For the specific limitations and beneficial effects of the picture-in-picture display device, please refer to the limitations of the picture-in-picture display method above, which will not be repeated here. Each module in the above-mentioned picture-in-picture display device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0163] The embodiment of the present invention also provides an electronic device having the above Figure 8 as well as Fig. 9 Picture-in-picture display device shown.

[0164] like Fig.10 As shown, Fig.10 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Fig.10 As shown, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, a memory 54, and at least one communication bus 52. The communication bus 52 is used to realize the connection and communication between these components. The communication interface 53 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a wireless interface. The memory 54 may be a high-speed RAM memory (Random Access Memory) or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 54 may optionally be at least one storage device located away from the aforementioned processor 51. The processor 51 may be combined with Figure 8 or Fig. 9 In the described device, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 to execute any of the above method steps.

[0165] The communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 52 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0166] Among them, the memory 54 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 54 may also include a combination of the above types of memory.

[0167] The processor 51 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.

[0168] The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0169] Optionally, the memory 54 is also used to store program instructions. The processor 51 can call the program instructions to implement the present application Figures 3 to 5 The picture-in-picture display method shown in the embodiment.

[0170] The embodiment of the present invention further provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the picture-in-picture display method in any of the above method embodiments. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above types of memory.

[0171] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A picture-in-picture display method, characterized in that: include: Initializing a picture-in-picture page container and a player in the picture-in-picture page container; Modify specific parameters corresponding to the picture-in-picture page container in a KVC manner to prohibit interactive operations corresponding to the picture-in-picture page container; Receiving a picture-in-picture switching instruction corresponding to the target software; the picture-in-picture switching instruction is used to instruct to display the interface corresponding to the target software in a picture-in-picture manner; According to the picture-in-picture switching instruction, a picture-in-picture page container is run to realize displaying the interface corresponding to the target software in a picture-in-picture manner; Obtaining a video interface and an interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface; Controlling the video interface and the interactive interface to be in a keep-alive state; Displaying the video interface and the interactive interface according to the picture-in-picture page container; The step of running a picture-in-picture page container according to the picture-in-picture switching instruction includes: According to the picture-in-picture switching instruction, the player is controlled to play in an infinite loop to run the picture-in-picture page container; Setting the volume of the player to mute; The controlling the video interface and the interactive interface to be in a keep-alive state includes: Setting a loop mechanism for the target software and setting a timer for the loop mechanism to control the thread corresponding to the target software to be in a keep-alive state; wherein the loop mechanism is NSRunLoop; The displaying of the video interface and the interactive interface according to the picture-in-picture page container includes: Obtaining a visualization page display container, wherein the visualization page display container is used to display an interface; Adding the video interface and the interactive interface to the visualization page display container to display the video interface and the interactive interface; The visual page display container is used to cover the picture-in-picture page container to display only the video interface and the interactive interface.

2. The method according to claim 1, characterized in that The step of adding the video interface and the interactive interface to the visualization page display container and displaying the video interface and the interactive interface includes: Obtaining the height-to-width ratios of the video interface and the interactive interface; According to the aspect ratio and the size of the visualization page display container, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

3. The method according to claim 2, characterized in that The adding the video interface and the interactive interface to the visual page display container according to the aspect ratio and the size of the visual page display container, and displaying the video interface and the interactive interface, comprises: Determine, according to the aspect ratio and the size of the visualization page display container, a target height and a target width corresponding to adding the video interface and the interactive interface to the visualization page display container; According to the target height and the target width, the video interface and the interactive interface are added to the visualization page display container to display the video interface and the interactive interface.

4. A picture-in-picture display device, characterized in that: include: An initialization module, used to initialize a picture-in-picture page container and a player in the picture-in-picture page container; A modification module, used to modify specific parameters corresponding to the picture-in-picture page container in a KVC manner, and prohibit interactive operations corresponding to the picture-in-picture page container; A receiving module, used for receiving a picture-in-picture switching instruction corresponding to a target software; the picture-in-picture switching instruction is used for instructing to display an interface corresponding to the target software in a picture-in-picture manner; A running module, configured to run a picture-in-picture page container according to the picture-in-picture switching instruction, so as to display the interface corresponding to the target software in a picture-in-picture manner; wherein, running the picture-in-picture page container according to the picture-in-picture switching instruction includes: controlling the player to play in an infinite loop according to the picture-in-picture switching instruction, so as to run the picture-in-picture page container; and setting the volume of the player to mute; An acquisition module, used to acquire a video interface and an interactive interface corresponding to the target software; wherein the interactive interface is displayed on the video interface; A control module, used for controlling the video interface and the interactive interface to be in a keep-alive state; wherein, the controlling the video interface and the interactive interface to be in a keep-alive state comprises: setting a loop mechanism for the target software, and setting a timer for the loop mechanism, and controlling the thread corresponding to the target software to be in a keep-alive state; wherein, the loop mechanism is NSRunLoop; A display module, used to display the video interface and the interactive interface according to the picture-in-picture page container; wherein, displaying the video interface and the interactive interface according to the picture-in-picture page container includes: obtaining a visualization page display container, the visualization page display container is used to display the interface; adding the video interface and the interactive interface to the visualization page display container, and displaying the video interface and the interactive interface; The visual page display container is used to cover the picture-in-picture page container to display only the video interface and the interactive interface.

5. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer instructions, and the processor executes the picture-in-picture display method according to any one of claims 1 to 3 by executing the computer instructions.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the picture-in-picture display method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Android-based floating video playing method

    CN108366301A

  • Interaction method and device based on cloud game, electronic equipment and readable storage medium

    CN113457123A