OpenTV Player Web HTML5

Module: url

url

url.js

Methods

staticmodule:url.getAbsoluteURL(url){string}

Get absolute version of relative URL.

Name Type Description
url string

URL to make absolute

Returns:
Type Description
string Absolute URL

staticmodule:url.getFileExtension(path){string}

Returns the extension of the passed file name. It will return an empty string if passed an invalid path.

Name Type Description
path string

The fileName path like '/path/to/file.mp4'

Returns:
Type Description
string The extension in lower case or an empty string if no extension could be found.

staticmodule:url.isCrossOrigin(url, winLoc){boolean}

Returns whether the url passed is a cross domain request or not.

Name Type Description
url string

The url to check.

winLoc URL optional

the domain to check the url against, defaults to window.location

Returns:
Type Description
boolean Whether it is a cross domain request or not.

staticmodule:url.parseUrl(url){URL}

Resolve and parse the elements of a URL.

Name Type Description
url string

The url to parse

Returns:
Type Description
URL An object of url details