Video cover display method, device, equipment, medium and program product
By customizing video cover selection and processing logic, generating thumbnails, and providing placeholder and error image processing, the limitations of image loading frameworks in meeting user customization needs are resolved, improving user experience and loading efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PATEO CONNECT (NANJING) CO LTD
- Filing Date
- 2024-12-04
- Publication Date
- 2026-06-05
AI Technical Summary
Existing image loading frameworks have limitations in meeting users' customization and personalization needs, and cannot effectively support users in selecting video cover images, thus limiting users' creative expression.
Through custom logic and image loading interfaces, users can select video cover images and process the images with preset parameters to generate thumbnails that are displayed in the video display area. Placeholder and error image processing are also provided, and image loading is optimized by combining caching strategies.
It enhanced user engagement and satisfaction, improved image loading efficiency and user experience, shortened loading time, and optimized the compactness and browsing of the video list.
Smart Images

Figure CN122153185A_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of computer technology, and in particular to a video cover display method, apparatus, device, medium, and program product. Background Technology
[0002] Currently, many applications (APPs) on the market widely employ a range of image loading frameworks to optimize the efficiency of loading image or video data. These frameworks boast powerful image processing capabilities, efficient memory management, and user-friendly application programming interfaces (APIs). However, they have certain limitations in meeting users' personalized customization needs. Summary of the Invention
[0003] One objective of this application is to provide a video cover display method. A first image is obtained through an image loading interface. Since the first image is the video cover image selected by the user for the target video, the user can choose the video cover according to their preferences and needs. This customization and personalization enhances user engagement and satisfaction. By processing the image with preset parameters, the image size can be further compressed, improving loading efficiency. Moreover, thumbnails are usually smaller than the original image size, resulting in faster loading speeds and reduced network bandwidth. After obtaining the thumbnail, it is displayed within the display area of the target video. The thumbnail display makes the video list more compact and easier to browse, enabling users to quickly find content of interest and further improving user satisfaction with the application.
[0004] Another objective of this application is to provide a video cover display method that performs image processing through a predefined image loading interface and objective functions to obtain the processed image. The objective functions provided by the interface allow for the flexible definition and application of various image processing functions. When a new image processing function needs to be added, simply implement a new objective function and add it to the interface, thus simplifying the operation.
[0005] Another objective of this application is to provide a video cover display method. This method involves acquiring image parameters and compression parameters, processing a first image according to the image parameters to obtain a third image, and then compressing the third image according to the compression parameters to obtain a thumbnail of the first image. Specifically, image cropping and other processing can adapt the processed image to different display devices and save storage space, while image compression can shorten image loading time and improve user experience.
[0006] Another objective of this application is to provide a method for displaying video cover images. Before the video cover image is fully loaded, a placeholder image can be displayed within the display area of the target video as temporary visual fill. Once the video cover image is fully loaded, the placeholder image is replaced with the video cover image. This method of displaying a preview image before the video cover image is fully loaded effectively reduces user waiting time and makes the application run more smoothly.
[0007] Another objective of this application is to provide a video cover display method that, in the event of a video cover image loading failure, can obtain an error image and display it within the display area of the target video to alert the user. This allows the user to quickly understand the current status, thereby improving the user experience.
[0008] Another objective of this application is to provide a video cover display method that applies caching parameters to the storage and retrieval of thumbnails and processes the thumbnail of a first image according to different caching strategies. When the caching parameters indicate caching the thumbnail in memory / disk, the thumbnail of the first image can be directly cached in memory / disk, so that the thumbnail of the first image can be displayed in the display area of the target video after being retrieved from memory / disk. Therefore, after caching the thumbnail, the generated cached image can be directly retrieved from the cache, thereby saving the time spent on image loading.
[0009] Another objective of this application is to provide a video cover display device that allows users to select video covers according to their preferences and needs through custom logic. This customization and personalization feature enhances user engagement and satisfaction.
[0010] Another object of this application is to provide a computer device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the steps in the above-described method. This application allows users to select video covers according to their preferences and needs through custom logic; this customization and personalization feature enhances user engagement and satisfaction.
[0011] Another objective of this application is to provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the aforementioned method. This application allows users to select video covers according to their preferences and needs through custom logic; this customization and personalization feature enhances user engagement and satisfaction.
[0012] Another objective of this application is to provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the aforementioned method. This application allows users to select video covers according to their preferences and needs through custom logic; this customization and personalization feature enhances user engagement and satisfaction.
[0013] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows:
[0014] In a first aspect, embodiments of this application provide a video cover display method, the method comprising: obtaining a first image through an image loading interface, the first image being a video cover selected by a user for a target video; processing the first image according to preset parameters to obtain a thumbnail of the first image; and displaying the thumbnail of the first image within the display area of the target video.
[0015] Secondly, embodiments of this application provide a video cover display device, the device comprising: a loading module configured to obtain a first image through an image loading interface, the first image being a video cover selected by a user for a target video; a processing module configured to process the first image according to preset parameters to obtain a thumbnail of the first image; and a display module configured to display the thumbnail of the first image within the display area of the target video.
[0016] Thirdly, embodiments of this application provide a computer device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the program to implement the steps in the above-described method.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps in the above-described method.
[0018] Fifthly, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the method described above.
[0019] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this application. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0021] Figure 1This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0022] Figure 2 This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0023] Figure 3 This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0024] Figure 4 This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0025] Figure 5 This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0026] Figure 6 This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0027] Figure 7 This is an optional flowchart illustrating the video cover display method provided in this application embodiment;
[0028] Figure 8 This is a schematic diagram of the composition structure of a video cover display device provided in an embodiment of this application;
[0029] Figure 9 This is a schematic diagram of the hardware entity of a computer device provided in an embodiment of this application. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. The terms "first / second / third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used herein is for descriptive purposes only and is not intended to be limiting of this application.
[0033] Many popular apps on the market today use image loading frameworks to optimize the data loading efficiency of images or videos. These image processing frameworks have won the favor of app developers due to their powerful image processing capabilities, efficient memory management, and convenient API design. For example, image loading frameworks can include Glide and ImageLoader. Glide is a powerful Android image loading library that supports loading images from various sources such as the network, local files, and application resources, and can perform various processing operations on images, such as cropping, rotating, and applying filters. In addition, Glide provides memory caching and disk caching functions to optimize image loading efficiency and performance. ImageLoader is also a commonly used image loading library in Android development. It also supports loading images from multiple sources and provides rich configuration options, allowing developers to configure various aspects of image loading and display, such as image scaling type, loading priority, and other requirements.
[0034] However, while the aforementioned image loading frameworks perform well in handling image loading, they fall short in meeting users' growing customization needs. For example, users might need to extract a frame from a video as a cover image, or more directly, they might want to set a more attractive image unrelated to the video content as the cover image to enhance the video's appeal and click-through rate. However, the image loading frameworks mentioned above fail to provide such functionality, thus limiting users' creativity and personalized expression in video content presentation.
[0035] Based on this, this application provides a video cover display method. This method allows users to select video covers according to their own preferences and needs through custom logic. This customization and personalization feature enhances user participation and satisfaction.
[0036] Figure 1 This is an optional flowchart illustrating a video cover display method provided in an embodiment of this application. For example, this method can be applied to an image loading framework. Figure 1 As shown, the method includes steps S101 to S103.
[0037] In step S101, the first image is obtained through the image loading interface.
[0038] In some embodiments, the first image is a video cover selected by the user for the target video, and the target video is a locally stored video.
[0039] As is understandable, an image loading interface refers to a series of functions or methods in a programming environment used to load images from various sources (such as local files, networks, memory, etc.) into an application. Through the image loading interface, the image loading framework can obtain the cover image selected by the user for the target video. The image loading interface acts as a bridge, connecting the user's selection and the display of the video cover image, ensuring that the user-selected cover image can be loaded and presented.
[0040] In some embodiments, the image loading framework can obtain an image loading interface, which can be predefined. Once the image loading framework obtains the image loading interface, it can obtain the first image through the image loading interface.
[0041] In some embodiments, the first image may be a frame from a target video selected by the user, or it may be a non-target video frame selected by the user from local resources.
[0042] In some embodiments, the target video may be one video or multiple videos, and correspondingly, the first image may be a cover image or a cover image selected by the user for each of the multiple videos.
[0043] In some embodiments, where the first image is a frame from a target video selected by the user, the image loading framework can obtain the user's first selection operation for the target video through an image loading interface, and determine the first image selected by the user based on the user's first selection operation. The user's first selection operation indicates that the user has selected a cover image for the target video. For example, the image loading framework can provide a video selection interface, allowing the user to select a target video and further select a frame from the target video that serves as the video cover. After the user selects a frame from the target video, the image loading interface can obtain the timestamp corresponding to that frame and decode the frame from the target video based on the timestamp. Thus, the image loading framework can obtain the first image through the image loading interface.
[0044] In some embodiments, where the first image is a non-target video frame selected by the user from local resources, the image loading framework can provide the user with the ability to access resources such as a local photo album, allowing the user to select the first image from the provided resources. After the user selects a locally stored image (such as the first image), the image loading interface can directly retrieve the first image.
[0045] In step S102, the first image is processed according to preset parameters to obtain a thumbnail of the first image.
[0046] Understandably, after acquiring the first image, the image loading framework can process it to obtain a thumbnail, which can then be displayed on the application's interface for user browsing. As a smaller version of the cover image, the thumbnail can display the image's basic content and key elements within a smaller space. This allows users to quickly browse and identify the image's subject and key information without opening the full image. Furthermore, thumbnail files are typically much smaller than the original image, meaning they occupy less storage space during storage and transmission and load faster. Additionally, different devices and display environments have different image display requirements; thumbnails can be adjusted in size and resolution to adapt to different display scenarios.
[0047] In some embodiments, the image loading framework can process the first image according to preset parameters. These preset parameters may include, but are not limited to: image size, image aspect ratio, image format, image quality, background type, and color. Here, image size refers to the width and height of the thumbnail; for example, an image size of (150, 150) means the thumbnail is 150 pixels wide and 150 pixels high. Image aspect ratio refers to the aspect ratio of the thumbnail. Image format refers to the storage format of the thumbnail, such as Joint Photographic Experts Group (JPEG), Portable Network Graphics (PNG), Bitmap (BMP), etc. Image quality refers to the quality of the thumbnail. Background type and color indicate whether the thumbnail needs a background fill, and if so, the type and color of the background fill.
[0048] Understandably, when the preset parameters include multiple parameters, the image loading framework can process the first image according to each parameter in the preset parameters to obtain a thumbnail of the first image.
[0049] For example, if the preset parameters include an image size of (150, 150), the image loading frame can adjust the first image according to the image size in the preset parameters to obtain a thumbnail of the first image with an image size of (150, 150).
[0050] For example, given preset parameters including image size, image format, and image quality, and an image size of (150, 150), an image format of JPEG, and an image quality of 85 (e.g., an image quality range of 1 to 100), the image loading framework can adjust the first image based on the values in the preset parameters to obtain a thumbnail of the first image with an image size of (150, 150), an image format of JPEG, and an image quality of 85. In one example, the image quality can be divided into 100 levels, with an image quality range of 1 to 100.
[0051] In some embodiments, after processing the first image, the image loading framework can load the processed first image through the image loading interface, and after loading is complete, a thumbnail of the first image can be obtained.
[0052] In step S103, a thumbnail of the first image is displayed within the display area of the target video.
[0053] In some embodiments, after obtaining a thumbnail of the first image, the image loading framework can display the thumbnail of the first image within the display area of the target video on the application's interface.
[0054] As mentioned above, there can be multiple target videos, and correspondingly, there can also be multiple thumbnails for the first image. Therefore, the image loading framework can be configured with a video list on the application's interface, including a thumbnail for each video. This embodiment of the application can display the thumbnail of each video through the video list, making the video list more compact and easier to browse.
[0055] In some embodiments, the image loading framework can display thumbnails using a RecyclerView (or control, component) on the application interface. RecyclerView is a highly customizable and flexible list view that can display a large number of data items and supports various layout methods (such as linear layout, grid layout, etc.). Understandably, a ViewHolder can be created in the RecyclerView for each video item, containing an ImageView to display the thumbnail. After the thumbnail is loaded, the ImageView is updated in the ViewHolder; that is, when there are multiple target videos, the thumbnail of each target video is displayed through the RecyclerView list view.
[0056] In this embodiment, a first image is obtained through an image loading interface. Since the first image is the video cover image selected by the user for the target video, the user can choose the video cover according to their own preferences and needs. This customization and personalization function enhances the user's sense of participation and satisfaction. By processing the image with preset parameters, the image size can be further compressed, improving loading efficiency. Moreover, thumbnails are usually smaller than the original image size, so the loading speed is faster and network bandwidth is reduced. After obtaining the thumbnail, the thumbnail is displayed in the display area of the target video. The display of the thumbnail makes the video list more compact and easier to browse, enabling users to quickly find content of interest and further improving user satisfaction with the application.
[0057] Figure 2 This is an optional flowchart illustrating the video cover display method provided in this application embodiment. Based on Figure 1 , Figure 1 Step S101 can be updated to steps S201 to S203, which will combine Figure 2 The steps shown are explained.
[0058] In step S201, a predefined image loading interface is obtained.
[0059] In some embodiments, the image loading interface includes a target function that returns an image.
[0060] In some embodiments, the image loading framework may predefine an implementable image loading interface and define a target function in the image loading interface, setting the return value of the target function to an image.
[0061] As is understandable, an image loading interface defines a method or specification for loading a first image from a source (such as a local resource). This interface contains one or more objective functions (also called methods), which are the code that actually performs the image loading operation. The objective functions are the core of the image loading interface; their primary function is to process the image data and return the processed image.
[0062] In step S202, the second image stored locally is obtained through the image loading interface.
[0063] In some embodiments, the second image is a frame from the target video.
[0064] In some embodiments, the second image is an image of a non-target video frame selected by the user from a local resource.
[0065] Understandably, once the image loading framework obtains the image loading interface, it can retrieve the second image through that interface. The implementation process of the image loading framework retrieving the second image can be found in [reference needed]. Figure 1 The image loading framework in this embodiment obtains the relevant information of the first image, which will not be repeated here.
[0066] In step 203, the second image is processed according to the objective function to obtain the first image.
[0067] In some embodiments, the image loading framework can perform specific processing on the second image through an objective function. This processing can be any form of image operation, such as cropping, rotating, adjusting brightness, contrast, etc.
[0068] It is understood that the embodiments of this application can perform image processing through a predefined image loading interface and objective function to obtain a processed image. Various image processing functions, such as cropping, can be flexibly defined and applied through the objective function provided by the interface. When a new image processing function needs to be added, simply implement a new objective function and add it to the interface.
[0069] In some embodiments, the image loading framework can also obtain a user selection operation, which indicates the image processing function selected by the user; in response to the selection operation, the functions contained in the image loading interface are rewritten to obtain the target function. (This is in contrast to the above.) Figure 1 The first selection operation in the embodiment is distinguished as the second selection operation.
[0070] Image processing functions are designed to improve, enhance, or modify image data. For example, image processing functions may include image editing, image retouching, image enhancement, image conversion, and compression.
[0071] Understandably, an image loading framework can provide an interface for users to select desired image processing functions. Once a user selects a function, the image loading framework, in response to this selection, can override the functions contained in the image loading interface to obtain the target function. In other words, after the image loading framework has written its functions, if a user wants to modify the acquired image, they can select the corresponding image processing function, and the framework will override the function to obtain the target function.
[0072] For example, the user interface includes three controls representing image processing functions: control one for image enhancement, control two for image retouching, and control three for image compression. If the user selects control one, the image loading framework responds to the user's selected image enhancement function by overriding the functions contained in the image loading interface. The image loading framework can then perform image enhancement processing on the second image based on the overridden functions to obtain the first image.
[0073] In this embodiment, the image loading interface is dynamically rewritten or adjusted according to the user's selection to call the corresponding image processing function (i.e., the target function). The original image is then processed based on the target function to obtain the processed image. In this way, the processed image better meets the user's needs and further improves the user experience.
[0074] Figure 3 This is an optional flowchart illustrating the video cover display method provided in this application embodiment. Based on Figure 2 , Figure 2 Step S102 can be updated to steps S301 to S303, which will be discussed below. Figure 3 The steps shown are explained.
[0075] In step S301, the image parameters and compression parameters in the preset parameters are obtained.
[0076] In some embodiments, image parameters include at least one of image size, cropping method, and image format; compression parameters include thumbnail compression ratio.
[0077] As you can understand, image dimensions refer to the image's width and height. Cropping method refers to the method used to crop a specific area from the original first image; examples of cropping methods include center cropping, proportional cropping, and custom region cropping. Image format refers to the way the image is stored and encoded, such as JPEG, PNG, etc. Compression ratio refers to the proportion by which the original image size is reduced when generating a thumbnail. For example, a compression ratio of 5:1 means that the compressed image size is one-fifth of the original image. If an original image is 100 megabytes (MB), then with a compression ratio of 5:1, the compressed thumbnail image size will be 20 MB.
[0078] Understandably, the image loading framework can obtain preset image parameters and compression parameters so that the first image can be processed based on these two parameters later.
[0079] In some embodiments, the preset parameters may also include an image signature, which is a unique identifier used to distinguish image resources in the cache. The signature accurately identifies image resources, avoiding cache conflicts or incorrect loading of older versions of images. Furthermore, when an image resource is updated, changing the signature ensures that the new image is loaded correctly, while the old image is replaced. For example, the image loading framework may pre-sign the first image using the image's Uniform Resource Locator (URL), filename, or content hash.
[0080] In some embodiments, preset parameters may also include image loading priority. Loading priority determines the order in which image resources are loaded and displayed. By prioritizing the loading of important or user-visible images, key content can be presented faster, reducing user waiting time. For example, when there are multiple first images, the image loading framework can pre-set the loading priority of each first image based on factors such as its importance and position. The lower the loading priority value, the earlier the image is loaded.
[0081] In some embodiments, the preset parameters may also include image loading transition animations. Loading transition animations are animation effects displayed during image loading to smoothly transition to the finally loaded image. These animation effects can reduce user anxiety while waiting, making the image loading process smoother and more natural. Loading transition animations may, for example, include fade-in / fade-out, scaling, and rotation effects. For example, the image loading framework may pre-set loading transition animations for each first image.
[0082] In step S302, the first image is processed according to the image parameters to obtain the third image.
[0083] Understandably, after obtaining image parameters such as image size, cropping method, and image format, the image loading framework can adjust the first image based on these parameters to obtain the adjusted image (i.e., the third image).
[0084] For example, with an image size of (150, 150) and a cropping method of center cropping, the image loading frame can crop the first image by center to obtain a third image with a size of (150, 150).
[0085] In step S303, the third image is processed according to the compression parameters to obtain a thumbnail of the first image.
[0086] Understandably, after obtaining the third image, the image loading framework can compress the third image according to the compression ratio in the compression parameters to obtain a thumbnail of the first image.
[0087] For example, with a compression ratio of 5:1, if the size of the third image is 100MB, the image loading frame can determine that the size of the compressed image is 20MB to obtain the compressed image (i.e., a thumbnail of the first image).
[0088] In some embodiments, when there are multiple video cover images and the preset parameters include the loading priority of each video cover image, the computer can also load the thumbnail of each first image sequentially according to the loading priority of each video cover image.
[0089] In this embodiment, image parameters and compression parameters are obtained, and a third image is obtained by processing the first image according to the image parameters. Then, the third image is compressed according to the compression parameters, thus obtaining a thumbnail of the first image. Cropping the image allows the processed image to adapt to different display devices and saves storage space, while compressing the image shortens image loading time and improves user experience.
[0090] Figure 4 This is an optional flowchart illustrating the video cover display method provided in this application embodiment. Based on Figure 1 , Figure 1 The method may further include steps S401 to S402, combining Figure 4 The steps shown are explained.
[0091] In step S401, during the process of obtaining the thumbnail of the first image, a preset placeholder image is obtained.
[0092] In some embodiments, the image loading framework may pre-set a placeholder image and store the placeholder image in a preset location. The placeholder image is a user-defined image.
[0093] Understandably, users can pre-set a custom placeholder image in the image loading frame according to their preferences and needs, and securely store the placeholder image in a preset location. This placeholder image may be a carefully selected image by the user, or it may be a preview image closely related to the content to be displayed (such as a thumbnail of the first image). It can not only enhance the user's visual experience, but also, to some extent, foreshadow or guide the user's anticipation for the following content.
[0094] In some embodiments, when the image loading framework acquires and processes the first image, it can retrieve and obtain the placeholder image from a preset storage location.
[0095] In step S402, a placeholder image is displayed within the display area of the target video until a thumbnail of the first image is obtained.
[0096] Understandably, before the thumbnail of the first image is fully loaded and displayed, there will be no image in the display area of the target video on the user interface, resulting in a visual blank space. Therefore, this embodiment of the application can display the placeholder image in the display area of the target video before the video cover image is fully loaded. This can alleviate user waiting time, optimize user experience, and ensure that users can see a visually appealing alternative image before the thumbnail is fully loaded, thereby avoiding blank or loading situations in the display area.
[0097] In some embodiments, after the thumbnail of the first image has been loaded, the placeholder image can be replaced with the thumbnail of the first image, thereby presenting a preview of the first image on the user interface.
[0098] In this embodiment, a placeholder image is displayed within the target video's display area before the video cover image is fully loaded, serving as temporary visual fill. Once the video cover image is fully loaded, the placeholder image is replaced with the video cover image. This method of displaying a preview image before the video cover image is fully loaded effectively reduces user waiting time and makes the application run more smoothly.
[0099] Figure 5 This is an optional flowchart illustrating the video cover display method provided in this application embodiment. Based on Figure 1 , Figure 1 The method may further include steps S501 to S502, combining Figure 5 The steps shown are explained.
[0100] In step S501, if obtaining a thumbnail of the first image fails, a preset error image is obtained.
[0101] Understandably, various unexpected situations may arise during image processing or loading, leading to operation failures. Therefore, to improve user experience and ensure users are clearly aware of the current status, image loading frameworks can implement measures to handle these failures.
[0102] In some embodiments, the image loading framework may pre-set an error graph and store it in a preset location. The error graph is used to indicate an error that occurred during loading or processing. For example, the error graph may be an error icon that visually conveys the message "Video cover image generation failed" to the user.
[0103] In some embodiments, when the image loading framework processes and loads the first image, if the operation is successful, a thumbnail of the first image can be generated. If the operation fails, a thumbnail of the first image cannot be generated. In this case, the image loading framework can retrieve and obtain the error image from a preset storage location.
[0104] In step S502, an error image is displayed in the display area of the target video to indicate that the cover image of the target video failed to load.
[0105] Understandably, when an image loading framework receives an error image, it can display it within the target video's display area. This allows users to understand the problem simply by seeing the error image, without waiting for lengthy error messages or unnecessary retries. The advantage of this approach is its simplicity and clarity; it quickly informs users of the current status and guides them to take appropriate actions (such as reloading or checking network connectivity), thus improving the user experience.
[0106] In this embodiment, if the video cover image fails to load, the image loading framework can obtain an error image and display it within the display area of the target video to alert the user. This allows the user to quickly understand the current status, thereby improving the user experience.
[0107] Figure 6 This is an optional flowchart illustrating the video cover display method provided in this application embodiment. Based on Figure 1 , Figure 1 The method may further include steps S601 to S604, combining Figure 6 The steps shown are explained.
[0108] In step S601, the cache parameters are obtained.
[0109] In some embodiments, the cache parameter is used to indicate the caching strategy for thumbnails.
[0110] Understandably, caching thumbnails can significantly speed up image resource loading. When users need to browse a large number of images, generating thumbnails from the original images each time would consume a significant amount of time and computing resources. By caching thumbnails, the image loading framework can directly read the generated thumbnails from the cache, thus saving time. Moreover, caching thumbnails reduces the frequency of accessing and processing the original images, thereby lowering the consumption of hardware resources such as memory and hard drive space.
[0111] In some embodiments, caching parameters may include parameters such as the cache type of thumbnails, cache size, and cache update strategy. The cache type may include memory caching, disk caching, and no caching. The cache size may include both memory cache size and disk cache size. Cache update strategies may, for example, include cache-aside, read-through, and write-through / write-back strategies. A cache-aside strategy means that whenever an application sends a request, it first checks if the requested data is in the cache. If it is, the cached data is returned; otherwise, the data is queried from the database or the original data source, and the cache is updated on the return trip. A read-through strategy means that the cache performs a read / query operation on the database or the original data source, then updates itself and returns the requested data to the user. If the data is not in the cache, the cache queries the database or the original data source and updates itself. Write-through / write-back strategies are suitable for write-intensive applications and ensure data consistency between the cache and the database or original data source.
[0112] In some embodiments, when the cache parameter includes a cache type, the image loading framework can obtain the cache type of the thumbnail and process the thumbnail of the first image according to the different cache types. If the cache type in the cache parameter is memory cache, the image loading framework determines to cache the thumbnail in memory. If the cache type in the cache parameter is disk cache, the image loading framework determines to cache the thumbnail on disk. If the cache type in the cache parameter is no cache, the image loading framework determines not to cache the thumbnail.
[0113] In step S602, if the cache parameter indicates that the thumbnail is cached in memory, the thumbnail of the first image is cached in memory so that the thumbnail of the first image is read from memory and displayed in the display area of the target video.
[0114] Understandably, when the cache type in the cache parameters obtained by the image loading framework indicates that thumbnails should be cached in memory, the thumbnail of the first image can be cached in the memory image cache area, which is stored in the memory of the image loading framework. This way, when the image loading framework needs to display the thumbnail of the first image on the user interface later, it can directly read it from the memory image cache area and display the thumbnail of the first image within the display area of the target video, thus saving image loading time.
[0115] Understandably, since the storage area in memory is small, the memory image buffer can usually be set to be small, meaning that the memory image buffer stores fewer images.
[0116] In step S603, if the cache parameter indicates that the thumbnail is cached on the hard disk, the thumbnail of the first image is cached on the hard disk so that the thumbnail of the first image is read from the hard disk and displayed in the display area of the target video.
[0117] Understandably, when the cache type in the cache parameters obtained by the image loading framework indicates that thumbnails should be cached on the hard drive, the thumbnail of the first image can be cached in the hard drive image cache area, which is stored on the image loading framework's hard drive. This way, when the image loading framework needs to display the thumbnail of the first image on the user interface later, it can directly read it from the hard drive image cache area and display the thumbnail of the first image in the display area of the target video, thus saving image loading time.
[0118] Understandably, compared to computer memory, the storage area on a hard drive is usually larger, so the disk image cache can usually be set to be larger, meaning that the hard drive image cache can cache a large number of images.
[0119] In step S604, if the caching parameter indicates that the thumbnail should not be cached, the thumbnail of the first image is not cached.
[0120] Understandably, when the cache type in the cache parameters obtained by the image loading framework indicates that thumbnails should not be cached, the image loading framework will not cache the thumbnail of the first image. Therefore, when the image loading framework subsequently needs to display the thumbnail of the first image on the user interface, it needs to obtain the original first image, process it to obtain the thumbnail, and then display the first image within the display area of the target video. In this case, the image loading framework needs to spend more time obtaining and loading the image.
[0121] In this embodiment, caching parameters are applied to the storage and retrieval of thumbnails, and the thumbnails of the first image are processed according to different caching strategies. When the caching parameters indicate that the thumbnails should be cached in memory / disk, the thumbnails of the first image can be directly cached in memory / disk, so that the thumbnails of the first image can be displayed in the display area of the target video after being retrieved from memory / disk. Therefore, after caching the thumbnails, the image loading framework can directly read the generated cached images from the cache, thereby saving the time spent on image loading.
[0122] Figure 7 This is an optional flowchart illustrating the video cover display method provided in this application embodiment. The following is an example... Figure 7 For example Figures 1 to 6 The illustrated embodiments further illustrate that, in conjunction with Figure 7 The steps shown are explained.
[0123] In step S701, a function is defined.
[0124] In some embodiments, the predefined functions may include setting a placeholder image, setting an error image, setting cache parameters, setting image size, setting cropping method, setting image format, setting compression ratio, setting signature, setting loading priority, setting loading transition animation, setting image loading interface, and setting components so that the image is displayed in the component after loading.
[0125] In step S702, the interface is defined.
[0126] In some embodiments, defining an interface may include defining an image loading interface and defining functions within that image loading interface.
[0127] Understandably, a class can be predefined to implement the image loading interface. If a user wants to customize or modify the image, the function in the image loading interface can be overridden in response to the user's selection, resulting in a modified function that returns the image. The image processing functionality corresponding to the modified function is the same as the image processing functionality corresponding to the user's selection.
[0128] Therefore, according to the user's selection, the image loading interface can be dynamically rewritten or adjusted to call the corresponding image processing function (i.e., the target function). The original image is then processed based on the target function to obtain the processed image. In this way, the processed image better meets the user's needs and further improves the user experience.
[0129] In step S703, the image is returned.
[0130] Understandably, the functions in the image loading interface can return the video cover image selected by the user for the target video, which can be a thumbnail of the original image.
[0131] In step S704, the image is displayed using a component.
[0132] Understandably, the image loading framework can display thumbnails through a component on the application interface. The component is a video list, so a thumbnail of each video can be displayed through the video list, making the video list more compact and easier to browse.
[0133] In this embodiment, a first image is obtained through an image loading interface. Since the first image is the video cover image selected by the user for the target video, the user can choose the video cover according to their own preferences and needs. This customization and personalization function enhances the user's sense of participation and satisfaction. By processing the image with preset parameters, the image size can be further compressed, improving loading efficiency. Moreover, thumbnails are usually smaller than the original image size, so the loading speed is faster and network bandwidth is reduced. After obtaining the thumbnail, the thumbnail is displayed in the display area of the target video. The display of the thumbnail makes the video list more compact and easier to browse, enabling users to quickly find content of interest and further improving user satisfaction with the application.
[0134] Based on the foregoing embodiments, this application provides a video cover display device. The modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0135] Reference Figure 8 , Figure 8 This is a schematic diagram of the structural composition of a video cover display device provided in an embodiment of this application. The video cover display device 8 includes: a loading module 801, a processing module 802, and a display module 803, wherein...
[0136] The loading module 801 is configured to obtain a first image through an image loading interface, wherein the first image is a video cover selected by the user for the target video; the processing module 802 is configured to process the first image according to preset parameters to obtain a thumbnail of the first image; and the display module 803 is configured to display the thumbnail of the first image in the display area of the target video.
[0137] In some embodiments, the loading module 801 is further configured to obtain a predefined image loading interface, the image loading interface containing a target function, the return value of which is an image; obtain a second image stored locally through the image loading interface; and perform custom processing on the second image according to the target function to obtain a first image, wherein the custom processing is the image processing function corresponding to the target function.
[0138] In some embodiments, the loading module 801 is further configured to obtain a user selection operation, the selection operation being used to indicate the image processing function selected by the user; in response to the selection operation, the functions contained in the image loading interface are rewritten to obtain the target function.
[0139] In some embodiments, the second image is a frame from the target video.
[0140] In some embodiments, the preset parameters include image parameters and compression parameters, wherein the image parameters include at least one of the image size, cropping method, and image format; the compression parameters include thumbnail compression ratio; the processing module 802 is further configured to: acquire the image parameters and compression parameters; process the first image according to the image parameters to obtain a third image; and process the third image according to the compression parameters to obtain a thumbnail of the first image.
[0141] In some embodiments, the display module 803 is further configured to acquire a preset placeholder image during the process of obtaining a thumbnail of the first image; and to display the placeholder image in the display area of the target video until a thumbnail of the first image is obtained.
[0142] In some embodiments, the display module 803 is further configured to acquire a preset error image if it fails to obtain a thumbnail of the first image; and display the error image in the display area of the target video to indicate that the cover image of the target video has failed to load.
[0143] In some embodiments, the apparatus further includes: an acquisition module configured to acquire cache parameters, the cache parameters indicating a caching strategy for thumbnails; a first caching module configured to cache a thumbnail of a first image in memory when the cache parameters indicate that thumbnails should be cached in memory, so that the thumbnail of the first image is displayed in the display area of the target video after being read from memory; a second caching module configured to cache a thumbnail of the first image in the hard disk when the cache parameters indicate that thumbnails should be cached in the hard disk, so that the thumbnail of the first image is displayed in the display area of the target video after being read from the hard disk; and a third caching module configured not to cache a thumbnail of the first image when the cache parameters indicate that thumbnails should not be cached.
[0144] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this application can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0145] It should be noted that, in the embodiments of this application, if the above-described video cover display method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.
[0146] This application provides a computer device including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the program to implement the steps in the above-described method.
[0147] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.
[0148] This application provides a computer program including computer-readable code, wherein when the computer-readable code is executed in a computer device, a processor in the computer device performs steps for implementing the method described above.
[0149] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0150] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the vehicle-mounted device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0151] Figure 9 This application provides a hardware entity diagram of a computer device as an embodiment of the present application, such as... Figure 9 As shown, the hardware entity of the computer device 9 includes a processor 901 and a memory 902, wherein the memory 902 stores a computer program that can run on the processor 901, and the processor 901 executes the program to implement the steps in the method of any of the above embodiments.
[0152] The memory 902 stores computer programs that can run on the processor. The memory 902 is configured to store instructions and applications that can be executed by the processor 901. It can also cache data to be processed or already processed by the processor 901 and various modules in the electronic device 9 (e.g., image data, audio data, voice communication data and video communication data). It can be implemented by flash memory or random access memory (RAM).
[0153] The processor 901 executes the program to implement the video cover display method steps described above. The processor 901 typically controls the overall operation of the computer device 9.
[0154] This application provides a computer storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the video cover display method as described in any of the above embodiments.
[0155] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0156] The aforementioned processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), DSP, Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), FPGA, CPU, controller, microcontroller, and microprocessor. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.
[0157] The aforementioned computer storage media / memory can be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory, Optical Disc, or Compact Disc Read-Only Memory (CD-ROM), etc.; or it can be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0158] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0159] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0160] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0161] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected based on actual needs to achieve the purpose of this embodiment.
[0162] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0163] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0164] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.
[0165] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for displaying video cover images, characterized in that, The method includes: The first image is obtained through the image loading interface. The first image is the video cover selected by the user for the target video. The first image is processed according to preset parameters to obtain a thumbnail of the first image; A thumbnail of the first image is displayed within the display area of the target video.
2. The method according to claim 1, characterized in that, The process of obtaining the first image through the image loading interface includes: Obtain a predefined image loading interface, which contains a target function, the return value of which is an image; Obtain the second image stored locally through the image loading interface; According to the target function, the second image is subjected to custom processing to obtain the first image, wherein the custom processing is the image processing function corresponding to the target function.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the user's selection operation, which indicates the image processing function selected by the user; In response to the selection operation, the functions contained in the image loading interface are rewritten to obtain the target function.
4. The method according to claim 2, characterized in that, The second image is a frame from the target video.
5. The method according to claim 1, characterized in that, The preset parameters include image parameters and compression parameters, wherein the image parameters include at least one of the following: image size, cropping method, and image format; and the compression parameters include the thumbnail compression ratio. The step of processing the first image according to preset parameters to obtain a thumbnail of the first image includes: Obtain the image parameters and the compression parameters; The first image is processed according to the image parameters to obtain the third image; The third image is processed according to the compression parameters to obtain a thumbnail of the first image.
6. The method according to claim 1, characterized in that, The method further includes: During the process of obtaining the thumbnail of the first image, a preset placeholder image is obtained; The placeholder image is displayed within the display area of the target video until a thumbnail of the first image is obtained.
7. The method according to claim 6, characterized in that, The method further includes: If obtaining a thumbnail of the first image fails, a preset error image is obtained; The error image is displayed within the display area of the target video to indicate that the cover image of the target video failed to load.
8. The method according to claim 1, characterized in that, The method further includes: Obtain cache parameters, which are used to indicate the caching strategy for thumbnails; When the cache parameter indicates that the thumbnail is cached in memory, the thumbnail of the first image is cached in memory so that the thumbnail of the first image is displayed in the display area of the target video after being read from the memory; When the cache parameter indicates that the thumbnail is cached on the hard disk, the thumbnail of the first image is cached on the hard disk so that the thumbnail of the first image is displayed in the display area of the target video after being read from the hard disk. If the caching parameter indicates that thumbnails should not be cached, then thumbnails of the first image are not cached.
9. A video cover display device, characterized in that, The device includes: The loading module is configured to obtain a first image through an image loading interface, wherein the first image is a video cover selected by the user for the target video; The processing module is configured to process the first image according to preset parameters to obtain a thumbnail of the first image; The display module is configured to display a thumbnail of the first image within the display area of the target video.
10. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.