Dynamic wallpaper setting method and device, equipment, storage medium and program product

By deploying the built-in browser engine in the target application and calling the streaming media recording API, only recording dynamic pictures without recording basic controls, the problem of insufficient recording and generated videos in the existing technology is solved, and high-quality dynamic wallpaper settings are achieved, improving the diversity and display effect of wallpapers.

CN119536881APending Publication Date: 2025-02-28ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411588972.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

When the prior art sets the dynamic screen in the application as a dynamic wallpaper of an electronic device, it is easy to record the basic controls provided by the operating system together, resulting in the recorded and generated videos not being clean enough, affecting the display effect of the dynamic wallpaper.

Method used

By deploying the built-in browser engine in the target application and calling its streaming recording API, the target display page is recorded, recording only the dynamic screen without the basic controls, resulting in a clean video without the interfering elements.

Benefits of technology

It has achieved the setting of exquisite and colorful dynamic pictures as dynamic wallpapers, which has improved the diversity and fun of the wallpapers, and effectively improved the display effect of the dynamic wallpapers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536881A_ABST
    Figure CN119536881A_ABST
Patent Text Reader

Abstract

One or more embodiments of the invention provide a dynamic wallpaper setting method and device, equipment, a storage medium and a program product. The method comprises the following steps: displaying a target display page in a target application program, wherein the target display page comprises a dynamic picture rendered and generated by a built-in browser engine of the target application program; recording the target display page by calling a streaming media recording API (Application Program Interface) of the built-in browser engine, so that a target video generated by recording contains the dynamic picture; and setting the target video as the dynamic wallpaper of the electronic equipment where the target application program is located.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the technical field of wallpaper setting, and in particular, to a method, apparatus, device, storage medium, and program product for setting a dynamic wallpaper. Background Art

[0002] With the rapid development of electronic devices, people are increasingly pursuing personalized and diversified wallpaper displays on electronic devices. More and more users will set dynamic wallpapers for their terminal desktop interfaces. General electronic devices can only set ordinary static / dynamic wallpapers that come with the operating system, which inevitably appear boring. With the continuous iteration of applications, some applications installed on electronic devices can display exquisite and colorful dynamic pictures in the corresponding display pages. Therefore, how to set these dynamic pictures as dynamic wallpapers of electronic devices to improve the display effect of wallpapers is one of the research directions of wallpaper settings. Summary of the invention

[0003] In view of this, one or more embodiments of this specification provide the following technical solutions:

[0004] According to a first aspect of one or more embodiments of this specification, a method for setting a dynamic wallpaper is provided, the method comprising:

[0005] Displaying a target display page in a target application, wherein the target display page includes a dynamic picture rendered by a built-in browser engine in the target application;

[0006] By calling the streaming media recording API of the built-in browser engine, the target display page is recorded so that the target video generated by the recording includes the dynamic picture;

[0007] The target video is set as a dynamic wallpaper of the electronic device where the target application is located.

[0008] According to a second aspect of one or more embodiments of this specification, a dynamic wallpaper setting device is provided, the device comprising:

[0009] A display unit, used for displaying a target display page in a target application, wherein the target display page includes a dynamic picture rendered by a built-in browser engine of the target application;

[0010] A recording unit, configured to record the target display page by calling the streaming media recording API of the built-in browser engine, so that the target video generated by the recording includes the dynamic picture;

[0011] The dynamic wallpaper setting unit is used to set the target video as the dynamic wallpaper of the electronic device where the target application is located.

[0012] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0013] A processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method as described in the first aspect by running the executable instructions.

[0014] According to a fourth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] According to a fifth aspect of one or more embodiments of the present specification, a computer program product is proposed, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.

[0016] As can be seen from the above embodiments, this specification deploys a browser engine inside the target application, and then uses the streaming media recording API of the built-in browser engine to record the target display page in the target application. Because the target display page mainly contains two types of page elements: dynamic pictures rendered by the built-in browser engine, and basic controls provided by the operating system. The streaming media recording API of the built-in browser engine will only record the dynamic pictures, and will not record the basic controls together. Therefore, the target video generated by the recording is a clean video that only contains dynamic pictures and does not contain other interfering elements. Then, the target video is set as a dynamic wallpaper, that is, the exquisite and colorful dynamic pictures displayed in the target application are set as dynamic wallpapers, thereby improving the diversity and fun of dynamic wallpapers. Moreover, the target video obtained in this way is a clean video that does not contain interfering elements, thereby effectively improving the display effect of dynamic wallpapers. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 The present invention is a flowchart of a method for setting a dynamic wallpaper provided by an exemplary embodiment.

[0018] Figure 2 It is a schematic diagram of a target display page provided by an exemplary embodiment.

[0019] Figure 3a It is a schematic diagram of a hidden control provided by an exemplary embodiment.

[0020] Figure 3b It is a schematic diagram of a dynamic picture in a wallpaper recording mode provided by an exemplary embodiment.

[0021] Figure 3cIt is a schematic diagram of another dynamic picture in wallpaper recording mode provided by an exemplary embodiment.

[0022] Figure 4a The figure is a schematic diagram of a desktop dynamic wallpaper provided by an exemplary embodiment.

[0023] Figure 4b It is a schematic diagram of a lock screen dynamic wallpaper provided by an exemplary embodiment.

[0024] Figure 5 It is a schematic diagram of a preview page of a target video provided by an exemplary embodiment.

[0025] Figure 6a It is a schematic diagram of a static wallpaper entrance provided by an exemplary embodiment.

[0026] Figure 6b It is a schematic diagram of another static wallpaper entrance provided by an exemplary embodiment.

[0027] Figure 7 It is a schematic diagram of a pop-up window during a dynamic wallpaper setting process provided by an exemplary embodiment.

[0028] Figure 8a This is a schematic diagram of a successful static wallpaper setting provided by an exemplary embodiment.

[0029] Figure 8b It is a schematic diagram of a prompt pop-up window provided by an exemplary embodiment when the static wallpaper setting function is not enabled.

[0030] Fig. 9 This is a schematic diagram of a process for setting dynamic wallpapers and static wallpapers at the device level provided by an exemplary embodiment.

[0031] Fig.10 It is a structural schematic diagram of a device provided by an exemplary embodiment.

[0032] Fig.11 It is a block diagram of a dynamic wallpaper setting device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0033] As mentioned above, in the related art, it is hoped that the exquisite and colorful dynamic pictures displayed in the application will be set as the dynamic wallpaper of the electronic device to enhance the diversity and display effect of the wallpaper. In the related art, the display page of the application is usually recorded using the screen recording function of the operating system of the electronic device to set the video generated by the recording as the dynamic wallpaper. However, the display page of the application usually contains basic controls provided by the operating system, such as return controls, more options controls, etc. Therefore, when recording using the screen recording function of the operating system, these basic controls will be recorded together, resulting in the video generated by the recording not being clean enough, and then the dynamic wallpaper contains interference elements, which greatly reduces the display effect of the dynamic wallpaper. Therefore, the technical solution provided in this specification is to solve the problem that the video obtained by recording is not clean enough. By only recording the dynamic pictures contained in the display page of the application without recording the basic controls provided by the operating system, it is ensured that a clean video without interference elements is obtained, and then the clean video is set as the dynamic wallpaper to enhance the display effect of the dynamic wallpaper.

[0034] Figure 1 This is a flowchart of a method for setting a dynamic wallpaper provided by an exemplary embodiment. It should be noted that the technical solution of this specification can be applied to electronic devices that can install applications, including but not limited to: tablet devices, laptops, PDAs (Personal Digital Assistants), mobile phones, smart watches, etc. Figure 1 As shown, the method may include the following steps:

[0035] S102: Display a target display page in a target application, wherein the target display page includes a dynamic picture rendered by a built-in browser engine of the target application.

[0036] An application usually has one or more display pages, such as the homepage of the application and other pages generated by the control jump. In this embodiment, the "target application" refers to an application that has at least one display page that can display dynamic images. For example, the target application is application Q, and the display page of product A in application Q can display a dynamic picture of two-player PK. For another example, a game application can be used as a target application, and the display page of the game application can display colorful dynamic game pictures.

[0037] The target display page can be any display page in the target application that can display dynamic images. The dynamic images contained in the target display page can be rendered and generated by the built-in browser engine of the target application. A browser engine generally refers to an engine that processes HTML (HyperText Markup Language), CSS (Cascading Style Sheets) and JavaScript, such as Chromium, WebKit, etc. These browser engines can be used to parse and render web page content. By embedding the browser engine into the target application, it is possible to render and generate web page images inside the target application using web page technology. In this embodiment, the built-in browser engine of the target application can render and generate dynamic images inside the target application using web page technology. In addition, the target display page also includes basic controls provided by the operating system, such as a return control, a more options control, and a page name provided by the operating system. For example, the display page of product B in application Q is used as the target display page for illustration, please refer to Figure 2 , the page name "Product B" is displayed at the top of the target display page a. A return control is displayed in the upper left corner of the target display page a. The control is used to jump back to the previous page of the target display page a when triggered. A more options control is displayed in the upper right corner of the target display page a. The control is used to display more operation options when triggered, such as sharing operation options, setting operation options, etc. The return control and the more options control are both basic controls provided by the operating system of the electronic device. The target display page a also includes a dynamic picture of a certain sea area, and the aforementioned basic controls and page name are superimposed on the dynamic picture.

[0038] S104: Record the target display page by calling the streaming media recording API of the built-in browser engine, so that the target video generated by the recording includes the dynamic picture.

[0039] The dynamic wallpaper entrance can be displayed in the target display page. When a trigger operation for the dynamic wallpaper entrance is received, the streaming media recording API is called to record the target display page. The streaming media recording API provides a mechanism to capture media streams and record the captured media streams. It supports multiple encoding formats, such as MP4, WebM, etc. The streaming media recording API of the built-in browser engine is mainly used to record media streams in web pages. That is to say, the streaming media recording API can control the recording range and only record the pictures generated by the built-in browser engine based on web page technology rendering, without recording the basic controls and page names provided by the operating system. Therefore, the target video generated by the recording may only contain dynamic pictures but not basic controls and page names. Exemplarily, the MediaStream Recording API can be used as the streaming media recording API of the built-in browser engine. By calling the MediaStream Recording API, the dynamic pictures contained in the target display page are recorded using the WebRTC (Web Real-Time Communication) MediaRecorder interface provided by the API, and the binary stream of the recorded content is converted into arrayBuffer to be saved locally, that is, the target video generated by the recording is saved locally. It should be noted that the MediaStream Recording API is only an example, and this specification does not specifically limit the streaming media recording API.

[0040] In one embodiment, the dynamic picture displayed in the target display page may include two parts: dynamic background content generated by the built-in browser engine rendering, and initial interactive elements superimposed on the dynamic background content. The initial interactive elements refer to page elements that can interact with the user, that is, the initial interactive elements can respond to the operations initiated by the user in the target display page. Figure 2 , the dynamic background content may include: mountain background, cows, grass. The initial interactive elements may include: interactive elements 201-208. In addition, the initial interactive elements may also include: delivery content (such as surprise gifts, public welfare projects, etc.) displayed in the target display page of product B, page bubbles, etc.

[0041] The dynamic background content and the initial interactive elements are rendered and generated by the built-in browser engine of the target application. Therefore, before recording the target display page, the initial interactive elements in the target display page can be hidden by the built-in browser engine. Exemplarily, in response to the received instruction to enter the wallpaper recording mode, the initial interactive elements can be hidden by the built-in browser engine to obtain a dynamic picture in the wallpaper recording mode. The dynamic picture can include the dynamic background content and the newly added interactive elements superimposed and displayed. The newly added interactive elements are used to trigger the dynamic picture recording request. Please refer to Figure 3a-3b ,exist Figure 3a In the example, a hidden control 301 is displayed in the target display page. The user can trigger the hidden control 301 to send an instruction to the electronic device to enter the wallpaper recording mode. Figure 3b 300 shows a dynamic picture in wallpaper recording mode, which includes not only dynamic background content, but also a newly added interactive element superimposed on the dynamic background content, that is, a dynamic wallpaper entry 302. In addition, the dynamic picture in wallpaper recording mode may also include an interactive element for returning to non-wallpaper recording mode (such as Figure 3b In response to a trigger operation for the return option, the dynamic picture in the non-wallpaper recording mode is returned, and the dynamic picture includes the dynamic background content and the initial interactive elements.

[0042] In another exemplary embodiment, the wallpaper recording mode and the non-wallpaper recording mode can be switched by repeatedly triggering the hidden control. Figure 3a , the hidden control 301 is presented in the form of an eye, and the user can send an instruction to the electronic device to enter the wallpaper recording mode by triggering the hidden control 301. When the hidden control 301 is triggered and changes from the open-eye state to the closed-eye state, the electronic device can respond to the instruction to enter the wallpaper recording mode, hide the initial interactive elements in the target display page through the built-in browser engine of the target application, and obtain a dynamic picture in the wallpaper recording mode (such as Figure 3c The dynamic picture includes dynamic background content, a newly added interactive element for triggering a dynamic picture recording request, namely, a dynamic wallpaper entry 302, and a hidden control 301 in the closed-eye state. In the wallpaper recording mode, when the hidden control 301 is triggered and changes from the closed-eye state to the open-eye state, a dynamic picture including dynamic background content and initial interactive elements is displayed (i.e., a dynamic picture in the non-wallpaper recording mode).

[0043] It should be noted that the above method of hiding the initial interactive elements and the display form of the newly added interactive elements are only examples, and this specification does not specifically limit the specific implementation method of hiding the initial interactive elements and superimposing the newly added interactive elements. In addition, it can be set that each time the user enters the target display page, the target display page defaults to display the dynamic picture in the non-wallpaper recording mode, which helps to improve the user's experience of using the target application.

[0044] In this embodiment, dynamic images in two modes can be displayed to the user: the dynamic images in the wallpaper recording mode and the dynamic images in the non-wallpaper recording mode, which effectively improves the diversity and flexibility of the dynamic images. Among them, the dynamic images in the non-wallpaper recording mode can interact with the user based on the initial interactive elements, thereby improving the user's experience and satisfaction with the product. The dynamic images in the wallpaper recording mode appear cleaner because the initial interactive elements are hidden. Therefore, recording the dynamic images in the wallpaper recording mode can make the images contained in the target video generated by the recording cleaner.

[0045] In one embodiment, the dynamic picture in the wallpaper recording mode can be recorded to obtain a target video. The dynamic picture in the wallpaper recording mode includes dynamic background content and newly added interactive elements that are superimposed and displayed to trigger the dynamic picture recording request. The user can send a dynamic picture recording request to the electronic device by triggering the newly added interactive elements. In response to the dynamic picture recording request, the electronic device hides all newly added interactive elements through the built-in browser engine, and records the remaining displayed dynamic background content by calling the streaming media recording API. The target video generated by recording in this way only contains the dynamic background content. Recording dynamic pictures in the above manner can make the pictures contained in the target video generated by recording cleaner. Subsequently, setting the cleaner target video as a dynamic wallpaper can further improve the quality and display effect of the dynamic wallpaper.

[0046] S106: Setting the target video as a dynamic wallpaper of the electronic device where the target application is located.

[0047] Exemplarily, the dynamic wallpaper service provided by the operating system can be called to set the target video as the dynamic wallpaper of the electronic device where the target application is located. For example, the built-in browser engine of the target application can send the save path or storage location of the target video to the interface provided by the operating system, and then call the dynamic wallpaper service through the interface to set the target video corresponding to the save path or storage location as the dynamic wallpaper. At the user level, the aforementioned process can be manifested as: the user sets the target video as a dynamic wallpaper through the wallpaper setting function in the system settings page. Exemplarily, the target video can be set as the desktop dynamic wallpaper or lock screen dynamic wallpaper of the electronic device. Figure 4aFIG. 1 is a schematic diagram of a desktop dynamic wallpaper provided by an exemplary embodiment. Figure 4a As shown, the desktop of the electronic device displays application classification boxes xx1 to xx5, each of which contains one or more application icons. These application classification boxes are superimposed and displayed on the dynamic wallpaper. In combination with the above-mentioned embodiment, the dynamic wallpaper of the desktop can be generated by the dynamic picture in the target display page of product B, thereby greatly improving the fun and diversity of the desktop display content. Figure 4b FIG. 1 is a schematic diagram of a lock screen dynamic wallpaper provided by an exemplary embodiment. Figure 4b As shown, in combination with the embodiment of the aforementioned product B, the dynamic picture displayed in the target display page of product B can be set as the lock screen dynamic wallpaper of the electronic device, thereby significantly improving the fun of the lock screen wallpaper.

[0048] In the above embodiment, a browser engine is deployed inside the target application, and then the target display page in the target application is recorded using the streaming media recording API of the built-in browser engine. Since the target display page mainly contains two types of page elements: dynamic images rendered by the built-in browser engine, and basic controls provided by the operating system. The streaming media recording API of the built-in browser engine only records the dynamic images, and does not record the basic controls together. Therefore, the target video generated by the recording is a clean video that only contains dynamic images and does not contain other interfering elements. Then, the target video is set as a dynamic wallpaper, that is, the exquisite and colorful dynamic images displayed in the target application are set as dynamic wallpapers, thereby improving the diversity and fun of the dynamic wallpapers. Moreover, the target video obtained in this way is a clean video that does not contain interfering elements, thereby effectively improving the display effect of the dynamic wallpaper.

[0049] In one embodiment, a dynamic wallpaper setting API may be pre-deployed in the target application. In this case, after the target video is recorded and generated, the built-in browser engine of the target application may send the save path or storage location of the target video to the dynamic wallpaper setting API inside the target application, and then call the dynamic wallpaper service provided by the operating system through the dynamic wallpaper setting API, and then use the called dynamic wallpaper service to set the target video corresponding to the save path or storage location as the dynamic wallpaper of the electronic device where the target application is located. Exemplarily, in combination with the embodiment of the aforementioned product B, a dynamic wallpaper setting API may be developed in the application Q container, such as launchLiveWallpaperSelectorjsapi. Then, the dynamic wallpaper service is called using launchLiveWallpaperSelectorjsapi to set the target video as a dynamic wallpaper. For the user, when the user triggers the dynamic wallpaper entrance (see Figure 3b) after which the dynamic picture displayed in the target display page can be set as the dynamic wallpaper of the electronic device.

[0050] The above method realizes directly calling the dynamic wallpaper setting service within the target application to set the target video as the dynamic wallpaper, without the user having to exit the target application and enter the system settings page to set the dynamic wallpaper, thereby greatly improving the convenience of user operation.

[0051] In one embodiment, in the process of setting the target video as the dynamic wallpaper of the electronic device where the target application is located, the target video can be played on the electronic device first to display the wallpaper preview effect corresponding to the target video. Exemplarily, a video player can be called to play the target video to display the wallpaper preview effect corresponding to the target video. For example, when the dynamic wallpaper service is called through the interface provided by the operating system, the target video can be played through the video player provided by the operating system.

[0052] Further, in response to the received confirmation instruction, the target video is set as a dynamic wallpaper of the electronic device. Figure 5 FIG. 1 is a schematic diagram of a wallpaper preview effect provided by an exemplary embodiment. Figure 5 As shown, the preview page can play the target video in a loop to show the wallpaper rendering effect of the target video. In addition, the preview page also displays an "Apply" control. When a trigger operation for the "Apply" control is received, it is equivalent to receiving a confirmation instruction, and the target video can be set as a dynamic wallpaper. It should be noted that the above-mentioned "Apply" control is only an example, and this specification does not limit the specific implementation form of the confirmation instruction.

[0053] In this embodiment, before setting the target video as a dynamic wallpaper, a preview effect of the wallpaper corresponding to the target video is displayed to the user, which helps the user to check the size, picture and other contents of the target video during the preview process and make timely adjustments, thereby ensuring that the display effect of the wallpaper meets the user's expectations in actual application, avoiding further adjustments after the wallpaper is set, and reducing unnecessary trouble and waste of resources.

[0054] In one embodiment, a video player can be deployed inside the target application. In this case, in addition to calling the video player that comes with the operating system to play the target video, the built-in video player of the target application can also be called to play the target video to display the wallpaper playback effect corresponding to the target video. Especially in the case of calling the dynamic wallpaper service through the dynamic wallpaper setting API inside the target application, playing the target video through the built-in video player of the target application can complete the entire process of dynamic wallpaper setting within the target application, greatly simplifying the user's operation of setting dynamic wallpapers and improving the convenience of user operations. In addition, by playing the target video through the built-in video player of the target application, if the user is not satisfied with the content of the target video during the preview process, the user can directly choose to reset the dynamic wallpaper in the target application so that the electronic device can re-record the dynamic picture and preview it, further improving the convenience of setting dynamic wallpapers.

[0055] In one embodiment, the dynamic picture included in the target display page can be set as a static wallpaper of the electronic device where the target application is located. In the related art, the screenshot tool provided by the operating system is usually used to capture the picture displayed in the display page to set the captured content as a static wallpaper. However, on the one hand, this method of setting a static wallpaper will capture the basic controls contained in the target display page, resulting in the static wallpaper being not clean enough; on the other hand, the screenshot content may be empty. This is because the content displayed in the target display page is submitted by the rendering layer. If the rendering layer and the display layer are separated, even if the content displayed in the target display page is correct, the screenshot tool will not be able to correctly obtain the content of the rendering layer, resulting in an empty screenshot content.

[0056] In view of this, the present specification proposes to directly obtain the target frame of the dynamic picture from the rendering layer of the electronic device. Specifically, in response to the received static wallpaper generation instruction, the target frame of the dynamic picture is obtained from the rendering layer of the electronic device, and the target frame is converted into a data stream. For example, see Figure 6a , you can display the static wallpaper entrance in the target display page. When receiving a trigger operation for the static wallpaper entrance, it is equivalent to receiving a static wallpaper generation instruction. At this time, you can call canvas.toDataURL() to obtain the target frame of the dynamic picture from the rendering layer of the electronic device and convert the target frame into a data stream. canvas.toDataURL() is a method in the HTML5 Canvas API that is used to convert <canvas>The content of the element is exported as a data URL string. Then, the data stream is converted into a target image and the target image is set as a static wallpaper. In this case, the resulting target image will contain the dynamic background content and the initial interactive element superimposed on the dynamic background content.

[0057] Alternatively, see Figure 6b , you can display a static wallpaper entrance overlaid on the dynamic screen in wallpaper recording mode. When a trigger operation for a static wallpaper entrance is received, call canvas.toDataURL() to obtain the target frame of the dynamic background content from the rendering layer of the electronic device, and convert the target frame into a data stream. Then, convert the data stream into a target image. In this case, the target image obtained will contain the dynamic background content but not the initial interactive elements and the newly added interactive elements. The target image can be saved to the device album, and it supports setting the target image as the static wallpaper of the electronic device. It should be noted that Figure 6a and Figure 6b This is only an example, and this specification does not specifically limit the implementation form of the static wallpaper generation instruction and obtaining the target frame from the rendering layer.

[0058] In this embodiment, the target frame of the dynamic picture is directly obtained from the rendering layer of the electronic device, which can effectively avoid the situation where the content of the target frame is empty. In addition, the target frame of the dynamic picture is obtained, which means that the target frame does not contain basic controls, so the static wallpaper finally set can be a clean wallpaper, which helps to improve the display effect of the static wallpaper.

[0059] In one embodiment, the user can set the dynamic wallpaper setting function and static wallpaper setting function of the target application to be turned on or off. When the dynamic wallpaper setting function is turned on, the dynamic picture of the target application can be set as the dynamic wallpaper of the electronic device according to the method described in any of the above embodiments. When the static wallpaper setting function is turned on, the static wallpaper can be set according to the method described in the above static wallpaper setting embodiment. Figure 3b and Figure 6a , when only the static wallpaper setting function of the target application is enabled, only the static wallpaper entrance will be displayed on the relevant page of the target application. When only the dynamic wallpaper setting function of the target application is enabled, only the dynamic wallpaper entrance will be displayed on the relevant page of the target application. If both the static wallpaper setting function and the dynamic wallpaper setting function are enabled, then the relevant page of the target application will display both the static wallpaper entrance and the dynamic wallpaper entrance.

[0060] The following describes the dynamic wallpaper setting method of this manual in detail, taking application Q as the target application and the target display page of product B as the target display page. After the user enters the target display page of product B of application Q, the page (such as Figure 3a The dynamic picture generated by the built-in browser engine of the application Q, the basic control provided by the operating system, and the hidden control 301 are included. In response to the trigger operation on the hidden control 301, the initial interactive element is hidden by the built-in browser engine, and the dynamic picture in the wallpaper recording mode is obtained (as shown in FIG. Figure 6b The dynamic picture in the wallpaper recording mode includes dynamic background content, basic controls provided by the operating system, and newly added interactive elements (i.e., static wallpaper entrance and dynamic wallpaper entrance). Further, in response to the trigger operation of the newly added interactive element of the dynamic wallpaper entrance, all newly added interactive elements are hidden, and the streaming media recording API of the built-in browser engine is called to record the dynamic background content, and the target video generated by the recording is displayed on the preview page (such as Figure 5 The preview page also displays an "apply" control. Further, in response to a trigger operation on the "apply" control, a pop-up window 701 (as shown in FIG. Figure 7 As shown). Pop-up window 701 is used to display desktop options, lock screen options, and lock screen and desktop options, which are used for users to choose to set the target video as a dynamic wallpaper for the desktop and / or lock screen. Further, in response to a triggering operation for any of the aforementioned options, a dynamic wallpaper setting API inside the target application calls a dynamic wallpaper service provided by the operating system, and the called dynamic wallpaper service is used to set the target video as a dynamic wallpaper corresponding to the triggered option in the electronic device where the target application is located.

[0061] Accordingly, the static wallpaper setting method of this manual is described in detail below. The user enters the target display page of product B of application Q, and the page (such as Figure 3a The dynamic picture generated by the built-in browser engine of the application Q, the basic control provided by the operating system, and the hidden control 301 are included. In response to the trigger operation on the hidden control 301, the initial interactive element is hidden by the built-in browser engine, and the dynamic picture in the wallpaper recording mode is obtained (as shown in FIG. Figure 6b As shown). The dynamic picture in wallpaper recording mode includes dynamic background content, basic controls provided by the operating system, and newly added interactive elements (i.e., static wallpaper entry and dynamic wallpaper entry). Furthermore, if the static wallpaper setting function of the target application is turned on, then in response to the trigger operation of the static wallpaper entry, which is a newly added interactive element, canvas.toDataURL() is called to obtain the target frame of the dynamic picture from the rendering layer of the electronic device, and the target frame is converted into a data stream for storage, and then the saved data stream is converted into a target image and stored in the album, and the prompt word "Save Successfully" is displayed (such as Figure 8a If the static wallpaper setting function of the target application is turned off, a prompt pop-up window is displayed in response to the trigger operation for the static wallpaper entry, and the prompt pop-up window is used to display prompts such as "obtain album storage permission" and "whether to turn on the static wallpaper setting function" (such as Figure 8b If the user agrees to obtain the album storage permission or agrees to enable the static wallpaper setting function, the user can save the target frame of the dynamic picture to the album by triggering the static wallpaper entrance again, and then set the target image in the album as a static wallpaper.

[0062] The following uses an Android phone as an example of an electronic device to explain in detail the process of setting dynamic wallpaper and static wallpaper for the phone according to the solution in this manual. Fig. 9 As shown, the process may include the following steps:

[0063] S901: Turn on the phone.

[0064] S902: Display a target display page of a target application.

[0065] The target display page includes a dynamic picture rendered by the built-in browser engine of the target application and basic controls provided by the operating system. The dynamic picture includes a dynamic background content rendered by the built-in browser engine and an initial interactive element superimposed on the dynamic background content.

[0066] S903: In response to the received instruction to enter the wallpaper recording mode, the initial interactive element is hidden through the built-in browser API of the target application program to obtain a dynamic picture in the wallpaper recording mode.

[0067] The dynamic picture in the wallpaper recording mode includes: dynamic background content and a newly added interactive element displayed in a superimposed manner for triggering a dynamic picture recording request. In this embodiment, the newly added interactive element may include a static wallpaper entry and a dynamic wallpaper entry.

[0068] S904: Detect whether the static wallpaper setting function and the dynamic wallpaper setting function of the target application are enabled.

[0069] When it is detected that the static wallpaper setting function is turned on, the process may jump to S905 .

[0070] When it is detected that the dynamic wallpaper setting function is turned on, the process may jump to S908.

[0071] S905: Receive a trigger operation for a static wallpaper entry.

[0072] S906: In response to the triggering operation on the static wallpaper entry, canvas.toDataURL() is called to obtain a target frame of the dynamic picture from the rendering layer of the electronic device, and the target frame is converted into a data stream.

[0073] S907: Convert the data stream into a target image, and save the target image to an album.

[0074] S908: Receive a trigger operation for a dynamic wallpaper entry.

[0075] S909: In response to the triggering operation on the dynamic wallpaper entry, calling canvas to determine the dynamic picture.

[0076] S910: Calling WebRTC MediaRecorder to record the dynamic image.

[0077] S911: Generate a binary stream of the recorded target video.

[0078] S912: Convert the binary stream of the target video into arrayBuffer and save it to the File Manager.

[0079] S913: Call launchLiveWallpaperSelector jsapi in the application Q container, and inform launchLiveWallpaperSelector jsapi of the save path of the target video.

[0080] S914: calling the dynamic wallpaper service provided by the operating system through launchLiveWallpaperSelector jsapi, and using the dynamic wallpaper service to set the target video as the dynamic wallpaper of the electronic device.

[0081] Fig.10 is a schematic structural diagram of a device provided by an exemplary embodiment. Fig.10 At the hardware level, the device includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 1002 reading the corresponding computer program from the non-volatile memory 1010 into the memory 1008 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0082] Please refer to Fig.11 , the dynamic wallpaper setting device can be applied to Fig.10 The device shown in the figure can realize the technical solution of this specification. The dynamic wallpaper setting device can include: a display unit 1102, a recording unit 1104 and a dynamic wallpaper setting unit 1106.

[0083] A display unit 1102 is used to display a target display page in a target application, wherein the target display page includes a dynamic picture rendered by a built-in browser engine of the target application;

[0084] The recording unit 1104 is used to record the target display page by calling the streaming media recording API of the built-in browser engine, so that the target video generated by the recording includes the dynamic picture;

[0085] The dynamic wallpaper setting unit 1106 is configured to set the target video as a dynamic wallpaper of the electronic device where the target application is located.

[0086] Optionally, the dynamic picture includes dynamic background content generated by rendering of the built-in browser engine and an initial interactive element superimposed on the dynamic background content; the device further includes:

[0087] A hiding unit 1108, configured to, in response to a received instruction to enter a wallpaper recording mode, hide the initial interactive element through the built-in browser engine to obtain a dynamic picture in the wallpaper recording mode, the dynamic picture including the dynamic background content and a newly added interactive element for triggering a dynamic picture recording request that is superimposed and displayed;

[0088] The recording unit 1104 is specifically configured to: in response to a triggering operation on the newly added interactive element, hide the newly added interactive element, and record the remaining displayed dynamic background content by calling the streaming media recording API.

[0089] Optionally, the target application is deployed with a dynamic wallpaper setting API, and the dynamic wallpaper setting unit 1106 is specifically used to: call the dynamic wallpaper service provided by the operating system through the dynamic wallpaper setting API, and use the called dynamic wallpaper service to set the target video as the dynamic wallpaper of the electronic device.

[0090] Optionally, the dynamic wallpaper setting unit 1106 is specifically used to: play the target video to display the wallpaper preview effect corresponding to the target video; and set the target video as the dynamic wallpaper of the electronic device in response to a received confirmation instruction.

[0091] Optionally, playing the target video includes: calling a built-in video player of the target application to play the target video.

[0092] Optionally, the device further comprises:

[0093] The static wallpaper setting unit 1110 is used to obtain the target frame of the dynamic picture from the rendering layer of the electronic device in response to the received static wallpaper generation instruction, and convert the target frame into a data stream; convert the data stream into a target image, and set the target image as the static wallpaper of the electronic device where the target application is located.

[0094] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.

[0095] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0096] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.< / canvas>

Claims

1. A method for setting a dynamic wallpaper, characterized in that: include: Displaying a target display page in a target application, wherein the target display page includes a dynamic picture rendered by a built-in browser engine in the target application; By calling the streaming media recording API of the built-in browser engine, the target display page is recorded so that the target video generated by the recording includes the dynamic picture; The target video is set as a dynamic wallpaper of the electronic device where the target application is located.

2. The method according to claim 1, characterized in that The dynamic picture includes dynamic background content generated by rendering of the built-in browser engine and initial interactive elements superimposed on the dynamic background content; The method also includes: in response to a received instruction to enter a wallpaper recording mode, hiding the initial interactive element through the built-in browser engine to obtain a dynamic picture in the wallpaper recording mode, the dynamic picture including the dynamic background content and a newly added interactive element superimposed and displayed for triggering a dynamic picture recording request.

3. The method according to claim 2, characterized in that The step of recording the target display page by calling the streaming media recording API of the built-in browser engine includes: In response to the triggering operation on the newly added interactive element, the newly added interactive element is hidden, and the remaining dynamic background content displayed is recorded by calling the streaming media recording API.

4. The method according to claim 1, characterized in that: The target application is deployed with a dynamic wallpaper setting API, and the step of setting the target video as a dynamic wallpaper of the electronic device where the target application is located includes: The dynamic wallpaper setting API calls a dynamic wallpaper service provided by the operating system, and uses the called dynamic wallpaper service to set the target video as the dynamic wallpaper of the electronic device.

5. The method according to claim 1, characterized in that The step of setting the target video as a dynamic wallpaper of the electronic device where the target application is located comprises: Play the target video to display the wallpaper preview effect corresponding to the target video; In response to the received confirmation instruction, the target video is set as a dynamic wallpaper of the electronic device.

6. The method according to claim 5, characterized in that The playing of the target video includes: The built-in video player of the target application is called to play the target video.

7. The method according to claim 1, characterized in that Also includes: In response to the received static wallpaper generation instruction, acquiring a target frame of the dynamic picture from a rendering layer of the electronic device, and converting the target frame into a data stream; The data stream is converted into a target image, and the target image is set as a static wallpaper of the electronic device where the target application is located.

8. A dynamic wallpaper setting device, characterized in that: include: A display unit, used for displaying a target display page in a target application, wherein the target display page includes a dynamic picture rendered by a built-in browser engine of the target application; A recording unit, configured to record the target display page by calling the streaming media recording API of the built-in browser engine, so that the target video generated by the recording includes the dynamic picture; The dynamic wallpaper setting unit is used to set the target video as the dynamic wallpaper of the electronic device where the target application is located.

9. An electronic device, characterized in that: include: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1 to 6 by executing the executable instructions.

10. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.