Method, device and equipment for playing multimedia resource
By obtaining the configuration information of multimedia resources and the default processing logic of the Webview container, the state of multimedia resources in the background is dynamically determined and processed accordingly. This solves the problem of poor user experience in the existing technology, realizes reasonable playback of multimedia resources in the background, and improves user experience and compatibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2026-03-20
AI Technical Summary
The existing multimedia resource playback process pauses by default when the user performs other operations, which cannot meet the user's need to continue playback in the background, resulting in a poor user experience.
By obtaining the configuration information of multimedia resources and the default processing logic of the Webview container, the state of multimedia resources in the background is dynamically determined, and corresponding processing is performed according to the state and configuration information to support background playback.
It enables reasonable handling of multimedia resources according to user needs when they are moved to the background, improving user experience, and is highly compatible and low-cost.
Smart Images

Figure CN116662701B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of multimedia resource processing, and particularly relates to a multimedia resource playing processing method, device and equipment. BACKGROUND
[0002] With the development of information technology, the way of playing multimedia resources such as audio and video through electronic devices such as mobile phones and tablet computers has become the most common way of information acquisition in people's daily life or work. However, the inventors have found through research that the existing playing processing method of multimedia resources is not good, such as most devices can only play multimedia resources when the device screen displays the page where the multimedia resource is located, and once the user performs other operations (such as switching other applications, locking the screen, etc.) to make the page retreat to the background, the playing of the multimedia resource will be paused by default. However, in many cases, the user actually still wants to continue playing the multimedia resource, such as listening to the audio of the multimedia resource while using other applications, or continuing to listen to the audio of the multimedia resource while the screen is locked, and the related art directly pauses the playing of the multimedia resource when the page where the multimedia resource is located retreats to the background, which results in a poor user experience. SUMMARY
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a multimedia resource playing processing method, device and equipment.
[0004] According to an aspect of the present disclosure, a multimedia resource playing processing method is provided, comprising: obtaining first configuration information corresponding to a target multimedia resource of a current H5 page, and obtaining second configuration information corresponding to a Webview container used to carry the current H5 page; wherein the first configuration information corresponding to the target multimedia resource includes the on-off state of the background playing function corresponding to the target multimedia resource; the second configuration information corresponding to the Webview container includes the default processing logic adopted by the Webview container for the target multimedia resource in the case that the current H5 page retreats to the background, and the default processing logic includes pause playing processing or continue playing processing; obtaining a first state of the target multimedia resource before the current H5 page retreats to the background; the first state includes a pause state or a playing state; determining a second state of the target multimedia resource in the case that the current H5 page retreats to the background according to the first configuration information and the first state, and performing processing corresponding to the second state on the target multimedia resource based on the second configuration information.
[0005] According to another aspect of this disclosure, a multimedia resource playback processing apparatus is provided, comprising: an information acquisition module, configured to acquire first configuration information corresponding to a target multimedia resource of a current H5 page, and second configuration information corresponding to a Webview container used to carry the current H5 page; wherein, the first configuration information corresponding to the target multimedia resource includes: the on / off state of the background playback function corresponding to the target multimedia resource; the second configuration information corresponding to the Webview container includes: the default processing logic of the Webview container for the target multimedia resource when the current H5 page is moved to the background, the default processing logic including pause playback processing or continue playback processing; a state acquisition module, configured to acquire a first state of the target multimedia resource before the current H5 page is moved to the background; the first state includes a paused state or a playback state; and a resource processing module, configured to determine the second state of the target multimedia resource when the current H5 page is moved to the background based on the first configuration information and the first state, and to perform processing on the target multimedia resource corresponding to the second state based on the second configuration information.
[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the multimedia resource playback processing method.
[0007] The technical solution provided in this disclosure can comprehensively determine the second state of the target multimedia resource when the current H5 page is in the background, based on the first configuration information corresponding to the target multimedia resource of the current H5 page (the on / off state of the background playback function corresponding to the target multimedia resource) and the first state of the target multimedia resource before the current H5 page is moved to the background. Based on the second configuration information corresponding to the Webview container used to carry the current H5 page (the default processing logic adopted by the Webview container for the target multimedia resource when the current H5 page is moved to the background), the solution can process the target multimedia resource according to the second state. This allows for dynamic determination of the target multimedia resource's state when the current H5 page is moved to the background, based on the on / off state of the background playback function configured for the target multimedia resource and the state of the target multimedia resource before the current H5 page is moved to the background. Corresponding processing is then taken based on the configuration of the Webview container. Compared with the related technologies that directly stop playing the target multimedia resource when the H5 page is moved to the background, the method provided in this disclosure is more reasonable and better meets actual needs, effectively improving the user experience.
[0008] It should be understood that nothing in this section is intended to limit the scope of the disclosure. Other aspects, features, and advantages of the disclosure will become apparent to those of ordinary skill in the art from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0009] The accompanying drawings are incorporated in and constitute a part of this specification and, together with the description, explain the principles of the disclosure.
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required by the embodiments or the prior art description. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative labor.
[0011] Figure 1 A flowchart of a multimedia resource playing processing method provided by an embodiment of the present disclosure;
[0012] Figure 2 A flowchart of a multimedia resource playing processing method provided by an embodiment of the present disclosure;
[0013] Figure 3 A structural diagram of a multimedia resource playing processing device provided by an embodiment of the present disclosure;
[0014] Figure 4 A structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail by making reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided to make the present disclosure more thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.
[0016] It should be understood that each step described in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0017] The term "include" and variations thereof used in the present disclosure mean a non-exclusive inclusion, i.e., "including, but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Related definitions are given throughout the detailed description. It should be noted that the concepts mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one", "multiple" modification is illustrative and not restrictive, and should be understood as "one or more" unless otherwise explicitly indicated in the context.
[0018] It should be noted that the "one", "multiple" modification mentioned in the present disclosure is illustrative and not restrictive, and those skilled in the art should understand that "one", "multiple" modification is illustrative and not restrictive, and should be understood as "one or more" unless otherwise explicitly indicated in the context.
[0019] In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the schemes of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0020] The inventors have found that the related art provides a poor playing processing method for multimedia resources. In one aspect, most devices almost only use fixed processing logic, such as most devices that will default to pause playing multimedia resources directly when it is detected that the page where the multimedia resources are located is retreated to the background, without considering the user's background playing demand. In another aspect, directly using the page of the native end for background playing processing is relatively complex and cumbersome, and the native end of different types of devices may need to set different background playing processing logics respectively, which requires a high cost and has poor compatibility. Although some native ends will nest HTML5 (HyperText Markup Language 5, abbreviated as H5) pages to play multimedia resources, once it is detected that the H5 page is retreated to the background, the H5 page process will be directly destroyed, and the background playing processing of the multimedia resources cannot be realized. To improve at least one of the above problems, the present disclosure provides a playing processing method, device and equipment for multimedia resources, which are described in detail below.
[0021] Figure 1 A flowchart of a playing processing method for multimedia resources provided by the present disclosure is shown. The method can be executed by a playing processing device for multimedia resources, which can be implemented by software and / or hardware, and can be integrated in an electronic device, such as a user device, such as a mobile phone, a tablet computer, etc. Figure 1 As shown, the method mainly includes the following steps S102-S106:
[0022] In step S102, the first configuration information corresponding to the target multimedia resource of the current H5 page is acquired, and the second configuration information corresponding to the Webview container used to carry the current H5 page is acquired. The first configuration information corresponding to the target multimedia resource includes the on-off state of the background playing function corresponding to the target multimedia resource. The second configuration information corresponding to the Webview container includes the default processing logic of the Webview container for the target multimedia resource in the case where the current H5 page is backgrounded, and the default processing logic includes the pause playing processing or the continue playing processing. In some embodiments, the current H5 page being backgrounded can be understood as the application to which the current H5 page belongs being backgrounded, and can further be understood as the application to which the current H5 page belongs exiting the current operating system. Although the H5 page is no longer displayed on the screen interface of the user device at this time, the application to which the current H5 page belongs is not completely closed at this time, and the information of the application to which the current H5 page belongs is still retained in the current operating system. The application to which the current H5 page belongs can continue to run in the background.
[0023] Considering the flexibility of the H5 page and the richness of the supportable content, in the embodiments of the present disclosure, the native end of the user device can play multimedia resources through nested H5 pages. The way of playing multimedia resources through H5 pages can be widely applied to various types of devices, such as iOS devices, Android devices, etc., and has stronger compatibility. The playing processing method of the multimedia resource provided in the embodiments of the present disclosure can be specifically executed by the H5 end of the user device, thereby flexibly and conveniently realizing cross-end application. Compared with the different multimedia resource playing processing logic required by the native end of different types of devices in the related art, the above-mentioned way of playing multimedia resources through H5 pages has stronger flexibility and compatibility, and also has relatively low cost. Specifically, the native end can carry the H5 page through the Webview container (which can also be understood as the Webview environment), and the current H5 page can be the H5 page currently displayed on the screen of the user device, which can be an H5 Video page or an H5 Audio page, etc., without limitation. In some embodiments, all the multimedia resources loaded by the current H5 page are target multimedia resources, and the target multimedia resources can be displayed through the current H5 page, such as picture display, video playing, etc. In other embodiments, the current H5 page corresponds to one or more multimedia resources, and only the multimedia resources meeting the condition are target multimedia resources, such as the resource location area being located within the specified area range of the current H5 page, or the multimedia resource having been triggered to play on the current H5 page, etc., without limitation.
[0024] The embodiments of the present disclosure can acquire the opening and closing state of the background playing function configured for the multimedia resource, and the opening and closing state specifically includes an open state or a closed state. The opening and closing state of the multimedia resource can be set by a background staff, such as a publisher of the multimedia resource, or can be set by a user, such as providing a control for the user to control the opening and closing state of the background playing function for the user to set the required opening and closing state through the control. In addition, the embodiments of the present disclosure fully consider that the default processing logic of the Webview container of different devices for the target multimedia resource under the condition of the H5 page retreating to the background is different, such as the Webview container of most devices defaulting to pause playing the multimedia resource, and there can be a small part of devices defaulting to continue playing the multimedia resource, so the embodiments of the present disclosure also acquire the default processing logic corresponding to the Webview container, so as to be combined with other information such as the opening and closing state of the background playing function corresponding to the multimedia resource for comprehensive analysis and processing.
[0025] In step S104, a first state of the target multimedia resource before the current H5 page retreats to the background is acquired; the first state includes a pause state or a play state. Specifically, the first state is used to represent the state of the target multimedia resource when it retreats to the background, such as the target multimedia resource being in a play state before retreating to the background, and the first state being a play state. If the user has initiated a pause instruction for the target multimedia resource before the page retreats to the background, the target multimedia resource is in a pause state before retreating to the background, and the first state is a pause state. The first state being a pause state or a play state mainly depends on user operation, and in specific implementation, the state of the current H5 page at the moment of retreating to the background can be acquired as the first state. In actual application, the H5 end can directly obtain from the native end whether the current H5 page retreats to the background, and in the case that the native end of some devices does not support the H5 end to directly acquire the state of whether the H5 page retreats to the background, the H5 end can determine whether the current H5 page retreats to the background through the visibilitState method attribute, which is not limited herein.
[0026] In step S106, according to the first configuration information and the first state, a second state of the target multimedia resource under the condition of the current H5 page retreating to the background is determined, and the target multimedia resource is processed according to the second state based on the second configuration information.
[0027] Compared with the manner of directly processing the target multimedia resource according to the default processing logic when the H5 page is returned to the background in the related technology, the above manner provided by the embodiments of the present disclosure is more reasonable and more in line with actual needs, and can effectively improve the user experience.
[0028] Exemplarily, the embodiments of the present disclosure provide two ways of obtaining the first configuration information corresponding to the target multimedia resource of the current H5 page:
[0029] The first way is to obtain the associated information of the target multimedia resource issued by the server, and extract the on-off state of the background playing function corresponding to the target multimedia resource from the associated information. The on-off state contained in the associated information is pre-set.
[0030] That is, in this way, the configuration information of the multimedia resource can be pre-set by the background personnel, such as setting the on-off state of the background playing function of the multimedia resource according to the content type of the multimedia resource. Assuming that the multimedia resource is music, the background playing function of the music can be set to be turned on, and assuming that the multimedia resource is a course video, only in the case of front-end viewing, the course video can have a good learning effect, so the background playing function of the course video can be set to be turned off. In actual application, a field for representing the on-off state can be set in the associated information, and by extracting the content of the field in the associated information of the target multimedia resource, the on-off state of the background playing function corresponding to the target multimedia resource can be obtained.
[0031] The second way is to obtain the state of the background playing control corresponding to the target multimedia resource, and determine the on-off state of the background playing function corresponding to the target multimedia resource according to the state of the background playing control. The background playing control is set on the current H5 page.
[0032] That is, in this way, the user can set the on-off state of the background playing function corresponding to the target multimedia resource according to the demand, and in actual application, the background playing control can be provided for the user on the current H5 page. If the user triggers the background playing control, it is confirmed that the user sets the background playing function to the on state. In this way, the user demand can be fully considered, the on-off state of the background playing function is set based on the user demand, and the user experience is effectively guaranteed.
[0033] Exemplarily, the embodiments of the present disclosure provide two ways of obtaining the second configuration information corresponding to the Webview container for carrying the current H5 page:
[0034] The second configuration information corresponding to the Webview container for bearing the current H5 page is obtained from the native side. In actual application, the H5 side can directly obtain the second configuration information corresponding to the Webview container from the native side, which is very convenient and fast.
[0035] The second configuration information corresponding to the Webview container is determined based on the test operation result. The test operation result includes change information of a target parameter corresponding to the target multimedia resource when the target multimedia resource executes the test operation of being sent to the background.
[0036] Considering that some devices may not support the H5 side to obtain the second configuration information corresponding to the Webview container from the native side, in this case, the Webview container can be tested in advance. Specifically, the current H5 page borne by the Webview container is first sent to the background, that is, the test operation of being sent to the background is executed, and then the change of the target parameter corresponding to the target multimedia resource is monitored to determine whether the Webview container directly performs the pause playing processing or the continuous playing processing on the target multimedia resource. The background playing function corresponding to the target multimedia resource is started during the test, and the target parameter can be the playing time or any parameter that changes with the playing of the target multimedia resource. In this case, if the target parameter does not change, it means that the target multimedia resource does not play after the current H5 page is sent to the background, and at this time, it can be confirmed that the default processing logic corresponding to the Webview container is the pause playing processing. In addition, the target parameter can also be a sound parameter. In this case, if the sound of the target multimedia resource changes from sound to silence after the current H5 page is sent to the background, it is considered that the default processing logic corresponding to the Webview container is the pause playing processing. The type of the target parameter can be flexibly set according to the requirement, and the second configuration information corresponding to the Webview container is determined based on the type of the target parameter and the change of the target parameter. The above method can effectively and reliably obtain the configuration information corresponding to the Webview container even if the native side does not support the H5 side to obtain the configuration information corresponding to the Webview container. In actual application, the test operation of sending the H5 page to the background can be performed only once in advance for the Webview container, and the test operation result can be saved for subsequent application.
[0037] Based on the first configuration information and the first state, the two implementation manners of determining the second state of the target multimedia resource in the case of being sent to the background in the current H5 page according to the first configuration information and the first state are provided, which can be implemented according to the following implementation examples.
[0038] In an embodiment, when the first state is the playing state, the second state of the target multimedia resource when the current H5 page is backgrounded is determined according to an open or close state of a background playing function corresponding to the target multimedia resource.
[0039] Specifically, when the background playing function corresponding to the target multimedia resource is in the open state, the second state of the target multimedia resource when the current H5 page is backgrounded is determined to be the playing state; when the background playing function corresponding to the target multimedia resource is in the close state, the second state of the target multimedia resource when the current H5 page is backgrounded is determined to be the pause state. In other words, if the current H5 page is backgrounded when the target multimedia resource is in the playing state, the second state of the target multimedia resource should depend on the open or close state of the background playing function. When the background playing function is open, the second state is the playing state, that is, even if the current H5 page is backgrounded, the target multimedia resource continues to play; when the background playing function is closed, the second state is the pause state. That is, even if the target multimedia resource is in the playing state before the current H5 page is backgrounded, because the background playing function is closed, the target multimedia resource will stop playing when the current H5 page is backgrounded.
[0040] In an embodiment, when the first state is the pause state, the first configuration information is ignored, and the second state of the target multimedia resource when the current H5 page is backgrounded is determined to be the pause state. If the first state is the pause state, whether the background playing function is open or not, the target multimedia resource is directly considered to be in the pause state after the current H5 page is backgrounded. In actual application, the first state and the first configuration information can be obtained in advance, and the first state is first determined, and then whether the first configuration information needs to be ignored is determined according to the first state.
[0041] In the above manner, the second state of the target multimedia resource when the current H5 page is backgrounded can be reasonably determined, so as to meet the real needs of users.
[0042] When the second state of the target multimedia resource when the current H5 page is backgrounded is known, the target multimedia resource can be processed according to the second state based on the second configuration information. Embodiments of the present disclosure provide an embodiment of processing the target multimedia resource according to the second state based on the second configuration information, which can be implemented by referring to the following embodiment one or embodiment two:
[0043] In a second state does not match the default processing logic, the Webview container in the current H5 page to the background in the case of the target multimedia resources for the backup processing logic, wherein the backup processing logic and the second state matching; using the backup processing logic for the target multimedia resources corresponding to the second state processing.
[0044] The second state and the default processing logic does not match the case, including: the second state is the pause state, and the default processing logic is to continue playing; and, the second state is the playing state, and the default processing logic is to pause playing. It can be understood that in the related art, the second state is not determined in combination with the first configuration information and the first state, but directly using the default processing logic to process the multimedia resources on the H5 page which is retreated to the background, such as directly pausing playing multimedia resources, or still continue to play multimedia resources, that is, only a set of fixed logic (default processing logic) is used to process the target multimedia resources. However, in the embodiment of the present disclosure, the second state is additionally determined in combination with the first configuration information and the first state, and when the second state does not match the default processing logic, the backup processing logic is additionally introduced, so that the target multimedia resources are reasonably processed. Specifically, if the default processing logic is the pause playing processing, the backup processing logic is the continue playing processing; if the default processing logic is the continue playing processing, the backup processing logic is the pause playing processing. When using the continue playing processing logic, the background can only play the audio of the multimedia resource, or the video window screen can be presented in the case of not locking the screen, which is not limited. In actual application, the default processing logic and the backup processing logic can be implemented by using JS (JavaScript) programming language, or can be implemented by using other ways, which is not limited.
[0045] In a second state does not match the default processing logic, the Webview container in the current H5 page to the background in the case of the target multimedia resources for the backup processing logic, wherein the backup processing logic and the second state matching; using the backup processing logic for the target multimedia resources corresponding to the second state processing.
[0046] In order to avoid the current H5 page from being returned to the background and the processing of the target multimedia resource from being stuck, in the embodiment of the present disclosure, when the target multimedia resource is processed according to the second state, the target multimedia resource can be processed according to the second state when it is monitored that the current H5 page is returned to the background for a preset time length. The preset time length can be flexibly set according to the needs, such as 500 milliseconds. The preset time length can be set to be shorter than the time length that can be perceived by the user. In this way, the user experience will not be affected and the processing success probability will be improved, and the user experience will be protected. Specifically, the inventors have found that if the target multimedia resource is processed according to the second state immediately when it is monitored that the current H5 page is returned to the background, some devices are prone to be stuck or even fail to process. However, if a preset buffer time length is set, that is, the corresponding processing of the target multimedia resource is performed after the current H5 page is returned to the background for a preset time length, the success probability can be improved and the problem of being stuck can be avoided.
[0047] Further, the above-mentioned method provided by the embodiment of the present disclosure further comprises: if it is monitored that the play control of the target multimedia resource displayed in the resource play bar is triggered, the playing of the target multimedia resource is paused under the condition that the current H5 page is returned to the background and the preset condition is met; wherein, the preset condition comprises: the device type for executing the play processing method of the multimedia resource is a target type, the current H5 page is returned to the background, and the background play function corresponding to the target multimedia resource is in a closed state. Exemplarily, the target type is an iOS type. The inventors have found that some target type devices (such as iOS devices) will set a resource play bar. Even if the current H5 page is returned to the background and the background play function is closed, the user can still play the target multimedia resource through the play control on the resource play bar. For multimedia resources such as course videos, relevant personnel need to obtain the learning progress of the user, and in order to protect the learning effect, the background setting of such resources does not allow background playing, that is, the background play function of such resources is in a closed state. However, if the user directly plays through the resource play bar of the iOS device, it will affect the recording accuracy of the learning progress and the learning effect. Therefore, if it is monitored that the play control of the target multimedia resource displayed in the resource play bar is triggered, the playing of the target multimedia resource is paused under the condition that the current H5 page is returned to the background and the preset condition is met. Specifically, the playing of the target multimedia resource can be paused immediately or after a preset time length such as 100 milliseconds. This is not limited herein.
[0048] On the basis of the foregoing, Figure 2 The flowchart of the play processing method of the multimedia resource provided by the embodiment of the present disclosure can be executed by referring to steps S202-S220:
[0049] In step S202, the open / close state of the background playing function corresponding to the target multimedia resource of the current H5 page is acquired, and the default processing logic adopted by the Webview container for the target multimedia resource in the case where the current H5 page is backgrounded is acquired. The Webview container is used to carry the current H5 page, and the default processing logic includes a pause playing processing or a continue playing processing.
[0050] In step S204, the first state of the target multimedia resource before the current H5 page is backgrounded is acquired. The first state includes a pause state or a playing state.
[0051] In step S206, it is determined whether the first state is the pause state. If yes, step S208 is executed, and if no, step S210 is executed.
[0052] In step S208, the open / close state of the background playing function corresponding to the target multimedia resource is ignored, and it is determined that the second state of the target multimedia resource in the case where the current H5 page is backgrounded is the pause state.
[0053] In step S210, it is determined whether the background playing function corresponding to the target multimedia resource is in the open state. If yes, step S212 is executed, and if no, step S214 is executed.
[0054] In step S212, it is determined that the second state of the target multimedia resource in the case where the current H5 page is backgrounded is the playing state.
[0055] In step S214, it is determined that the second state of the target multimedia resource in the case where the current H5 page is backgrounded is the pause state.
[0056] In step S216, it is determined whether the second state matches the default processing logic. If yes, step S218 is executed, and if no, step S220 is executed.
[0057] In step S218, the target multimedia resource is processed according to the second state by using the default processing logic.
[0058] In step S220, the standby processing logic adopted by the Webview container for the target multimedia resource in the case where the current H5 page is backgrounded is acquired, and the target multimedia resource is processed according to the second state by using the standby processing logic.
[0059] The specific implementation manners of the above steps can refer to the related contents described above, and will not be described here again. In actual application, even if the target multimedia resource is played in the background, the playing progress of the target multimedia resource can be periodically reported to the server, so as to guarantee the accuracy of the playing progress of the target multimedia resource recorded by the server.
[0060] In summary, the playing processing method of the multimedia resource provided by the embodiments of the present disclosure can be well applied to various types of devices, supports various types of devices to realize multimedia resource playing by using H5 pages, and reasonably processes whether the multimedia resource on the H5 page is played when the H5 page is backgrounded, has strong compatibility, and the way of realizing the playing processing of the multimedia resource by using the H5 technology also has low cost. It can be understood that different devices have different configurations, and the default processing logic for the resources on the page in the case of the page being backgrounded is also different, and the above-mentioned way provided by the embodiments of the present disclosure can comprehensively determine the state of the multimedia resource in the background of the page based on the configuration of the background playing function of the multimedia resource and the state of the multimedia resource before the page is backgrounded, and determine whether to use the default processing logic or introduce the backup processing logic based on the configuration of the Webview container, so that the multimedia resource can be processed according to its background state. Compared with the way of directly using the default processing logic of the device itself to process the multimedia resource when the page is backgrounded in the related art, the above-mentioned way provided by the embodiments of the present disclosure can dynamically determine the reasonable state of the multimedia resource in the background and take appropriate processing logic for corresponding processing, and can better meet the actual needs, and can effectively improve the user experience. In addition, the above-mentioned way provided by the embodiments of the present disclosure can also delay for a certain time before processing the multimedia resource in the case of the page being backgrounded, which can better improve the problems such as lag in the related art, and effectively improve the user experience.
[0061] Corresponding to the playing processing method of the multimedia resource, the embodiments of the present disclosure also provide a playing processing device of a multimedia resource, Figure 3 A structural schematic diagram of a playing processing device of a multimedia resource provided by the embodiments of the present disclosure, which can be realized by software and / or hardware, and can be integrated in an electronic device. As shown in Figure 3 The playing processing device 300 of the multimedia resource includes:
[0062] The information acquisition module 302 is configured to acquire first configuration information corresponding to a target multimedia resource of a current H5 page, and acquire second configuration information corresponding to a Webview container used to carry the current H5 page; wherein the first configuration information corresponding to the target multimedia resource includes an on-off state of a background playing function corresponding to the target multimedia resource; and the second configuration information corresponding to the Webview container includes a default processing logic of the Webview container for the target multimedia resource in the case of the current H5 page being backgrounded, and the default processing logic includes a pause playing processing or a continue playing processing;
[0063] The state acquisition module 304 is configured to acquire a first state of the target multimedia resource before the current H5 page is backgrounded.
[0064] The resource processing module 306 is configured to determine a second state of the target multimedia resource in the case where the current H5 page is backgrounded, according to the first configuration information and the first state, and perform processing corresponding to the second state on the target multimedia resource based on the second configuration information.
[0065] The above apparatus can dynamically determine the state of the target multimedia resource in the case where the current H5 page is backgrounded, based on the on-off state of the background playing function configured for the target multimedia resource and the state of the target multimedia resource before the current H5 page is backgrounded, and perform corresponding processing based on the configuration of the Webview container. Compared with the manner in the related art in which the target multimedia resource is directly stopped from playing when the H5 page is backgrounded, the above manner provided in the embodiments of the present disclosure is more reasonable and more in line with actual needs, and can effectively improve user experience.
[0066] In some embodiments, the resource processing module 306 is specifically configured to: in the case where the first state is a playing state, determine the second state of the target multimedia resource in the case where the current H5 page is backgrounded, according to the on-off state of the background playing function included in the first configuration information; and in the case where the first state is a pause state, ignore the first configuration information, and determine that the second state of the target multimedia resource in the case where the current H5 page is backgrounded is a pause state.
[0067] In some embodiments, the resource processing module 306 is specifically configured to: in the case where the background playing function corresponding to the first configuration information is in an on state, determine that the second state of the target multimedia resource in the case where the current H5 page is backgrounded is a playing state; and in the case where the background playing function corresponding to the first configuration information is in an off state, determine that the second state of the target multimedia resource in the case where the current H5 page is backgrounded is a pause state.
[0068] In some embodiments, the resource processing module 306 is specifically configured to: in the case where the second state does not match the default processing logic, acquire a backup processing logic of the Webview container for the target multimedia resource in the case where the current H5 page is backgrounded, wherein the backup processing logic matches the second state; and perform processing corresponding to the second state on the target multimedia resource by using the backup processing logic.
[0069] In some embodiments, the resource processing module 306 is specifically configured to: in a case where the second state matches the default processing logic, performing processing corresponding to the second state on the target multimedia resource by using the default processing logic.
[0070] In some embodiments, the information obtaining module 302 is specifically configured to: obtaining, from a native side, second configuration information corresponding to a Webview container used for carrying the current H5 page; or, obtaining a test operation result of a Webview container used for carrying the current H5 page, and determining the second configuration information corresponding to the Webview container based on the test operation result; wherein the test operation result includes change information of a target parameter corresponding to the target multimedia resource when the target multimedia resource performs a test operation of backgrounding.
[0071] In some embodiments, the resource processing module 306 is specifically configured to: in a case where it is monitored that the current H5 page backgrounds for a preset time length, performing processing corresponding to the second state on the target multimedia resource.
[0072] In some embodiments, the apparatus further includes a pausing module configured to, in a case where the current H5 page backgrounds and a preset condition is met, pause playing the target multimedia resource if it is monitored that a play control of the target multimedia resource displayed in a resource play bar is triggered; wherein the preset condition includes: a device type used for executing a play processing method of the multimedia resource is a target type, the current H5 page backgrounds, and a background play function corresponding to the target multimedia resource is in a closed state.
[0073] The apparatus for processing a multimedia resource provided in the embodiments of the present disclosure can execute the method for processing a multimedia resource provided in any of the embodiments of the present disclosure, and has the function modules and beneficial effects corresponding to the execution method.
[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the apparatus embodiments described above can refer to the corresponding process in the method embodiments, which will not be repeated here.
[0075] The exemplary embodiments of the present disclosure also provide an electronic device, including: at least one processor; and a memory connected with the at least one processor in communication. The memory stores a computer program capable of being executed by the at least one processor, and the computer program, when executed by the at least one processor, is configured to cause the electronic device to perform the method according to the embodiments of the present disclosure.
[0076] The exemplary embodiments of this disclosure further provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, causes the computer to perform the method according to the embodiments of this disclosure.
[0077] The exemplary embodiments of this disclosure further provide a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, causes the computer to perform the method according to the embodiments of this disclosure.
[0078] The computer program product can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, etc., and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server.
[0079] Furthermore, embodiments of the present disclosure can also be a computer readable storage medium, having stored thereon computer program instructions which, when executed by a processor, cause the processor to carry out the multimedia resource playing processing method provided by the embodiments of the present disclosure. The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0080] Reference Figure 4The present invention describes a structural block diagram of an electronic device 400 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0081] like Figure 4 As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. The RAM 403 may also store various programs and data required for the operation of the device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0082] Multiple components in electronic device 400 are connected to I / O interface 405, including: input unit 406, output unit 407, storage unit 408, and communication unit 409. Input unit 406 can be any type of device capable of inputting information to electronic device 400. Input unit 406 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 407 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 408 may include, but is not limited to, disks and optical discs. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMa4 devices, cellular communication devices, and / or the like.
[0083] The computing unit 401 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 401 performs various methods and processes described above. For example, in some embodiments, the playback processing method of multimedia resources can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 400 via the ROM 402 and / or the communication unit 409. In some embodiments, the computing unit 401 can be configured to perform the playback processing method of multimedia resources by any other suitable means, such as by means of firmware.
[0084] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a function / operation specified in the flowchart and / or block diagram. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, and partially on a remote machine or entirely on a remote machine or server.
[0085] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable storage media can include, without limitation, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include one or more lines of electrical connections, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical storage devices, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0086] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus and / or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal that can be used to provide machine instructions and / or data to a programmable processor.
[0087] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0088] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0089] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
[0090] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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. Without further limitations, 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 said element.
[0091] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for playing multimedia resources, comprising: The system obtains first configuration information corresponding to the target multimedia resource of the current H5 page, and second configuration information corresponding to the Webview container used to host the current H5 page. The first configuration information for the target multimedia resource includes the on / off state of the background playback function corresponding to the target multimedia resource. The second configuration information for the Webview container includes the default processing logic adopted by the Webview container for the target multimedia resource when the current H5 page is moved to the background; the default processing logic includes pause playback or resume playback. The first state of the target multimedia resource before the current H5 page is moved to the background is obtained; the first state includes a paused state or a playing state. Based on the first configuration information and the first state, determine the second state of the target multimedia resource when the current H5 page is moved to the background, and perform processing on the target multimedia resource corresponding to the second state based on the second configuration information, including: if the second state does not match the default processing logic, obtain the backup processing logic adopted by the Webview container for the target multimedia resource when the current H5 page is moved to the background, wherein the backup processing logic matches the second state; and use the backup processing logic to perform processing on the target multimedia resource corresponding to the second state.
2. The multimedia resource playback processing method as described in claim 1, wherein, The step of determining the second state of the target multimedia resource when the current H5 page is moved to the background based on the first configuration information and the first state includes: When the first state is the playback state, the second state of the target multimedia resource when the current H5 page is moved to the background is determined according to the on / off state of the background playback function corresponding to the target multimedia resource. If the first state is a paused state, ignore the first configuration information and determine that the target multimedia resource is in a paused state when the current H5 page is moved to the background.
3. The multimedia resource playback processing method as described in claim 2, wherein, The step of determining the second state of the target multimedia resource when the current H5 page is moved to the background based on the on / off state of the background playback function corresponding to the target multimedia resource includes: When the background playback function corresponding to the target multimedia resource is enabled, the second state in which the target multimedia resource is located when the current H5 page is moved to the background is determined to be the playback state. If the background playback function corresponding to the target multimedia resource is turned off, the second state of the target multimedia resource when the current H5 page is moved to the background is determined to be a paused state.
4. The multimedia resource playback processing method according to any one of claims 1 to 3, wherein, The step of processing the target multimedia resource according to the second configuration information in accordance with the second state includes: If the second state matches the default processing logic, the default processing logic is used to process the target multimedia resource in accordance with the second state.
5. The multimedia resource playback processing method as described in claim 1, wherein, The step of obtaining the second configuration information corresponding to the Webview container used to host the current H5 page includes: Obtain the second configuration information from the native client corresponding to the Webview container used to host the current H5 page; or, Obtain the test operation result of the Webview container used to carry the current H5 page, and determine the second configuration information corresponding to the Webview container based on the test operation result; wherein, the test operation result includes: the change information of the target parameters corresponding to the target multimedia resource when the test operation of returning to the background is performed on the current H5 page.
6. The multimedia resource playback processing method as described in claim 1, wherein, The step of processing the target multimedia resource in accordance with the second state includes: If the current H5 page is detected to have been in the background for a preset period of time, the target multimedia resource will be processed in accordance with the second state.
7. The multimedia resource playback processing method as described in claim 1, wherein, The method further includes: If the current H5 page is moved to the background and preset conditions are met, and the playback control of the target multimedia resource displayed in the resource playback bar is triggered, then the playback of the target multimedia resource is paused; wherein, the preset conditions include: the device type used to execute the playback processing method of the multimedia resource is the target type, the current H5 page is moved to the background, and the background playback function corresponding to the target multimedia resource is in a closed state.
8. A multimedia resource playback processing device, comprising: The information acquisition module is used to acquire first configuration information corresponding to the target multimedia resource of the current H5 page, and second configuration information corresponding to the Webview container used to carry the current H5 page; wherein, the first configuration information corresponding to the target multimedia resource includes: the on / off state of the background playback function corresponding to the target multimedia resource; the second configuration information corresponding to the Webview container includes: the default processing logic of the Webview container for the target multimedia resource when the current H5 page is moved to the background, the default processing logic including pause playback processing or continue playback processing; The status acquisition module is used to acquire the first state of the target multimedia resource before the current H5 page is returned to the background; the first state includes a paused state or a playing state; The resource processing module is configured to determine, based on the first configuration information and the first state, the second state of the target multimedia resource when the current H5 page is moved to the background, and to perform processing on the target multimedia resource corresponding to the second state based on the second configuration information, including: if the second state does not match the default processing logic, obtaining the backup processing logic adopted by the Webview container for the target multimedia resource when the current H5 page is moved to the background, wherein the backup processing logic matches the second state; and using the backup processing logic to perform processing on the target multimedia resource corresponding to the second state.
9. An electronic device, comprising: processor; as well as Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform the multimedia resource playback processing method according to any one of claims 1-7.
Citation Information
Patent Citations
Video playing method, video playing device and electronic equipment
CN112866782A
Display device and browser multi-label page media resource playing method
CN113507646A
Automate control of media playback based on visibility
US20180285148A1