Media resource playing method and device

By quickly starting media resource playback using a simple first playback page when the client starts, and switching to the second playback page that supports interactive operation during playback, the problem of long wait time for media resource viewing is solved and the viewing experience is improved .

CN119420997APending Publication Date: 2025-02-11BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411346419.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the prior art, the waiting time for the media resource to be started on the client to enter the playback page is long, resulting in a decrease in the viewing experience of the media resource.

Method used

By first displaying a simpler first play page when the client starts, quickly start playing media resources and switch to the second play page during playback, which contains more page elements to support interactive operations.

Benefits of technology

It shortens the waiting time for media resources, improves the user's media resources viewing experience, and at the same time realizes the experience conversion from immersive viewing and playback pages to smoothly interact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420997A_ABST
    Figure CN119420997A_ABST
Patent Text Reader

Abstract

The invention provides a media resource playing method and device. The method comprises the steps of displaying a first playing page in response to a starting instruction of a client, the first playing page comprising media resources in a playing state; in the process of playing the media resource, switching from the first playing page to a second playing page so as to continue to play the media resource on the second playing page; wherein the second playing page comprises the page elements of the first playing page, and the second playing page comprises at least one page element except the page elements of the first playing page. According to the embodiment of the invention, before the media resource is played by using the second playing page with relatively rich page elements, the media resource is quickly played by using the first playing page with relatively simple page elements, so that the watching waiting time of the media resource can be shortened, and the media resource watching experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet application technology, and in particular to a method and device for playing media resources. Background Art

[0002] With the rapid development of the Internet and mobile communication technologies, media playback services provided for mobile terminals such as mobile phones and tablet computers have been widely used.

[0003] Before using a client to play a media resource, a user needs to start the client to enter a play page, and then can watch the media resource on the play page. Currently, the waiting time from starting the client to entering the play page is long, which reduces the viewing experience of the media resource. Summary of the invention

[0004] The present application provides a method and device for playing media resources to shorten the waiting time for watching media resources, thereby improving the viewing experience of media resources.

[0005] In a first aspect, a method for playing a media resource is provided, comprising: in response to a startup instruction from a client, displaying a first play page, wherein the first play page includes a media resource in a playing state; during the process of playing the media resource, switching from the first play page to a second play page to continue playing the media resource on the second play page; wherein the second play page includes page elements of the first play page, and the second play page includes at least one page element other than the page elements of the first play page.

[0006] Before using the second playback page with richer page elements to play the media resource, first use the first playback page with simpler page elements to quickly start playing the media resource, which can shorten the viewing waiting time of the media resource and improve the user's media resource viewing experience.

[0007] In some implementations, the first play page does not support the first interactive operation being performed on the first play page, and the second play page supports the first interactive operation being performed on the second play page.

[0008] Compared with the second play page, the first play page supports fewer interactive operations or does not support interactive operations, which can simplify the implementation of the first play page. The simpler the implementation of the first play page, the shorter the viewing waiting time of the media resources on the first play page, thereby improving the user's media resource viewing experience.

[0009] In some implementations, the first interactive operation includes at least one of the following: a zoom operation on the page, a sliding operation on the page, a rotation operation on the page, a full-screen play operation on the media resource, a like operation on the media resource, a comment operation on the media resource, a collection operation on the media resource, and a forwarding operation on the media resource.

[0010] In some implementations, the media resource is a short video, and the first interactive operation includes switching videos by sliding the short video up and down; or, the media resource is a picture in a gallery, and the first interactive operation includes switching pictures by sliding the picture left and right.

[0011] In some implementations, the first play page does not support any interactive operations performed on the first play page, and the second play page supports interactive operations performed on the second play page.

[0012] The first playback page does not support any page interaction operations, so the first playback page allows immersive viewing of media resources. The second playback page supports page interaction operations, so users can interact with the second playback page smoothly. The above setting method is equivalent to providing users with a viewing experience from immersive viewing of media resources to smooth interaction with playback pages.

[0013] In some implementations, the at least one page element includes at least one of the following page elements: a first page element for displaying relevant information of the media resource; and a second page element for supporting interactive operations on the media resource.

[0014] Not displaying page elements related to media resources on the first playback page is conducive to the rapid start of media resources, and displaying page elements related to media resources on the second playback page is conducive to improving the user experience of the playback page.

[0015] In some implementations, the relevant information of the media resource includes at least one of the following: a content summary of the media resource, audio information in the media resource, information of the provider of the media resource; and / or, the interactive operations of the media resource include at least one of the following: like, comment, favorite, forward, and full-screen play.

[0016] In some implementations, the first playback page includes a navigation bar of the client.

[0017] Displaying the client's navigation bar on the first playback page can give viewers a feeling of entering the client, thereby enhancing the user's viewing experience.

[0018] In some implementations, the media resource is a media resource that the client caches in advance before receiving the start instruction.

[0019] The media resources to be played are cached in advance before the client is started. In this way, after the client is started, there is no need to go through the complex process of establishing a connection with the server, requesting media resources from the server, and downloading media resources from the server. This is conducive to further shortening the waiting time for watching media resources and improving the viewing experience of media resources.

[0020] In some implementations, before displaying the first playback page in response to a start instruction from the client, the method further includes: closing the client in response to a close instruction from the client, and retaining cached data of the client, wherein the cached data includes the media resource.

[0021] In the above implementation, the media resources played by the client this time are the media resources retained when the client was last closed. Such media resources are recommended to the client based on an accurate recommendation algorithm. Playing such media resources can enable the client to quickly start playing the media resources, which also meets the user's expectations.

[0022] In some implementations, the first play page is a play page that the client caches in advance before receiving the start instruction.

[0023] The first play page is cached in advance before the client is started. After the client is started, the first play page can be directly rendered without waiting for the first play page to be loaded, thereby facilitating further shortening the viewing waiting time of the media resource.

[0024] In some implementations, the first playback page plays the media resource based on a first surface view; and / or, the second playback page plays the media resource based on a second surface view.

[0025] The surface view can run through an independent sub-thread to support asynchronous rendering of media resources. Playing media resources based on the surface view helps speed up the rendering of media resources and shorten the viewing waiting time of media resources.

[0026] In some implementations, the second playback page plays the media resource based on the second surface view, and the method further includes: calling a performDrawFinished method before the second playback page renders the media resource for the first time.

[0027] In some versions of the Android system, when the surface view performs the first rendering, the sub-thread where the surface view is located needs to wait for the frame callback of the main thread. Therefore, in the process of switching from the first playback page to the second playback page, if the main thread is blocked, it may take a long time to wait for the second surface view to start the first rendering, resulting in a black screen phenomenon in the switching process from the first playback page to the second playback page. In this implementation, before the second playback page renders the media resources for the first time, the performDrawFinished method is called first. The performDrawFinished method is equivalent to notifying the sub-thread where the second surface view is located that the first rendering has ended, so that the sub-thread where the second surface view is located can directly render without waiting for the frame callback of the main thread, thereby achieving smooth switching between the first playback page and the second playback page.

[0028] According to a second aspect, a device for playing media resources is provided, comprising: an instruction monitoring unit, configured to monitor a startup instruction of a client; an interface display unit, configured to: display a first playback page in response to the startup instruction of the client, wherein the first playback page includes a media resource in a playback state; during the playback of the media resource, switch from the first playback page to a second playback page to continue playing the media resource on the second playback page; wherein the second playback page includes page elements of the first playback page, and the second playback page includes at least one page element other than the page elements of the first playback page.

[0029] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect or any one of the implementations of the first aspect is implemented.

[0030] In a fourth aspect, an electronic device is provided, comprising: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, and the program instructions, when read and executed by the one or more processors, execute the method described in the first aspect or any one of the implementation methods of the first aspect.

[0031] According to a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method described in the first aspect or any one of the implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0033] Figure 1 A system architecture diagram applicable to the embodiments of the present application.

[0034] Figure 2 This is an example diagram of the playback process of a media resource.

[0035] Figure 3 A schematic flowchart of a method for playing media resources provided in an embodiment of the present application.

[0036] Figure 4 An example diagram of the playback process of a media resource provided in an embodiment of the present application.

[0037] Figure 5 Another example diagram of the playback process of media resources provided in an embodiment of the present application.

[0038] Figure 6 A schematic block diagram of a playback device provided in an embodiment of the present application.

[0039] Figure 7 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0041] In order to facilitate understanding of the embodiments of the present application, a system architecture to which the embodiments of the present application can be applied is first described by way of example. Figure 1 An exemplary system architecture to which the embodiments of the present application can be applied is shown. Figure 1 As shown, the system architecture may include: a terminal device 110 and a server 120. The terminal device 110 may be connected to the server 120 via a wireless network or a wired network. It should be understood that Figure 1 The number of terminal devices 110 and servers 120 in the embodiment is only for illustration. According to the implementation requirements, the system architecture based on the embodiment of the present application can have any number of terminal devices 110 and servers 120.

[0042] The terminal device 110 may include, but is not limited to, a smart mobile terminal, a wearable device, a personal computer (PC), a smart home device, etc. Among them, smart mobile devices may include, for example, mobile phones, tablet computers, laptop computers, personal digital assistants (PDA), Internet car terminals, etc. Wearable devices may include, for example, smart watches, smart glasses, smart bracelets, virtual reality (VR) devices, augmented reality (AR) devices, mixed reality devices (i.e., devices that can support virtual reality and augmented reality), etc. Smart home devices may include, for example, smart TVs, smart refrigerators with display screens, etc.

[0043] The terminal device 110 may be provided with a client 112. The client 112 involved in the embodiment of the present application may be an application (APP), a small program, or a web program running through a browser, etc. running on the terminal device. The client 112 may interact with the server 120 through a network, request and obtain media resources from the server 120, and play the media resources on the display interface of the client 112.

[0044] The server 120 may be a platform that provides media resource playback services. The server 120 may be a single server, a server group consisting of multiple servers, or a cloud server. A cloud server, also known as a cloud computing server or cloud host, is a host product in a cloud computing service system that solves the defects of difficult management and weak service scalability in traditional physical hosts and virtual private servers (VPS) services.

[0045] The server 120 may use a streaming transmission method to send the media resource to the client 112, and the client 112 plays the media resource while downloading the media stream. Alternatively, the server 120 may also use a progressive transmission method, that is, send the media resource to the client 112, and the client 112 plays it after downloading the entire media resource. In addition, the server 120 may also use other methods to transmit the media resource to the client 112. For example, the server 120 may provide the media resource based on a content delivery network (CDN) and transmit it to the client 112.

[0046] Combination of the above Figure 1 , an example is given to illustrate the system architecture to which the embodiments of the present application can be applied. The following is a detailed description of the media resource playback process after the client is started.

[0047] If the user wants to use the client to play media resources, the client needs to be started first. After the client is started, in order to play the media resources, on the one hand, the media resources need to be obtained from the server, and on the other hand, the playback page needs to be loaded (or built) on the client. Only after the media resources are obtained and the playback page is loaded, can the media resources be viewed on the client.

[0048] With the development of media playback technology, the functions supported by the playback page are becoming more and more abundant. For example, in the process of playing media resources using the playback page, users can slide the playback page up and down to switch media resources. For another example, in the process of playing media resources using the playback page, users can perform operations such as likes, comments, favorites, and forwarding on the media resources. The implementation of the above functions requires the support of a large number of page elements, which makes the design of the playback page more and more complicated. In addition, the page elements of the playback page usually need to be loaded through the main thread (or UI thread), that is, only after the main thread has loaded a large number of page elements involved in the playback page can it start playing media resources, which leads to a long loading process for the playback page. In addition, the main thread is usually busy. During the loading process, the main thread may need to handle other tasks with higher priority and interrupt the loading process, which will undoubtedly further increase the time consuming of the playback page loading process.

[0049] by Figure 2 For example, after the client is started, it will usually be displayed on the client interface first. Figure 2 The client will then switch from screen A to screen B and display "Loading" (or an icon or control with a similar meaning) on ​​screen B. While displaying screen B, the client needs to load all page elements in the playback page. After all page elements in the playback page have been loaded, the client will display playback page C.

[0050] Continue to see Figure 2, the play page C includes a view 21, and the media resource in the play state is displayed in the view 21. In addition, the play page C also includes page elements 22a to 22c, wherein the page element 22a is used to display the profile information of the media resource, the page element 22b is used to view the provider of the media resource, and the page element 22c is used to view the audio information of the media resource. In addition, the play page C also includes page elements 23a to 23e, wherein the page element 23a is used to perform a like operation on the media resource, the page element 23b is used to perform a comment operation on the media resource, the page element 23c is used to perform a collection operation on the media resource, the page element 23d is used to perform a forwarding operation on the media resource, and the page element 23e is used to display the media resource in full screen. In addition, the play page C also includes page elements 24a to 24d, which form a navigation bar of the client, which is used to navigate between different pages provided by the client. In addition, the play page C also supports the up and down sliding operation of the play page C to switch the media resources.

[0051] According to the above introduction to the page elements in the playback page C, it can be seen that in order to display the playback page C, a huge number of page elements (UI elements) need to be loaded, which causes the client to stay on the screen B for a long time. In other words, the user needs to wait for a long time to watch the media resource, thereby reducing the viewing experience of the media resource.

[0052] In response to the above problems, after the client is started, the embodiment of the present application first plays the media resources through the first playback page; then, in the process of playing the media resources, the client switches from the first playback page to the second playback page to continue playing the media resources on the second playback page. Compared with the second playback page, the first playback page has fewer page elements (that is, the first playback page is a relatively simple playback page). Using the first playback page to play the media resources first can achieve rapid start of the media resources and shorten the viewing waiting time of the media resources. After switching from the first playback page to the second playback page, since the second playback page has more page elements, the second playback page can provide more information to the user and / or support more playback functions. In summary, it can be seen that the embodiment of the present application not only shortens the viewing waiting time before playing the media resources, but also does not reduce the user experience of the playback page.

[0053] For ease of understanding, the following Figure 3 , the embodiments of the present application are illustrated in more detail.

[0054] Figure 3 A schematic flowchart of a method for playing media resources provided in an embodiment of the present application. Figure 3The method may be executed by a terminal device, which may be Figure 1 As a more specific example, Figure 3 The method can be executed by a client installed on the terminal device (which can be an application (APP) supporting media resource playback, a small program, or a web program running through a browser). Figure 3 Each step in is described in detail.

[0055] See also Figure 3 In step S310, in response to the client's start instruction, the first play page is displayed. The first play page can be understood as a relatively simple play page. That is, compared with the second play page mentioned later, the design and / or function of the first play page is relatively simple, and has fewer page elements. For example, the first play page may only include a page element (view) for displaying a media resource in a play state. Alternatively, in addition to including a page element for displaying a media resource in a play state, the first play page may also display at least one other page element, such as a navigation bar of the client. For example, see Figure 4 After receiving the startup instruction from the client, the client interface may first display screen A, which includes the client's LOGO. Then, the client may continue to display the first play page B. The first play page B may only include view 41, and play the media resource through view 41. Alternatively, in addition to view 41, the first play page B may also include a navigation bar 42 of the client (the navigation bar 42 may be located at the bottom of the client interface). Displaying the navigation bar 42 of the client on the first play page will give the user a feeling of having entered the client, and the visual perception is better.

[0056] The first play page can display media resources in the play state. The media resources (also referred to as media data or media content) mentioned in the embodiment of the present application may include at least one of a video or a picture in an atlas. The video mentioned here can be a long video or a short video. The distinction between so-called long videos and short videos is mainly reflected in the duration, content, and production method of the video. Among them, long videos are usually more than tens of minutes in length; the content is relatively complete and in-depth, and the content quality is relatively high; usually professional photography, editing, sound effects and other teams are required to complete the production cycle, the production cycle is long, and more resources are required; for example, movies, TV series, documentaries, etc. are all long videos. Short videos are usually within a dozen minutes or a few minutes; the content is usually relatively short and concise, mainly to highlight a highlight or quickly convey information; the production is also relatively simple, often shot with a mobile phone or other portable device, and post-editing is relatively easy; short videos pay more attention to rapid production and rapid dissemination, emphasizing timeliness; for example, some funny videos, life record videos, advertising videos, short dramas, etc. are all short videos.

[0057] In addition, the video mentioned in the embodiments of the present application can be a horizontal video or a vertical video. The so-called horizontal video refers to a video whose width is greater than its height, which is more in line with the natural field of human eyes and more suitable for viewing on wide-screen devices (such as TVs and computers). Vertical video refers to a video whose height is greater than its width, which is more suitable for viewing on narrow-screen devices (such as smartphones and tablets) and is more popular in the fields of social media and short videos.

[0058] The pictures in the atlas mentioned in the embodiments of the present application can be ordinary pictures or long pictures. The so-called ordinary pictures are usually single, static images, and users can see the complete content of ordinary pictures without additional operations. Long pictures are usually a special form of pictures, composed of continuous images. Users need to scroll or slide to view the content of the entire long picture. Long pictures usually need to combine multiple image elements together to form a coherent content.

[0059] The media resource on the first play page is in a play state, which means that the media resource is in a state where the user can watch it. Taking the media resource as a video as an example, the media resource on the first play page is in a play state, which means that the first play page is displaying the picture in the video. Taking the media resource as a picture as an example, the media resource on the first play page is in a play state, which means that the first play page is displaying the picture.

[0060] Continue to see Figure 3 In step S320, during the playback of the media resource, the first playback page is switched to the second playback page to continue to play the media resource on the second playback page. It should be understood that the second playback page includes at least one other page element in addition to the page elements of the first playback page. In other words, compared with the first playback page, the second playback page has a richer design and / or function, which can enhance the viewing experience of the media resource and / or the use experience of the playback page. Figure 4 For example, after the client is started, the first playback page B and the second playback page C will be displayed in sequence. By comparing the first playback page B and the second playback page C, it can be seen that the page elements in the second playback page C are far more than the page elements in the first playback page B, so that the second playback page can provide users with richer visual information and / or support richer page functions.

[0061] The “continue playing media resources on the second play page” mentioned above refers to the continuity of the content of the media resources played on the first play page and the media resources played on the second play page. Taking video as an example, continuing to play media resources on the second play page may mean: the video content played on the second play page forms a coherent video content with the video content played on the first play page, so as to minimize the user's perception of the switch of the play page, rather than replaying the video content that has been played on the first play page on the second play page. Taking pictures as an example, continuing to play media resources on the second play page may mean: if the first play page always displays the first picture, the second play page can continue to display the first picture; if the first play page first displays the first picture and then displays the second picture, the second play page continues to display the second picture.

[0062] Combination of the above Figure 3 , the method for playing media resources provided in the embodiment of the present application is illustrated by way of example. Figure 3 As can be seen from the description, the embodiment of the present application first uses a relatively simple playback page (i.e., the first playback page mentioned above) to quickly start playing the media resource, thereby reducing the user's viewing waiting time. Then, during the playback of the media resource, the embodiment of the present application switches from the first playback page to the second playback page with more page elements to support richer playback functions, which can improve the viewing / use experience of the playback page.

[0063] As mentioned above, there are differences between the first play page and the second play page. In some implementations, the difference between the first play page and the second play page can be reflected in the different page functions that can be implemented by the two. In other words, the second play page can implement more page functions than the first play page. Implementing relatively simple page functions on the first play page is conducive to the rapid start of media resources, and implementing relatively rich page functions on the second play page is conducive to improving the viewing and / or use experience of the play page.

[0064] For example, the first play page does not support the first interactive operation for the first play page (or for the media resources on the first play page), while the second play page supports the first interactive operation for the second play page (or for the media resources on the second play page). The first interactive operation mentioned here may include one interactive operation or multiple interactive operations. In some implementations, although the first play page does not support the first interactive operation, it can support the second interactive operation, and the second play page can support the first interactive operation and the second interactive operation at the same time. In other implementations, the first play page may not support any page interactive operation, and the second play page may support page interactive operation. Interactive operations are usually implemented by loading UI elements through the main thread. The more interactive operations supported, the longer the loading time of the play page. Therefore, reducing the interactive operations supported by the first play page, or even building a play page that does not support interactive operations at all, can minimize the loading time of the first play page, thereby reducing the viewing waiting time of the media resources. In addition, in the process of playing media resources based on the first play page, since the interactive operations for the play page are reduced or even cancelled, it can give users an immersive media resource viewing experience. Of course, since the second play page still supports interactive operations, after entering the second play page, the user can still interact smoothly with the second play page while watching the media resource.

[0065] In some implementations, the first interactive operation mentioned above (i.e., an interactive operation that is not supported by the first playback page but supported by the second playback page) may include at least one of the following operations: a zoom operation of the page, a sliding operation of the page, a rotation operation of the page, a full-screen playback operation for a media resource, a like operation for a media resource, a comment operation for a media resource, a collection operation for a media resource, and a forwarding operation for a media resource. The page sliding operation mentioned here may be an ordinary page sliding operation or a page sliding operation for switching media resources. Taking the media resource as a short video as an example, the first interactive operation may include switching videos by sliding the short video up and down. Taking the media resource as a picture in a collection as an example, the first interactive operation may include switching pictures by sliding the picture left and right. Several more specific examples of the first interactive operation are given below.

[0066] For example, the first interactive operation includes a page zooming operation triggered by a two-finger zoom gesture. During the display of the first play page, if the user zooms the first play page by using a two-finger zoom gesture, the first play page does not respond, that is, the size of the first play page remains unchanged. Accordingly, after switching to the second play page, if the user zooms the second play page by using a two-finger zoom gesture, the second play page is zoomed.

[0067] For another example, the first interactive operation includes a page sliding operation triggered by a single-finger sliding operation. During the display of the first play page, if the user slides the first play page by a single-finger sliding operation, the first play page is unresponsive, that is, the relative position of the first play page in the client interface remains unchanged. Accordingly, after switching to the second play page, if the user slides the second play page by a single-finger sliding operation, the relative position of the second play page in the client interface is changed.

[0068] For another example, the first interactive operation includes at least one of a full-screen play operation for a media resource, a like operation for a media resource, a comment operation for a media resource, a favorite operation for a media resource, or a forwarding operation for a media resource. In the process of displaying the first playback page, since the first playback page does not display page elements for triggering the above interactive operations, the user cannot trigger such interactive operations. Accordingly, after switching to the second playback page, the second playback page will display page elements for triggering the above interactive operations, and the user can perform the corresponding interactive operations through such page elements.

[0069] As mentioned above, the second playback page may include at least one page element in addition to the page elements of the first playback page. The embodiment of the present application does not specifically limit the type or function of the at least one page element. The at least one page element may be a page element related to a media resource. In some implementations, the first playback page does not include: a page element for displaying relevant information of a media resource (hereinafter referred to as the first page element), and the second playback page includes the first page element. The relevant information of the media resources mentioned here may include at least one of the following: a content introduction of the media resource, audio information in the media resource, and information about the provider of the media resource. Figure 4 For example, Figure 4 It shows that after receiving the start instruction, the client will sequentially go through screen A (LOG page), the first play page B and the second play page C. Figure 4 It can be seen that compared with the page elements in the first play page B, the second play page C further includes page elements 43a to 43c. Among them, page element 43a is used to display the content introduction of the media resource, page element 43b is used to display the information of the provider of the media resource (after triggering page element 43b, the provider of the media resource can be viewed), and page element 43c is used to display the audio information in the media resource (after triggering page element 43c, the audio information in the media resource can be played separately).

[0070] In some implementations, the first play page does not include: a page element for supporting interactive operations on media resources (hereinafter referred to as the second page element), while the second play page includes the second page element. The interactive operations on media resources mentioned here may include at least one of the following: like, comment, favorite, forward, and full-screen play. Figure 4 For example, Figure 4 It shows that after receiving the start instruction, the client will sequentially go through screen A (LOG page), the first play page B and the second play page C. Figure 4 It can be seen that compared with the page elements in the first play page B, the second play page C further includes page elements 44a to 44e. Among them, page element 44a is used to support the like operation for the media resource, page element 44b is used to support the comment operation for the media resource, page element 44c is used to support the collection operation for the media resource, page element 44d is used to support the forwarding operation for the media resource, and page element 44e is used to support the full-screen play (or full-screen view) operation for the media resource.

[0071] As mentioned above, one of the reasons why users have to wait a long time before watching media resources after the client is started is that the loading time of the playback page is long. In addition, another reason for the long waiting time before users watch media resources is that the process of obtaining media resources is complicated. Specifically, after the client is started, the client needs to establish a connection with the server through a handshake protocol. After establishing a connection with the server, the client needs to send a media resource request to the server to request the acquisition of media resources. After sending the media resource request, the client needs to wait for the server to send the media resources. It can be seen that from the startup of the client to the acquisition of media resources, it is necessary to go through many processes such as connection establishment, media resource request, and media resource download in sequence, which makes the whole process time-consuming. In addition, when the network conditions are poor, the download time of the media resources will increase, which will make the whole process take longer.

[0072] In order to avoid the user being unable to watch the media resource due to the long time it takes to obtain the media resource, in some implementations, the media resource can be cached in advance before the client receives the start instruction. In this way, after the client is started, once the first play page is loaded, the media resource can be played using the first play page without executing a complicated media resource acquisition process, thereby shortening the waiting time for watching the media resource.

[0073] The media resource can be a video that was automatically cached when the client was used last time, or it can be a media resource that the user actively cached during any use of the client. For example, when playing a media resource, the client usually caches one or more media resources to be played, so that after the current media resource is played, or after the user switches the media resource, the next media resource can be played quickly. Therefore, this feature of the client can be used to continue to retain the media resources that the client has cached but not yet played after the user closes the client. In this way, when the client is started next time, the first playback page can be used to directly play the media resources that the client retained when it was closed last time.

[0074] Since the first play page is relatively simple to implement, it can be loaded and rendered after the client is started. However, it takes a certain amount of time to load and render a simple play page. In order to further shorten the waiting time before watching the media resource, the first play page can be cached in advance. In other words, before the client is started, an idle play page is created in advance, and after the client is started, the idle play page can be used to play the media resource directly, thereby speeding up the display of the media resource.

[0075] Both the first play page and the second play page can play media resources based on a view (a control defined by Android). In some implementations, the view used to present media resources on the first play page and / or the second play page may be a surface view (SurfaceView). Compared with other types of views (such as texture views (TextureView)), surface views support asynchronous rendering of views, that is, media resources can be drawn in an independent sub-thread. Since the surface view can draw media resources in an independent sub-thread, the speed at which media resources are displayed on the screen can be accelerated, and the waiting time before watching media resources can be shortened (the main thread needs to load more UI elements, and if the view is loaded through the main thread, it may take a long time to wait). In addition, loading the view through an independent sub-thread can also reduce the burden on the main thread, thereby reducing the probability of the main thread being blocked.

[0076] There are certain differences in the implementation of surface views in different versions of Android systems. In higher versions of Android systems (such as Android systems above Android 12, such as Android 13) and other Android systems modified by some manufacturers (such as Android 8.1), if the surface view is used to play media resources, the first rendering (or drawing) of the surface view needs to wait for the frame callback (doFrame callback) of the main thread. In other words, only after receiving the frame callback of the main thread can the first rendering of the media resource be performed in the child thread (the drawing thread where the surface view is located). The reason why this version of the Android system is set up in this way is to match the refresh rate of the screen provided by the main thread and the child thread, so that the screen synchronization can be achieved. However, when switching from the first playback page (the first playback page can present media resources based on the first surface view) to the second playback page (the second playback page can play media resources based on the second surface view), assuming that the main thread is blocked and cannot immediately send a frame callback to the child thread, at this time, the child thread will be waiting for the frame callback of the main thread. The playback content of the media resource will be interrupted (the duration of the interruption is related to the duration of the main thread being blocked), which causes the user to see a black screen on the client interface, reducing the viewing experience of the media resource.

[0077] In order to avoid the above-mentioned black screen phenomenon, in some implementations, the performDrawFinished method of the surface view is called before the second playback page renders the media resources for the first time. For example, the performDrawFinished method can be reflectively called using a hook function. Calling the performDrawFinished method is equivalent to notifying the sub-thread where the second surface view is located that the drawing rendering has been completed, and the media resources can be directly displayed on the screen. In other words, the drawing thread where the second surface view is located originally needs to wait for the frame callback of the main thread before the first rendering can be performed. However, after calling the performDrawFinished method, it is equivalent to informing the drawing thread where the second surface view is located that the last drawing rendering has ended. In this way, the sub-thread where the second surface view is located believes that the next drawing rendering is not the first drawing rendering, so there is no need to wait for the frame callback of the main thread, and the drawing rendering can be started directly.

[0078] The following describes the embodiments of the present application in more detail with reference to specific examples. Figure 5 The examples are only intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific values ​​or specific scenarios illustrated. Figure 5 It is obvious that various equivalent modifications or changes can be made, and such modifications or changes also fall within the scope of the embodiments of the present application.

[0079] See also Figure 5 , both reference numerals 52 and 54 show the cold start process of the client. Reference numeral 52 shows the client cold start method provided in an embodiment of the present application, and reference numeral 54 shows the traditional client cold start method. Referring to reference numeral 52, after the client receives the start instruction, the LOGO page 521 will be displayed on the client interface first. Then, at time t2, the client interface displays the first play page 522. The first play page 522 is a relatively simple play page, and the first play page has fewer page elements, including only a view for playing media resources and a navigation bar at the bottom of the client. In addition, the first play page 522 does not support page interaction operations. Then, at time t3, the client interface displays the second play page 523. Compared with the first play page 522, the second play page 523 has richer page elements, and the second play page 523 supports page interaction operations.

[0080] Different from the client cold start process shown in reference numeral 52, see reference numeral 54. After the client receives the start command, the LOGO page 541 will be displayed on the client interface first. Then, before the arrival of time t4, the client interface always displays "loading" (or a graphic or control expressing a similar meaning), see reference numeral 542. After the playback page is loaded, at time t4, the client interface starts to play the media resources through the playback page 543, and supports page interaction operations at the same time. By comparing the client cold start process shown in reference numerals 52 and 54, it can be seen that the embodiment of the present application can greatly shorten the viewing waiting time of media resources (the viewing waiting time can be shortened by more than half), thereby improving the user's media resource viewing experience.

[0081] The above text, in conjunction with the accompanying drawings, provides a detailed example of the embodiments of the present application. It should be noted that the second play page mentioned above includes the page elements of the first play page, which means that from a visual perspective, the second play page and the first play page contain the same page elements. The visually identical page elements in the first play page and the second play page can be implemented by the same code or by different codes in the underlying code. For example, see Figure 4 , the first play page B and the second play page C both include the visually identical view 41 (the media resources played in the view 41 belong to the media content rendered by the view, and are not part of the view). However, the view 41 in the first play page B and the view 41 in the second play page C can be implemented by different codes at the underlying level, that is, the view 41 in the first play page B and the view 41 in the second play page C can correspond to two different view controls at the code level.

[0082] As mentioned above, the first play page is relatively simple in design and is mainly used to implement a quick play function of media resources. Therefore, in some implementations, the first play page may be referred to as a flash play page.

[0083] As mentioned above, before displaying the first playback page, the client will first receive a startup instruction. There are many ways to input the startup instruction to the client. For example, the user can click on the icon of the client to input the startup instruction to the client. For another example, the user can input the startup instruction to the client by voice (such as calling a voice assistant to open the client).

[0084] The play page mentioned above can be understood as a container that can play media resources. In some implementations, the play page can also be called a "player", "player page" or "player framework". In the embodiments of the present application, these terms can be used interchangeably without conflict.

[0085] In some implementations, to support seamless switching of playback pages, the second playback page and the first playback page may share the same media resource instead of using two identical media resources, so that the first playback page can transition naturally and smoothly to the second playback page.

[0086] It should be noted that the “playback” involved in the embodiments of the present application refers to converting the content of the media resource into images, sounds, or a combination of the two that can be directly perceived by humans.

[0087] It should be noted that the limitations such as "first" and "second" involved in the embodiments of the present application do not have limitations on size, order, quantity, etc., and are only used to distinguish them in name. For example, "first play page" and "second play page" are used to distinguish two play pages in name. For another example, "first page element" and "second page element" are used to distinguish different page elements in name.

[0088] It should also be noted that in order to detect the occurrence of the client's startup instruction or shutdown instruction, the client can pre-register a callback function or method for the instruction to be detected, and the function or method contains the logic code that needs to be executed in response to the instruction. Once the instruction is monitored, the client can automatically call the corresponding callback function or method. For example, a callback function can be pre-registered for the client's startup instruction, and the callback function triggers the client to display the first playback page. The response to the instruction in the embodiment of the present application can be implemented in this way, and will not be described in detail one by one later.

[0089] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the scope of protection of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0090] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0091] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to" depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when determining" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0092] It should also be noted that the page elements involved in the embodiments of the present application generally refer to visual elements on the playback page, which may include text, icons, images, videos, components, etc. The so-called component refers to an object obtained by simply encapsulating data and methods, which may also be called a control. It may include buttons, input boxes, drop-down menus, dialog boxes, navigation bars, cards, icons that can generate interactions, etc.

[0093] Combination of the above Figures 1 to 5 , describes the method embodiment of the present application in detail, and the following is combined with Figure 6 to Figure 7 , describes the device embodiment of the present application in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.

[0094] Figure 6A structural diagram of a playback device for media resources provided in an embodiment of the present application. The playback device 600 may include an instruction monitoring unit 610 and an interface display unit 620. The instruction monitoring unit 610 is configured to monitor the startup instruction of the client; the interface display unit 620 is configured to: in response to the startup instruction of the client, display a first playback page, wherein the first playback page contains media resources in a playback state; during the playback of the media resources, switch from the first playback page to the second playback page to continue playing the media resources on the second playback page; wherein the second playback page contains page elements of the first playback page, and the second playback page contains at least one page element other than the page elements of the first playback page.

[0095] In some implementations, the first play page does not support the first interactive operation being performed on the first play page, and the second play page supports the first interactive operation being performed on the second play page.

[0096] In some implementations, the first interactive operation includes at least one of the following: a zoom operation on the page, a sliding operation on the page, a rotation operation on the page, a full-screen play operation on the media resource, a like operation on the media resource, a comment operation on the media resource, a collection operation on the media resource, and a forwarding operation on the media resource.

[0097] In some implementations, the media resource is a short video, and the first interactive operation includes switching videos by sliding the short video up and down; or, the media resource is a picture in a gallery, and the first interactive operation includes switching pictures by sliding the picture left and right.

[0098] In some implementations, the at least one page element includes at least one of the following page elements: a first page element for displaying relevant information of the media resource; and a second page element for supporting interactive operations on the media resource.

[0099] In some implementations, the relevant information of the media resource includes at least one of the following: a content summary of the media resource, audio information in the media resource, information of the provider of the media resource; and / or, the interactive operations of the media resource include at least one of the following: like, comment, favorite, forward, and full-screen play.

[0100] In some implementations, the first playback page includes a navigation bar of the client.

[0101] In some implementations, the media resource is a media resource that the client caches in advance before receiving the start instruction.

[0102] In some implementations, the playback device 600 further includes: a processing unit configured to: before receiving the start instruction, in response to a close instruction from the client, close the client and retain cache data of the client, wherein the cache data includes the media resource.

[0103] In some implementations, the first play page is a play page that the client caches in advance before receiving the start instruction.

[0104] In some implementations, the first playback page plays the media resource based on a first surface view; and / or, the second playback page plays the media resource based on a second surface view.

[0105] In some implementations, the second playback page plays the media resource based on the second surface view, and the playback device 600 further includes: a processing unit configured to: call a performDrawFinished method before the second playback page renders the media resource for the first time.

[0106] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0107] 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 application 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 the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0108] In addition, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the aforementioned method embodiments is implemented.

[0109] In addition, an embodiment of the present application further provides an electronic device, including:

[0110] one or more processors; and

[0111] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute any of the methods described in the foregoing method embodiments.

[0112] The present application also provides a computer program product, including a computer program, which implements any one of the methods described in the aforementioned method embodiments when executed by a processor.

[0113] in, Figure 7 The architecture of the electronic device is shown as an example, which may include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720 may be communicatively connected via a communication bus 730.

[0114] Among them, the processor 710 can be implemented by a general-purpose CPU, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., to execute relevant programs to implement the technical solutions provided in this application.

[0115] The memory 720 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 720 can store an operating system 721 for controlling the operation of the electronic device 700, and a basic input output system (BIOS) 722 for controlling the low-level operation of the electronic device 700. In addition, a web browser 723, a data storage management system 724, and a playback processing device 725 for media files, etc. can also be stored. The playback processing device 725 for the above-mentioned media files can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.

[0116] The input / output interface 713 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0117] The network interface 714 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0118] The bus 730 comprises a pathway for transmitting information between the various components of the device (eg, the processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720).

[0119] It should be noted that, although the above device only shows a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, a memory 720, a bus 730, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.

[0120] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a computer program product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0121] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A method for playing a media resource, characterized in that: include: In response to a start instruction from a client, display a first play page, wherein the first play page includes a media resource in a play state; During the process of playing the media resource, switching from the first play page to the second play page to continue playing the media resource on the second play page; The second play page includes the page elements of the first play page, and the second play page includes at least one page element other than the page elements of the first play page.

2. The method according to claim 1, characterized in that The first play page does not support the first interactive operation being performed on the first play page, and the second play page supports the first interactive operation being performed on the second play page.

3. The method according to claim 2, characterized in that The first interactive operation includes at least one of the following: a zooming operation of a page, a sliding operation of a page, a rotating operation of a page, a full-screen playback operation on a media resource, a like operation on the media resource, a comment operation on the media resource, a collection operation on the media resource, and a forwarding operation on the media resource.

4. The method according to claim 3, characterized in that: The media resource is a short video, and the first interactive operation includes switching the video by sliding the short video up and down; or The media resource is a picture in a picture collection, and the first interactive operation includes performing picture switching by sliding the picture left or right.

5. The method according to any one of claims 1 to 4, characterized in that The at least one page element includes at least one of the following page elements: The first page element is used to display relevant information of the media resource; The second page element is used to support interactive operations on the media resource.

6. The method according to claim 5, characterized in that: The relevant information of the media resource includes at least one of the following: a content introduction of the media resource, audio information in the media resource, and information of a provider of the media resource; and / or, The interactive operations of the media resources include at least one of the following: like, comment, favorite, forward, and full-screen play.

7. The method according to any one of claims 1 to 4, characterized in that The first play page includes a navigation bar of the client.

8. The method according to any one of claims 1 to 4, characterized in that The media resource is a media resource that the client caches in advance before receiving the start instruction.

9. The method according to claim 8, characterized in that Before displaying the first play page in response to the start instruction of the client, the method further includes: In response to a closing instruction from the client, the client is closed, and cache data of the client is retained, where the cache data includes the media resource.

10. The method according to any one of claims 1 to 4, characterized in that The first play page is a play page that is cached in advance by the client before receiving the start instruction.

11. The method according to any one of claims 1 to 4, characterized in that: The first playback page plays the media resource based on the first surface view; and / or The second playback page plays the media resource based on a second surface view.

12. The method according to claim 11, characterized in that The second playing page plays the media resource based on the second surface view, and the method further includes: Before the second playback page renders the media resource for the first time, the performDrawFinished method is called.

13. A device for playing media resources, characterized in that: include: An instruction monitoring unit is configured to monitor the startup instruction of the client; The interface display unit is configured as follows: In response to a start instruction from the client, display a first play page, wherein the first play page includes a media resource in a play state; During the process of playing the media resource, switching from the first play page to the second play page to continue playing the media resource on the second play page; The second play page includes the page elements of the first play page, and the second play page includes at least one page element other than the page elements of the first play page.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.

15. An electronic device, characterized in that: include: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein when the one or more processors read and execute the program instructions, the method according to any one of claims 1 to 12 is executed.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.