CN106528735B - Method and device for controlling browser to play media resources - Google Patents

Method and device for controlling browser to play media resources Download PDF

Info

Publication number
CN106528735B
CN106528735B CN201610958860.5A CN201610958860A CN106528735B CN 106528735 B CN106528735 B CN 106528735B CN 201610958860 A CN201610958860 A CN 201610958860A CN 106528735 B CN106528735 B CN 106528735B
Authority
CN
China
Prior art keywords
browser
target hyperlink
hyperlink
controlling
media
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
CN201610958860.5A
Other languages
Chinese (zh)
Other versions
CN106528735A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610958860.5A priority Critical patent/CN106528735B/en
Publication of CN106528735A publication Critical patent/CN106528735A/en
Application granted granted Critical
Publication of CN106528735B publication Critical patent/CN106528735B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9558Details of hyperlinks; Management of linked annotations

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present disclosure provides a method and an apparatus for controlling a browser to play media resources, the method including: judging whether a target hyperlink meets a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises the following steps: the browser opens the target hyperlink in the new tab page in the background, and the content of the web page pointed by the target hyperlink contains the media resource, and the media resource comprises: an audio or video resource; and if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink. According to the technical scheme, whether the browser is controlled to automatically play the media resource pointed by the hyperlink can be determined by judging whether the browser opens the hyperlink in the new background tab or not, and when the browser opens the hyperlink in the new background tab, the browser is controlled to prohibit the media resource pointed by the hyperlink from being automatically played, so that disturbance to a user is avoided.

Description

Method and device for controlling browser to play media resources
Technical Field
The present disclosure relates to the field of browser technologies, and in particular, to a method and an apparatus for controlling a browser to play media resources.
Background
At present, when a browser opens a hyperlink in a current tab page, the browser may open the current tab page or a new tab page.
In the related art, when a new tab page is opened in the background, if the web page content pointed by the hyperlink contains media resources such as audio and video resources and the browser is set to automatically play the audio and video resources, the browser automatically loads and plays the media resources in the new tab page opened in the background. However, the user may still browse the web page content in the current tab page, and if the media resource in the new background tab page is played at this time, a certain disturbance may be caused to the user.
Disclosure of Invention
In order to solve the above problem, the present disclosure provides a method and an apparatus for controlling a browser to play a media resource. The method is realized by the following technical scheme:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for controlling a browser to play a media resource, the method including:
judging whether a target hyperlink meets a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises the following steps: the browser opens the target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains media resources, wherein the media resources comprise: an audio or video resource;
and if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink.
In an embodiment of the present disclosure, the controlling the browser to prohibit automatic playing of the media resource in the web content pointed to by the target hyperlink includes:
and prohibiting the browser from loading the media resource in the webpage content pointed by the target hyperlink.
In an embodiment of the present disclosure, the controlling the browser to prohibit automatic playing of the media resource in the web content pointed to by the target hyperlink includes:
controlling the browser to load the media resource in the webpage content pointed by the target hyperlink;
and controlling the browser to prohibit playing the media resources in the webpage content pointed by the target hyperlink loaded by the browser.
In an embodiment of the present disclosure, after the controlling the browser to prohibit playing the media resource in the web content pointed by the target hyperlink loaded by the browser, the method further includes:
and when detecting that a new label page for opening the target hyperlink is switched to a foreground from a background, controlling the browser to automatically play the media resource in the webpage content pointed by the target hyperlink loaded by the browser.
In an embodiment of the present disclosure, after the controlling the browser to automatically play the media resource in the web content pointed by the target hyperlink loaded by the browser, the method further includes:
and when detecting that the new label page for opening the target hyperlink is switched from the foreground to the background, controlling the browser to pause playing the media resource in the webpage content pointed by the target hyperlink.
In an embodiment of the present disclosure, after the controlling the browser to pause playing the media resource in the web content pointed by the target hyperlink, the method further includes:
and displaying a prompt message in the current tab page, wherein the prompt message is used for informing the user that the browser suspends the playing of the media resources in the background tab page.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for controlling a browser to play a media resource, the apparatus including:
the judging module is configured to judge whether a target hyperlink meets a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises: the browser opens the target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains media resources, wherein the media resources comprise: an audio or video resource;
and the first control module is configured to control the browser to prohibit automatic playing of the media resource in the webpage content pointed by the target hyperlink under the condition that the judgment result of the judgment module is yes.
In an embodiment of the present disclosure, the first control module includes:
and the loading forbidding sub-module is configured to forbid the browser from loading the media resource in the webpage content pointed by the target hyperlink under the condition that the judgment result of the judgment module is yes.
In an embodiment of the present disclosure, the first control module includes:
the first control sub-module is configured to control the browser to load the media resource in the webpage content pointed by the target hyperlink under the condition that the judgment result of the judgment module is yes;
and the second control submodule is configured to control the browser to prohibit playing of the media resource in the webpage content pointed by the target hyperlink loaded by the browser under the control of the first control submodule.
In an embodiment of the present disclosure, the apparatus further includes:
and the second control module is configured to control the browser to automatically play the media resource in the webpage content pointed by the target hyperlink loaded by the browser under the control of the first control submodule when the situation that the new tab page for opening the target hyperlink is switched from the background to the foreground is detected.
In an embodiment of the present disclosure, the apparatus further includes:
and the third control module is configured to control the browser to pause playing of the media resource in the webpage content pointed by the target hyperlink when the new tab page for opening the target hyperlink is detected to be switched from the foreground to the background.
In an embodiment of the present disclosure, the apparatus further includes:
the display module is configured to display a prompt message in the current tab page, wherein the prompt message is used for notifying a user that the browser suspends playing of the media resources in the background tab page.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for controlling a browser to play a media resource, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
judging whether a target hyperlink meets a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises the following steps: the browser opens the target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains media resources, wherein the media resources comprise: an audio or video resource;
and if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink.
In an embodiment of the present disclosure, whether to control the browser to automatically play the media resource to which the hyperlink points may be determined by determining whether to open the hyperlink in a new background tab of the browser, and when the browser opens the hyperlink in the new background tab of the browser, the browser is controlled to prohibit the automatic playing of the media resource to which the hyperlink points, so as to avoid disturbing the user.
In an embodiment of the present disclosure, after the browser opens the target hyperlink in the background new tab page, media resources such as audio and video in the web page content pointed by the target hyperlink may be loaded in the background new tab page, so that when the media resources such as audio and video pointed by the target hyperlink need to be played, the browser may directly play the cached media resources such as audio and video without consuming additional loading time.
In an embodiment of the present disclosure, when a new tab page of an open target hyperlink is switched from a background to a foreground, media resources such as cached audio and video may be automatically played without a user performing an additional play triggering operation.
In an embodiment of the present disclosure, when a new tab page of an open target hyperlink is switched from a foreground to a background, playing of media resources such as audio and video in the background tab page may be suspended, so as to avoid disturbance of the user due to playing of the media resources such as audio and video in the background tab page.
In an embodiment of the present disclosure, after the audio and video and other media resources in the background tab page are paused, the pause playing situation may be prompted to the user in the current tab page, so that the user may learn the situation in time.
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 invention and together with the description, serve to explain the principles of the invention.
FIG. 1A is a flow chart illustrating a method of controlling a browser to play a media asset according to an exemplary embodiment of the present disclosure;
FIG. 1B is a diagram illustrating an application scenario of the method for controlling a browser to play a media asset shown in FIG. 1A according to an exemplary embodiment of the present disclosure;
FIG. 1C is a diagram illustrating another application scenario of the method for controlling a browser to play a media asset shown in FIG. 1A according to an exemplary embodiment of the present disclosure;
FIG. 1D is a diagram illustrating another application scenario of the method for controlling a browser to play a media asset shown in FIG. 1A according to an exemplary embodiment of the present disclosure;
FIG. 2A is a flow chart illustrating another method of controlling a browser to play a media asset according to an exemplary embodiment of the present disclosure;
FIG. 2B is a diagram illustrating an application scenario of the method for controlling a browser to play a media asset shown in FIG. 2A according to an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating another method of controlling a browser to play a media asset according to an exemplary embodiment of the present disclosure;
FIG. 4 is a block diagram illustrating an apparatus for controlling a browser to play a media asset according to an exemplary embodiment of the present disclosure;
FIG. 5 is a block diagram illustrating another apparatus for controlling a browser to play a media asset according to an example embodiment of the present disclosure;
FIG. 6 is a block diagram illustrating another apparatus for controlling a browser to play a media asset according to an example embodiment of the present disclosure;
FIG. 7 is a block diagram illustrating another apparatus for controlling a browser to play a media asset according to an example embodiment of the present disclosure;
FIG. 8 is a block diagram illustrating another apparatus for controlling a browser to play a media asset according to an example embodiment of the present disclosure;
FIG. 9 is a block diagram illustrating another apparatus for controlling a browser to play a media asset according to an example embodiment of the present disclosure;
fig. 10 is a schematic structural diagram illustrating an apparatus for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure.
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.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
At present, when a browser opens a hyperlink in a current tab page, the browser may open the current tab page or a new tab page. In the related art, when a new tab page is opened in the background, if the web page content pointed by the hyperlink contains media resources such as audio and video resources and the browser is set to automatically play the audio and video resources, the browser automatically loads and plays the media resources in the new tab page opened in the background. However, the user may still browse the web page content in the current tab page, and if the media resource in the new background tab page is played at this time, a certain disturbance may be caused to the user. In order to solve the above problem, the present disclosure provides a method and an apparatus for controlling a browser to play a media resource.
The following first introduces a method for controlling a browser to play a media asset provided by the present disclosure.
It should be noted that the method provided by the present disclosure is applicable to an electronic device, and in practical applications, the electronic device may include: a mobile terminal such as a smart phone and a tablet computer, or a computer device such as a computer and a desktop computer.
As shown in fig. 1A, fig. 1A is a flowchart illustrating a method for controlling a browser to play a media asset according to an exemplary embodiment of the present disclosure, which may include the following steps:
in step 101, it is determined whether a target hyperlink satisfies a set condition, where the target hyperlink is a clicked hyperlink in a current tab page of a browser, and the set condition includes: the browser opens a target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains a media resource, wherein the media resource comprises: audio or video resources.
In the disclosed embodiment, the hyperlink is essentially a part of a web page, and is an element for allowing connection between the current web page and other web pages or sites.
In the embodiment of the disclosure, there may be multiple hyperlinks in the current tab page of the browser, and for the sake of convenience of distinction, the clicked hyperlink in the current tab page of the browser is referred to as the target hyperlink.
The method for opening the hyperlink in the current tab page by the browser comprises the following steps: opening at the current tab page and opening at the new tab page; when a new tab page is opened, the new tab page can be opened in the foreground or in the background, and if the new tab page is opened in the background, the page currently displayed by the browser is still the tab page containing the hyperlink.
For example, when a user clicks a hyperlink in the current tab page, the foreground opens to jump to a new tab page immediately; and if the background is opened, the new tab page is still left in the current tab page, and the new tab page is opened in the background and can be checked only by switching the tab page by the user.
In the embodiment of the present disclosure, the browser may use a related JavaScript command in related technologies to determine whether the opening mode of the target hyperlink is a background opening, determine whether the browser is preset to automatically play the audio and video resources in the web page at the background, and determine whether the content of the web page pointed by the target hyperlink contains the audio and video resources, which is not limited in the present disclosure.
In the embodiment of the disclosure, if it is determined that the browser opens the target hyperlink in the new tag of the background, and the content of the webpage pointed by the target hyperlink contains media resources such as audio and video, it is determined that the target hyperlink meets the set condition.
In step 102, when the target hyperlink satisfies a set condition, the browser is controlled to prohibit automatic playing of the media resource in the webpage content pointed by the target hyperlink.
In the embodiment of the disclosure, when it is determined that the browser is preset to automatically play media resources such as audio and video in the web page in the background, the browser may be prohibited from loading the media resources in the content of the web page to which the target hyperlink points, and since the browser does not load the media resources to which the target hyperlink points, the browser cannot play the media resources to which the target hyperlink in the new tab page in the background points.
In an exemplary application scenario, as shown in fig. 1B, 1C and 1D, fig. 1B is a window of a browser, a current tab page in the window is "tab page 1", and a web page of the current tab page "tab page 1" includes picture content and a hyperlink "http:// www.iqiyi.com/v _19rr9nbp7 c.html". Thereafter, the user clicks on the hyperlink "http:// www.iqiyi.com/v _19rr9nbp 7c.html" in "Tab Page 1", as shown in FIG. 1C. Then, the browser opens the hyperlink "http:// www.iqiyi.com/v _19rr9nbp 7c.html", as shown in fig. 1D, opens the web page content corresponding to the hyperlink in the background new tab page "tab page 2", and controls the browser to prohibit the playing of the audio and video resources in the "tab page 2".
As can be seen from the foregoing embodiment, in the embodiment, whether the browser is controlled to automatically play the media resource pointed by the hyperlink can be determined by determining whether the browser opens the hyperlink in the new tab page in the background, and when the browser opens the hyperlink in the new tab page in the background, the browser is controlled to prohibit the automatic playing of the media resource pointed by the hyperlink, so as to avoid disturbing the user.
In another embodiment provided by the present disclosure, which may be based on the embodiment shown in fig. 1A, step 102 in the embodiment of the present disclosure may include the following steps:
s10, controlling the browser to load the media resource in the webpage content pointed by the target hyperlink.
And S20, controlling the browser to prohibit playing the media resources in the webpage content pointed by the target hyperlink loaded by the browser.
In the embodiment of the disclosure, after the browser opens the target hyperlink in the background new tag page, media resources such as audio and video in the webpage content pointed by the target hyperlink can be loaded in the background new tag page, so that when the media resources such as audio and video pointed by the target hyperlink need to be played, the browser can directly play the cached media resources such as audio and video without consuming extra loading time.
Although the browser loads the media resource pointed by the target hyperlink, since any play prohibition technology in the related technologies can be adopted in the embodiment of the present disclosure to prohibit the browser from playing the loaded media resource, the browser can be prevented from playing the media resource pointed by the target hyperlink in a new tab page in the background, thereby avoiding disturbing the user.
As shown in fig. 2A, fig. 2A is a flowchart illustrating another method for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure, where a new tab page of an open target hyperlink is switched from background to foreground, the method may include the following steps:
in step 201, it is determined whether a target hyperlink satisfies a set condition, where the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition includes: the browser opens a target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains a media resource, wherein the media resource comprises: audio or video resources.
In the disclosed embodiment, the hyperlink is essentially a part of a web page, and is an element for allowing connection between the current web page and other web pages or sites.
In the embodiment of the disclosure, there may be multiple hyperlinks in the current tab page of the browser, and for the sake of convenience of distinction, the clicked hyperlink in the current tab page of the browser is referred to as the target hyperlink.
The method for opening the hyperlink in the current tab page by the browser comprises the following steps: opening at the current tab page and opening at the new tab page; when a new tab page is opened, the new tab page can be opened in the foreground or in the background, and if the new tab page is opened in the background, the page currently displayed by the browser is still the tab page containing the hyperlink.
For example, when a user clicks a hyperlink in the current tab page, the foreground opens to jump to a new tab page immediately; and if the background is opened, the new tab page is still left in the current tab page, and the new tab page is opened in the background and can be checked only by switching the tab page by the user.
In the embodiment of the present disclosure, the browser may use a related JavaScript command in related technologies to determine whether the opening mode of the target hyperlink is a background opening, determine whether the browser is preset to automatically play the audio and video resources in the web page at the background, and determine whether the content of the web page pointed by the target hyperlink contains the audio and video resources, which is not limited in the present disclosure.
In the embodiment of the disclosure, if it is determined that the browser opens the target hyperlink in the new tag of the background, and the content of the webpage pointed by the target hyperlink contains media resources such as audio and video, it is determined that the target hyperlink meets the set condition.
In step 202, when the target hyperlink satisfies the set condition, the browser is controlled to load the media resource in the webpage content pointed by the target hyperlink.
In the embodiment of the disclosure, after the browser opens the target hyperlink in the background new tag page, media resources such as audio and video in the webpage content pointed by the target hyperlink can be loaded in the background new tag page, so that when the media resources such as audio and video pointed by the target hyperlink need to be played, the browser can directly play the cached media resources such as audio and video without consuming extra loading time.
In step 203, the browser is controlled to prohibit playing the media resource in the web page content pointed by the target hyperlink loaded by the browser.
In step 204, when it is detected that the new tab page of the opened target hyperlink is switched from the background to the foreground, the browser is controlled to automatically play the media resource in the webpage content pointed by the target hyperlink.
It can be understood that, in general, a foreground tab page is a page that a user is browsing or is ready to browse, and in this case, when a new tab page for opening a target hyperlink is switched from a background to a foreground, the browser can be controlled to automatically play media resources such as audio and video cached by the browser, and the browser can automatically play the media resources in the web page content pointed by the target hyperlink for the user without making an additional play triggering operation by the user.
In an exemplary application scenario, as shown in fig. 1B, 1C, 1D and 2B, fig. 1B is a window of a browser, a current tab page in the window is "tab page 1", and a web page of the current tab page "tab page 1" includes picture content and a hyperlink "http:// www.iqiyi.com/v _19 rrnbp 7 c.html". Thereafter, the user clicks on the hyperlink "http:// www.iqiyi.com/v _19rr9nbp 7c.html" in "Tab Page 1", as shown in FIG. 1C. Then, the browser opens the hyperlink "http:// www.iqiyi.com/v _19rr9nbp 7c.html", as shown in fig. 1D, after the browser opens the web page content corresponding to the hyperlink in the background new tab page "tab page 2", the browser loads the audio and video resources in the tab page 2 ", and simultaneously prohibits the browser from playing the loaded audio and video resources in the tab page 2". When the tab page 2 of the open hyperlink is switched to the foreground, the browser automatically plays the video rouge loaded in the tab page 2.
The embodiment can automatically play the cached media resources such as audio and video and the like when the new label page of the opened target hyperlink is switched from the background to the foreground, and the user does not need to make additional play triggering operation.
As shown in fig. 3, fig. 3 is a flowchart illustrating another method for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure, where a new tab page of an open target hyperlink is switched from a foreground to a background, the method may include the following steps:
in step 301, it is determined whether a target hyperlink satisfies a set condition, where the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition includes: the browser opens a target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains a media resource, wherein the media resource comprises: audio or video resources.
In the disclosed embodiment, the hyperlink is essentially a part of a web page, and is an element for allowing connection between the current web page and other web pages or sites.
In the embodiment of the disclosure, there may be multiple hyperlinks in the current tab page of the browser, and for the sake of convenience of distinction, the clicked hyperlink in the current tab page of the browser is referred to as the target hyperlink.
The method for opening the hyperlink in the current tab page by the browser comprises the following steps: opening at the current tab page and opening at the new tab page; when a new tab page is opened, the new tab page can be opened in the foreground or in the background, and if the new tab page is opened in the background, the page currently displayed by the browser is still the tab page containing the hyperlink.
For example, when a user clicks a hyperlink in the current tab page, the foreground opens to jump to a new tab page immediately; and if the background is opened, the new tab page is still left in the current tab page, and the new tab page is opened in the background and can be checked only by switching the tab page by the user.
In the embodiment of the present disclosure, the browser may use a related JavaScript command in related technologies to determine whether the opening mode of the target hyperlink is a background opening, determine whether the browser is preset to automatically play the audio and video resources in the web page at the background, and determine whether the content of the web page pointed by the target hyperlink contains the audio and video resources, which is not limited in the present disclosure.
In the embodiment of the disclosure, if it is determined that the browser opens the target hyperlink in the new tag of the background, and the content of the webpage pointed by the target hyperlink contains media resources such as audio and video, it is determined that the target hyperlink meets the set condition.
In step 302, when the target hyperlink satisfies the set condition, the browser is controlled to load the media resource in the webpage content pointed by the target hyperlink.
In the embodiment of the disclosure, after the browser opens the target hyperlink in the background new tag page, media resources such as audio and video in the webpage content pointed by the target hyperlink can be loaded in the background new tag page, so that when the media resources such as audio and video pointed by the target hyperlink need to be played, the browser can directly play the cached media resources such as audio and video without consuming extra loading time.
In step 303, the browser is controlled to prohibit playing the media resource in the web page content pointed to by the target hyperlink loaded by the browser.
In step 304, when it is detected that the new tab page of the opened target hyperlink is switched from the background to the foreground, the browser is controlled to automatically play the media resource in the webpage content pointed by the target hyperlink.
Under the normal condition, a foreground label page is a page which is browsed or prepared to be browsed by a user, and in this condition, when a new label page for opening a target hyperlink is switched from a background to a foreground, a browser can be controlled to automatically play media resources such as audio and video cached by the browser, so that the user does not need to make extra play triggering operation, and the browser can automatically play the media resources in the webpage content pointed by the target hyperlink for the user.
In step 305, when detecting that the new tab page of the open target hyperlink is switched from the foreground to the background, controlling the browser to pause playing the media resource in the webpage content pointed by the target hyperlink.
It can be understood that, in general, the web page content in the background tab page is content that the user does not pay attention to temporarily, and in this case, in order to avoid that media resources such as audio and video playing in the background tab page disturb the user, in the embodiment of the present disclosure, the browser may pause playing the media resources such as audio and video in the background tab page.
According to the embodiment, when the new label page for opening the target hyperlink is switched from the foreground to the background, the playing of the media resources such as audio and video in the background label page can be suspended, so that the disturbance of the user caused by the playing of the media resources such as audio and video in the background label page is avoided.
In another embodiment provided by the present disclosure, the embodiment may be based on the embodiment shown in fig. 3, and the method may further include the following steps:
and displaying a prompt message in the current tab page, wherein the prompt message is used for informing the user that the browser suspends the playing of the media resources in the background tab page.
As can be seen from the above embodiments, in the embodiments, after the playing of media resources such as audio and video in the background tab page is paused, the paused playing situation can be reminded to the user in the current tab page, so that the user can learn the situation in time.
It should be noted that while the operations of the disclosed methods are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
Corresponding to the embodiment of the method for controlling the browser to play the media resource, the disclosure further provides an embodiment of a device for controlling the browser to play the media resource.
As shown in fig. 4, fig. 4 is a block diagram illustrating an apparatus for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure, and the apparatus may include:
a determining module 410 configured to determine whether a target hyperlink satisfies a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition includes: the browser opens a target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains a media resource, wherein the media resource comprises: an audio or video resource;
and a first control module 420 configured to control the browser to prohibit automatic playing of the media resource in the web page content pointed by the target hyperlink, if the determination result of the determination module 410 is yes.
As can be seen from the foregoing embodiment, in the embodiment, whether the browser is controlled to automatically play the media resource pointed by the hyperlink can be determined by determining whether the browser opens the hyperlink in the new tab page in the background, and when the browser opens the hyperlink in the new tab page in the background, the browser is controlled to prohibit the automatic playing of the media resource pointed by the hyperlink, so as to avoid disturbing the user.
As shown in fig. 5, fig. 5 is a block diagram of another apparatus for controlling a browser to play a media resource according to an exemplary embodiment, where the embodiment may be based on the embodiment shown in fig. 4, and the first control module 420 in the embodiment of the present disclosure may include:
and the loading prohibition submodule 421, configured to prohibit the browser from loading the media resource in the web page content pointed by the target hyperlink if the determination result of the determining module 410 is yes.
As shown in fig. 6, fig. 6 is a block diagram of another apparatus for controlling a browser to play a media resource according to an exemplary embodiment, where the embodiment may be based on the embodiment shown in fig. 4, and the first control module 420 in the embodiment of the present disclosure may include:
a first control sub-module 422, configured to, in a case that the determination result of the determining module 410 is yes, control the browser to load the media resource in the web page content pointed by the target hyperlink;
a second control sub-module 423 configured to control the browser to prohibit playing of the media resource in the web page content pointed to by the target hyperlink that the first control sub-module 422 controls the browser to load.
As shown in fig. 7, fig. 7 is a block diagram of another apparatus for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure, where the embodiment may be based on the embodiment shown in fig. 6, and the apparatus may further include:
and the second control module 710 is configured to, when it is detected that the new tab page of the open target hyperlink is switched from the background to the foreground, control the browser to automatically play the media resource in the web page content pointed by the target hyperlink loaded by the browser and controlled by the first control sub-module 422.
As shown in fig. 8, fig. 8 is a block diagram of another apparatus for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure, where the embodiment may be based on the embodiment shown in fig. 7, and the apparatus may further include:
and a third control module 810 configured to control the browser to pause playing the media resource in the webpage content pointed by the target hyperlink when detecting that the new tab page of the opened target hyperlink is switched from the foreground to the background.
As shown in fig. 9, fig. 9 is a block diagram of another apparatus for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure, where the embodiment may be based on the embodiment shown in fig. 8, and the apparatus may further include:
a display module 910 configured to display a prompt message in the current tab page, wherein the prompt message is used to notify the user that the browser has paused playing of the media resource in the background tab page.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
Correspondingly, the present disclosure also provides a method for controlling a browser to play a media resource, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: judging whether a target hyperlink meets a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises the following steps: the browser opens the target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains media resources, wherein the media resources comprise: an audio or video resource; and if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink.
As shown in fig. 10, fig. 10 is a schematic structural diagram of an apparatus 1000 for controlling a browser to play a media resource according to an exemplary embodiment of the present disclosure. For example, the apparatus 1000 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, an aircraft, and the like.
Referring to fig. 10, the apparatus 1000 may include one or more of the following components: processing component 1002, memory 1004, power component 1006, multimedia component 1008, audio component 1010, input/output (I/O) interface 1012, sensor component 1014, and communications component 1016.
The processing component 1002 generally controls the overall operation of the device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 1002 may include one or more processors 1020 to execute instructions to perform a method for controlling a browser to play a media asset provided by the technical solution of the present disclosure, the method including: judging whether a target hyperlink meets a set condition, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises the following steps: the browser opens the target hyperlink in a new tab page in the background, and the content of the webpage pointed by the target hyperlink contains media resources, wherein the media resources comprise: an audio or video resource; and if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink.
Processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components. For example, the processing component 1002 can include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002.
The memory 1004 is configured to store various types of data to support operation at the device 1000. Examples of such data include instructions for any application or method operating on device 1000, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1004 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 supply component 1006 provides power to the various components of the device 1000. The power components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power supplies for the device 1000.
The multimedia component 1008 includes a screen that provides an output interface between the device 1000 and a 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 1008 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 device 1000 is in an operating mode, such as a shooting 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 1010 is configured to output and/or input audio signals. For example, audio component 1010 includes a Microphone (MIC) configured to receive external audio signals when apparatus 1000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, audio component 1010 also includes a speaker for outputting audio signals.
I/O interface 1012 provides an interface between processing component 1002 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 assembly 1014 includes one or more sensors for providing various aspects of status assessment for the device 1000. For example, sensor assembly 1014 may detect an open/closed state of device 1000, the relative positioning of components, such as a display and keypad of apparatus 1000, sensor assembly 1014 may also detect a change in position of apparatus 1000 or a component of apparatus 1000, the presence or absence of user contact with apparatus 600, orientation or acceleration/deceleration of apparatus 1000, and a change in temperature of apparatus 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1014 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 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1016 is configured to facilitate communications between the apparatus 1000 and other devices in a wired or wireless manner. The device 1000 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 1016 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1016 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 apparatus 1000 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 methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 1004 comprising instructions, executable by the processor 1020 of the device 1000 to perform the above-described method 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 disclosed herein. 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 (3)

1. A method for controlling a browser to play a media asset, the method comprising:
judging whether a target hyperlink meets a set condition or not by adopting a JavaScript command, wherein the target hyperlink is a clicked hyperlink in a current tab page of a browser, and the set condition comprises: the browser opens the target hyperlink in a new tag page in the background, the content of the webpage pointed by the target hyperlink contains media resources, and the browser is preset to automatically play the media resources in the background, wherein the media resources comprise: an audio or video resource;
if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink;
the controlling the browser to prohibit automatic playing of the media resource in the webpage content pointed to by the target hyperlink comprises:
controlling the browser to load the media resource in the webpage content pointed by the target hyperlink;
controlling the browser to prohibit playing of the media resource in the webpage content pointed by the target hyperlink loaded by the browser;
after the controlling the browser to prohibit playing the media resource in the web page content pointed to by the target hyperlink loaded by the browser, the method further includes:
when detecting that a new label page for opening the target hyperlink is switched to a foreground from a background, controlling the browser to automatically play media resources in webpage content pointed by the target hyperlink loaded by the browser;
after the controlling the browser to automatically play the media resource in the webpage content pointed by the target hyperlink loaded by the browser, the method further includes:
when detecting that a new label page for opening the target hyperlink is switched from a foreground to a background, controlling the browser to pause playing of media resources in the webpage content pointed by the target hyperlink;
after the controlling the browser to pause playing the media resource in the web page content pointed by the target hyperlink, the method further includes:
and displaying a prompt message in the current tab page, wherein the prompt message is used for informing the user that the browser suspends the playing of the media resources in the background tab page.
2. An apparatus for controlling a browser to play a media asset, the apparatus comprising:
the judging module is configured to judge whether a target hyperlink meets a set condition by adopting a JavaScript command, wherein the target hyperlink is a clicked hyperlink in a current tab page of the browser, and the set condition comprises: the browser opens the target hyperlink in a new tag page in the background, the content of the webpage pointed by the target hyperlink contains media resources, and the browser is preset to automatically play the media resources in the background, wherein the media resources comprise: an audio or video resource;
the first control module is configured to control the browser to prohibit automatic playing of the media resource in the webpage content pointed by the target hyperlink under the condition that the judgment result of the judgment module is yes;
the first control module includes:
the first control sub-module is configured to control the browser to load the media resource in the webpage content pointed by the target hyperlink under the condition that the judgment result of the judgment module is yes;
a second control submodule configured to control the browser to prohibit playing of a media resource in the web content pointed to by the target hyperlink, which is loaded by the browser and controlled by the first control submodule;
the device further comprises:
the second control module is configured to control the browser to automatically play the media resource in the webpage content pointed by the target hyperlink, which is loaded by the browser and controlled by the first control sub-module, when the situation that a new tab page for opening the target hyperlink is switched from a background to a foreground is detected;
the device further comprises:
the third control module is configured to control the browser to pause playing of the media resource in the webpage content pointed by the target hyperlink when the situation that the new tab page for opening the target hyperlink is switched from the foreground to the background is detected;
the device further comprises:
the display module is configured to display a prompt message in the current tab page, wherein the prompt message is used for notifying a user that the browser suspends playing of the media resources in the background tab page.
3. An apparatus for controlling a browser to play a media asset, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
judging whether a target hyperlink meets a set condition or not by adopting a JavaScript command, wherein the target hyperlink is a clicked hyperlink in a current tab page of a browser, and the set condition comprises: the browser opens the target hyperlink in a new tag page in the background, the content of the webpage pointed by the target hyperlink contains media resources, and the browser is preset to automatically play the media resources in the background, wherein the media resources comprise: an audio or video resource;
if the target hyperlink meets the set condition, controlling the browser to forbid automatically playing the media resource in the webpage content pointed by the target hyperlink;
the controlling the browser to prohibit automatic playing of the media resource in the webpage content pointed to by the target hyperlink comprises:
controlling the browser to load the media resource in the webpage content pointed by the target hyperlink;
controlling the browser to prohibit playing of the media resource in the webpage content pointed by the target hyperlink loaded by the browser;
after the controlling the browser to prohibit playing the media resource in the web page content pointed to by the target hyperlink loaded by the browser, the method further includes:
when detecting that a new label page for opening the target hyperlink is switched to a foreground from a background, controlling the browser to automatically play media resources in webpage content pointed by the target hyperlink loaded by the browser;
after the controlling the browser to automatically play the media resource in the webpage content pointed by the target hyperlink loaded by the browser, the method further includes:
when detecting that a new label page for opening the target hyperlink is switched from a foreground to a background, controlling the browser to pause playing of media resources in the webpage content pointed by the target hyperlink;
after the controlling the browser to pause playing the media resource in the web page content pointed by the target hyperlink, the method further includes:
and displaying a prompt message in the current tab page, wherein the prompt message is used for informing the user that the browser suspends the playing of the media resources in the background tab page.
CN201610958860.5A 2016-10-27 2016-10-27 Method and device for controlling browser to play media resources Active CN106528735B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610958860.5A CN106528735B (en) 2016-10-27 2016-10-27 Method and device for controlling browser to play media resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610958860.5A CN106528735B (en) 2016-10-27 2016-10-27 Method and device for controlling browser to play media resources

Publications (2)

Publication Number Publication Date
CN106528735A CN106528735A (en) 2017-03-22
CN106528735B true CN106528735B (en) 2021-06-29

Family

ID=58326095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610958860.5A Active CN106528735B (en) 2016-10-27 2016-10-27 Method and device for controlling browser to play media resources

Country Status (1)

Country Link
CN (1) CN106528735B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429930A (en) * 2018-04-13 2018-08-21 小草数语(北京)科技有限公司 The control method and device of video playing in browser
CN108959382B (en) * 2018-05-30 2021-06-18 维沃移动通信有限公司 Audio and video detection method and mobile terminal
CN112805988B (en) * 2018-11-16 2022-04-12 深圳市欢太科技有限公司 Call control method and device, computer readable storage medium and electronic equipment
CN111125562B (en) * 2019-11-18 2024-02-09 上海连尚网络科技有限公司 Method and equipment for switching display tag pages
CN113378092A (en) * 2021-06-22 2021-09-10 海信电子科技(深圳)有限公司 Video playing management method and display equipment
CN113660532A (en) * 2021-08-11 2021-11-16 海信电子科技(深圳)有限公司 Multi-webpage video playing method and display equipment
CN114070838B (en) * 2022-01-12 2022-11-22 北京智象信息技术有限公司 Method and device for controlling voice playing sound ray overlapping of intelligent sound box based on JS

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103714069A (en) * 2012-09-29 2014-04-09 腾讯科技(深圳)有限公司 Method and device for opening pages in background
CN104980801A (en) * 2015-06-05 2015-10-14 安一恒通(北京)科技有限公司 Method and device for processing audio data/video data

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8190760B2 (en) * 2008-01-15 2012-05-29 Echostar Advanced Technologies L.L.C. System and method of managing multiple video players
CN102325225A (en) * 2011-09-20 2012-01-18 北京鹏润鸿途科技有限公司 Method and device for playing video of mobile phone website
CN102622176A (en) * 2012-02-24 2012-08-01 青岛海信移动通信技术股份有限公司 Processing method and device of application program operation interface
CN102663079B (en) * 2012-04-01 2014-07-23 烟台朱葛软件科技有限公司 Control method in webpage and display device in webpage
CN103279321A (en) * 2013-05-07 2013-09-04 青岛海信电器股份有限公司 Audio and video control device and audio and video control method
CN103336838B (en) * 2013-07-15 2017-03-15 小米科技有限责任公司 A kind of processing method of webpage, device and terminal device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103714069A (en) * 2012-09-29 2014-04-09 腾讯科技(深圳)有限公司 Method and device for opening pages in background
CN104980801A (en) * 2015-06-05 2015-10-14 安一恒通(北京)科技有限公司 Method and device for processing audio data/video data

Also Published As

Publication number Publication date
CN106528735A (en) 2017-03-22

Similar Documents

Publication Publication Date Title
CN106528735B (en) Method and device for controlling browser to play media resources
EP3572936B1 (en) Method, terminal and computer-readable storage medium for displaying interface of application program
US11086482B2 (en) Method and device for displaying history pages in application program and computer-readable medium
CN105955607B (en) Content sharing method and device
WO2018058728A1 (en) Content sharing method and apparatus
CN105338409B (en) Network video preloading method and device
CN110995929B (en) Terminal control method, device, terminal and storage medium
US20170344192A1 (en) Method and device for playing live videos
CN104866179B (en) Terminal application program management method and device
CN105224349B (en) Application program deletion prompting method and device
EP3128411B1 (en) Interface display method, terminal, computer program and recording medium
US20190073124A1 (en) Method and apparatus for controlling application
US20190235745A1 (en) Method and device for displaying descriptive information
US20180167478A1 (en) Method and apparatus for displaying notification message
CN106528081B (en) Operation execution method and device
US11545188B2 (en) Video processing method, video playing method, devices and storage medium
CN105786507B (en) Display interface switching method and device
CN111552426B (en) Intelligent equipment operation method and device and storage medium
CN105912204B (en) Method and device for starting application interface
US20170308397A1 (en) Method and apparatus for managing task of instant messaging application
CN105389083B (en) Large font implementation method and device and intelligent terminal
CN108446226B (en) Application exception processing method
CN105760796B (en) Application security processing method and device
CN107422954B (en) Lock screen prolonging method and device
CN109743441B (en) Read-write permission setting method and device

Legal Events

Date Code Title Description
C06 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