url.js
Methods
static getAbsoluteURL(url) → {string}
[utils/url.js](https://docs.videojs.com/utils_url.js.html)
, [line 108](https://docs.videojs.com/utils_url.js.html#line108)
Get absolute version of relative URL. Used to tell Flash the correct URL.
Parameters:
Name | Type | Description |
---|---|---|
url | string | URL to make absolute |
Returns:
string -
Absolute URL
See:
static getFileExtension(path) → {string}
[utils/url.js](https://docs.videojs.com/utils_url.js.html)
, [line 133](https://docs.videojs.com/utils_url.js.html#line133)
Returns the extension of the passed file name. It will return an empty string if passed an invalid path.
Parameters:
Name | Type | Description |
---|---|---|
path | string | The fileName path like ‘/path/to/file.mp4’ |
Returns:
string -
The extension in lower case or an empty string if no extension could be found.
static isCrossOrigin(url, winLocopt) → {boolean}
[utils/url.js](https://docs.videojs.com/utils_url.js.html)
, [line 165](https://docs.videojs.com/utils_url.js.html#line165)
Returns whether the url passed is a cross domain request or not.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url | string | The url to check. | |||||||||||||
winLoc | Object | <optional> | the domain to check the url against, defaults to window.location Properties
|
Returns:
boolean -
Whether it is a cross domain request or not.
static parseUrl(url) → {url:URLObject}
[utils/url.js](https://docs.videojs.com/utils_url.js.html)
, [line 43](https://docs.videojs.com/utils_url.js.html#line43)
Resolve and parse the elements of a URL.
Parameters:
Name | Type | Description |
---|---|---|
url | String | The url to parse |
Returns:
url:URLObject -
An object of url details
Type Definitions
url:URLObject
[utils/url.js](https://docs.videojs.com/utils_url.js.html)
, [line 8](https://docs.videojs.com/utils_url.js.html#line8)
Properties:
Name | Type | Description |
---|---|---|
protocol | string | The protocol of the url that was parsed. |
hostname | string | The hostname of the url that was parsed. |
port | string | The port of the url that was parsed. |
pathname | string | The pathname of the url that was parsed. |
search | string | The search query of the url that was parsed. |
hash | string | The hash of the url that was parsed. |
host | string | The host of the url that was parsed. |