Preview picture display method and device, electronic equipment and storage medium
By obtaining the target preview picture corresponding to the current display progress and sewing the preview picture from it, the problem of time taking to obtain preview pictures in the prior art is solved, which improves the display efficiency of the preview picture and reduces the delay.
Patent Information
- Application Number
- CN202311865810.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, it takes a long time to obtain preview pictures from the server, resulting in a high delay in displaying the preview screen.
By obtaining the target preview picture in the preview picture collection, the target preview picture corresponds to the current display progress, and the target preview picture corresponding to the current display progress is cut from the target preview picture, and the target preview picture is displayed.
The time spent on obtaining preview images and the memory space occupied by parsing preview images is reduced, the success rate of preview images is improved and the interception speed of preview images is reduced, and the display delay of preview images is reduced.
Smart Images

Figure CN120238688A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method, an apparatus, an electronic device, and a storage medium for displaying a preview screen. Background Art
[0002] Currently, generally, a preview screen of a video is intercepted at preset time intervals, and after all the preview screens are intercepted, a preview picture containing all the intercepted preview screens, such as a sprite map, is generated. Thus, when the client detects that the user drags the progress bar of the video, it will obtain the preview picture of the video from the server and display the preview screen of the video based on the preview picture.
[0003] However, in the prior art, it takes a long time to obtain the preview picture from the server, resulting in a high display delay of the preview screen. Summary of the Invention
[0004] Embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for displaying a preview screen, so as to reduce the time consumed for obtaining the preview picture from the server and reduce the display delay of the preview screen.
[0005] In a first aspect, embodiments of the present disclosure provide a method for displaying a preview screen, including:
[0006] Obtaining a target preview picture from a set of preview pictures, where the target preview picture corresponds to a current display progress, the current display progress is the display progress to which the media content is currently adjusted, the set of preview pictures is a set of preview pictures corresponding to the media content, and the preview picture includes at least one picture area, and different picture areas present preview screens corresponding to the media content at different display progresses;
[0007] Intercepting a target preview screen corresponding to the current display progress from the target preview picture, and displaying the target preview screen.
[0008] In a second aspect, embodiments of the present disclosure further provide a device for displaying a preview screen, including:
[0009] A picture obtaining module, configured to obtain a target preview picture from a set of preview pictures, where the target preview picture corresponds to a current display progress, the current display progress is the display progress to which the media content is currently adjusted, the set of preview pictures is a set of preview pictures corresponding to the media content, and the preview picture includes at least one picture area, and different picture areas present preview screens corresponding to the media content at different display progresses;
[0010] A screen display module, configured to intercept a target preview screen corresponding to the current display progress from the target preview picture and display the target preview screen.
[0011] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
[0012] One or more processors;
[0013] A memory, configured to store one or more programs,
[0014] When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for displaying a preview screen as described in the embodiments of the present disclosure.
[0015] In a fourth aspect, an embodiment of the present disclosure 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 for displaying a preview screen as described in the embodiments of the present disclosure is implemented.
[0016] The method, apparatus, electronic device, and storage medium for displaying a preview screen provided by the embodiments of the present disclosure obtain a target preview picture from a set of preview pictures. The target preview picture corresponds to the current display progress, and the current display progress is the display progress to which the media content is currently adjusted. The set of preview pictures is a set of preview pictures corresponding to the media content, and the preview picture includes at least one picture area, and different picture areas present preview pictures corresponding to the media content at different display progress; intercept a target preview screen corresponding to the current display progress from the target preview picture and display the target preview screen. By using the above technical solutions, the embodiments of the present disclosure display a preview screen based on the preview picture corresponding to the display progress adjusted currently, so that only a relatively small preview picture needs to be obtained to display the preview screen, which can reduce the time consumed for obtaining the preview picture and the memory space occupied by parsing the preview picture, improve the parsing success rate of the preview picture, and increase the interception speed of the preview screen, thereby reducing the display latency of the preview screen. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the original components and elements are not necessarily drawn to scale.
[0018] Figure 1 It is a schematic flowchart of a method for displaying a preview screen provided by an embodiment of the present disclosure;
[0019] Figure 2Schematic flowchart of another method for displaying a preview screen provided by an embodiment of the present disclosure;
[0020] Figure 3 Schematic flowchart of an alternative method for displaying a preview screen provided by an embodiment of the present disclosure;
[0021] Figure 4 Block diagram of a device for displaying a preview screen provided by an embodiment of the present disclosure;
[0022] Figure 5 Schematic diagram of a structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0023] Embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0024] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0025] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0026] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependent relationships.
[0027] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more".
[0028] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0029] It should be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user in an appropriate manner and the user's authorization should be obtained in accordance with relevant laws and regulations.
[0030] For example, when responding to a user's active request, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application program, server, or storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message.
[0031] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request can be, for example, in the form of a pop-up window. The prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0032] It should be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0033] It should be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related regulations.
[0034] Figure 1 It is a schematic flowchart of a method for displaying a preview screen provided by an embodiment of the present disclosure. This method can be executed by a preview screen display device, where the device can be implemented by software and / or hardware and can be configured in an electronic device. Typically, it can be configured in a mobile phone or a tablet computer. The method for displaying a preview screen provided by the embodiments of the present disclosure is applicable to the scenario of displaying a preview screen corresponding to the current adjusted display progress.
[0035] Taking the media content as a video and the preview picture as a spritesheet as an example, when the user is watching a video, the user can jump to an interesting time point to continue playing by dragging the progress bar. During this process, as the user's finger continuously moves horizontally, a picture area will appear above the progress bar, which continuously displays the video preview screen near the time point dragged to currently, so as to facilitate the user to check whether the user has dragged to the segment he / she is interested in. This technology is called the spritesheet technology.
[0036] In the sprite map technology, when the user drags the progress bar, the client can request a large image (i.e., the sprite map) generated by combining all the preview images of the current video from the server according to a Uniform Resource Locator (URL) of a sprite map in the current video data. After this large image is returned from the server, according to the time point dragged to by the user, the small preview image corresponding to this time point is found from the large image through a pre-designed calculation rule, and it is intercepted and displayed to the user to optimize the user experience of dragging the progress bar.
[0037] According to the acquisition method and display principle of the sprite map, it can be known that the sprite map is a large image composed of small preview images representing several time nodes. The longer the video duration, the more small preview images that make up the sprite map, and the larger the sprite map.
[0038] However, the larger the requested image, the greater the bandwidth occupied when downloading from the server, and the longer the time for the image to be sent to the client; the larger the image, the greater the failure rate of parsing the image, the more memory space it occupies, and the corresponding increase in the probability of an Out Of Memory (OOM) crash, especially obvious on low-end devices; the larger the image, the more small preview images that make up the large image, and the slower the speed of finding and intercepting the small preview image corresponding to a certain time point from it. Thus, it affects the speed of displaying the actual image in the preview image area when the user drags the progress bar, and affects the user's interaction experience.
[0039] Therefore, the embodiments of the present disclosure provide a method for displaying preview images to solve at least some of the above technical problems.
[0040] As Figure 1 shown, the method for displaying preview images provided in this embodiment may include:
[0041] S101. Obtain a target preview image in the preview image set, where the target preview image corresponds to the current display progress, the current display progress is the display progress to which the media content is currently adjusted, the preview image set is the set of preview images corresponding to the media content, and at least one picture area is included in the preview image, and different picture areas present preview images corresponding to the media content at different display progress.
[0042] Among them, the media content may be media content whose display progress is currently adjusted by the user, and it may include but is not limited to video. The current display progress can be understood as the display progress to which the media content is currently adjusted, such as the display progress to which the user currently adjusts during the process of adjusting the display progress of the media content.
[0043] The preview image set can be a set of preview images of media content. The preview image set can contain one or more preview images, depending on the length of the media content. For example, each preview image can contain no more than a preset number of preview frames. Thus, when the length of the media content is long and the number of preview frames exceeds the preset number, there can be multiple preview images for the media content. Correspondingly, the preview image set of the media content can contain these multiple preview images. When the length of the media content is short and the number of preview frames does not exceed the preset number, there can be only one preview image for the media content. Correspondingly, the preview image set of the media content can contain only this one preview image. The preset number can be understood as the maximum number of preview frames shown in each preview image, and it can be flexibly set according to needs.
[0044] The preview image can be a picture composed of preview frames corresponding to different display progress of the media content, used to implement the preview of the picture during the adjustment of the media content display progress. It can be a sprite image or other images with corresponding functions other than the sprite image. Each preview image can contain at least one frame area. For example, the preview image can contain no more than a preset number of frame areas. Different frame areas can be used to present the preview frames of the media content at different display progress. For example, each preview image can be composed of continuously intercepted preview frames. The preview frame can be obtained by intercepting the picture of the media content once every preset time interval in the media content, for the user to preview, so that the user can determine whether the display progress has been adjusted to the one they want to adjust to.
[0045] The target preview image can be the preview image in the preview image set corresponding to the current display progress of the media content. In other words, the target preview image contains the target preview frame corresponding to the current display progress.
[0046] In this embodiment, when it is detected that the user adjusts the display progress of the media content, the target preview image corresponding to the current display progress to which the media content is adjusted can be obtained from the preview image set of the media content. For example, the current display progress to which the media content is adjusted can be detected, and based on this current display progress, the target preview image in the preview image set of the media content can be determined and the target preview image can be obtained, so as to facilitate the subsequent display of the preview frame based on the target preview image.
[0047] S102. Intercept the target preview frame corresponding to the current display progress from the target preview image, and display the target preview frame.
[0048] Among them, the target preview screen can be a preview screen corresponding to the current display progress. Different preview screens can correspond to different time nodes in the media content. Thus, the target preview screen can be the preview screen in the target preview images, whose corresponding time node in the media content is closest to the time node corresponding to the current display progress in the media content.
[0049] Specifically, after obtaining the target preview images of the media content, the position information of the target preview screen in the target preview images can be determined according to the current display progress of the media content, such as determining which preview screen the target preview screen is in the target preview images, or determining the row and column numbers of the target preview screen in the target preview images; the target preview screen is intercepted from the target preview images according to the position information; and the intercepted target preview screen is displayed. Exemplarily, the target preview screen can be displayed in the form of a thumbnail in the target area of the media content display page.
[0050] Herein, the target area can be understood as the area on the media content display page for displaying the preview screen corresponding to the current display progress when the user adjusts the display progress. It can be a preset area or an area associated with the current position adjusted by the progress indicator in the progress bar. The progress indicator can be an indicator for indicating the current display progress.
[0051] The method for determining the position information of the target preview screen in the target preview images is not limited. Exemplarily, it is assumed that each preview image contains at most m (i.e., the preset quantity) preview screens, the time interval between adjacent preview screens in the media content is n seconds, and the time node corresponding to the current display progress in the media content is the k-th second. Thus, the maximum length (such as the preset media content segment length) of the media content segment corresponding to the preview image in the media content can be determined as m×n seconds; thereby, the number of seconds corresponding to the current display progress in the target preview images can be determined by calculating the remainder of k / (m×n); furthermore, the position information of the target preview screen in the target preview images can be determined based on this number of seconds. For example, the number of seconds can be divided by n and rounded down to obtain the serial number of the target preview screen in the target preview images (assuming the serial number of the first preview screen in the target preview images is 0).
[0052] In this embodiment, during the process of a user adjusting the display progress of media content, such as during the process of the user performing a progress adjustment operation on the media content, the current display progress to which the media content is adjusted is periodically obtained. The target preview image corresponding to the current display progress in the preview image set is obtained, the target preview frame corresponding to the current display progress is intercepted from the target preview image, and the target preview frame is displayed. When displaying the target preview frame, exemplarily, if no preview frame is displayed on the media content display page before this display of the target preview frame, the target preview frame can be additionally displayed on the media content display page; if a preview frame is displayed on the media content display page before this display of the target preview frame, the currently displayed preview frame on the media content display page can be switched to the target preview frame.
[0053] At this time, optionally, before obtaining the target preview image in the preview image set, it further includes: during the execution of the progress adjustment operation, periodically determining the current display progress corresponding to the progress adjustment operation, where the progress adjustment operation is used to adjust the display progress of the media content; the displaying of the target preview frame includes: additionally displaying the target preview frame, or switching the currently displayed preview frame to the target preview frame.
[0054] Among them, the progress adjustment operation can be an operation for adjusting the display progress of the media content, and the execution manner of the progress adjustment operation is not limited. Optionally, the progress adjustment operation can include a preset sliding operation, such as a dragging operation on the progress indicator in the progress bar, or a horizontal sliding operation on the media content display page, etc.
[0055] The method for displaying a preview frame provided in this embodiment obtains the target preview image in the preview image set. The target preview image corresponds to the current display progress, and the current display progress is the display progress to which the media content is currently adjusted. The preview image set is a set of preview images corresponding to the media content, and at least one frame area is included in the preview image, and different frame areas present preview frames corresponding to the media content at different display progresses; the target preview frame corresponding to the current display progress is intercepted from the target preview image, and the target preview frame is displayed. By using the above technical solution in this embodiment, the preview frame is displayed based on the preview image corresponding to the currently adjusted display progress, so that only a relatively small preview image needs to be obtained to display the preview frame, which can reduce the time consumed for obtaining the preview image and the memory space occupied by parsing the preview image, improve the parsing success rate of the preview image, and increase the interception speed of the preview frame, thereby reducing the display delay of the preview frame.
[0056] Figure 2Schematic flowchart of another method for displaying a preview screen provided by an embodiment of the present disclosure. The solution in this embodiment can be combined with one or more alternative solutions in the above embodiments. Optionally, the obtaining of the target preview image in the preview image set includes: determining the target image identification information corresponding to the current display progress; obtaining the target preview image corresponding to the target image identification information from the server in the preview image set.
[0057] Correspondingly, as Figure 2 shown, the method for displaying a preview screen provided in this embodiment may include:
[0058] S201. Determine the target image identification information corresponding to the current display progress, where the current display progress is the display progress to which the media content is currently adjusted.
[0059] The target image identification information can be understood as the image identification information corresponding to the current display progress, and this image identification information can be used to identify the preview image (i.e., the target preview image) corresponding to the current display progress. Exemplarily, the image identification information can be the identity ID of the preview image or the URL of the preview image, etc. Hereinafter, the case where the image identification information is the URL of the preview image will be used as an example for description.
[0060] In this embodiment, the target image identification information corresponding to the current display progress can be determined to facilitate subsequent obtaining of the target preview image corresponding to the current display progress based on this target image identification information, where the determination method of the target image identification information is not limited.
[0061] In some embodiments, when the server receives a request from the client to obtain media content data for playing, the server can send the image identification information of each preview image in the preview image set of the media content to the client, for example, the server can send the image identification information of each preview image of the media content together with the media content data of the media content to the client. Correspondingly, the client can obtain the image identification information of each preview image included in the preview image set of the media content from the server. For example, when the client receives a play request for a certain media content, the client can obtain the image identification information of each preview image of the media content from the server, such as receiving the image identification information sent by the server. At this time, optionally, before determining the target image identification information corresponding to the current display progress, it further includes: in response to a play request for the media content, obtaining the preview image information of the media content from the server, where the preview image information includes the image identification information of each preview image in the preview image set.
[0062] Among them, the playback request for media content can be used to request the playback of the media content, and it can be generated in response to the playback operation for a certain media content. The playback operation can be a trigger operation for indicating the playback of the media content, and its specific execution method is not limited.
[0063] The preview picture information of the media content can be information related to the preview picture of the media content. The preview picture information can include the picture identification information of each preview picture in the preview picture set. Optionally, the preview picture information further includes preview screen configuration information, and the preview screen configuration information includes the preset time interval information between adjacent preview screens and the preset layout information of the preview screens in the preview picture. The preview screen configuration information can be information used to describe the preset configuration of the preview screen, and it can include the preset time interval information between adjacent preview screens and the preset layout information of the preset screen in the preview picture. The preset time interval information can be information used to describe the time interval when intercepting the preview screen, such as the preset time length between adjacent two preview screens in the media content, etc. The preset layout information can be information used to describe the preset layout method of the preview screen in the preview picture, such as the total number of rows and columns of the preview screens included in a single preview picture, etc.
[0064] In some embodiments, after obtaining the preview picture information of the media content from the server, it further includes: determining the preset media content segment length of the preview picture according to the preview screen configuration information, where the preset media content segment length is the length of the media content segment corresponding in the media content; the determining of the target picture identification information corresponding to the current display progress includes: based on the current time node corresponding to the current display progress in the media content and the preset media content segment length, determining the target picture identification information corresponding to the current display progress.
[0065] Among them, the preset media content segment length can be the length of the media content segment corresponding to a single preview picture in the media content, and this length can be, for example, the maximum length. For example, when there are a preset number of preview screens arranged in the preview picture, the length of the media content segment corresponding to it in the media content. The media content segment corresponding to a certain preview picture can be, for example, the media content segment presenting the preview screen based on this preview picture, and the time range corresponding to this media content segment in the media content can be determined based on the time ranges corresponding to each preview screen included in this preview picture in the media content. The current time node can be the time node corresponding to the current display progress in the media content screen.
[0066] In the above embodiments, the target picture identification information corresponding to the current display progress can be determined according to the preset media content segment length of the preview picture.
[0067] Exemplarily, the server can send the picture identification information of each preview picture in the preview picture set to the client according to the sequence of the media content segments corresponding to the preview pictures in the media content. Also, the preview screen configuration information of the preview pictures is sent to the client.
[0068] Correspondingly, the client can store the received picture identification information according to this sequence or record this sequence of the received picture identification information. Also, determine the preset media content segment length of the preview pictures according to the received preview screen configuration information. For example, determine the number of preview screens included in a single preview picture according to the received preset layout information, and calculate the preset media content segment length of a single preview picture based on this number information and the received preset time interval information.
[0069] Thus, when the client determines the target picture identification information corresponding to the current display progress, it can determine the serial number of the target picture identification information based on the current time node corresponding to the current display progress and the preset media content segment length. For example, divide the current time node information by the preset media content segment length and take the integer part as the serial number of the target picture identification information. This serial number can be used to indicate which picture identification information the target picture identification information is in the above sequence (here, it can be assumed that the serial number of the first picture identification information is 0). After determining the serial number of the target picture identification information, the target picture identification information can be obtained from the received picture identification information corresponding to the media content according to this serial number.
[0070] S202. Obtain a target preview picture corresponding to the target picture identification information from the preview picture set of the server. The preview picture set is a set of preview pictures corresponding to the media content, and at least one picture area is included in the preview picture, and different picture areas present preview pictures corresponding to different display progress of the media content.
[0071] In this embodiment, after determining the target picture identification information corresponding to the current display progress, the target preview picture corresponding to the target picture identification information can be obtained from the preview picture set of the media content of the server, so as to subsequently intercept and display the current preview picture corresponding to the current display progress based on the target preview picture.
[0072] Taking the target picture identification information as a URL as an example, a preview picture acquisition request carrying the URL can be sent to the server, and the target preview picture returned by the server in response to the preview picture acquisition request is received.
[0073] In some embodiments, the target preview image can be obtained from the server only when the target preview image corresponding to the target image identification information is not stored in the local cache, so as to further reduce the occupation of the server bandwidth. For example, after determining the target image identification information, the target image identification information can be used as a key to find out whether the target preview image corresponding to the target image identification information is stored in the local cache; if it is determined that the target preview image is not stored in the local cache, then based on the target image identification information, the target preview image in the preview image set is obtained from the server, and the obtained target preview image is stored in the local cache, such as using the target image identification information as the key and the target preview image as the value, and storing the target preview image in the local cache. At this time, optionally, the target preview image corresponding to the target image identification information in the preview image set is obtained from the server, including: if the target preview image corresponding to the target image identification information is not stored in the local cache, then based on the target image identification information, the target preview image in the preview image set is obtained from the server, and the target preview image is stored in the local cache. Wherein, this local cache can be understood as the local cache of the client.
[0074] In addition, if it is determined that a preview image corresponding to the target image identification information is stored in the local cache, the target preview image can be directly obtained from the local cache. At this time, optionally, after the target image identification information corresponding to the current display progress is determined, it also includes: if a target preview image corresponding to the target image identification information is stored in the local cache, the target preview image is obtained from the local cache.
[0075] S203: capturing a target preview screen corresponding to the current display progress from the target preview picture, and displaying the target preview screen.
[0076] The preview screen display method provided in this embodiment can reduce the bandwidth occupied when obtaining the preview image from the server, and improve the speed of obtaining the preview image.
[0077] The following is an exemplary description of the method for displaying the preview screen provided in the embodiment of the present disclosure:
[0078] Taking the media content as a video and the preview image as a Sprite as an example, in order to solve the problems of high bandwidth usage, long downloading time, increased image parsing failure rate, high memory usage, and slow response to user interaction experience caused by the server only sending a large Sprite (i.e., a Sprite containing all preview images captured by the video) regardless of the length of the video, in some embodiments, the preview image can be displayed in the following way:
[0079] Generate N small sprites according to the video duration. Each sprite is still a collection of small pictures of adjacent time slices (i.e., preview pictures). The value of N depends on the video duration. Suppose there is a video with a duration of 9 minutes, and a small picture of the video is captured every 3 seconds. Each sprite consists of 25 small pictures (i.e., a 75-second video segment). Then, this 540-second video will generate 8 sprites (540÷75 = 7.2. Since the video frames corresponding to the last 0.2 part may also be shown to the user, it also occupies one sprite, so N is 8).
[0080] Thus, when the user watches this video, such as when the client requests video data from the server after receiving a play request for this video, the server sends N sprite URLs (i.e., picture identification information). In the above example, N = 8. In addition, the server can also send the preset time interval information (such as 3 seconds in the above example) when capturing the preview pictures and the preset layout information of the sprites (such as the total number of rows and columns of the preview pictures included in a single sprite) to the client.
[0081] Furthermore, the client can request the sprite containing the current time point according to the current time point where the finger slides when the user drags the progress bar. After the server returns the sprite, the client can then find the preview picture corresponding to the current time point from the sprite through a preset calculation rule and intercept and display the preview picture to the user. For example, the user drags the progress bar. Suppose the current drag reaches the 90th second. Since the client can determine that each sprite represents a duration of 75 seconds (i.e., the length of the preset media content segment) according to the preset time interval information and the preset layout information, it can be determined that the picture at the 90th second is in the second of the 8 sprites. So, it only needs to request the second sprite (i.e., the target preview picture) according to the URL corresponding to the second sprite. After the server returns the sprite, then find the preview picture closest to the 90th second (i.e., the target preview picture) from it, intercept and display it. If the user drags the progress bar from the 90th second to the 180th second, only the second sprite (representing the pictures between the 76th second and the 150th second) and the third sprite (representing the pictures between the 151st second and the 225th second) of the 8 sprites need to be requested, and the above process of intercepting the preview picture is repeated.
[0082] Figure 3 It is a schematic flowchart of an optional method for displaying a preset picture provided by an embodiment of the present disclosure. As Figure 3 shown, the method for displaying a preset picture provided in this embodiment can be described as follows:
[0083] A1. The user opens the client and prepares to watch the video.
[0084] A2. The client obtains the current video data from the server and starts playing the video. The current video data contains N preview picture URLs (i.e., the URLs of each preview picture included in the set of preview pictures of the video).
[0085] A3. The user watches the video and starts dragging the progress bar of the video when they want to switch to the content they are interested in by dragging the progress bar.
[0086] A4. The client obtains the current time point indicated by the progress identifier on the progress bar when the user starts dragging (i.e., the current display progress), determines which time range the current time point belongs to among the time ranges represented by the sprite map URLs, and finds the corresponding sprite map URL (i.e., determines the target picture identifier information corresponding to the current display progress).
[0087] A5. Using this URL as the key, the client checks whether there is a sprite map (i.e., the target preview picture) corresponding to this URL in the local cache.
[0088] A6. When there is cache data corresponding to the sprite map in the local cache, the client obtains the sprite map from the local cache (i.e., if the target preview picture corresponding to the target picture identifier information is stored in the local cache, the target preview picture is obtained from the local cache);
[0089] When there is no cache data corresponding to the sprite map in the local cache, the client requests the sprite map corresponding to this URL from the server. After the server returns the sprite map, using this URL as the key, the sprite map is stored in the client cache (i.e., if the target preview picture corresponding to the target picture identifier information is not stored in the local cache, based on the target picture identifier information, the target preview picture in the preview picture set is obtained from the server and the target preview picture is stored in the local cache).
[0090] A7. The client finds the small picture of the frame closest to the current time point from this sprite map according to the pre-designed calculation rule (i.e., the target preview frame)
[0091] A8. The client intercepts the small picture of the frame from this sprite map and displays it to the user (i.e., intercepts the target preview frame corresponding to the current display progress from the target preview picture and displays the target preview frame).
[0092] A9. The client determines whether the user continues to horizontally slide and drag the progress bar. If the user continues to drag the progress bar, it returns to execute A4; if the user does not continue to drag the progress bar, for example, if the user releases the hand, the display of the small picture of the frame is cancelled. At this time, the user can watch the video according to the adjusted latest progress.
[0093] Through the above preview screen display method in this embodiment, the client only requests preview images at corresponding time points according to its own needs, which can reduce the bandwidth cost of the server and the return duration of the preview image interface, reduce the memory occupancy of the client and the probability of OOM crashes, and reduce the failure rate of preview screen capture, network failure rate, and decoding failure rate of the client, improving the usage experience of the progress bar.
[0094] Figure 4 It is a structural block diagram of a preview screen display device provided by an embodiment of the present disclosure. This device can be implemented by software and / or hardware, and can be configured in an electronic device. Typically, it can be configured in a mobile phone or a tablet computer, and can display a preview screen corresponding to the current display progress adjusted by executing the preview screen display method. As Figure 4 shown, the preview screen display device provided in this embodiment may include: a picture acquisition module 401 and a screen display module 402, where
[0095] The picture acquisition module 401 is used to acquire a target preview picture from a set of preview pictures. The target preview picture corresponds to the current display progress, and the current display progress is the display progress to which the media content is currently adjusted. The set of preview pictures is the set of preview pictures corresponding to the media content. The preview picture contains at least one picture area, and different picture areas present preview pictures corresponding to the media content at different display progressions;
[0096] The screen display module 402 is used to intercept a target preview screen corresponding to the current display progress from the target preview picture and display the target preview screen.
[0097] For the preview screen display device provided in this embodiment, the picture acquisition module acquires a target preview picture from the set of preview pictures. The target preview picture corresponds to the current display progress, and the current display progress is the display progress to which the media content is currently adjusted. The set of preview pictures is the set of preview pictures corresponding to the media content. The preview picture contains at least one picture area, and different picture areas present preview pictures corresponding to the media content at different display progressions. The screen display module intercepts a target preview screen corresponding to the current display progress from the target preview picture and displays the target preview screen. By using the above technical solution in this embodiment, the preview screen is displayed based on the preview picture corresponding to the currently adjusted display progress, so that only a smaller preview picture needs to be acquired to display the preview screen, which can reduce the time consumed for acquiring the preview picture and the memory space occupied by parsing the preview picture, improve the parsing success rate of the preview picture, and increase the interception speed of the preview screen, thereby reducing the display latency of the preview screen.
[0098] Optionally, the picture acquisition module 401 includes: an information determination unit, configured to determine target picture identification information corresponding to the current display progress; a first preview picture acquisition unit, configured to acquire a target preview picture corresponding to the target picture identification information from a preview picture set of a server.
[0099] Further, the preview screen display device provided in this embodiment may further include: an information acquisition module, configured to, before determining the target picture identification information corresponding to the current display progress, in response to a play request for media content, acquire preview picture information of the media content from a server, where the preview picture information includes picture identification information of each preview picture in the preview picture set.
[0100] Optionally, the preview picture information further includes preview screen configuration information, where the preview screen configuration information includes preset time interval information between adjacent preview screens and preset layout information of the preview screen in the preview picture.
[0101] Further, the preview screen display device provided in this embodiment may further include: a length determination module, configured to, after acquiring the preview picture information of the media content from the server, determine a preset media content segment length of the preview picture according to the preview screen configuration information, where the preset media content segment length is the length of a corresponding media content segment in the media content; the information determination unit may specifically be configured to: based on a current time node corresponding to the current display progress in the media content and the preset media content segment length, determine the target picture identification information corresponding to the current display progress.
[0102] Optionally, the first preview picture acquisition unit is specifically configured to: when a target preview picture corresponding to the target picture identification information is not stored in a local cache, based on the target picture identification information, acquire the target preview picture from the preview picture set of the server, and store the target preview picture in the local cache.
[0103] Optionally, the picture acquisition module 401 further includes: a second preview picture acquisition unit, configured to, after determining the target picture identification information corresponding to the current display progress, if a target preview picture corresponding to the target picture identification information is stored in the local cache, acquire the target preview picture from the local cache.
[0104] Further, the preview screen display device provided in this embodiment may further include: a progress determination module, configured to periodically determine a current display progress corresponding to the progress adjustment operation during the execution of the progress adjustment operation before obtaining the target preview image in the preview image set, where the progress adjustment operation is used to adjust the display progress of the media content; the screen display module 402 may be configured to: increase the display of the target preview screen, or switch the currently displayed preview screen to the target preview screen.
[0105] The preview screen display device provided in the embodiments of the present disclosure may execute the preview screen display method provided in any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the preview screen display method. For technical details not described in detail in this embodiment, reference may be made to the preview screen display method provided in any embodiment of the present disclosure.
[0106] Next, with reference to Figure 5 , which shows a schematic structural diagram of an electronic device (such as a terminal device) 500 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0107] As Figure 5 shown, the electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0108] Generally, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or wiredly to exchange data. AlthoughFigure 5 An electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0109] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by a processing device 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0110] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0111] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0112] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.
[0113] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to: obtain a target preview picture from a set of preview pictures, the target preview picture corresponding to the current display progress, the current display progress being the display progress to which the media content is currently adjusted, the set of preview pictures being a set of preview pictures corresponding to the media content, and at least one picture area being included in the preview pictures, different picture areas presenting preview pictures corresponding to the media content at different display progress; intercept a target preview picture corresponding to the current display progress from the target preview picture, and display the target preview picture.
[0114] Computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.
[0116] The units involved in the embodiments described in the present disclosure can be implemented in software or in hardware. In some cases, the name of the module does not constitute a limitation on the unit itself.
[0117] The functions described above herein can be performed, at least in part, by one or more hardware logic components. By way of example, and without limitation, the types of hardware logic components that may be used include: field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), system-on-a-chip (SOC), complex programmable logic devices (CPLD), and the like.
[0118] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0119] According to one or more embodiments of the present disclosure, Example 1 provides a method for displaying a preview screen, including:
[0120] Obtain a target preview image from a set of preview images, where the target preview image corresponds to the current display progress, the current display progress is the display progress to which the media content is currently adjusted, the set of preview images is a set of preview images corresponding to the media content, and at least one picture area is included in the preview images, and different picture areas present preview pictures corresponding to the media content at different display progressions;
[0121] Crop a target preview picture corresponding to the current display progress from the target preview image, and display the target preview picture.
[0122] According to one or more embodiments of the present disclosure, Example 2 According to the method described in Example 1, the obtaining of the target preview image from the set of preview images includes:
[0123] Determine target picture identification information corresponding to the current display progress;
[0124] Obtain a target preview image corresponding to the target picture identification information from the set of preview images from the server.
[0125] According to one or more embodiments of the present disclosure, Example 3 According to the method described in Example 2, before determining the target picture identification information corresponding to the current display progress, it further includes:
[0126] In response to a play request for media content, obtain preview picture information of the media content from the server, where the preview picture information includes picture identification information of each preview picture in the set of preview images.
[0127] According to one or more embodiments of the present disclosure, Example 4 According to the method described in Example 3, the preview picture information further includes preview picture configuration information, and the preview picture configuration information includes preset time interval information between adjacent preview pictures and preset layout information of the preview pictures in the preview images.
[0128] According to one or more embodiments of the present disclosure, Example 5 According to the method described in Example 4, after obtaining the preview picture information of the media content from the server, it further includes:
[0129] Determine a preset media content segment length of the preview images according to the preview picture configuration information, and the preset media content segment length is the length of the media content segment corresponding to the media content;
[0130] The determining of the target picture identification information corresponding to the current display progress includes:
[0131] Determine the target picture identification information corresponding to the current display progress based on the current time node corresponding to the current display progress in the media content and the preset media content segment length.
[0132] According to one or more embodiments of the present disclosure, Example 6 According to the method described in Example 2, obtaining, from the server, a target preview picture corresponding to the target picture identification information in the preview picture set includes:
[0133] If the target preview picture corresponding to the target picture identification information is not stored in the local cache, then based on the target picture identification information, obtain the target preview picture in the preview picture set from the server, and store the target preview picture in the local cache.
[0134] According to one or more embodiments of the present disclosure, Example 7 According to the method described in Example 6, after determining the target picture identification information corresponding to the current display progress, further includes:
[0135] If the target preview picture corresponding to the target picture identification information is stored in the local cache, then obtain the target preview picture from the local cache.
[0136] According to one or more embodiments of the present disclosure, Example 8 According to the method described in any one of Examples 1-7, before obtaining the target preview picture in the preview picture set, further includes:
[0137] During the execution of the progress adjustment operation, periodically determine the current display progress corresponding to the progress adjustment operation, where the progress adjustment operation is used to adjust the display progress of the media content;
[0138] Displaying the target preview screen includes:
[0139] Increase the display of the target preview screen, or switch the currently displayed preview screen to the target preview screen.
[0140] According to one or more embodiments of the present disclosure, Example 9 provides a display device for a preview screen, including:
[0141] A picture acquisition module, configured to acquire a target preview picture in a preview picture set, where the target preview picture corresponds to the current display progress, the current display progress is the display progress to which the media content is currently adjusted, the preview picture set is a set of preview pictures corresponding to the media content, and at least one picture area is included in the preview pictures, and different picture areas present preview pictures corresponding to the media content at different display progressions;
[0142] A screen display module, configured to intercept a target preview screen corresponding to the current display progress from the target preview picture and display the target preview screen.
[0143] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, including:
[0144] One or more processors;
[0145] A memory, configured to store one or more programs,
[0146] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for displaying a preview screen as described in any one of Examples 1-8.
[0147] According to one or more embodiments of the present disclosure, Example 11 provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method for displaying a preview screen as described in any one of Examples 1-8 is implemented.
[0148] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0149] In addition, although the operations are depicted in a specific order, this should not be construed as requiring that the operations be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of a single embodiment can also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment can also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0150] Although the subject matter has been described in language specific to structural features and / or methodological act logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A method for displaying a preview screen, characterized in that, including: Obtain a target preview image from a set of preview images, where the target preview image corresponds to the current display progress, the current display progress is the display progress to which the media content is currently adjusted, the set of preview images is a set of preview images corresponding to the media content, and at least one frame area is included in the preview image, and different frame areas present preview frames corresponding to the media content at different display progressions; Intercept a target preview frame corresponding to the current display progress from the target preview image, and display the target preview frame.
2. The method according to claim 1, characterized in that The obtaining of the target preview image from the set of preview images includes: Determine target image identification information corresponding to the current display progress; Obtain the target preview image corresponding to the target image identification information from the set of preview images from the server.
3. The method according to claim 2, wherein Before determining the target image identification information corresponding to the current display progress, it further includes: In response to a play request for the media content, obtain preview image information of the media content from the server, where the preview image information includes image identification information of each preview image in the set of preview images.
4. The method according to claim 3, wherein The preview image information further includes preview frame configuration information, and the preview frame configuration information includes preset time interval information between adjacent preview frames and preset layout information of the preview frames in the preview image.
5. The method according to claim 4, characterized in that, After obtaining the preview image information of the media content from the server, it further includes: Determine a preset media content segment length of the preview image according to the preview frame configuration information, and the preset media content segment length is the length of the media content segment corresponding to the media content. The determining of the target image identification information corresponding to the current display progress includes: Based on the current time node corresponding to the current display progress in the media content and the preset media content segment length, determine the target image identification information corresponding to the current display progress.
6. The method according to claim 2, wherein The obtaining of the target preview image corresponding to the target image identification information from the set of preview images from the server includes: If the target preview image corresponding to the target image identification information is not stored in the local cache, then based on the target image identification information, obtain the target preview image from the set of preview images from the server, and store the target preview image in the local cache.
7. The method according to claim 6, characterized in that, After determining the target image identification information corresponding to the current display progress, it further includes: If the target preview image corresponding to the target image identification information is stored in the local cache, then obtain the target preview image from the local cache.
8. The method according to any one of claims 1-7, characterized in that Before obtaining the target preview image from the set of preview images, it further includes: During the execution of the progress adjustment operation, periodically determine the current display progress corresponding to the progress adjustment operation, and the progress adjustment operation is used to adjust the display progress of the media content; The displaying of the target preview frame includes: Increasing the display of the target preview frame, or switching the currently displayed preview frame to the target preview frame.
9. A display device for a preview screen, characterized in that, including: An image acquisition module, configured to acquire a target preview image from a set of preview images, where the target preview image corresponds to the current display progress, the current display progress is the display progress to which the media content is currently adjusted, the set of preview images is a set of preview images corresponding to the media content, and at least one frame area is included in the preview images, and different frame areas present preview frames corresponding to the media content at different display progressions; A frame display module, configured to intercept a target preview frame corresponding to the current display progress from the target preview image, and display the target preview frame.
10. An electronic device, characterized in that, Comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the preview frame display method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the preview frame display method according to any one of claims 1-8 when executed.