IP Library Granted Patent US 9,965,468
Granted Patent B2
US 9,965,468 · App. 15/024,461 · Granted May 8, 2018

Method and apparatus for acquiring network resource

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,965,468
App. No.
15/024,461
Granted
May 8, 2018
Kind
B2
Abstract

A method and an apparatus for acquiring a network resource where the method includes extracting language configuration information of a browser, and placing the language configuration information into a language list, sending a hypertext transfer protocol (HTTP) request to a web server, locating a position of a media element, matching a value of a language attribute of a specified resource element in the media element with the language information in the language list, selecting a media resource address, and finally according to the media resource address, requesting a media resource from the web server and loading the media resource. Hence, the browser can automatically select a media file of a specified language version according to a language preference of a user, thereby reducing a workload of a website developer. Additionally, the user does not need to perform manual selection, thereby enhancing user experience.

Claims (56)

1. A method for acquiring a network resource, comprising:

extracting language configuration information of a browser;

extracting language information from the language configuration information, wherein the language information is included in setting information of a language preference of each of a video, an audio, and a subtitle, and wherein extracting the language information includes:

connecting the language information in the setting information using a comma to obtain a character string of the video, a character string of the audio, and a character string of the subtitle; and

separating the character string of the video, the character string of the audio, and the character string of the subtitle into different pieces of language information according to the comma, wherein when there is a semicolon in the language information, a character string preceding the semicolon is extracted, and wherein when there is no semicolon in the language information, an entire character string is extracted;

storing the language information into a language list by successively storing the language information into a corresponding language list of the video, the audio, or the subtitle;

sending a hypertext transfer protocol (HTTP) request to a web server to request a media play page or a media list page;

loading a web page returned by the web server;

locating a position of a media element;

matching a value of a language attribute of a specified resource element in the media element with the language information in the language list;

selecting a media resource address;

requesting a media resource from the web server according to the media resource address;

loading the media resource; and

presenting the web page including the media resource to a user.

2. The method according to claim 1 , wherein extracting the language configuration information of the browser comprises:

extracting the language configuration information of the browser and language setting information of a user operating system; and

performing selection according to a language configuration information priority of the browser and a language setting information priority of the user operating system, wherein the language configuration information priority and the language setting information priority are preset or user-selected.

3. The method according to claim 1 , wherein before extracting the language configuration information of the browser, the method further comprises adding the setting information of the language preference of each of the video, the audio, and the subtitle to the language configuration information of the browser.

4. The method according to claim 1 , wherein matching the value of the language attribute of the specified resource element in the media element with the language information in the language list, and wherein selecting the media resource address comprises:

successively extracting the language information in the language list when the specified resource element in the media element has the language attribute;

successively matching the extracted language information with values of language attributes of all specified resource elements in the media element;

selecting the media resource address specified by a value of a resource address attribute of a first specified resource element when there is a matched value of the language attribute of the first specified resource element;

selecting the media resource address specified by the value of the resource address attribute of the resource element that is first specified in the media element when there is no matched value of the language attribute of the first specified resource element; and

selecting the media resource address specified by the value of the resource address attribute of the resource element that is first specified in the media element when the specified resource element in the media element has no language attribute.

5. The method according to claim 4 , wherein the media element comprises a video element, an audio element, and a subtitle element.

6. An apparatus for acquiring a network resource, comprising:

a memory;

a transceiver; and

a processor,

wherein the memory, the transceiver and the processor are coupled to and in communication with each other,

wherein the processor is configured to:

extract language configuration information of a browser; and

extract language information from the language configuration information, wherein the language information is included in setting information of a language preference of each of a video, an audio, and a subtitle, and wherein the processor is configured to extract the language information by:

connecting the language information in the setting information using a comma to obtain a character string of the video, a character string of the audio, and a character string of the subtitle; and

separating the character string of the video, the character string of the audio, and the character string of the subtitle into different pieces of language information according to the comma, wherein when there is a semicolon in the language information, a character string preceding the semicolon is extracted, and wherein when there is no semicolon in the language information, an entire character string is extracted,

wherein the memory is configured to store the language information into a language list by successively storing the language information into a corresponding language list of the video, the audio, or the subtitle, and

wherein the transceiver is configured to:

send a hypertext transfer protocol (HTTP) request to a web server to request a media play page or a media list page; and

load a web page returned by the web server,

wherein the processor is further configured to:

locate a position of a media element;

match a value of a language attribute of a specified resource element in the media element with the language information in the language list; and

select a media resource address;

wherein the transceiver is further configured to:

request a media resource from the web server according to the media resource address; and

load the media resource.

7. The apparatus according to claim 6 , wherein the processor is further configured to:

extract the language configuration information of the browser and language setting information of a user operating system; and

perform selection according to a language configuration information priority of the browser and a language setting information priority of the user operating system, wherein the language configuration information priority and the language setting information priority are preset or user-selected.

8. The apparatus according to claim 6 , wherein the processor is further configured to add the setting information of the language preference of each of the video, the audio, and the subtitle to the language configuration information of the browser.

9. The apparatus according to claim 6 , wherein the processor is further configured to:

successively extract the language information in the language list when the specified resource element in the media element has the language attribute;

successively match the extracted language information with values of language attributes of all specified resource elements in the media element;

select the media resource address specified by a value of a resource address attribute of a first specified resource element when there is a matched value of the language attribute of the first specified resource element;

select the media resource address specified by the value of the resource address attribute of the resource element that is first specified in the media element when there is no any matched value of the language attribute of the first specified resource element; and

select the media resource address specified by the value of the resource address attribute of the resource element that is first specified in the media element when the specified resource element in the media element has no language attribute.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 19, 2018
From: HUAWEI DEVICE (SHENZHEN) CO., LTD.
To: HUAWEI DEVICE CO., LTD.
Reel/Frame 047603/0039 →
CHANGE OF NAME Recorded Jun 12, 2018
From: HUAWEI DEVICE CO.,LTD.
To: HUAWEI DEVICE (SHENZHEN) CO., LTD.
Reel/Frame 046340/0590 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 24, 2016
From: JING, HAO
To: HUAWEI DEVICE CO., LTD.
Reel/Frame 038094/0439 →