Interface switching method and apparatus, electronic device, and storage medium

By playing the preview video in the first interface and obtaining the target frame image during interface switching, and playing the live video after loading in the second interface is completed, the problem of lag and black screen in the live interface switching is solved, and the smoothness of the interface switching is improved Spend.

WO2024255894A1PCT designated stage expired Publication Date: 2024-12-19BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/099433
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-14
Filing Date
2024-06-14
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

In Internet applications, there are problems of lag and black screen when switching live broadcast interfaces, which affects the smoothness of interface switching.

Method used

By playing the preview video of the target live room in the first interface, and pulling the live stream data after receiving the trigger command, obtaining the target frame image, displaying it in the second interface until the live video is loaded, avoiding the live video in the next interface. A black screen appears during interface switching.

Benefits of technology

It improves the smoothness of the interface switching process, prevents the black screen from switching from preview video to live video, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024099433_19122024_PF_FP_ABST
    Figure CN2024099433_19122024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide an interface switching method and apparatus, an electronic device, and a storage medium. The method comprises: playing in a first interface a preview video of a target livestreaming room, and when a trigger instruction for the preview video is received, pulling livestream data of the target livestreaming room; acquiring a target image frame of the target livestreaming room by means of the livestream data of the target livestreaming room; and displaying the target image frame in a second interface of a target application program until a livestreaming video of the target livestreaming room has been loaded, and playing in the second interface the livestreaming video of the target livestreaming room. In the process of jumping from the first interface where the preview video is located to the second interface where the livestreaming video is located, the corresponding target image frame is obtained by means of the livestream data, and the target image frame is displayed before a screen image cache has been loaded in the second interface, thereby avoiding black screen in the process of jumping from the first interface to the second interface, and improving the smoothness of the interface switching process.
Need to check novelty before this filing date? Find Prior Art

Description

Interface switching method, device, electronic device and storage medium

[0001] This application claims priority to the Chinese invention patent application entitled “Interface switching method, device, electronic device and storage medium” and application number 202310709132.0 filed on June 14, 2023. The entire contents of that application are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present disclosure relate to the field of Internet technology, and in particular to an interface switching method, device, electronic device, and storage medium. Background Art

[0003] In Internet applications, by setting up a live broadcast component in the application interface, a preview interface of the live video is formed in a specific area, so that the application can display the basic information within the application while playing the preview video of a specific live broadcast room. Afterwards, the user can switch to the corresponding live broadcast room interface by triggering the live broadcast component, thereby realizing quick switching of the video interface.

[0004] However, in actual application, when switching from the preview interface to the live broadcast room interface, there are problems of freeze and black screen, which affect the smoothness of the interface switching process.

[0005] Summary of the Invention

[0006] The embodiments of the present disclosure provide an interface switching method, device, electronic device, and storage medium to overcome the problems of freeze and black screen during interface switching.

[0007] In a first aspect, an embodiment of the present disclosure provides an interface switching method, comprising: playing a preview video of a target live broadcast room in a first interface, and pulling live stream data of the target live broadcast room after receiving a trigger instruction for the preview video; obtaining a target frame image of the target live broadcast room through the live stream data of the target live broadcast room; displaying the target frame image in a second interface until the live video of the target live broadcast room is loaded, and then playing the live video of the target live broadcast room in the second interface.

[0008] In a second aspect, an embodiment of the present disclosure provides an interface switching method, comprising: playing the live video of a target live room in a second interface of a target application, and pulling the live stream data of the target live room after receiving an exit instruction for the target live room; obtaining a target frame image of the target live room through the live stream data of the target live room; displaying the target frame image in a first interface of the target application until the preview video of the target live room is loaded, and then playing the preview video of the target live room in the first interface.

[0009] In a third aspect, an embodiment of the present disclosure provides an interface switching device, comprising: a first playback unit, for playing a preview video of a target live broadcast room in a first interface, and pulling live stream data of the target live broadcast room after receiving a trigger instruction for the preview video; a first processing unit, for obtaining a target frame image of the target live broadcast room through the live stream data of the target live broadcast room; a second playback unit, for displaying the target frame image in a second interface until the live video of the target live broadcast room is loaded, and then playing the live video of the target live broadcast room in the second interface.

[0010] In a fourth aspect, an embodiment of the present disclosure provides an interface switching device, comprising: a third playback unit, which plays the live video of a target live room in a second interface of a target application, and pulls the live stream data of the target live room after receiving an exit instruction for the target live room; a second processing unit, which obtains a target frame image of the target live room through the live stream data of the target live room; a fourth playback unit, which displays the target frame image in a first interface of the target application until the preview video of the target live room is loaded, and then plays the preview video of the target live room in the first interface.

[0011] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the interface switching method described in the first aspect and various possible designs of the first aspect, or to implement the interface switching method described in the second aspect and various possible designs of the second aspect.

[0012] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions. When the processor executes the computer execution instructions, the interface switching method described in the first aspect and various possible designs of the first aspect is implemented, or the interface switching method described in the second aspect and various possible designs of the second aspect is implemented.

[0013] In the seventh aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the interface switching method described in the first aspect and various possible designs of the first aspect, or implements the interface switching method described in the second aspect and various possible designs of the second aspect.

[0014] The interface switching method, device, electronic device and storage medium provided in this embodiment play the preview video of the target live broadcast room in the first interface, and after receiving the trigger instruction for the preview video, pull the live stream data of the target live broadcast room; obtain the target frame image of the target live broadcast room through the live stream data of the target live broadcast room; display the target frame image in the second interface until the live video of the target live broadcast room is loaded, and then play the live video of the target live broadcast room in the second interface. In the process of jumping from the first interface where the preview video is located to the second interface where the live video is located, the corresponding target frame image is obtained through the live stream data, and the target frame image is displayed before the screen image cache is loaded in the second interface, thereby avoiding a black screen during the jump from the first interface to the second interface and increasing the smoothness of the interface switching process. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0016] FIG1 is a diagram of an application scenario of the interface switching method provided by an embodiment of the present disclosure;

[0017] FIG2 is a flow chart of a method for switching interfaces according to an embodiment of the present disclosure;

[0018] FIG3 is a schematic diagram of a process of switching from a first interface to a second interface of a target application provided by an embodiment of the present disclosure;

[0019] FIG4 is a second flow chart of the interface switching method provided by an embodiment of the present disclosure;

[0020] FIG5 is a schematic diagram of a process for generating a target frame image provided by an embodiment of the present disclosure;

[0021] FIG6 is a schematic diagram of another process for generating a target frame image provided by an embodiment of the present disclosure;

[0022] FIG7 is a flowchart of a specific implementation method of step S206 in the embodiment shown in FIG4 ;

[0023] FIG8 is a flowchart of a specific implementation of step S209 in the embodiment shown in FIG4 ;

[0024] FIG9 is a third flow chart of the interface switching method provided in an embodiment of the present disclosure;

[0025] FIG10 is a structural block diagram of an interface switching device provided by an embodiment of the present disclosure;

[0026] FIG11 is a structural block diagram of another interface switching device provided by an embodiment of the present disclosure;

[0027] FIG12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;

[0028] FIG13 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0030] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0031] The following explains the application scenarios of the embodiments of the present disclosure:

[0032] Figure 1 is an application scenario diagram of the interface switching method provided by an embodiment of the present disclosure. The interface switching method provided by an embodiment of the present disclosure can be applied to the scenario of entering and exiting the live broadcast room in an application. More specifically, the interface switching method provided by this embodiment can be applied to the application scenario of entering and exiting the live broadcast room in an application based on the Android operating system. As shown in Figure 1, the method provided by an embodiment of the present disclosure can be applied to a terminal device, such as a smart phone, on which applications such as live broadcast and video are running. In the process of the terminal device running the above-mentioned application, a preview interface 11 of the target live broadcast room will be displayed in the main interface of the application, and a preview video 12 of the target live broadcast room will be played through the preview interface 11. Afterwards, when the user clicks on the preview interface 11, the terminal device jumps from the main interface of the application to the live broadcast room interface of the target live broadcast room, and plays the live video 13 in the live broadcast room interface of the target live broadcast room, thereby realizing the process of entering the live broadcast room interface from the preview interface in the main interface of the application. Similarly, when the user enters the exit command (for example, clicking the exit control in the live broadcast room interface), the terminal device returns from the live broadcast room interface to the main interface of the application, and can continue to play the preview interface of the target live broadcast room through the preview interface located in the main interface, thereby realizing seamless switching between the preview interface in the main interface and the live broadcast room interface, and realizing smooth entry and exit of the live broadcast room.

[0033] However, in actual use, taking the Android operating system as an example, to display the preview interface of the live broadcast room in the main interface of the application, it is necessary to activate the drawing surface view (SurfaceView) corresponding to the preview interface, then cache the image data of the preview video corresponding to the target live broadcast room in the screen image cache corresponding to the drawing surface view, and use the drawing surface (Surface) as a handle to access the screen image cache, thereby realizing the image drawing of the preview video; and after entering the live broadcast room interface, it is necessary to close the drawing surface view corresponding to the preview interface and destroy the screen image cache in the drawing surface view corresponding to the preview interface. Then, the drawing surface view corresponding to the live broadcast room interface is activated again, and the image data of the live broadcast video corresponding to the target live broadcast room is cached in the screen image cache corresponding to the drawing surface view and drawn. The above process is executed by the main thread (UI thread) of the application, that is, the main thread needs to "switch" between the two drawing surface views, but this "switching" process is time-consuming. Due to the time-consuming "switching" process, the existing solutions in the art will experience black screen and freezes when entering the live broadcast room interface from the preview interface, affecting the smoothness of entering and exiting the live broadcast room. The embodiments of the present disclosure provide an interface switching method to solve the above problems.

[0034] Referring to FIG2 , FIG2 is a flow chart of the interface switching method provided in an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device, and the interface switching method includes:

[0035] Step S101: Play the preview video of the target live broadcast room in the first interface, and pull the live broadcast stream data of the target live broadcast room when a trigger instruction for the preview video is received.

[0036] Exemplarily, referring to the application scenario diagram shown in FIG1 , the execution subject of the interface switching method provided in this embodiment can be a terminal device, such as a smart phone. A target application is installed in the terminal device, and the target application is, for example, a live broadcast software client, a video software client, etc. The interface switching method provided in this embodiment can be stored in the target application in the form of program code or functional modules. When the terminal device runs the above-mentioned target application, it executes the interface switching solution provided in this embodiment. More specifically, the method provided in this embodiment is applied to the application scenario of entering the live broadcast room interface.

[0037] Specifically, after running the target application, the terminal device displays the first interface. The first interface can be the main interface or the lower-level functional interface of the target application, or it can be the video preview interface for playing videos in the main interface or the lower-level functional interface of the target application. The terminal device plays the preview video of the target live broadcast room through the first interface. The preview video has the same content as the live video currently playing in the target live broadcast room, and the video playback progress can be the same or delayed. The preview video and the live video played in the target live broadcast room are generated based on the same live stream data, that is, after decoding and rendering the live stream data of the target live broadcast room, the preview video is generated and played in the first interface. Since the role of the preview video is to provide the user with a preview of the live broadcast room content while displaying the content in the main interface and the lower-level functional interface of the target application, the preview video usually has a lower bit rate and resolution than the live video in the live broadcast room, or only displays images without playing sound. Of course, the preview video can also be exactly the same as the live video in the live broadcast room as needed, which is not specifically limited here. The first interface in this embodiment implements the playback function of the preview video of the target live broadcast room based on the corresponding video playback component. Before playing the preview video of the target live broadcast, it also includes the initialization of the video playback component, obtaining the video stream of the target live broadcast room, and image rendering and caching steps. The specific implementation method of playing the preview video of the target live broadcast room in the first interface will not be repeated here.

[0038] Furthermore, after the preview video of the target live broadcast room is displayed, if the user is interested in the live broadcast content of the target live broadcast room based on the preview video, the user will trigger the interface jump by clicking or other operations, that is, input a trigger instruction for the preview video, so that the terminal device jumps to the live broadcast room interface corresponding to the target live broadcast room. Specifically, when the terminal device receives the trigger instruction for the preview video, it first pulls the live broadcast stream data of the target live broadcast room to perform a subsequent screenshot process based on the live broadcast stream data. Among them, since the preview video of the target live broadcast room itself requires the corresponding live broadcast stream data to be played, in a possible implementation method, the terminal device always continuously obtains the live broadcast stream data of the target live broadcast room. Pulling the live broadcast stream data of the target live broadcast room means that when the terminal device receives the trigger instruction for the preview video, it obtains the latest acquired live broadcast stream data based on the identifier of the target live broadcast room, and performs a subsequent screenshot process based on the latest acquired live broadcast stream data.

[0039] Step S102: Obtain a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room.

[0040] Exemplarily, after obtaining the live streaming data of the target live broadcast room, the live streaming data is processed, that is, the live streaming data is rendered into corresponding image frames and intercepted, and the latest image frame obtained therein is obtained, that is, the target frame image. Among them, the live streaming data is decoded and rendered into a screen image cache, and accessed through a drawing surface (Surface). The specific implementation process is a prior art and will not be repeated here. After obtaining the screen image cache, in a possible implementation method, the image interception of the live streaming data is implemented through a target function built into the target application, thereby obtaining the current frame screenshot. Specifically, the target function is a custom screenshot function, which includes a pixel copy (PixelCopy) function. Among them, the pixel copy function can be called a pixel copy (PixelCopy) interface, which is an official API interface provided by the Android system. Through the pixel copy interface, with the drawing surface (Surface) as the input parameter, a screenshot of the screen image cache can be implemented, that is, a screenshot rendered for SurfaceView, that is, the target frame image, and its corresponding data format is a bitmap (bitmap). More specifically, the pixel copy function is implemented by passing the message handler object corresponding to the main thread and using the message handler object to post a callback message to execute the corresponding screenshot function. The specific implementation method of the pixel copy function is existing in the art and will not be detailed here.

[0041] Step S103: Display the target frame image in the second interface until the live video of the target live broadcast room is loaded, and then play the live video of the target live broadcast room in the second interface.

[0042] For example, because the terminal device responds to the trigger instruction and jumps to the second interface, it is necessary to rebuild the loading screen image cache on the second interface to realize the display of the image content in the drawing surface view, that is, there is a "gap period" after the first interface disappears and before the live video is played on the second interface, which leads to the visual appearance of a "black screen". Before the second interface of the target application completes loading the screen image cache, that is, before the live video of the target live broadcast room is loaded, the content of the live video cannot be displayed in the second interface. Therefore, the target frame image obtained in the previous step is temporarily displayed in the second interface, so that the second interface visually displays the content of the live video, avoiding the visual effect of a black screen. Until the second interface completes loading the screen image cache, the live video of the corresponding target live broadcast room is played on the second interface, realizing the process of switching from the first interface to the second interface.

[0043] Figure 3 is a schematic diagram of a process of switching from a first interface of a target application to a second interface provided by an embodiment of the present disclosure. As shown in Figure 3, in the main interface of the target application, a first interface is displayed based on a live broadcast control, and a preview video of the target live broadcast room is played in the first interface; after the user clicks on the first interface, the terminal device first jumps to the second interface, that is, the live broadcast room interface of the target live broadcast room, and displays the target frame image obtained through the live broadcast stream data of the target live broadcast room in the second interface, and at the same time loads the screen image cache of the target live broadcast room (shown in the figure as loading the screen image cache), until the screen image cache is loaded, and then the live video of the target live broadcast room starts to be played in the second interface, thereby completing the process of switching from the first interface to the second interface.

[0044] In this embodiment, the preview video of the target live broadcast room is played in the first interface, and upon receiving a trigger instruction for the preview video, the live stream data of the target live broadcast room is pulled; the target frame image of the target live broadcast room is obtained through the live stream data of the target live broadcast room; the target frame image is displayed in the second interface of the target application until the live video of the target live broadcast room is loaded, and then the live video of the target live broadcast room is played in the second interface. In the process of jumping from the first interface where the preview video is located to the second interface where the live video is located, the corresponding target frame image is obtained through the live stream data, and the target frame image is displayed before the screen image cache is loaded in the second interface, thereby avoiding a black screen during the jump from the first interface to the second interface and increasing the smoothness of the interface switching process.

[0045] Referring to FIG4 , FIG4 is a second flow chart of the interface switching method provided by the embodiment of the present disclosure. Based on the embodiment shown in FIG2 , this embodiment further refines the process of obtaining the target frame image. The interface switching method includes:

[0046] Step S201: creating a first drawing surface in a first interface of a target application.

[0047] Step S202: downsample the live streaming data of the target live broadcast room to generate downsampled video data.

[0048] Step S203: Draw the downsampled video data on the first drawing surface to play the preview video of the target live broadcast room.

[0049] Exemplarily, after the target application is run, a first drawing surface is first created for the first interface for playing the preview video of the target live broadcast room. Specifically, the first drawing surface may refer to an object of a drawing surface view (SurfaceView object) located in the first interface. The process of creating and initializing SurfaceView is a prior art known to those skilled in the art and will not be described in detail here. Afterwards, the acquired live stream data of the target live broadcast room is downsampled, for example, by reducing the image resolution, frame rate, or bit rate, to generate data suitable for video preview, i.e., downsampled video data. Afterwards, based on the specific implementation method of SurfaceView, the downsampled video data is drawn, and the drawn image is displayed in the preview interface, thereby realizing the playback of the preview video of the target live broadcast room.

[0050] Step S204: When a trigger instruction for previewing the video is received, the live streaming data of the target live broadcast room is pulled, and a second drawing surface is created in the second interface of the target application.

[0051] Step S205: Create a renderer object through the main thread of the target application.

[0052] Step S206: Execute the target function through the renderer object to process the live stream data and obtain the target frame image. The target function includes a pixel copy function, which receives the rewritten target method to immediately generate the target frame image.

[0053] For example, when the terminal device receives a trigger instruction for the preview video, it triggers a jump to the live broadcast room interface, that is, the second interface. First, the second interface of the target application is started, and a second drawing surface is created in the second interface. The second drawing surface is similar to the first drawing surface, and both are objects of the drawing surface view (SurfaceView object). This process can be executed by the main thread of the target application, and the specific process steps are not repeated.

[0054] Afterwards, a renderer object (ThreadedRenderer) is created through the main thread of the target application, and the renderer object executes the corresponding target function to process the live stream data to obtain the target frame image. The target function is a custom function built into the target application, and the target function includes a pixel copy (PixelCopy) function. Through the pixel copy interface, with the drawing surface (Surface) as the input parameter, a screenshot of the screen image cache can be achieved, that is, a screenshot of the SurfaceView rendering, so as to obtain the target frame image. The data format corresponding to the target frame image is a bitmap. More specifically, the pixel copy function is implemented by passing in the message handler object (handler) corresponding to the main thread, and using the message handler object to make a callback message (post) to execute the corresponding screenshot function.

[0055] In the related art, in order to realize the screenshot of the drawing surface view (SurfaceView) through the pixel copy function, it is necessary to use the message handler object (handler) of the main thread as an input parameter, and use the message handler object to make a callback message (post) to realize the screenshot function. However, in the scenario of entering and exiting the live broadcast room, many complex and time-consuming logics and tasks need to be executed by the main thread. Therefore, the execution time of the callback message (post) becomes longer and cannot be controlled. This further leads to a delay in the implementation of the screenshot function. In the process of switching the target application from the first interface to the second interface, if the screenshot function is delayed, it will lead to the inability to generate and display the target frame image in time, and the black screen state cannot be blocked in time, resulting in problems such as freeze and reduced fluency, affecting the user experience.

[0056] In response to the above problem, in this embodiment, the target function includes a pixel copy function, and the pixel copy function realizes the immediate generation of the target frame image by receiving the overridden target method. Among them, the target method is, for example, a specific time message sending method (sendMessageAtTime method). By re-using the specific time message sending method, the screenshot function can be executed immediately, even if the execution message (runnable) in the callback message is executed immediately, without the need to execute the screenshot function through the message queue (MessageQueue) as in the solution in the related art, thereby avoiding the above-mentioned callback message (post) The execution time becomes longer and uncontrollable problem, so that the target frame image can be generated in time, and the black screen state in the process of switching from the first interface to the second interface is blocked.

[0057] FIG5 is a schematic diagram of a process for generating a target frame image provided by an embodiment of the present disclosure. As shown in FIG5 , in related art, the process for generating a target frame image includes:

[0058] S01. Execute ThreadedRenderer.copySurfaceInto.

[0059] S02. Execute listenerThread.post.

[0060] S03. Execute sendMessageDelayed.

[0061] S04. Execute sendMessageAtTime.

[0062] S05. Execute enqueueMessage.

[0063] S06. Execute the runnable through the message queue to generate a target frame image.

[0064] Among them, ThreadedRenderer is the renderer object, and copySurfaceInto is the target function. Furthermore, in the target function, listenerThread.post is called, listenerThread is the daemon thread, and post is the callback message. Furthermore, in the callback message, the sendMessageDelayed function is called, and sendMessageDelayed is a delayed sending function (interface). Through this delayed sending function, the execution message is inserted into the specified delayed position in the message queue. Furthermore, the delayed sending function is based on the sendMessageAtTime function, that is, the specific moment message sending method is implemented. The specific moment message sending method is used to send messages at a determined time. Afterwards, the enqueueMessage function in the sendMessageAtTime function is called. The enqueueMessage function is used to insert messages. Through the enqueueMessage function, the runnable (execution message) is inserted into the message queue and waits for execution. Finally, when the message queue executes runnable, the screenshot function is executed to generate the target frame image.

[0065] FIG6 is a schematic diagram of another process of generating a target frame image provided by an embodiment of the present disclosure. As shown in FIG5 , in this embodiment, the process of generating a target frame image includes:

[0066] S01. Execute ThreadedRenderer.copySurfaceInto.

[0067] S02. Execute listenerThread.post.

[0068] S03. Execute sendMessageDelayed.

[0069] S14. Execute the rewritten sendMessageAtTime.

[0070] S15. Execute runnable to generate a target frame image.

[0071] For example, in combination with the process diagram shown in reference Figure 5, after executing the same steps S01-S03, the rewritten sendMessageAtTime is executed, and the runnable is directly executed in sendMessageAtTime to immediately generate the target frame image without entering the message queue to wait, thereby avoiding the problems of excessively long time and uncontrollable time consumption in generating the target frame image in the above-mentioned related technologies.

[0072] In a possible implementation, as shown in FIG7 , a specific implementation of step S206 includes:

[0073] Step S2061: calling the drawing surface access interface to obtain the screen image cache based on the drawing surface view corresponding to the live stream data.

[0074] Step S2062: Taking the screen image cache and the specific moment message sending method of the message processor object as input, the pixel copy function is called to generate the target frame image, wherein the specific moment message sending method of the message processor object is overwritten, and the specific moment message sending method is used to immediately execute the execution message corresponding to the pixel copy function.

[0075] Exemplarily, the drawing surface view is surfaceView, and the screen image cache based on the drawing surface view is the cached image rendered by surfaceView. The drawing surface access interface is surfaceHolder, which stores a reference to the Surface object. Through the drawing surface access interface, the screen image cache corresponding to the Surface can be obtained and accessed. That is, the screen image cache is obtained through surfaceHolder, and the specific implementation method is to obtain the screen image cache by calling surfaceHolder.surface. Afterwards, the above-mentioned screen image cache and the specific moment message sending method are input, and the pixel copy function (PixelCopy.request) is called. Among them, the specific moment message sending method of the message processor object is overridden, and the specific moment message sending method is used to immediately execute the execution message corresponding to the pixel copy function. Among them, exemplarily, the overriding method of the specific moment message sending function includes:

[0076] override fun sendMessageAtTime(msg:Message?,uptimeMillis:Long

[0077] msg?.callback?.run()

[0078] return true)

[0079] The rewritten specific moment message sending function implemented by the above exemplary code implementation method can realize the immediate execution of the execution message corresponding to the pixel copy function, thereby achieving the purpose of generating the target frame image. The code implementation in the above code lines complies with the development language (such as Java) specifications for developing Android applications, and the specific meanings are not repeated one by one. At the same time, it should be noted that the rewritten specific moment message sending function can also include other implementation methods, which are not listed here one by one. Any implementation method that can realize the immediate execution of the execution message corresponding to the pixel copy function and the immediate execution of the screenshot function for SurfaceView is acceptable.

[0080] Step S207: Display the target frame image in the second interface of the target application.

[0081] Step S208: Obtain the screen image cache through the handle of the screen image cache.

[0082] Step S209: Draw the screen image cache in the second drawing surface to play the live video of the target live broadcast room.

[0083] For example, after obtaining the target frame image, the target frame image is displayed within the second interface. Simultaneously, a handle to the screen image cache, i.e., a surface, is obtained, and live video data is obtained through the surface. Specifically, the screen image cache handle can be called through a drawing surface access interface to obtain the screen image cache, i.e., the live video data used to implement live video playback. This process, i.e., loading the screen image cache, is described in detail in the embodiment shown in FIG. 2 and will not be further elaborated here. Subsequently, the screen image cache is drawn within the second drawing surface to achieve the purpose of playing the live video from the target live broadcast room.

[0084] For example, as shown in FIG8 , the specific implementation of step S209 includes:

[0085] Step S2091: Obtain the live video timestamp corresponding to the target frame image.

[0086] Step S2092: According to the live video timestamp, obtain the corresponding target video frame from the screen image cache.

[0087] Step S2093: Starting from the target video frame of the screen image cache, the screen image cache is drawn in the second drawing surface to play the live video of the target live broadcast room from the position of the target frame image.

[0088] Exemplarily, after obtaining the screen image cache, the video live broadcast timestamp corresponding to the target frame image is further obtained. The video live broadcast timestamp can be obtained through the reference information in the live streaming data. The specific implementation steps are described in detail. Then, according to the video live broadcast timestamp corresponding to the target frame image, a video frame whose playback timestamp is the same or similar to the video live broadcast timestamp is found from the screen image cache, that is, the target video frame. Since the target video frame and the timestamp corresponding to the target frame image are the same or similar, it can be ensured that the image content in the target video frame is the same or similar to the video content of the target frame image. Then, starting from the target video frame, the screen image cache is drawn in the second drawing surface, thereby achieving the effect of playing the live video of the target live room from the location of the target frame image. Through the above steps, when the terminal device switches from the first interface to the second interface, a seamless connection is formed between the preview video and the live video, avoiding the skipping of part of the live content due to the time-consuming switching process, and improving the viewing effect.

[0089] Referring to FIG9 , FIG9 is a flow chart of the third method for switching interfaces provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device, and the method for switching interfaces includes:

[0090] Step S301: In the second interface of the target application, the live video of the target live room is played, and after receiving the exit instruction for the target live room, the live stream data of the target live room is pulled.

[0091] Step S302: Obtain the target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room.

[0092] Step S303: Display the target frame image in the first interface until the preview video of the target live broadcast room is loaded, and then play the preview video of the target live broadcast room in the first interface.

[0093] Exemplarily, the interface switching method provided in this embodiment can be applied to the application scenario of launching a live broadcast room. Referring to the application scenario schematic diagram shown in Figure 1, the second interface is the live broadcast room interface within the target application. When the terminal device receives an exit instruction for the target live broadcast room, the terminal device pulls the live stream data of the target live broadcast room, and generates a target frame image based on the live stream data of the target live broadcast room. Then, it returns to the main page of the target application and displays the target frame image in the first interface within the main page, that is, the live broadcast room preview interface. After the preview video of the target live broadcast room is loaded, the preview video of the target live broadcast room is played in the first interface, thereby completing the process of switching from displaying the second interface to displaying the first interface, that is, the process of exiting the live broadcast room.

[0094] In one possible implementation, step S302 obtains the target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room, including: creating a renderer object through the main thread of the target application; executing the target function through the renderer object to process the live broadcast stream data to obtain the target frame image, wherein the target function includes a pixel copy function, and the pixel copy function realizes the immediate generation of the target frame image by receiving the rewritten target method.

[0095] In a possible implementation, the target method is a message sending method at a specific moment.

[0096] In one possible implementation, the steps in step S302: executing the target function, processing the live stream data, and obtaining the target frame image, the specific implementation method includes: calling the drawing surface access interface to obtain the screen image cache based on the drawing surface view corresponding to the live stream data; taking the screen image cache and the specific time message sending method of the message processor object as input, calling the pixel copy function to generate the target frame image, wherein the specific time message sending method of the message processor object is overwritten, and the specific time message sending method is used to immediately execute the execution message corresponding to the pixel copy function.

[0097] In this embodiment, the corresponding target frame image is obtained through live streaming data, and the target frame image is displayed before the first interface has loaded the screen image cache, thereby avoiding the problem of a black screen in the first interface during the jump from the second interface to the first interface, and increasing the smoothness of the interface switching process. Among them, the process of generating the target frame image (step S302) involved in this embodiment is the same as the specific implementation method of generating the target frame image in the embodiment corresponding to Figures 2 to 8, that is, the method of generating the target frame image in the embodiment corresponding to Figures 2 to 8 can also be partially or completely applied to this embodiment. The specific implementation method can refer to the relevant introduction in the embodiment corresponding to Figures 2 to 8, and will not be repeated here.

[0098] Corresponding to the interface switching method of the embodiments corresponding to Figures 2 to 8 above, Figure 10 is a structural block diagram of an interface switching device provided by an embodiment of the present disclosure. For ease of illustration, only the parts related to the embodiment of the present disclosure are shown. Referring to Figure 10, the interface switching device 4 includes:

[0099] The first playback unit 41 is configured to play the preview video of the target live broadcast room in the first interface, and pull the live stream data of the target live broadcast room upon receiving a trigger instruction for the preview video;

[0100] The first processing unit 42 is configured to obtain a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room;

[0101] The second playback unit 43 is configured to display the target frame image in the second interface of the target application until the live video of the target live broadcast room is loaded, and then play the live video of the target live broadcast room in the second interface.

[0102] In one embodiment of the present disclosure, the first processing unit 42 is specifically used to: create a renderer object through the main thread of the target application; execute the target function through the renderer object, process the live stream data, and obtain the target frame image, wherein the target function includes a pixel copy function, and the pixel copy function realizes the immediate generation of the target frame image by receiving the overwritten target method.

[0103] In one embodiment of the present disclosure, the target method is a message sending method at a specific moment.

[0104] In one embodiment of the present disclosure, when the first processing unit 42 executes the target function, processes the live stream data, and obtains the target frame image, it is specifically used to: call the drawing surface access interface to obtain the screen image cache based on the drawing surface view corresponding to the live stream data; take the screen image cache and the specific moment message sending method of the message processor object as input, call the pixel copy function, and generate the target frame image, wherein the specific moment message sending method of the message processor object is overwritten, and the specific moment message sending method is used to immediately execute the execution message corresponding to the pixel copy function.

[0105] In one embodiment of the present disclosure, when the first playback unit 41 plays the preview video of the target live broadcast room in the first interface, it is specifically used to: create a first drawing surface in the first interface; downsample the live stream data of the target live broadcast room to generate downsampled video data; and draw the downsampled video data on the first drawing surface to play the preview video of the target live broadcast room.

[0106] In one embodiment of the present disclosure, when a trigger instruction for a preview video is received, the second playback unit 43 is further used to: create a second drawing surface within the second interface of the target application; when the second playback unit 43 plays the live video of the target live room within the second interface, it is specifically used to: obtain the screen image cache through the handle of the screen image cache; draw the screen image cache within the second drawing surface to play the live video of the target live room.

[0107] In one embodiment of the present disclosure, when the second playback unit 43 draws the screen image cache in the second drawing surface to play the live video of the target live broadcast room, it is specifically used to: obtain the video live broadcast timestamp corresponding to the target frame image; obtain the corresponding target video frame from the screen image cache according to the video live broadcast timestamp; starting from the target video frame of the screen image cache, draw the screen image cache in the second drawing surface to play the live video of the target live broadcast room from the position of the target frame image.

[0108] The first playback unit 41, the first processing unit 42, and the second playback module 43 are connected in sequence. The interface switching device 4 provided in the embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0109] Corresponding to the interface switching method of the embodiment corresponding to FIG9 above, FIG11 is a structural block diagram of another interface switching device provided by an embodiment of the present disclosure. For ease of illustration, only the parts related to the embodiment of the present disclosure are shown. Referring to FIG11, the interface switching device 5 includes:

[0110] The third playback unit 51 plays the live video of the target live broadcast room in the second interface of the target application, and pulls the live stream data of the target live broadcast room after receiving the exit instruction for the target live broadcast room;

[0111] The second processing unit 52 obtains the target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room;

[0112] The fourth playback unit 53 displays the target frame image in the first interface until the preview video of the target live broadcast room is loaded, and then plays the preview video of the target live broadcast room in the first interface.

[0113] The third playback unit 51, the second processing unit 52, and the fourth playback unit 53 are connected in sequence. The interface switching device 5 provided in the embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0114] FIG12 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. As shown in FIG12 , the electronic device 6 includes:

[0115] A processor 61, and a memory 62 communicatively connected to the processor 61;

[0116] Memory 62 stores computer-executable instructions;

[0117] The processor 61 executes the computer-executable instructions stored in the memory 62 to implement the interface switching method in the embodiments shown in Figures 2 to 9.

[0118] Optionally, the processor 61 and the memory 62 are connected via a bus 63 .

[0119] The relevant explanations can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to Figures 2 to 9, and no further details will be given here.

[0120] An embodiment of the present disclosure provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the interface switching method provided in any of the embodiments corresponding to Figures 2 to 9 of the present disclosure.

[0121] The present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the interface switching method in the embodiments shown in FIG. 2 to FIG. 9 is implemented.

[0122] Referring to FIG13 , a schematic diagram of the structure of an electronic device 900 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG13 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0123] As shown in FIG13 , the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0124] Typically, the following devices can be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 can allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG13 shows an electronic device 900 with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0125] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0126] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0127] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0128] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0129] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).

[0130] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0131] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0132] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0133] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0134] In a first aspect, according to one or more embodiments of the present disclosure, a method for interface switching is provided, comprising:

[0135] Play the preview video of the target live broadcast room in the first interface, and after receiving the trigger instruction for the preview video, pull the live stream data of the target live broadcast room; obtain the target frame image of the target live broadcast room through the live stream data of the target live broadcast room; display the target frame image in the second interface until the live video of the target live broadcast room is loaded, and then play the live video of the target live broadcast room in the second interface.

[0136] According to one or more embodiments of the present disclosure, obtaining the target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room includes: creating a renderer object through the main thread of the target application; executing a target function through the renderer object to process the live broadcast stream data to obtain the target frame image, wherein the target function includes a pixel copy function, and the pixel copy function realizes the immediate generation of the target frame image by receiving the overwritten target method.

[0137] According to one or more embodiments of the present disclosure, the target method is a method for sending a message at a specific moment.

[0138] According to one or more embodiments of the present disclosure, the execution target function processes the live stream data to obtain the target frame image, including: calling a drawing surface access interface to obtain a screen image cache based on a drawing surface view corresponding to the live stream data; taking the screen image cache and the specific moment message sending method of the message processor object as input, calling a pixel copy function to generate a target frame image, wherein the specific moment message sending method of the message processor object is overwritten, and the specific moment message sending method is used to immediately execute the execution message corresponding to the pixel copy function.

[0139] According to one or more embodiments of the present disclosure, playing the preview video of the target live broadcast room in the first interface includes: creating a first drawing surface in the first interface; downsampling the live stream data of the target live broadcast room to generate downsampled video data; and drawing the downsampled video data on the first drawing surface to play the preview video of the target live broadcast room.

[0140] According to one or more embodiments of the present disclosure, after receiving a trigger instruction for the preview video, it also includes: creating a second drawing surface in a second interface; playing the live video of the target live room in the second interface includes: obtaining the screen image cache through the handle of the screen image cache; drawing the screen image cache in the second drawing surface to play the live video of the target live room.

[0141] According to one or more embodiments of the present disclosure, drawing the screen image cache within the second drawing surface to play the live video of the target live broadcast room includes: obtaining the video live broadcast timestamp corresponding to the target frame image; obtaining the corresponding target video frame from the screen image cache according to the video live broadcast timestamp; starting from the target video frame of the screen image cache, drawing the screen image cache within the second drawing surface to play the live video of the target live broadcast room from the position of the target frame image.

[0142] In a second aspect, according to one or more embodiments of the present disclosure, a method for interface switching is provided, comprising:

[0143] In the second interface of the target application, the live video of the target live room is played, and after receiving the exit instruction for the target live room, the live stream data of the target live room is pulled; the target frame image of the target live room is obtained through the live stream data of the target live room; the target frame image is displayed in the first interface of the target application until the preview video of the target live room is loaded, and then the preview video of the target live room is played in the first interface.

[0144] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an interface switching device, comprising:

[0145] A first playback unit is configured to play a preview video of a target live broadcast room in a first interface, and pull live stream data of the target live broadcast room after receiving a trigger instruction for the preview video;

[0146] A first processing unit is configured to obtain a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room;

[0147] The second playback unit is configured to display the target frame image in a second interface until the live video of the target live broadcast room is loaded, and then play the live video of the target live broadcast room in the second interface.

[0148] According to one or more embodiments of the present disclosure, the first processing unit is specifically used to: create a renderer object through the main thread of the target application; execute a target function through the renderer object to process the live stream data to obtain the target frame image, wherein the target function includes a pixel copy function, and the pixel copy function realizes the immediate generation of the target frame image by receiving the overwritten target method.

[0149] According to one or more embodiments of the present disclosure, the target method is a method for sending a message at a specific moment.

[0150] According to one or more embodiments of the present disclosure, when the first processing unit processes the live stream data during the execution of the target function to obtain the target frame image, it is specifically used to: call the drawing surface access interface to obtain the screen image cache based on the drawing surface view corresponding to the live stream data; call the pixel copy function with the screen image cache and the specific moment message sending method of the message processor object as input to generate the target frame image, wherein the specific moment message sending method of the message processor object is overwritten, and the specific moment message sending method is used to immediately execute the execution message corresponding to the pixel copy function.

[0151] According to one or more embodiments of the present disclosure, when the first playback unit plays the preview video of the target live broadcast room in the first interface, it is specifically used to: create a first drawing surface in the first interface; downsample the live stream data of the target live broadcast room to generate downsampled video data; and draw the downsampled video data on the first drawing surface to play the preview video of the target live broadcast room.

[0152] According to one or more embodiments of the present disclosure, after receiving a trigger instruction for the preview video, the second playback unit is further used to: create a second drawing surface within the second interface; when the second playback unit plays the live video of the target live room within the second interface, it is specifically used to: obtain the screen image cache through the handle of the screen image cache; draw the screen image cache within the second drawing surface to play the live video of the target live room.

[0153] According to one or more embodiments of the present disclosure, when the second playback unit draws the screen image cache within the second drawing surface to play the live video of the target live broadcast room, it is specifically used to: obtain the video live broadcast timestamp corresponding to the target frame image; obtain the corresponding target video frame from the screen image cache according to the video live broadcast timestamp; starting from the target video frame of the screen image cache, draw the screen image cache within the second drawing surface to play the live video of the target live broadcast room from the position of the target frame image.

[0154] In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided an interface switching device, comprising:

[0155] A third playback unit plays the live video of the target live broadcast room in the second interface of the target application, and pulls the live streaming data of the target live broadcast room after receiving an exit instruction for the target live broadcast room;

[0156] The second processing unit obtains a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room;

[0157] The fourth playback unit displays the target frame image in the first interface of the target application until the preview video of the target live broadcast room is loaded, and then plays the preview video of the target live broadcast room in the first interface.

[0158] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0159] The memory stores computer-executable instructions;

[0160] The processor executes the computer-executable instructions stored in the memory to implement the interface switching method described in the first aspect and various possible designs of the first aspect, or to implement the interface switching method described in the second aspect and various possible designs of the second aspect.

[0161] In the sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the interface switching method described in the first aspect and various possible designs of the first aspect is implemented, or the interface switching method described in the second aspect and various possible designs of the second aspect is implemented.

[0162] In the seventh aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the interface switching method described in the first aspect and various possible designs of the first aspect, or implements the interface switching method described in the second aspect and various possible designs of the second aspect.

[0163] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0164] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0165] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. An interface switching method, comprising: Playing a preview video of the target live broadcast room in the first interface, and pulling live stream data of the target live broadcast room when receiving a trigger instruction for the preview video; Obtaining a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room; The target frame image is displayed in the second interface until the live video of the target live broadcast room is loaded, and then the live video of the target live broadcast room is played in the second interface.

2. The method according to claim 1, wherein obtaining the target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room comprises: Create a renderer object through the main thread of the target application; The target function is executed through the renderer object to process the live streaming data to obtain the target frame image.

3. The method according to claim 2, wherein the target function realizes the immediate generation of the target frame image by receiving the rewritten target method, and the target method is a message sending method at a specific moment.

4. The method according to claim 2, wherein the executing the target function, processing the live streaming data, and obtaining the target frame image comprises: Calling a drawing surface access interface to obtain a screen image cache based on a drawing surface view corresponding to the live streaming data; Taking the screen image cache and the specific time message sending method of the message processor object as input, the target function is called to generate the target frame image, wherein the specific time message sending method of the message processor object is overwritten, and the specific time message sending method is used to immediately execute the execution message corresponding to the target function.

5. The method according to claim 1, wherein playing the preview video of the target live broadcast room in the first interface comprises: Creating a first drawing surface in the first interface; Downsampling the live streaming data of the target live broadcast room to generate downsampled video data; The downsampled video data is drawn on the first drawing surface to play the preview video of the target live broadcast room.

6. The method according to claim 1, wherein after receiving a trigger instruction for the preview video, it further comprises: Creating a second drawing surface in the second interface; Playing the live video of the target live broadcast room in the second interface includes: Obtaining a screen image cache corresponding to the live video; The screen image buffer is drawn in the second drawing surface to play the live video of the target live broadcast room.

7. The method according to claim 6, wherein drawing the screen image cache in the second drawing surface to play the live video of the target live broadcast room comprises: Obtaining a live video timestamp corresponding to the target frame image; According to the live video timestamp, obtaining a corresponding target video frame from the screen image cache; Starting from the target video frame of the screen image cache, the screen image cache is drawn in the second drawing surface to play the live video of the target live broadcast room starting from the position of the target frame image.

8. An interface switching method, comprising: In the second interface of the target application, the live video of the target live room is played, and after receiving an exit instruction for the target live room, the live streaming data of the target live room is pulled; Obtaining a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room; The target frame image is displayed in the first interface of the target application until the preview video of the target live broadcast room is loaded, and then the preview video of the target live broadcast room is played in the first interface.

9. An interface switching device, comprising: A first playback unit, configured to play a preview video of a target live broadcast room in a first interface, and pull live stream data of the target live broadcast room after receiving a trigger instruction for the preview video; A first processing unit is used to obtain a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room; The second playback unit is used to display the target frame image in a second interface until the live video of the target live broadcast room is loaded, and then play the live video of the target live broadcast room in the second interface.

10. An interface switching device, comprising: A third playback unit plays the live video of the target live room in the second interface of the target application, and pulls the live streaming data of the target live room after receiving an exit instruction for the target live room; A second processing unit acquires a target frame image of the target live broadcast room through the live broadcast stream data of the target live broadcast room; The fourth playback unit displays the target frame image in the first interface of the target application until the preview video of the target live broadcast room is loaded, and then plays the preview video of the target live broadcast room in the first interface.

11. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

12. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the interface switching method according to any one of claims 1 to 8 is implemented.

13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the interface switching method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Live broadcast interface display method and device, and terminal

    CN107911709A

  • Live video preloading method and device

    CN108769727A

  • Live broadcasting data processing method and device, and computer equipment and storage medium

    CN109309842A

  • Live broadcasting content previewing method and device, equipment and medium

    CN109413483A

  • Live video display method, device and equipment and storage medium

    CN110858910A