CN112511857B - Method, device, storage medium and terminal for preventing terminal from sleeping based on browser - Google Patents

Method, device, storage medium and terminal for preventing terminal from sleeping based on browser Download PDF

Info

Publication number
CN112511857B
CN112511857B CN202110147087.5A CN202110147087A CN112511857B CN 112511857 B CN112511857 B CN 112511857B CN 202110147087 A CN202110147087 A CN 202110147087A CN 112511857 B CN112511857 B CN 112511857B
Authority
CN
China
Prior art keywords
video
attribute
terminal
live
playing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110147087.5A
Other languages
Chinese (zh)
Other versions
CN112511857A (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New Oriental Education Technology Group Co ltd
Original Assignee
New Oriental Education Technology Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New Oriental Education Technology Group Co ltd filed Critical New Oriental Education Technology Group Co ltd
Priority to CN202110147087.5A priority Critical patent/CN112511857B/en
Publication of CN112511857A publication Critical patent/CN112511857A/en
Application granted granted Critical
Publication of CN112511857B publication Critical patent/CN112511857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4126The peripheral being portable, e.g. PDAs or mobile phones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/84Generation or processing of descriptive data, e.g. content descriptors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The disclosure relates to a method, a device, a storage medium and a terminal for preventing a terminal from sleeping based on a browser, wherein the browser is enabled to run a pre-generated hypertext markup language page code comprising a video tag in response to the operation of a user; analyzing the video source attribute included by the video tag in the hypertext markup language page code; under the condition that the video source attribute is analyzed, playing a live streaming video corresponding to a live video streaming address indicated by the video source attribute so as to prevent the terminal from automatically entering dormancy; the video label also comprises a mute attribute, the attribute value of the mute attribute is not a true value, a hypertext markup language page code generated in advance is executed through the browser, and the live streaming video played by the terminal is simulated.

Description

Method, device, storage medium and terminal for preventing terminal from sleeping based on browser
Technical Field
The present disclosure relates to the field of electronic information technologies, and in particular, to a method and an apparatus for preventing a terminal from sleeping based on a browser, a storage medium, and a terminal.
Background
In some application scenarios, it is required that a PC (Personal Computer) or a mobile device end does not enter a sleep state following a lock screen setting of a system.
In the related art, a video tag is set in HTML5 (HyperText Markup Language 5, 5 th generation HyperText Markup Language), and a loop playing attribute of the video tag is set so that the video tag is played in a loop mode, or a current playing position of the video tag is frequently changed so that the video tag is played in a loop mode, so that the effect of preventing the device from being dormant through a browser is achieved. However, some systems cannot achieve the purpose of preventing the device from sleeping by setting the attributes (the current playing position and the circular playing attribute) of the video tag, and frequent changing of the current playing position of the video tag may cause an increase in cpu (central processing unit) energy consumption, and further a memory surge, and an animation is played over the card until the browser crashes.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method, an apparatus, a storage medium, and a terminal for preventing a terminal from sleeping based on a browser, which achieve the purpose of preventing the terminal from sleeping through the browser on the basis of not increasing the energy consumption of a central processing unit.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for preventing a terminal from sleeping based on a browser, the method including:
responding to the operation of a user, and enabling a browser to run a pre-generated hypertext markup language page code comprising a video tag;
analyzing the video source attribute included by the video tag in the hypertext markup language page code;
under the condition that the video source attribute is analyzed, playing a live streaming video corresponding to a live video streaming address indicated by the video source attribute so as to prevent the terminal from automatically entering dormancy;
the video label also comprises a mute attribute, and the attribute value of the mute attribute is not a true value.
Optionally, the playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute to prevent the terminal from automatically entering the sleep mode includes:
under the condition that the attribute value of the automatic playing attribute in the video label is a true value, automatically playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering dormancy;
and under the condition that the attribute value of the automatic playing attribute in the video tag is not a true value, calling a playing method of the video tag to prevent the terminal from automatically entering dormancy, wherein the playing method is used for playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute.
Optionally, the live video stream address is obtained by:
acquiring a video to be processed;
separating video data in the video to be processed;
converting the format of the video data into a preset format to obtain target data to be pushed, wherein the data in the preset format is format data which can be used for pushing;
pushing the target data to be pushed to a server according to a preset pushing duration;
and receiving a video stream address returned by the server, and taking the video stream address as a live video stream address.
Optionally, the acquiring the video to be processed includes:
acquiring a source video;
and preprocessing the video parameters of the source video to obtain a video to be processed, wherein the video parameters comprise at least one of resolution parameters, frame rate parameters and code rate parameters.
Optionally, the video tag further comprises a page height size attribute, a page width size attribute, and a window attribute; the attribute value of the page height dimension attribute is a preset height, the attribute value of the page width dimension attribute is a preset width, the attribute value of the window attribute is a true value, the preset height is smaller than the screen height of the terminal, and the preset width is smaller than the screen width of the terminal.
Optionally, the code of the hypertext markup language page further includes a code for covering the video tag.
Optionally, after the playing of the live streaming video corresponding to the live streaming video address indicated by the video source attribute is performed to prevent the terminal from automatically entering the sleep mode, the method further includes:
and if the operation of the user on the terminal is not responded within a preset time period, ending the playing of the live streaming video.
Optionally, the method further comprises: under the condition that a live video stream address indicated by the video source attribute cannot be analyzed, controlling the browser to run a pre-generated hypertext markup language page backup code comprising a video tag;
and analyzing the video source attribute included by the video tag in the hypertext markup language page backup code, and playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering the dormancy state.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for preventing a terminal from sleeping based on a browser, the apparatus including:
the first loading module is configured to respond to the operation of a user and enable the browser to run a pre-generated hypertext markup language page code comprising a video tag;
a first parsing module configured to parse video source attributes included in a video tag in the hypertext markup language page code;
the playing module is configured to play a live streaming video corresponding to a live streaming video address indicated by the video source attribute under the condition that the video source attribute is analyzed so as to prevent the terminal from automatically entering dormancy;
the video label also comprises a mute attribute, and the attribute value of the mute attribute is not a true value.
According to a third aspect of the embodiments of the present disclosure, there is provided a terminal, including:
a processor;
a memory for storing instructions executable by the processor;
wherein the processor is configured to:
responding to the operation of a user, and enabling a browser to run a pre-generated hypertext markup language page code comprising a video tag;
analyzing the video source attribute included by the video tag in the hypertext markup language page code;
under the condition that the video source attribute is analyzed, playing a live streaming video corresponding to a live video streaming address indicated by the video source attribute so as to prevent the terminal from automatically entering dormancy;
the video label also comprises a mute attribute, and the attribute value of the mute attribute is a non-true value.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, which when executed by a processor, implement the steps of the browser-based method for preventing hibernation of a terminal provided by the first aspect of the present disclosure.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: responding to the operation of a user, and enabling a browser to run a pre-generated hypertext markup language page code comprising a video tag;
analyzing the video source attribute included by the video tag in the hypertext markup language page code; under the condition that the video source attribute is analyzed, playing a live streaming video corresponding to a live video streaming address indicated by the video source attribute so as to prevent the terminal from automatically entering dormancy; the video label also comprises a mute attribute, the attribute value of the mute attribute is not true, a hypertext markup language page code generated in advance is executed through a browser, and a live streaming video played by the terminal is simulated, so that the terminal detects that the live streaming video is played by the terminal, and the screen-off operation cannot be executed, the purpose of preventing the terminal from sleeping is achieved, the problem of repeatedly changing the playing position of the playing end is avoided, and therefore, the energy consumption of a central processing unit cannot be increased, and the problem of memory explosion is further caused.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow diagram illustrating a method for preventing a terminal from sleeping based on a browser in accordance with an exemplary embodiment.
Fig. 2 is a flow diagram illustrating a method for obtaining a live stream video address in accordance with an illustrative embodiment.
Fig. 3 is a block diagram illustrating an apparatus for preventing a terminal from sleeping based on a browser according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating a terminal according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
First, an application scenario of the present disclosure will be explained. Generally, in order to save power consumption of a device (PC (Personal Computer) or mobile device), if it is detected that there is no interaction between a user and the device for a certain period of time, the device automatically turns off a screen and enters a sleep mode, thereby saving power consumption of the device. However, in some application scenarios of the device, although the user may not interact with the device, the device is required to enter the sleep state without following the screen-off setting of its internal system.
In the related art, it is common to add a video (video) tag to the front page of the HTML5, and then play a piece of local video, and to make the local video play circularly by various methods. For example, a repeat play (loop) attribute is set, or a current play position attribute of the video tag is frequently changed, so that the effect of preventing the device from sleeping is achieved. However, such methods have a plurality of disadvantages, for example, although some devices support the repeat playing attribute and the current playing position attribute of the video tag, some systems cannot achieve the purpose of preventing the devices from sleeping by setting the attributes (the current playing position and the circular playing attribute) of the video tag; for the playing end, the continuous change of the position of the video played by the playing end may cause the increase of the energy consumption of the central processing unit and the sudden increase of the memory, and finally cause the browser to crash; in addition, switching the browser to the background may also fail to prevent the device from hibernating.
In view of the above, the present disclosure provides a method, an apparatus, a storage medium, and a terminal for preventing a terminal from sleeping based on a browser, where a hypertext markup language page code generated in advance is executed by the browser to simulate that the terminal is playing a live streaming video, so that the terminal does not perform a screen-off operation when detecting that the terminal is playing the live streaming video, thereby achieving a purpose of not turning off the screen, and for a playing terminal, a problem of repeatedly changing a video playing position is not present, so that energy consumption of a central processing unit is not increased, and further a problem of memory explosion is not caused.
The present disclosure is further explained below with reference to the drawings.
Fig. 1 is a flowchart illustrating a method for preventing a terminal from sleeping based on a browser according to an exemplary embodiment, where the method may be used in a terminal such as a mobile phone, a PC, etc., as shown in fig. 1, and includes the following steps:
s101, responding to the operation of a user, enabling the browser to run a pre-generated hypertext markup language page code comprising a video tag.
In the disclosure, in order to meet the requirement that a user needs to enter a dormant state without following a lock screen setting of a system in some application scenarios, the terminal responds to a corresponding operation when the user performs the operation on the terminal, so that a browser runs a pre-generated hypertext markup language page code including a video tag.
It should be noted that an application scenario that requires the terminal not to enter the sleep state following the lock screen setting of the system may be, for example, a scenario of reading an electronic book.
For example, the operation of the user may be an operation triggered by clicking a button, and the clicking operation may be a physical button or a virtual button for the terminal. When the user clicks the physical button or the virtual button, the terminal causes the browser to run a pre-generated hypertext markup language page code including a video tag.
Illustratively, the operation of the user may be an operation triggered by a voice instruction, for example, when the user issues a voice instruction representing a requirement that the terminal needs to enter a sleep state without following a lock screen setting of the system, the terminal causes the browser to execute a pre-generated hypertext markup language page code including a video tag.
In this disclosure, hypertext markup language page code refers to code edited using HTML5, which is loaded and run by a browser.
And S102, analyzing the video source attribute included by the video tag in the hypertext markup language page code.
In this disclosure, a video source attribute characterizes the acquisition address of the played video.
S103, under the condition that the video source attribute is analyzed, playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering the dormancy state.
In the present disclosure, an address where the video source attribute representation can successfully acquire the played video is analyzed, and the played live streaming video is acquired according to the address, so that the live streaming video can be played by using a browser.
By adopting the technical scheme, the hypertext markup language page code generated in advance is executed through the browser, the live streaming video playing of the terminal is simulated, and therefore the terminal detects that the live streaming video is played, the purpose of not turning off the screen is achieved, and the problem that the playing position is changed repeatedly is avoided for the browser end playing the live streaming video, so that the energy consumption of a central processing unit is not increased, and the problem of memory explosion is caused.
In addition, considering that when an internal system of the device plays a video, if the mute attribute of the video tag of the video is detected to be a true value, due to the relationship between the tag priority and the system itself, if the internal system detects that the mute attribute in the video tag is set to be a true value, the terminal automatically turns off the screen when there is no interactive operation between the user and the terminal for a long time. Therefore, the attribute value of the mute attribute of the video tag is not a true value, so that the internal system considers that the live streaming video is a non-mute played video, the situation that the internal system automatically turns off the screen of the device due to the fact that the mute attribute is set to the true value is detected is avoided, and the reliability is improved.
In one embodiment, playing the live streaming video corresponding to the live video streaming address indicated by the video source attribute in step S103 shown in fig. 1 to prevent the terminal from automatically entering the hibernation may include, for example:
and under the condition that the attribute value of the automatic playing attribute in the video label is a true value, automatically playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering the dormancy.
And under the condition that the attribute value of the automatic playing attribute in the video tag is not a true value, calling a playing method of the video tag to prevent the terminal from automatically entering dormancy, wherein the playing method is used for playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute.
In the present disclosure, the attribute value of the auto-play attribute in the video tag characterizes whether the browser allows auto-play. It should be noted that if the attribute value of the auto-play attribute is a true value, the representation browser allows auto-play, and if the attribute value of the auto-play attribute is not a true value, the representation browser does not allow auto-play.
Therefore, in order to improve the reliability and the real-time performance of the method in the aspect of preventing the automatic dormancy of the browser, a plurality of playing strategies are adopted, and the live streaming video is automatically played under the condition that the attribute value of the automatic playing attribute in the video label is a true value, namely under the condition that the browser can allow automatic playing; and when the attribute value of the automatic playing attribute in the video tag is not the true value, namely under the condition that the browser cannot realize automatic playing, the playing method of the video tag is controlled and called to automatically play the live streaming video corresponding to the live streaming video address indicated by the video source attribute, manual operation is not needed, and the reliability and the real-time performance are improved.
Fig. 2 is a flow diagram illustrating a method for obtaining a live stream video address in accordance with an illustrative embodiment. As shown in fig. 2, the live video stream address is obtained by the following steps:
s201, acquiring a video to be processed.
In the present disclosure, the video to be processed may be a cloud video downloaded from the internet, or may be a local video recorded by the user and stored in the terminal. This embodiment is not limited to this.
S202, separating video data in the video to be processed.
In the present disclosure, the video to be processed includes audio data and video data, and since the push stream data of the live stream can only be video data, it is necessary to separate the video data from the video to be processed.
In the present disclosure, video data in a video to be processed may be directly extracted, or audio data in the video to be processed may be directly extracted, and data after the audio data is extracted may be used as video data.
It should be noted that, the video data and the audio data in the video to be processed may be separated by using a method for separating video data and audio data in the related art, which is not described herein again.
And S203, converting the format of the video data into a preset format to obtain target data to be pushed, wherein the data in the preset format is format data which can be used for pushing.
In this disclosure, since the stream pushing end can only push the data in the preset format, the format of the video data needs to be converted into the preset format.
The preset format may be, for example, an mp4 format or a flv format.
And S204, pushing the target data to be pushed to the server according to the preset pushing duration.
In this disclosure, the preset plug flow duration may be set according to an actual situation, which is not limited in this embodiment.
S205, receiving the video stream address returned by the server, and taking the video stream address as a live video stream address.
By adopting the technical scheme, the video to be processed is processed into the live streaming video, so that a data basis is provided for the terminal browser to prevent the terminal from dormancy by playing the live streaming video.
In one embodiment, step S201 shown in fig. 2 may include, for example:
firstly, acquiring a source video;
and then, preprocessing the video parameters of the source video to obtain the video to be processed.
It can be understood that the source video may be a cloud video downloaded from the internet, or a local video recorded by the user and stored in the terminal. This embodiment is not limited to this.
The video parameter includes at least one of a resolution parameter, a frame rate parameter and a code rate parameter. It is understood that the resolution parameter, the frame rate parameter, and the bitrate parameter can be set to very low parameters, for example, the resolution parameter can be set to 128 × 128, the frame rate parameter can be set to 6, and the bitrate parameter can be set to 50. By adopting the technical scheme, the video parameters of the source video are preprocessed, so that the bandwidth consumed in the process of pushing the stream is saved.
In one embodiment, the video tag further includes a page height size attribute, a page width size attribute, and a window attribute; the attribute value of the page height dimension attribute is a preset height, the attribute value of the page width dimension attribute is a preset width, and the attribute value of the window attribute is a true value.
It should be understood that the preset height is smaller than the screen height of the terminal, the preset width is smaller than the screen height of the terminal, and both the preset height and the preset width are not 0.
In this disclosure, a window attribute refers to whether a live streaming video portlet is allowed to play. The window attribute is a boolean attribute, and the attribute value is a true value, that is, the representation allows the widget playing, and it is understood that the setting of the widget playing is to avoid affecting other interactive pictures of the user and the terminal.
In one embodiment, considering that a dynamic video picture may affect other interactions between the user and the terminal, the code for covering the video tag may be further included in the hypertext markup language page code, so as to avoid affecting other interaction scenes between the user and the terminal.
For example, the video label may be covered with a picture above the window interface of the video played by the video label, and correspondingly, the code for covering the video label is the code displayed above the window interface of the video played.
In one embodiment, after playing the live streaming video corresponding to the live video streaming address indicated by the video source attribute to prevent the terminal from automatically entering the sleep mode, the method further includes: and if the operation of the user on the terminal is not responded within the preset time period, ending the playing of the live streaming video.
In the present disclosure, if the live streaming instruction is already played to prevent the terminal from turning off the screen, after that, if the interactive operation of the user on the terminal is not responded for a long time, the playing of the live streaming video can be finished, so as to save unnecessary power consumption of the terminal caused by screen lightening and the like.
It should be noted that the preset time period may be set according to the actual requirement of the user.
In an implementation mode, under the condition that a live video stream address indicated by a video source attribute cannot be analyzed, a browser is controlled to run a pre-generated hypertext markup language page backup code comprising a video tag, the video source attribute comprised by the video tag in the hypertext markup language page backup code is analyzed, and a live stream video corresponding to the live video stream address indicated by the video source attribute is played, so that a terminal is prevented from automatically entering a sleep mode, and the reliability of the method is improved.
In the disclosure, the hypertext markup language page backup code is similar to the code of the hypertext markup language page code, and by adopting the technical scheme, in order to achieve the purpose that the browser prevents the terminal from sleeping when the live video stream address in the hypertext markup language page code is damaged, a backup page code is provided, that is, a backup live stream address is provided, so that the terminal is prevented from entering a sleeping state in a manner that the live stream video can be played by the browser, and the reliability of the method is improved.
It can be understood that the live video stream address in the video source attribute in the hypertext markup language page backup code may be the same as or different from the live video stream address in the video source attribute in the hypertext markup language page code.
Fig. 3 is a block diagram illustrating an apparatus 300 for preventing a terminal from sleeping based on a browser according to an exemplary embodiment. Referring to fig. 3, the apparatus includes a first loading module 301, a first parsing module 302, and a playing module 303.
The first loading module 301 is configured to cause the browser to run a pre-generated hypertext markup language page code including a video tag in response to a user operation.
The first parsing module 302 is configured to parse video source attributes included in video tags in the hypertext markup language page code.
The playing module 303 is configured to play the live streaming video corresponding to the live streaming video address indicated by the video source attribute to prevent the terminal from automatically entering the hibernation state when the video source attribute is analyzed.
The video label also comprises a mute attribute, and the attribute value of the mute attribute is not a true value.
Optionally, the playing module 303 includes:
and the first playing submodule is configured to automatically play the live streaming video corresponding to the live streaming video address indicated by the video source attribute under the condition that the attribute value of the automatic playing attribute in the video tag is a true value, so as to prevent the terminal from automatically entering the sleep mode.
And the second playing submodule is configured to call a playing method of the video tag to prevent the terminal from automatically entering the sleep mode under the condition that the attribute value of the automatic playing attribute in the video tag is not a true value, and the playing method is used for playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute.
The live video stream address is obtained through the following modules:
the acquisition module is configured to acquire a video to be processed.
And the separation module is configured to separate out the video data in the video to be processed.
And the format conversion module is configured to convert the format of the video data into a preset format to obtain target data to be pushed, wherein the data in the preset format is format data which can be used for pushing.
And the plug-flow module is configured to plug-flow the target data to be plug-flowed to the server according to a preset plug-flow duration.
And the return module is configured to receive the video stream address returned by the server and take the video stream address as a live video stream address.
Optionally, the obtaining module includes:
an acquisition submodule configured to acquire a source video.
The preprocessing submodule is configured to preprocess the video parameters of the source video to obtain a video to be processed, and the video parameters include at least one of a resolution parameter, a frame rate parameter and a code rate parameter.
Optionally, the video tag further comprises a page height size attribute, a page width size attribute, and a window attribute; the attribute value of the page height dimension attribute is a preset height, the attribute value of the page width dimension attribute is a preset width, the attribute value of the window attribute is a true value, the preset height is smaller than the screen height of the terminal, and the preset width is smaller than the screen width of the terminal.
Optionally, the code of the hypertext markup language page further includes a code for covering the video tag.
Optionally, the apparatus 300 further comprises:
and the ending module is configured to end the playing of the live streaming video after the live streaming video corresponding to the live streaming video address indicated by the video source attribute is played to prevent the terminal from automatically entering the dormancy and the operation of the user on the terminal is not responded within a preset time period.
Optionally, the apparatus 300 further comprises:
and the second loading module is configured to control the browser to run a pre-generated hypertext markup language page backup code comprising a video tag under the condition that a live video stream address indicated by the video source attribute cannot be analyzed.
And the second analysis module is configured to analyze the video source attribute included by the video tag in the hypertext markup language page backup code and play the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering the sleep mode.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present disclosure also provides a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the browser-based method for preventing hibernation of a terminal provided by the present disclosure.
Fig. 4 is a block diagram illustrating a terminal 400 according to an example embodiment. For example, the terminal 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 4, the terminal 400 may include one or more of the following components: a processing component 402, a memory 404, a power component 406, a multimedia component 408, an audio component 410, an interface for input/output (I/O) 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls overall operation of the terminal 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the browser-based method of preventing hibernation of a terminal described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the terminal 400. Examples of such data include instructions for any application or method operating on the terminal 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power components 406 provide power to the various components of the terminal 400. The power components 406 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the terminal 400.
The multimedia component 408 comprises a screen providing an output interface between the terminal 400 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the terminal 400 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 includes a Microphone (MIC) configured to receive external audio signals when the terminal 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
Input/output (I/O) interface 412 provides an interface between processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the terminal 400. For example, the sensor assembly 414 can detect an open/closed state of the terminal 400, relative positioning of components, such as a display and keypad of the terminal 400, the sensor assembly 414 can also detect a change in position of the terminal 400 or a component of the terminal 400, the presence or absence of user contact with the terminal 400, orientation or acceleration/deceleration of the terminal 400, and a change in temperature of the terminal 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate communications between the terminal 400 and other devices in a wired or wireless manner. The terminal 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described browser-based method of preventing hibernation of a terminal.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the terminal 400 to perform the above-described method for preventing sleep of a terminal based on a browser is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for preventing a terminal from sleeping based on a browser is characterized by comprising the following steps:
responding to the operation of a user, and enabling a browser to run a pre-generated hypertext markup language page code comprising a video tag;
analyzing the video source attribute included by the video tag in the hypertext markup language page code;
under the condition that the video source attribute is analyzed, playing a live streaming video corresponding to a live video streaming address indicated by the video source attribute so as to prevent the terminal from automatically entering the dormancy under the condition that the browser does not need to repeatedly change the current playing position attribute of the video tag;
the video label also comprises a mute attribute, and the attribute value of the mute attribute is not a true value;
the live video stream address is obtained in the following way:
acquiring a video to be processed;
separating video data in the video to be processed;
converting the format of the video data into a preset format to obtain target data to be pushed, wherein the data in the preset format is format data which can be used for pushing;
pushing the target data to be pushed to a server according to a preset pushing duration;
and receiving a video stream address returned by the server, and taking the video stream address as a live video stream address.
2. The method according to claim 1, wherein the playing the live streaming video corresponding to the live video streaming address indicated by the video source attribute to prevent the terminal from automatically entering the hibernation comprises:
under the condition that the attribute value of the automatic playing attribute in the video label is a true value, automatically playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering dormancy;
and under the condition that the attribute value of the automatic playing attribute in the video tag is not a true value, calling a playing method of the video tag to prevent the terminal from automatically entering dormancy, wherein the playing method is used for playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute.
3. The method of claim 1, wherein the obtaining the video to be processed comprises:
acquiring a source video;
and preprocessing the video parameters of the source video to obtain a video to be processed, wherein the video parameters comprise at least one of resolution parameters, frame rate parameters and code rate parameters.
4. The method of claim 1, wherein the video tag further comprises a page height size attribute, a page width size attribute, and a window attribute; the attribute value of the page height dimension attribute is a preset height, the attribute value of the page width dimension attribute is a preset width, the attribute value of the window attribute is a true value, the preset height is smaller than the screen height of the terminal, and the preset width is smaller than the screen width of the terminal.
5. The method of claim 1, wherein the hypertext markup language page code further comprises code that masks the video tag.
6. The method according to any one of claims 1-5, wherein after the playing the live-streaming video corresponding to the live-streaming video address indicated by the video source attribute to prevent the terminal from automatically entering into sleep, the method further comprises:
and if the operation of the user on the terminal is not responded within a preset time period, ending the playing of the live streaming video.
7. The method of claim 6, further comprising: under the condition that a live video stream address indicated by the video source attribute cannot be analyzed, controlling the browser to run a pre-generated hypertext markup language page backup code comprising a video tag;
and analyzing the video source attribute included by the video tag in the hypertext markup language page backup code, and playing the live streaming video corresponding to the live streaming video address indicated by the video source attribute so as to prevent the terminal from automatically entering the dormancy state.
8. An apparatus for preventing a terminal from sleeping based on a browser, the apparatus comprising:
the first loading module is configured to respond to the operation of a user and enable the browser to run a pre-generated hypertext markup language page code comprising a video tag;
a first parsing module configured to parse video source attributes included in a video tag in the hypertext markup language page code;
the playing module is configured to play a live streaming video corresponding to a live streaming video address indicated by the video source attribute under the condition that the video source attribute is analyzed, so that the terminal is prevented from automatically entering the dormancy under the condition that the browser does not need to repeatedly change the current playing position attribute of the video tag;
the video label also comprises a mute attribute, and the attribute value of the mute attribute is not a true value;
the live video stream address is obtained in the following way:
acquiring a video to be processed;
separating video data in the video to be processed;
converting the format of the video data into a preset format to obtain target data to be pushed, wherein the data in the preset format is format data which can be used for pushing;
pushing the target data to be pushed to a server according to a preset pushing duration;
and receiving a video stream address returned by the server, and taking the video stream address as a live video stream address.
9. A terminal, comprising:
a processor;
a memory for storing instructions executable by the processor;
wherein the processor is configured to:
responding to the operation of a user, and enabling a browser to run a pre-generated hypertext markup language page code comprising a video tag;
analyzing the video source attribute included by the video tag in the hypertext markup language page code;
under the condition that the video source attribute is analyzed, playing a live streaming video corresponding to a live video streaming address indicated by the video source attribute so as to prevent the terminal from automatically entering the dormancy under the condition that the browser does not need to repeatedly change the current playing position attribute of the video tag;
the video label also comprises a mute attribute, and the attribute value of the mute attribute is a non-true value;
the live video stream address is obtained in the following way:
acquiring a video to be processed;
separating video data in the video to be processed;
converting the format of the video data into a preset format to obtain target data to be pushed, wherein the data in the preset format is format data which can be used for pushing;
pushing the target data to be pushed to a server according to a preset pushing duration;
and receiving a video stream address returned by the server, and taking the video stream address as a live video stream address.
10. A computer-readable storage medium, on which computer program instructions are stored, which program instructions, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 7.
CN202110147087.5A 2021-02-03 2021-02-03 Method, device, storage medium and terminal for preventing terminal from sleeping based on browser Active CN112511857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110147087.5A CN112511857B (en) 2021-02-03 2021-02-03 Method, device, storage medium and terminal for preventing terminal from sleeping based on browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110147087.5A CN112511857B (en) 2021-02-03 2021-02-03 Method, device, storage medium and terminal for preventing terminal from sleeping based on browser

Publications (2)

Publication Number Publication Date
CN112511857A CN112511857A (en) 2021-03-16
CN112511857B true CN112511857B (en) 2021-06-04

Family

ID=74952881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110147087.5A Active CN112511857B (en) 2021-02-03 2021-02-03 Method, device, storage medium and terminal for preventing terminal from sleeping based on browser

Country Status (1)

Country Link
CN (1) CN112511857B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102917123A (en) * 2012-09-27 2013-02-06 东莞宇龙通信科技有限公司 Mobile terminal and dormancy processing method for mobile terminal
CN103024546A (en) * 2012-12-25 2013-04-03 福州瑞芯微电子有限公司 Method and system for controlling sleep during playing of online video
CN103150194A (en) * 2013-04-10 2013-06-12 天津三星光电子有限公司 Sleep control method of mobile terminal and mobile terminal thereof
CN103324276A (en) * 2012-03-22 2013-09-25 华为终端有限公司 Method and device for controlling standby operation
CN103559034A (en) * 2013-09-02 2014-02-05 百度在线网络技术(北京)有限公司 Method and device for controlling screen locking in mobile equipment
CN103702178A (en) * 2013-12-13 2014-04-02 乐视网信息技术(北京)股份有限公司 Play method and electronic equipment
CN104635918A (en) * 2013-11-15 2015-05-20 索尼公司 Control method and control device of electronic equipment and electronic equipment
CN106303638A (en) * 2016-08-30 2017-01-04 北京奇艺世纪科技有限公司 A kind of audio and video playing method and device based on HTML5 player
CN106921873A (en) * 2017-02-28 2017-07-04 北京小米移动软件有限公司 Live-broadcast control method and device
CN108196893A (en) * 2017-12-29 2018-06-22 北京小米移动软件有限公司 Adjust the method, apparatus and terminal of terminal sleeping

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202197356U (en) * 2011-09-05 2012-04-18 冠捷显示科技(厦门)有限公司 Television mute timeout shutdown system
KR102350781B1 (en) * 2017-06-15 2022-01-14 엘지전자 주식회사 Mobile terminal and method for controlling the same
US10289885B2 (en) * 2017-06-30 2019-05-14 Synaptics Incorporated Use fingerprint sensor signal to prevent device sleep

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324276A (en) * 2012-03-22 2013-09-25 华为终端有限公司 Method and device for controlling standby operation
CN102917123A (en) * 2012-09-27 2013-02-06 东莞宇龙通信科技有限公司 Mobile terminal and dormancy processing method for mobile terminal
CN103024546A (en) * 2012-12-25 2013-04-03 福州瑞芯微电子有限公司 Method and system for controlling sleep during playing of online video
CN103150194A (en) * 2013-04-10 2013-06-12 天津三星光电子有限公司 Sleep control method of mobile terminal and mobile terminal thereof
CN103559034A (en) * 2013-09-02 2014-02-05 百度在线网络技术(北京)有限公司 Method and device for controlling screen locking in mobile equipment
CN104635918A (en) * 2013-11-15 2015-05-20 索尼公司 Control method and control device of electronic equipment and electronic equipment
CN103702178A (en) * 2013-12-13 2014-04-02 乐视网信息技术(北京)股份有限公司 Play method and electronic equipment
CN106303638A (en) * 2016-08-30 2017-01-04 北京奇艺世纪科技有限公司 A kind of audio and video playing method and device based on HTML5 player
CN106921873A (en) * 2017-02-28 2017-07-04 北京小米移动软件有限公司 Live-broadcast control method and device
CN108196893A (en) * 2017-12-29 2018-06-22 北京小米移动软件有限公司 Adjust the method, apparatus and terminal of terminal sleeping

Also Published As

Publication number Publication date
CN112511857A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
CN106911961B (en) Multimedia data playing method and device
EP3188066B1 (en) A method and an apparatus for managing an application
US9786326B2 (en) Method and device of playing multimedia and medium
CN107608561B (en) Touch screen control method and device
EP2947891A1 (en) Method for providing episode selection of video and apparatus thereof
US11545188B2 (en) Video processing method, video playing method, devices and storage medium
CN105786507B (en) Display interface switching method and device
CN109451341B (en) Video playing method, video playing device, electronic equipment and storage medium
RU2663709C2 (en) Method and device for data processing
CN111432278A (en) Video control method, device, terminal and storage medium
CN112153396B (en) Page display method, device, system and storage medium
CN111432288A (en) Video playing method and device, electronic equipment and storage medium
CN108804179B (en) Method, device, terminal and storage medium for displaying notification bar message
CN110719530A (en) Video playing method and device, electronic equipment and storage medium
CN111182328B (en) Video editing method, device, server, terminal and storage medium
CN114727004A (en) Image acquisition method and device, electronic equipment and storage medium
CN106331328B (en) Information prompting method and device
CN112511779B (en) Video data processing method and device, computer storage medium and electronic equipment
CN107105311B (en) Live broadcasting method and device
CN112685269A (en) Data acquisition method and device, electronic equipment and storage medium
CN112511857B (en) Method, device, storage medium and terminal for preventing terminal from sleeping based on browser
CN111698532A (en) Bullet screen information processing method and device
US11496787B2 (en) Information processing method and device, electronic device, and storage medium
US20210377454A1 (en) Capturing method and device
CN114827721A (en) Video special effect processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant