Live video playing method and related product
By pre-creating the resource management thread, decoder, and renderer for the next live stream in the live video player, the problem of slow start-up speed when switching live streams is solved, thus improving the user's live streaming viewing experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-24
AI Technical Summary
The live video player has a slow startup speed when switching live rooms, resulting in long waiting times for users and affecting the viewing experience.
While playing the current live stream, the resource management thread, decoder, and renderer for the next live stream are created in advance using the resource manager. After creation, the resource acquisition component is closed, and the acquisition component is reopened when the user switches to play the next live stream video.
It shortens the waiting time after switching live stream rooms, reduces resource consumption, and improves the user's live stream viewing experience.
Smart Images

Figure CN121728274A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of online live streaming technology, and in particular to a live video playback method and related products. Background Technology
[0002] With the rapid development of internet and mobile communication technologies, live streaming technology has been widely applied and promoted. The widespread availability of high-speed networks and mobile devices allows people to watch live content anytime, anywhere via smartphones, tablets, and other devices. Live streaming technology requires real-time and smooth content, ensuring the real-time transmission and playback of video and audio to meet users' immediate needs for live content.
[0003] In common live video playback scenarios, when a live video player can play the live video for a specific live room, if the user performs a switching operation (such as swiping up), the live video player will switch to play the live video for the next live room. However, the live video player typically takes a considerable amount of time from preparing to start playing the live video; that is, the live video starts playing slowly. This results in users having to wait a long time each time they switch to a live video, leading to a poor live streaming viewing experience. Summary of the Invention
[0004] This application provides a live video playback method and related products, wherein the related products include a live video playback device, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] Firstly, a method for playing live video is provided, including:
[0006] When the first live video corresponding to the first live room is played on the live video playback page corresponding to the live video player, the next adjacent live room corresponding to the first live room is determined as the second live room.
[0007] A resource management thread corresponding to the second live room is created through the resource manager in the live video player. The live resource acquisition component corresponding to the second live room is started through the resource management thread. The first live resource corresponding to the second live room is acquired through the live resource acquisition component.
[0008] The live video player creates a decoder and renderer corresponding to the second live room based on the acquired first live resource.
[0009] When it is determined that the decoder and renderer corresponding to the second live room have been created, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room;
[0010] When a post-switching operation is detected for the live video playback page, the live resource acquisition component is started through the resource management thread. The live resource acquisition component begins to acquire the second live resource corresponding to the second live room. The live resource acquisition component notifies the live video player to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video. The second live video is then played on the live video playback page.
[0011] In any embodiment of this application, the step of acquiring the first live streaming resource corresponding to the second live streaming room through the live streaming resource acquisition component includes:
[0012] The live streaming address corresponding to the second live streaming room is obtained through the live streaming resource acquisition component.
[0013] Establish a communication connection between the server corresponding to the second live streaming room and the live streaming address;
[0014] The first live streaming resource corresponding to the second live streaming room is obtained from the server corresponding to the second live streaming room through the communication connection.
[0015] In any embodiment of this application, the step of creating a decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player includes:
[0016] The first live streaming resource is parsed by the live streaming video player to obtain the audio and video encoding format, and a decoder corresponding to the second live streaming room is created according to the audio and video encoding format.
[0017] The first live streaming resource is processed by the decoder corresponding to the second live streaming room to obtain the first decoded audio and video frame.
[0018] The resource manager creates a renderer corresponding to the second live streaming room based on the data format of the first decoded audio and video frame.
[0019] In any embodiment of this application, the step of notifying the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and playing the second live video on the live video playback page, includes:
[0020] The live streaming resource acquisition component notifies the live streaming video player to send the second live streaming resource to the decoder corresponding to the second live streaming room. The decoder then performs audio and video decoding processing on the second live streaming resource to obtain the second decoded audio and video frame.
[0021] The live video player obtains the second decoded audio and video frame from the decoder, sends the second decoded audio and video frame to the renderer corresponding to the second live room, and renders the second decoded audio and video frame to obtain the second live video.
[0022] The second live video is played on the live video playback page.
[0023] In conjunction with any embodiment of this application, the method further includes:
[0024] When the second live video corresponding to the second live room is played on the live video playback page, the preceding adjacent live room corresponding to the first live room is determined as the third live room.
[0025] The live video player releases the decoder, renderer, live resource acquisition component, and resource management thread corresponding to the third live room.
[0026] In any embodiment of this application, the step of closing the live stream resource acquisition component through the resource management thread to stop acquiring the first live stream resource corresponding to the second live stream room includes:
[0027] If no post-switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live room, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room.
[0028] In conjunction with any embodiment of this application, the method further includes:
[0029] If a post-switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live room, the decoder and renderer corresponding to the second live room are called through the live video player to perform resource conversion processing on the first live resource to obtain the second live video, and the second live video is played on the live video playback page.
[0030] Secondly, a live video playback device is provided, comprising:
[0031] The determination module is used to determine the next adjacent live room as the second live room when the first live video is played on the live video playback page corresponding to the live video player.
[0032] The startup module is used to create a resource management thread corresponding to the second live room through the resource manager in the live video player, start the live resource acquisition component corresponding to the second live room through the resource management thread, and start acquiring the first live resource corresponding to the second live room through the live resource acquisition component.
[0033] A creation module is used to create a decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player.
[0034] The shutdown module is used to shut down the live resource acquisition component through the resource management thread when it is determined that the decoder and renderer corresponding to the second live room have been created, so as to stop acquiring the first live resource corresponding to the second live room.
[0035] The playback module is configured to, when a post-switching operation is detected for the live video playback page, activate the live resource acquisition component through the resource management thread, start acquiring the second live resource corresponding to the second live room through the live resource acquisition component, notify the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and play the second live video on the live video playback page.
[0036] In any embodiment of this application, the step of acquiring the first live stream resource corresponding to the second live stream room through the live stream resource acquisition component, specifically the activation module, is used for:
[0037] The live streaming address corresponding to the second live streaming room is obtained through the live streaming resource acquisition component.
[0038] Establish a communication connection between the server corresponding to the second live streaming room and the live streaming address;
[0039] The first live streaming resource corresponding to the second live streaming room is obtained from the server corresponding to the second live streaming room through the communication connection.
[0040] In any embodiment of this application, the step of creating a decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player includes:
[0041] The first live streaming resource is parsed by the live streaming video player to obtain the audio and video encoding format, and a decoder corresponding to the second live streaming room is created according to the audio and video encoding format.
[0042] The first live streaming resource is processed by the decoder corresponding to the second live streaming room to obtain the first decoded audio and video frame.
[0043] The resource manager creates a renderer corresponding to the second live streaming room based on the data format of the first decoded audio and video frame.
[0044] In any embodiment of this application, the step of notifying the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and playing the second live video on the live video playback page, the playback module is specifically used for:
[0045] The live streaming resource acquisition component notifies the live streaming video player to send the second live streaming resource to the decoder corresponding to the second live streaming room. The decoder then performs audio and video decoding processing on the second live streaming resource to obtain the second decoded audio and video frame.
[0046] The live video player obtains the second decoded audio and video frame from the decoder, sends the second decoded audio and video frame to the renderer corresponding to the second live room, and renders the second decoded audio and video frame to obtain the second live video.
[0047] The second live video is played on the live video playback page.
[0048] In any embodiment of this application, the device further includes a release module.
[0049] The release module is used to determine the preceding adjacent live room of the first live room as the third live room when the second live video corresponding to the second live room is played on the live video playback page.
[0050] The live video player releases the decoder, renderer, live resource acquisition component, and resource management thread corresponding to the third live room.
[0051] In any embodiment of this application, the step of closing the live stream resource acquisition component via the resource management thread to stop acquiring the first live stream resource corresponding to the second live stream room, wherein the closing module is specifically used for:
[0052] If no post-switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live room, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room.
[0053] In any embodiment of this application, the device further includes a fast-play module.
[0054] The QVOD module is configured to, if during the creation of the decoder and renderer corresponding to the second live room, detect a post-switching operation for the live video playback page, then call the decoder and renderer corresponding to the second live room through the live video player to perform resource conversion processing on the first live resource to obtain the second live video, and play the second live video on the live video playback page.
[0055] Thirdly, an electronic device is provided, comprising: a processor and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs as described in the first aspect and any of its embodiments.
[0056] Fourthly, another electronic device is provided, comprising: a processor, a transmitting device, an input device, an output device, and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs as described in the first aspect and any of its embodiments.
[0057] Fifthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, the computer program including program instructions that, when executed by a processor, cause the processor to perform the first aspect and any of its embodiments described above.
[0058] In a sixth aspect, a computer program product is provided, the computer program product comprising a computer program or instructions that, when the computer program or instructions are executed on a computer, cause the computer to perform the first aspect described above and any of its embodiments.
[0059] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application.
[0060] In this application, when the first live video corresponding to the first live room is played on the live video playback page corresponding to the live video player, the adjacent live room corresponding to the first live room is determined as the second live room; a resource management thread corresponding to the second live room is created through the resource manager in the live video player, and the live resource acquisition component corresponding to the second live room is started through the resource management thread, and the live resource acquisition component starts to acquire the first live resource corresponding to the second live room; the decoder and renderer corresponding to the second live room are created through the live video player based on the acquired first live resource; when it is determined that the decoder and renderer corresponding to the second live room have been created, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room; when a subsequent switching operation is detected for the live video playback page, the live resource acquisition component is started through the resource management thread, and the live resource acquisition component starts to acquire the second live resource corresponding to the second live room, and the live resource acquisition component notifies the live video player to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and the second live video is played on the live video playback page. The method provided in this application embodiment allows for the pre-creation of the live resource acquisition component, decoder, and renderer for the second live room via a background resource management thread when playing the live video in the first live room. After creation, the live resource acquisition component is closed and then reopened when the user switches to the second live room. This reduces the waiting time after switching live rooms and also reduces resource consumption, avoiding the continuous acquisition of live resources when the user does not need them, thereby improving the user's live viewing experience. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0063] Figure 1 This application provides a schematic diagram of a network architecture.
[0064] Figure 2 This is a schematic diagram illustrating an application scenario of a live video playback method provided in an embodiment of this application.
[0065] Figure 3 A flowchart illustrating a live video playback method provided in an embodiment of this application;
[0066] Figure 4 A flowchart illustrating a live streaming preloading optimization method provided in this application embodiment;
[0067] Figure 5 An interactive schematic diagram of a live streaming preloading optimization method provided in an embodiment of this application;
[0068] Figure 6 This is a schematic diagram of the structure of a live video playback device provided in an embodiment of this application;
[0069] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0070] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0071] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0072] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0073] The embodiments of this application are described below with reference to the accompanying drawings.
[0074] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application. Figure 1As shown, this network architecture may include a server 2000 and a terminal cluster. The terminal cluster may specifically include one or more terminals; the number of terminals in the terminal cluster is not limited here. Figure 1 As shown, the multiple terminals may specifically include terminal 3000a, terminal 3000b, terminal 3000c, ..., terminal 3000n; terminal 3000a, terminal 3000b, terminal 3000c, ..., terminal 3000n can be directly or indirectly connected to server 2000 via wired or wireless communication, so that each terminal can interact with server 2000 through the network connection. It is understood that the above network connection is not limited to a specific connection method; it can be directly or indirectly connected via wired communication, wireless communication, or other methods. This application does not impose any restrictions on this.
[0075] Each terminal in the terminal cluster can include: smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances (e.g., smart TVs), wearable devices, vehicle terminals, aircraft, and other smart terminals with data processing capabilities. It should be understood that, as... Figure 1 Each terminal in the terminal cluster shown can have an application client installed. When the application client runs on each terminal, it can interact with the aforementioned... Figure 1 Data exchange occurs between the 2000 servers shown.
[0076] The application client can specifically include in-vehicle clients, smart home clients, entertainment clients (e.g., game clients), multimedia clients (e.g., video clients), social clients, and information clients (e.g., news clients) with data processing capabilities. In this embodiment, the application client can be integrated into a client (e.g., a social client), or it can be a standalone client (e.g., a news client). This embodiment does not limit the type of application client. The application client in this embodiment may include a live video player, which is the core component responsible for audio and video playback in the application client.
[0077] Among them, such as Figure 1The server 2000 shown can be the server corresponding to the application client. The server 2000 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0078] For ease of understanding, the embodiments of this application may be described in detail below. Figure 1 Among the multiple terminals shown, one terminal can be selected as the live streaming terminal, and another terminal can be selected as the viewing terminal. For example, in the embodiments of this application, a terminal can be selected as the live streaming terminal. Figure 1 The terminal 3000a shown serves as the live streaming client, which can be equipped with an application client capable of data processing. In this case, the live streaming client can interact with the server 2000 via the application client, such as uploading live streaming resources (e.g., audio and video streams) corresponding to the live video. This embodiment of the application can... Figure 1 The terminal 3000b shown serves as the viewing end, which can have an application client with data processing capabilities installed. In this case, the viewing end can interact with the server 2000 through the application client, such as downloading live streaming resources (e.g., audio and video streams) corresponding to the live video uploaded by the live streaming end. Furthermore, the user corresponding to the live streaming end can be referred to as the live streaming audience, and the user corresponding to the viewing end can be referred to as the viewing audience.
[0079] like Figure 1 As shown, when a viewer wants to watch a live stream, the viewing client can respond to the viewer's live stream viewing operation through the running application client, generating a live stream viewing request, and then sending the live stream viewing request to server 2000. Server 2000 can obtain the viewer's historical viewing data and the currently playing live stream data based on the live stream viewing request to generate a live stream playlist for the viewer. This live stream playlist indicates the playback order of N live streams on the viewing client, where N is a positive integer. Server 2000 can send this live stream playlist to the viewing client, and then the viewing client can determine the first live stream to be played based on the playlist, and then play the first live stream video corresponding to the first live stream video on its corresponding live stream video playback page through the live video player.
[0080] If a viewer no longer wants to watch the first live stream, they can switch to a later live stream on the live video playback page. The viewer's application client will respond to this switch, selecting the live stream immediately following and adjacent to the first live stream in the playlist (this can be called the adjacent live stream following the first live stream) as the second live stream. The viewer can then use the live video player to create the encoder and renderer for this second live stream. Based on the encoder and renderer, the live video player will then play the second live stream video on its corresponding playback page, thus completing the live stream switch. It's understandable that the live video player typically takes a considerable amount of time from preparing to play (i.e., creating the encoder and renderer for the second live stream) to starting to play the second live stream video. This waiting time significantly impacts the viewer's live stream viewing experience.
[0081] Therefore, this application provides a live video playback method to solve the problem of slow live video startup speed and improve the live viewing experience for viewers. The live video playback method specifically includes: when the first live video of the first live room is played on the live video playback page corresponding to the live video player, the adjacent live room corresponding to the first live room is identified as the second live room; a resource management thread corresponding to the second live room is created through the resource manager in the live video player, and the live resource acquisition component corresponding to the second live room is started through the resource management thread, and the live resource acquisition component starts to acquire the first live resource corresponding to the second live room; the decoder and renderer corresponding to the second live room are created through the live video player based on the acquired first live resource; when it is determined that the decoder and renderer corresponding to the second live room have been created, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room; when a subsequent switching operation is detected for the live video playback page, the live resource acquisition component is started through the resource management thread, and the live resource acquisition component starts to acquire the second live resource corresponding to the second live room, and the live resource acquisition component notifies the live video player to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and the second live video is played on the live video playback page.
[0082] For better understanding, please refer to [further details]. Figure 2 , Figure 2 This is a schematic diagram illustrating an application scenario of a live video playback method provided in an embodiment of this application. For example... Figure 2 The terminal 20a shown can be the one described above. Figure 1In the corresponding embodiment, the viewing terminal 20a may have an application client containing a live video player installed, and the user corresponding to terminal 20a can be the viewing object 20b. For ease of understanding, this embodiment of the application will be described using the live video playback method executed by terminal 20a as an example.
[0083] like Figure 2 As shown, terminal 20a plays the first live video corresponding to the first live room on the live video playback page 201 through the live video player included in the running application client. The specific implementation process can be as follows: terminal 20a creates the live resource acquisition component A1, decoder A2, and renderer A3 corresponding to the first live room through the live video player, and then plays the first live video through the live resource acquisition component A1, decoder A2, and renderer A3 (e.g., ...). Figure 2 As shown in S211a). The live streaming resource acquisition component A1 is used to acquire resources from the resource server (which can be the one mentioned above). Figure 1 In the corresponding embodiment, server 2000 (not shown in the figure) continuously acquires the real-time live streaming resources corresponding to the first live streaming room. Decoder A2 is used to decode the real-time live streaming resources acquired by live streaming resource acquisition component A1 to obtain the decoded audio and video frames corresponding to the first live streaming room. Renderer A3 is used to render the decoded audio and video frames to obtain the first live streaming video.
[0084] like Figure 2 As shown, when terminal 20a plays the first live video through the live video playback page 201, the adjacent live room corresponding to the first live room is determined as the second live room. Then, the live video player creates the live resource acquisition component B1, decoder B2, and renderer B3 corresponding to the second live room, and closes the live resource acquisition component B1 (e.g., ...). Figure 2 (as shown in S212a).
[0085] like Figure 2 As shown, when viewer 20b wants to switch live stream rooms, they can perform a back-switching operation on the live video playback page 201 (an operation to switch to the next live stream room, such as swiping up the screen). When the back-switching operation of viewer 20b on the live video playback page 201 is detected, terminal 20a can restart the live resource acquisition component B1, and then play the second live stream video (e.g., using the live resource acquisition component B1, decoder B2, and renderer B3) Figure 2 (As shown in S213a).
[0086] Obviously, through the live video playback method provided in this application embodiment, when playing the first live video corresponding to the first live room, the live resource acquisition component, decoder, and renderer required for playing the live video corresponding to the second live room can be created in advance. After creation, the live resource acquisition component is closed to avoid acquiring the live resources of the second live room when the viewer does not need them, thus reducing resource consumption. When the viewer is detected to perform a post-switching operation, the established live resource acquisition component is directly restarted, and then the second live video is played directly through the live resource acquisition component, decoder, and renderer required for the live video corresponding to the second live room. This shortens the viewing waiting time and improves the live viewing experience for the viewer.
[0087] Furthermore, this application provides a live video playback method, wherein the execution subject of the live video playback method is a live video playback device, which can be any electronic device capable of executing the technical solutions disclosed in the embodiments of this application. Optionally, the live video playback device can be one of the following: a computer, a server. It should be understood that the embodiments of this application can also be implemented by a processor executing computer program code.
[0088] Please see Figure 3 , Figure 3 This is a flowchart illustrating a live video playback method provided in an embodiment of this application.
[0089] S101. When the first live video corresponding to the first live room is played on the live video playback page corresponding to the live video player, the next adjacent live room corresponding to the first live room is determined as the second live room.
[0090] Specifically, the next adjacent live stream room corresponding to the first live stream room refers to the live stream room that follows the first live stream room in the playback order. In other words, when a viewer switches to the next live stream room on the live video playback page (which can be called a subsequent switching operation, such as swiping up the page in an up-down scenario), the next live stream room played by the live video player should be the next adjacent live stream room corresponding to the first live stream room.
[0091] S102. Create a resource management thread corresponding to the second live room through the resource manager in the live video player, start the live resource acquisition component corresponding to the second live room through the resource management thread, and start acquiring the first live resource corresponding to the second live room through the live resource acquisition component.
[0092] Specifically, the resource manager in the live video player is the core module responsible for scheduling, allocating, recycling, and optimizing audio and video resources (such as live stream data, cache files, hardware resources, etc.). Its role is to ensure that the player efficiently and stably acquires and uses resources, avoiding stuttering, crashes, or resource waste. The resource management thread corresponding to the second live room is used to manage the player instance of the second live room (including the live resource acquisition component, decoder, and renderer). Different live rooms correspond to different resource management threads. The live resource acquisition component corresponding to the second live room is used to acquire the live resources corresponding to the second live room, where live resources can refer to real-time audio and video streams.
[0093] Specifically, after obtaining the resource management thread (source thread) corresponding to the second live room through the resource manager (opensourcemanager) in the live video player (redplayer), the open method can be called through the resource management thread to start the live resource component (opensource) and begin preparing new live resources. Among them, the open method is a core operation in the live video player, which is usually used to initialize playback resources, establish playback links, and prepare for subsequent decoding, rendering and other processes.
[0094] Specifically, a feasible implementation process for obtaining the first live stream resource corresponding to the second live stream room through the live stream resource acquisition component can be as follows: obtain the live stream playback address corresponding to the second live stream room through the live stream resource acquisition component; establish a communication connection with the server corresponding to the second live stream room based on the live stream playback address; and obtain the first live stream resource corresponding to the second live stream room from the server corresponding to the second live stream room through the communication connection. Here, the playback address can refer to the access address corresponding to the live stream room, through which a connection can be accurately established with the server.
[0095] S103. The live video player creates a decoder and renderer corresponding to the second live room based on the acquired first live resource.
[0096] Specifically, a feasible implementation process for creating a decoder and renderer for the second live room based on the acquired first live resource using a live video player can be as follows: The live video player performs resource parsing processing on the acquired first live resource to obtain the audio and video encoding format; a decoder for the second live room is created based on the audio and video encoding format; the decoder for the second live room performs audio and video decoding processing on the first live resource to obtain the first decoded audio and video frame; and a renderer for the second live room is created based on the data format of the first decoded audio and video frame using a resource manager.
[0097] One feasible implementation process for parsing the acquired first live stream resource using a live video player to obtain the audio and video encoding format is as follows: The first audio and video data packet is obtained from the acquired first live stream resource; after decapsulation, the audio and video format is detected; and the detected audio and video format is determined as the audio and video encoding format. The audio and video encoding format includes audio encoding formats (such as AAC / MP3) and video encoding formats (such as H.264 / H.265).
[0098] S104. When it is determined that the decoder and renderer corresponding to the second live room have been created, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room.
[0099] Specifically, a feasible implementation process for stopping the acquisition of the first live stream resource corresponding to the second live stream room by shutting down the live stream resource acquisition component through the resource management thread can be as follows: If no subsequent switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live stream room, then the live stream resource acquisition component is shut down through the resource management thread to stop acquiring the first live stream resource corresponding to the second live stream room. In other words, if the viewers are continuously watching the first live stream video during the pre-creation of the decoder and renderer corresponding to the second live stream room and have no immediate intention to switch live stream rooms, the backend can shut down the live stream resource acquisition component corresponding to the second live stream room, putting it in a waiting state. At this time, the live stream resource acquisition component corresponding to the second live stream room will not acquire the live stream resource of the second live stream room, thus avoiding unnecessary resource consumption.
[0100] Optionally, if a post-switching operation for the live video playback page is detected during the creation of the decoder and renderer for the second live room, the live video player calls the decoder and renderer for the second live room to perform resource conversion processing on the first live resource to obtain the second live video, which is then played on the live video playback page. It's understandable that if the viewer has already performed a post-switching operation for the live room during the creation of the decoder and renderer for the second live room, the live video player should be playing the second live video on the live video playback page at this point. If the live resource acquisition component is then closed and restarted, it would increase the viewer's waiting time. Therefore, playing the second live video directly reduces the viewer's waiting time.
[0101] S105. When a post-switching operation is detected for the live video playback page, the live resource acquisition component is started through the resource management thread. The live resource acquisition component starts to acquire the second live resource corresponding to the second live room. The live resource acquisition component notifies the live video player to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video. The second live video is then played on the live video playback page.
[0102] Specifically, a feasible implementation process for notifying the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and then playing the second live video on the live video playback page, can be as follows: The live resource acquisition component notifies the live video player to send the second live resource to the decoder corresponding to the second live room; the decoder performs audio and video decoding processing on the second live resource to obtain the second decoded audio and video frames; the live video player obtains the second decoded audio and video frames from the decoder and sends the second decoded audio and video frames to the renderer corresponding to the second live room; the renderer performs rendering processing on the second decoded audio and video frames to obtain the second live video; and the second live video is played on the live video playback page.
[0103] Optionally, when the second live video corresponding to the second live room is played on the live video playback page, the preceding adjacent live room corresponding to the first live room is designated as the third live room; the decoder, renderer, live resource acquisition component, and resource management thread corresponding to the third live room are released through the live video player. This means that once the viewer has switched to the next live room, the decoder, renderer, live resource acquisition component, and resource management thread corresponding to the previous live room of the first live room can be released, preventing too many player instances from consuming excessive system resources.
[0104] The method provided in this application embodiment allows for the pre-creation of the live resource acquisition component, decoder, and renderer for the second live room via a background resource management thread when playing the live video in the first live room. After creation, the live resource acquisition component is closed and then reopened when the user switches to the second live room. This reduces the waiting time after switching live rooms and also reduces resource consumption, avoiding the continuous acquisition of live resources when the user does not need them, thereby improving the user's live viewing experience.
[0105] Furthermore, for ease of understanding, please refer to Figure 4 , Figure 4 This is a flowchart illustrating a live streaming preloading optimization method provided in an embodiment of this application. Figure 4 As shown, the entire process of the live streaming preloading optimization method mainly includes the following steps:
[0106] S41. Play the current live stream.
[0107] Specifically, the live stream can be played on the live stream playback page of the live video player.
[0108] S42. Create a player instance for the scrolling live stream and set it not to start automatically.
[0109] Specifically, when a user is watching the current live stream, the live video player can create a player instance in advance for the next live stream that the user might scroll to, and configure the player instance to a non-autoplay mode. For example, this can be done by calling relevant interfaces such as `preparesync` to prepare the player without starting playback. `preparesync` is a core operation in the player, typically referring to initiating a non-blocking preprocessing flow before executing a core task (such as reading a file, playing a video, or sending a network request). This preprocessing completes tasks such as "resource initialization, status checks, and data preloading." Once ready, the caller is notified through "callback functions, event notifications, etc.", and the core task is finally executed.
[0110] S43. Enable the live streaming resource acquisition component.
[0111] Specifically, the resource management thread (source thread) corresponding to the player instance is obtained through the resource manager (opensourcemanager) in the live video player (redplayer). The resource management thread can call the open method to start the live resource component (opensource) and begin preparing new live resources. The open method is a core operation in the player, usually used to initialize playback resources, establish playback links, and prepare for subsequent decoding, rendering, and other processes.
[0112] S44. Create the decoder and renderer.
[0113] Specifically, once new live streaming resources are ready, the resource management thread can call the `prepare` method to create the decoder and renderer. The `prepare` method is a core operation in the player, a crucial step following the `open` method and preceding the `start` method. Its core function is to complete the final preparations before playback, ensuring all components (decoder, buffer, renderer, etc.) are ready and fully prepared for playback to be triggered by `start`.
[0114] S45. Determine whether a swipe-down switching operation has been detected. If yes, proceed to step S46; otherwise, proceed to step S47.
[0115] Specifically, the live video player can determine whether a scroll-down switching operation of the viewed object has been detected during the execution of steps S42-S44. If it has been detected, it means that the live video player needs to switch the live stream, and the next live stream should be played as soon as possible. Therefore, step S46 can be executed directly. If it has not been detected, it means that the live video player still needs to play the current live stream, and the resource consumption of the next live stream should be minimized as much as possible.
[0116] S46. Start playing the next live stream.
[0117] Specifically, when the live video player executes the `start` method, it immediately begins playing new live content. The `start` method is the core operation in the player that triggers the actual playback of audio and video. Its function is to initiate the complete workflow of "decoding → rendering → output" after `open` (opening resources) and `prepare` (preparing components) are completed.
[0118] S47. Disable the live stream resource acquisition component.
[0119] Specifically, the live video player can close the live resource components by calling the close method through the resource management thread and enter a waiting state.
[0120] S48. When a swipe-down switching operation is detected, restart the live stream resource acquisition component and then play the next live stream.
[0121] Specifically, when a swipe-down switching operation is detected (i.e., when the user swipes down to the next live stream), the resource management thread calls the `open` method to instruct the live stream resource component to fetch the audio and video streams (waking up the live stream resource fetching component), and the live stream resource component sends an internal event to the player to instruct the live video player to start playing the new live stream content. After receiving the start playback event, the live video player executes the `start` method and immediately begins playing the new live stream content.
[0122] It is understood that the specific meaning and execution logic of the above methods (such as open, start, prepare, etc.) may vary slightly due to different player frameworks in actual situations, and this application does not impose any restrictions on them.
[0123] The method provided in this application embodiment ensures that playback can start seamlessly and quickly when a user swipes to the next live stream, improving the user's viewing experience. Furthermore, the thread-based open / close and wake-up mechanism in the resource manager improves system resource utilization, ensuring that resources are consumed only at appropriate times.
[0124] Furthermore, to better understand the call process between the live video player, resource manager, resource management thread, live resource acquisition component, decoder, and renderer, please refer to [link to documentation]. Figure 5 , Figure 5 This is an interactive schematic diagram illustrating a live streaming preloading optimization method provided in an embodiment of this application. For example... Figure 5 As shown, the entire interaction process involves the application client (i.e., the client corresponding to the application on the terminal), the player (i.e., the live video player mentioned above), the resource manager, the resource management thread, the live resource acquisition component, the decoder, and the renderer. The entire interaction process mainly includes the following steps:
[0125] S51, The application client sends an asynchronous preparation request to the player.
[0126] Specifically, the asynchronous preparation request, also known as the prepareasync request mentioned above, is used to inform the player to prepare playback resources for the next live stream without blocking other operations of the application client itself, such as user interface response, current video playback, etc.
[0127] S52, The player sends an asynchronous preparation request to the resource manager.
[0128] Specifically, the player forwards the asynchronous preparation request sent by the application client to the resource manager, which then coordinates the resource loading-related operations.
[0129] S53, the resource manager sends an asynchronous preparation request to the resource management thread.
[0130] S54, The resource management thread opens the live stream resource acquisition component.
[0131] Specifically, the resource management thread calls the open method to open the live streaming resource acquisition component, which is used to instruct it to pull the live stream based on the video address, read local files, etc.
[0132] S55, The live streaming resource acquisition component sends a resource ready notification to the player.
[0133] Specifically, the live streaming resource acquisition component sends a prepared event to the player, informing the player that the resource layer is ready and subsequent component initialization can proceed.
[0134] S56. The resource management thread sends a ready notification to the player.
[0135] Specifically, the resource management thread uses the prepareecb (preparation complete callback function) to report to the player that the component-level preparation is complete.
[0136] S57, Player creates decoder.
[0137] Specifically, the player creates the decoder using the prepare method.
[0138] S58, Player creates renderer.
[0139] Specifically, the player creates a renderer using the prepare method.
[0140] S59. The resource management thread closes the live stream resource acquisition component.
[0141] Specifically, the resource management thread calls the close method to close the live stream resource acquisition component and enters a waiting state.
[0142] S510: The application client sends a pre-created startup command to the player.
[0143] Specifically, when the application client detects a user's swipe down, it can send a precreatestart command to the player.
[0144] S511, The player sends a pre-creation startup command to the resource manager.
[0145] Specifically, the player forwards the pre-created startup command to the resource manager, requesting it to begin preparing to play the next live stream.
[0146] S512, Resource Manager notifies the resource management thread.
[0147] S513, The resource management thread opens the live stream resource acquisition component.
[0148] Specifically, the resource management thread needs to wake up the live resource acquisition component that is in a waiting state. At this time, the live resource acquisition component can be restarted through the open method.
[0149] S514, The live streaming resource acquisition component sends an internal startup event to the player.
[0150] Specifically, the live stream resource acquisition component sends an internal start event to the player to trigger the playback of the next live stream.
[0151] S515, the player sends a start playback event to the resource manager.
[0152] Specifically, after receiving the internal start event, the player executes the start method and immediately begins playing the new live content.
[0153] The method provided in this application allows for the preparation of resources for the next live stream in advance via a background thread before user interaction. This includes creating a player instance, decoder, and renderer, reducing user waiting time, enabling fast and seamless switching between live streams, and improving user experience. Furthermore, configuring the player to non-autoplay and using preparesync for silent resource preparation reduces resource consumption and prevents users from playing live stream content unnecessarily. In addition, dynamically triggering playback startup when the user swipes and using custom events for precise player control enhances system response speed and provides a smoother user interaction experience.
[0154] Please see Figure 6 , Figure 6 This is a schematic diagram of a live video playback device provided in an embodiment of this application. The live video playback device 1 includes: a determining module 11, an opening module 12, a creating module 13, a closing module 14, and a playback module 15. Specifically:
[0155] The determination module 11 is used to determine the next adjacent live room as the second live room when the first live video corresponding to the first live room is played in the live video playback page corresponding to the live video player.
[0156] The module 12 is used to create a resource management thread corresponding to the second live room through the resource manager in the live video player, start the live resource acquisition component corresponding to the second live room through the resource management thread, and start acquiring the first live resource corresponding to the second live room through the live resource acquisition component.
[0157] Module 13 is used to create a decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player.
[0158] The shutdown module 14 is used to shut down the live resource acquisition component through the resource management thread when it is determined that the decoder and renderer corresponding to the second live room have been created, so as to stop acquiring the first live resource corresponding to the second live room.
[0159] The playback module 15 is configured to, when a post-switching operation is detected for the live video playback page, activate the live resource acquisition component through the resource management thread, start acquiring the second live resource corresponding to the second live room through the live resource acquisition component, notify the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and play the second live video on the live video playback page.
[0160] In any embodiment of this application, the step of acquiring the first live streaming resource corresponding to the second live streaming room through the live streaming resource acquisition component, specifically the activation module 12, is used for:
[0161] The live streaming address corresponding to the second live streaming room is obtained through the live streaming resource acquisition component.
[0162] Establish a communication connection between the server corresponding to the second live streaming room and the live streaming address;
[0163] The first live streaming resource corresponding to the second live streaming room is obtained from the server corresponding to the second live streaming room through the communication connection.
[0164] In any embodiment of this application, the step of creating a decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player includes:
[0165] The first live streaming resource is parsed by the live streaming video player to obtain the audio and video encoding format, and a decoder corresponding to the second live streaming room is created according to the audio and video encoding format.
[0166] The first live streaming resource is processed by the decoder corresponding to the second live streaming room to obtain the first decoded audio and video frame.
[0167] The resource manager creates a renderer corresponding to the second live streaming room based on the data format of the first decoded audio and video frame.
[0168] In any embodiment of this application, the step of notifying the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and playing the second live video on the live video playback page, wherein the playback module 15 is specifically used for:
[0169] The live streaming resource acquisition component notifies the live streaming video player to send the second live streaming resource to the decoder corresponding to the second live streaming room. The decoder then performs audio and video decoding processing on the second live streaming resource to obtain the second decoded audio and video frame.
[0170] The live video player obtains the second decoded audio and video frame from the decoder, sends the second decoded audio and video frame to the renderer corresponding to the second live room, and renders the second decoded audio and video frame to obtain the second live video.
[0171] The second live video is played on the live video playback page.
[0172] In any embodiment of this application, the device further includes a release module 16.
[0173] The release module 16 is used to determine the preceding adjacent live room of the first live room as the third live room when the second live video corresponding to the second live room is played in the live video playback page.
[0174] The live video player releases the decoder, renderer, live resource acquisition component, and resource management thread corresponding to the third live room.
[0175] In any embodiment of this application, the step of closing the live streaming resource acquisition component through the resource management thread to stop acquiring the first live streaming resource corresponding to the second live streaming room, the closing module 14, is specifically used for:
[0176] If no post-switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live room, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room.
[0177] In any embodiment of this application, the device further includes: a fast-play module 17.
[0178] The QVOD module 17 is configured to, if during the creation of the decoder and renderer corresponding to the second live room, detect a post-switching operation for the live video playback page, then call the decoder and renderer corresponding to the second live room through the live video player to perform resource conversion processing on the first live resource to obtain the second live video, and play the second live video on the live video playback page.
[0179] In this embodiment, when the first live video corresponding to the first live room is played on the live video playback page corresponding to the live video player, the live video playback device can determine the adjacent live room corresponding to the first live room as the second live room; create a resource management thread corresponding to the second live room through the resource manager in the live video player, start the live resource acquisition component corresponding to the second live room through the resource management thread, and start acquiring the first live resource corresponding to the second live room through the live resource acquisition component; create a decoder and renderer corresponding to the second live room through the live video player based on the acquired first live resource; when it is determined that the decoder and renderer corresponding to the second live room have been created, close the live resource acquisition component through the resource management thread to stop acquiring the first live resource corresponding to the second live room; when a subsequent switching operation is detected for the live video playback page, start the live resource acquisition component through the resource management thread, start acquiring the second live resource corresponding to the second live room through the live resource acquisition component, notify the live video player to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and play the second live video on the live video playback page. With the apparatus provided in this application embodiment, when playing the live video of the first live room, the live resource acquisition component, decoder and renderer corresponding to the second live room can be created in advance through the background resource management thread. After creation, the live resource acquisition component is closed, and then reopened when the user switches to the second live room. In this way, the waiting time after the user switches to the live room can be reduced, and resource consumption can be reduced. It avoids continuously acquiring live resources when the user does not need them, thereby improving the user's live viewing experience.
[0180] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device 4 includes a processor 41 and a memory 42. Optionally, the electronic device 4 also includes an input device 43 and an output device 44. The processor 41, memory 42, input device 43, and output device 44 are coupled together via connectors, which include various interfaces, transmission lines, or buses, etc., and are not limited in this embodiment. It should be understood that in the various embodiments of this application, coupling refers to mutual connection in a specific way, including direct connection or indirect connection through other devices, such as through various interfaces, transmission lines, buses, etc.
[0181] Processor 41 may include one or more processors, such as one or more central processing units (CPUs). If the processor is a CPU, it may be a single-core CPU or a multi-core CPU. Optionally, processor 41 may be a processor group consisting of multiple CPUs, with the multiple processors coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in this embodiment.
[0182] The memory 42 can be used to store computer program instructions, as well as various types of computer program code, including program code for executing the present application. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), which is used for related instructions and data.
[0183] Input device 43 is used to input data and / or signals, and output device 44 is used to output data and / or signals. Input device 43 and output device 44 can be independent devices or an integrated device.
[0184] It is understood that in this embodiment of the application, the memory 42 can be used not only to store related instructions, but also to store related data. This embodiment of the application does not limit the specific data stored in the memory.
[0185] Understandable, Figure 7 This is merely a simplified design of an electronic device. In practical applications, the electronic device may also include other necessary components, including, but not limited to, any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of this application are within the protection scope of this application.
[0186] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0187] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will also readily understand that the various embodiments of this application have different focuses, and for the sake of convenience and brevity, the same or similar parts may not be repeated in different embodiments. Therefore, parts not described or not described in detail in one embodiment can be referred to the descriptions in other embodiments.
[0188] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0189] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0190] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0191] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0192] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for playing live video, characterized in that, The method includes: When the first live video corresponding to the first live room is played on the live video playback page corresponding to the live video player, the next adjacent live room corresponding to the first live room is determined as the second live room. A resource management thread corresponding to the second live room is created through the resource manager in the live video player. The live resource acquisition component corresponding to the second live room is started through the resource management thread. The first live resource corresponding to the second live room is acquired through the live resource acquisition component. The live video player creates a decoder and renderer corresponding to the second live room based on the acquired first live resource. When it is determined that the decoder and renderer corresponding to the second live room have been created, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room; When a post-switching operation is detected for the live video playback page, the live resource acquisition component is started through the resource management thread. The live resource acquisition component begins to acquire the second live resource corresponding to the second live room. The live resource acquisition component notifies the live video player to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video. The second live video is then played on the live video playback page.
2. The method according to claim 1, characterized in that, The step of acquiring the first live stream resource corresponding to the second live stream room through the live stream resource acquisition component includes: The live streaming address corresponding to the second live streaming room is obtained through the live streaming resource acquisition component. Establish a communication connection between the server corresponding to the second live streaming room and the live streaming address; The first live streaming resource corresponding to the second live streaming room is obtained from the server corresponding to the second live streaming room through the communication connection.
3. The method according to claim 1, characterized in that, The step of creating the decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player includes: The first live streaming resource is parsed by the live streaming video player to obtain the audio and video encoding format, and a decoder corresponding to the second live streaming room is created according to the audio and video encoding format. The first live streaming resource is processed by the decoder corresponding to the second live streaming room to obtain the first decoded audio and video frame. The resource manager creates a renderer corresponding to the second live streaming room based on the data format of the first decoded audio and video frame.
4. The method according to claim 1, characterized in that, The step of notifying the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and playing the second live video on the live video playback page includes: The live streaming resource acquisition component notifies the live streaming video player to send the second live streaming resource to the decoder corresponding to the second live streaming room. The decoder then performs audio and video decoding on the second live streaming resource to obtain the second decoded audio and video frame. The second decoded audio and video frame is obtained from the decoder by the live video player, and the second decoded audio and video frame is sent to the renderer corresponding to the second live room. The renderer performs rendering processing on the second decoded audio and video frame to obtain the second live video. The second live video is played on the live video playback page.
5. The method according to claim 1, characterized in that, Also includes: When the second live video corresponding to the second live room is played on the live video playback page, the preceding adjacent live room corresponding to the first live room is determined as the third live room. The live video player releases the decoder, renderer, live resource acquisition component, and resource management thread corresponding to the third live room.
6. The method according to claim 1, characterized in that, The step of closing the live stream resource acquisition component through the resource management thread to stop acquiring the first live stream resource corresponding to the second live stream room includes: If no post-switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live room, the live resource acquisition component is closed through the resource management thread to stop acquiring the first live resource corresponding to the second live room.
7. The method according to claim 1, characterized in that, Also includes: If a post-switching operation for the live video playback page is detected during the creation of the decoder and renderer corresponding to the second live room, the decoder and renderer corresponding to the second live room are called through the live video player to perform resource conversion processing on the first live resource to obtain the second live video, and the second live video is played on the live video playback page.
8. A live video playback device, characterized in that, The device includes: The determination module is used to determine the next adjacent live room as the second live room when the first live video is played on the live video playback page corresponding to the live video player. The startup module is used to create a resource management thread corresponding to the second live room through the resource manager in the live video player, start the live resource acquisition component corresponding to the second live room through the resource management thread, and start acquiring the first live resource corresponding to the second live room through the live resource acquisition component. A creation module is used to create a decoder and renderer corresponding to the second live room based on the acquired first live resource through the live video player. The shutdown module is used to shut down the live resource acquisition component through the resource management thread when it is determined that the decoder and renderer corresponding to the second live room have been created, so as to stop acquiring the first live resource corresponding to the second live room. The playback module is configured to, when a post-switching operation is detected for the live video playback page, activate the live resource acquisition component through the resource management thread, start acquiring the second live resource corresponding to the second live room through the live resource acquisition component, notify the live video player through the live resource acquisition component to call the decoder and renderer corresponding to the second live room to perform resource conversion processing on the second live resource to obtain the second live video, and play the second live video on the live video playback page.
9. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes a computer program or instructions; when the computer program or instructions are executed on a computer, the computer causes the computer to perform the method according to any one of claims 1 to 7.