Skip to content

Commit

Permalink
Initial merge (with errors)
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bartos committed Sep 11, 2019
2 parents 34998e1 + 0818601 commit a6a7c29
Show file tree
Hide file tree
Showing 68 changed files with 1,909 additions and 852 deletions.
8 changes: 7 additions & 1 deletion .esdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"destination": "./api-docs",
"plugins": [
{"name": "esdoc-standard-plugin"},
{"name": "esdoc-typescript-plugin", "option": {"enable": true}}
{"name": "esdoc-typescript-plugin", "option": {"enable": true}},
{
"name": "esdoc-ecmascript-proposal-plugin",
"option": {
"objectRestSpread": true
}
}
]
}
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ module.exports = {
'eslint:recommended',
'standard'
],
'parser': 'typescript-eslint-parser',
'parserOptions': {
'sourceType': 'module'
'sourceType': 'module'
},
'plugins': [
'typescript'
],
'rules': {
// our basic style rules
'semi': [
Expand Down
5 changes: 4 additions & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
daysUntilStale: 60

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
daysUntilClose: 30

# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- Confirmed
- Feature proposal
- Question


# Label to use when marking an issue as stale
staleLabel: Stale
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
- stage: testFuncOptional
env: TRAVIS_MODE=funcTests UA=safari OS="OS X 10.11" UA_VERSION="9.0"
addons:
sauce_connect: true
sauce_connect:
tunnel_domains: localhost
jwt:
secure: TxJT041jqRf4raCwtNJRb0rz2gGvEaADZjWO41UQND2+YIZ//S9qB2C4YyrL1BBsn8/ebdHr0cd18PwCzoBSEmoCdoAWXmqBaaLvM1DOeQkKJbU3+pFmWtv1qGqRXJLEAysNvzhG0sLdvBc0M7a/CWxqRfx1O3lGhLnTlAW33LlQndjJ8vh3SGQm8HxFR1503ujPd7V1jGwduVwaQp4zbAKTnQ4MLugmJf6UKiTc+YILMrVWOwipOIyYHh2GqbChd/v1PXff26XCNJXcaRZKJ8JosWyBpq5t4zlPO0qDfHpqbEuYK44xm4vzbZS94P/KF8BYzdtxQYLrxoS1UlnUYU7RmzqgL3y3AM7nzX/cXvJcoNXfUK2BpsB754XNyQfRmXOdRiHoC8+wwPqGkH/KCrmS4UIOqv4THfmDbrtewfcDTgKOzHxGcT1IsUq9BTxMNtxSwpHTHUXTXrzpS/UBDvrlc+9qPTqf+e6QL1aG+JT5sOg5REm2hMy0j18/Kr+HLXkehxEgJ6JrybyHUkkJrfcuWgVDu7Lv3cxlrtSMXi7TIwSB75NMoM8AE71GEVjXwpOw/0giwnmGsJNNi01ztod0UFe2V2rS+yPI1WNZIJ7Fw66U0oOKJ1rb4Iksl86n5Y2snHsxK8q5jhKaAaiWgGK5kVTAgF89t/GXYyNH6cI=
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[![Build Status](https://api.travis-ci.org/video-dev/hls.js.svg?branch=master)](https://travis-ci.org/video-dev/hls.js)
[![npm](https://img.shields.io/npm/v/hls.js.svg?style=flat)](https://npmjs.org/package/hls.js)
[![npm](https://img.shields.io/npm/v/hls.js/canary.svg?style=flat)](https://www.npmjs.com/package/hls.js/v/canary)
[![](https://data.jsdelivr.com/v1/package/npm/hls.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/hls.js)
[![](https://data.jsdelivr.com/v1/package/npm/hls.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/hls.js)

[![](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com)

Join the discussion via [video-dev.org](http://video-dev.org) in #hlsjs (our Slack channel)

Expand Down Expand Up @@ -70,7 +72,7 @@ Find the commit on [https://github.com/video-dev/hls.js/blob/deployments/README.
});
}
// hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
// When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.
// When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element through the `src` property.
// This is using the built-in support of the plain video element, without using hls.js.
// Note: it would be more normal to wait on the 'canplay' event below however on Safari (where you are most likely to find built-in HLS support) the video.src URL must be on the user-driven
// white-list before a 'canplay' event will be emitted; the last video event that can be reliably listened-for when the URL is not on the white-list is 'loadedmetadata'.
Expand All @@ -93,14 +95,16 @@ HTMLVideoElement control and events could be used seamlessly.

|[<img src="http://i.cdn.turner.com/adultswim/big/img/global/adultswim.jpg" width="120">](http://www.adultswim.com/videos/streams)|[<img src="https://www.akamai.com/fr/fr/multimedia/images/logo/akamai-logo.png" width="120">](https://www.akamai.com)|[<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Canal%2B.svg/2000px-Canal%2B.svg.png" width="120">](https://www.canalplus.fr)|[<img src="https://avatars2.githubusercontent.com/u/115313" width="120">](http://www.dailymotion.com)|
|---|---|---|---|
|[<img src="https://user-images.githubusercontent.com/4006693/44003595-baff193c-9e8f-11e8-9848-7bb91563499f.png" width="120">](https://freshlive.tv)|[<img src="https://flowplayer.org/media/img/logo-blue.png" width="120">](http://www.flowplayer.org)|[<img src="https://avatars1.githubusercontent.com/u/12554082?s=240" width="120">](http://www.foxsports.com.au)|[<img src="https://cloud.githubusercontent.com/assets/244265/12556435/dfaceb48-c353-11e5-971b-2c4429725469.png" width="120">](http://www.globo.com)|
|[<img src="https://user-images.githubusercontent.com/4006693/44003595-baff193c-9e8f-11e8-9848-7bb91563499f.png" width="120">](https://freshlive.tv)|[<img src="https://flowplayer.org/media/img/logo-blue.png" width="120">](http://www.flowplayer.org)|[<img src="https://avatars1.githubusercontent.com/u/12554082?s=240" width="120">](https://www.foxsports.com.au)|[<img src="https://cloud.githubusercontent.com/assets/244265/12556435/dfaceb48-c353-11e5-971b-2c4429725469.png" width="120">](http://www.globo.com)|
|[<img src="https://images.gunosy.com/logo/gunosy_icon_company_logo.png" width="120">](https://gunosy.com)|[<img src="https://user-images.githubusercontent.com/1480052/35802840-f8e85b8a-0a71-11e8-8eb2-eee323e3f159.png" width="120">](https://www.gl-systemhaus.de/)|[<img src="https://cloud.githubusercontent.com/assets/6525783/20801836/700490de-b7ea-11e6-82bd-e249f91c7bae.jpg" width="120">](http://nettrek.de/)|[<img src="https://cloud.githubusercontent.com/assets/244265/12556385/999aa884-c353-11e5-9102-79df54384498.png" width="120">](https://www.nytimes.com/)|
|[<img src="https://cloud.githubusercontent.com/assets/1798553/20356424/ba158574-ac24-11e6-95e1-1ae591b11a0a.png" width="120">](https://www.peer5.com/)|[<img src="https://cloud.githubusercontent.com/assets/4909096/20925062/e26e6fc8-bbb4-11e6-99a5-d4762274a342.png" width="120">](http://qbrick.com/)|[<img src="https://www.radiantmediaplayer.com/images/radiantmediaplayer-new-logo-640.jpg" width="120">](https://www.radiantmediaplayer.com/)|[<img src="https://www.rts.ch/hummingbird-static/images/logos/logo_marts.svg" width="120">](http://www.rts.ch/)|
|[<img src="https://cloud.githubusercontent.com/assets/12702747/19316434/0a3601de-9067-11e6-85e2-936b1cb099a0.png" width="120">](https://www.snapstream.com/)|[<img src="https://www.streamamg.com/wp-content/themes/barebones/_assets/images/streamamg-logo.png" width="120">](https://www.streamamg.com/)|[<img src="https://streamsharkio.sa.metacdn.com/wp-content/uploads/2015/10/streamshark-dark.svg" width="120">](https://streamshark.io/)|[<img src="https://camo.githubusercontent.com/9580f10e9bfa8aa7fba52c5cb447bee0757e33da/68747470733a2f2f7777772e7461626c6f74762e636f6d2f7374617469632f696d616765732f7461626c6f5f6c6f676f2e706e67" width="120">](http://my.tablotv.com/)|
|[<img src="https://user-images.githubusercontent.com/2803310/34083705-349c8fd0-e375-11e7-92a6-5c38509f4936.png" width="120">](https://www.streamroot.io/)|[<img src="http://vignette1.wikia.nocookie.net/tedtalks/images/c/c0/TED_logo.png/revision/20150915192527" width="120">](https://www.ted.com/)|[<img src="https://www.seeklogo.net/wp-content/uploads/2014/12/twitter-logo-vector-download.jpg" width="120">](https://twitter.com/)|[<img src="https://cloud.githubusercontent.com/assets/8201317/20566816/bc33f51c-b196-11e6-9bd3-afb71a06460b.png" width="120">](http://vwflow.com)|
|[<img src="https://player.mtvnservices.com/edge/hosted/Viacom_logo.svg" width="120">](https://www.viacom.com/)|[<img src="https://user-images.githubusercontent.com/1181974/29248959-efabc440-802d-11e7-8050-7c1f4ca6c607.png" width="120">](https://vk.com/)|[<img src="https://s3.amazonaws.com/uploads.hipchat.com/87223/4876411/7Rybnl26ReFzlt3/jw-logo-red.png" width="120">](https://www.jwplayer.com)|[<img src="https://staticftv-a.akamaihd.net/arches/francetv/default/img/og-image.jpg?20161007" width="120">](https://www.france.tv)|
|[<img src="http://showmax.akamaized.net/e/logo/showmax_black.png" width="120">](https://tech.showmax.com)|[<img src="https://static3.1tv.ru/assets/web/logo-ac67852f1625b338f9d1fb96be089d03557d50bfc5790d5f48dc56799f59dec6.svg" width="120" height="120">](https://www.1tv.ru/) | [<img src="https://user-images.githubusercontent.com/1480052/40482633-c013ebce-5f55-11e8-96d5-b776415de0ce.png" width="120">](https://www.zdf.de) | [<img src="https://github.com/cdnbye/hlsjs-p2p-engine/blob/master/figs/cdnbye.png" width="120">](https://github.com/cdnbye/hlsjs-p2p-engine)| |
|[<img src="https://streaming.cdn77.com/live-streaming-logo-dark.png" width="120">](https://streaming.cdn77.com/)| [<img src="https://avatars0.githubusercontent.com/u/7442371?s=200&v=4" width="120">](https://r7.com/)|[<img src="https://raw.githubusercontent.com/Novage/p2p-media-loader/gh-pages/images/p2pml-logo.png" width="120">](https://github.com/Novage/p2p-media-loader)
|[<img src="https://streaming.cdn77.com/live-streaming-logo-dark.png" width="120">](https://streaming.cdn77.com/)| [<img src="https://avatars0.githubusercontent.com/u/7442371?s=200&v=4" width="120">](https://r7.com/)|[<img src="https://raw.githubusercontent.com/Novage/p2p-media-loader/gh-pages/images/p2pml-logo.png" width="120">](https://github.com/Novage/p2p-media-loader)|[<img src="https://avatars3.githubusercontent.com/u/45617200?s=400" width="120">](https://kayosports.com.au)
|[<img src="https://user-images.githubusercontent.com/6701211/61649753-b3415600-ac77-11e9-9fbb-90a4d4c61628.png" width="120">](https://flosports.tv)


## Player Integration

Expand Down
5 changes: 0 additions & 5 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ <h3>
<input id="dumpfMP4" type=checkbox unchecked/>
</label>

<label class="innerControls">
Metrics history (max limit, -1 is unlimited):
<input id="limitMetrics" style="width: 8em" type=number/>
</label>

<label class="innerControls">
Player size:
<select id="videoSize" style="float:right;">
Expand Down
1 change: 1 addition & 0 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,7 @@ function setupConfigEditor() {
const elPersistence = document.querySelector('#configPersistence');
elPersistence.addEventListener('change', onConfigPersistenceChanged);
elPersistence.checked = shouldRestorePersisted;
configPersistenceEnabled = shouldRestorePersisted;

updateConfigEditorValue(contents);
}
Expand Down
18 changes: 16 additions & 2 deletions demo/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,22 @@ <h1 class="title">hls.js metrics page</h1>

function updateMetrics() {
var hlsLink = document.URL.substr(0,document.URL.lastIndexOf("/")+1) + 'index.html?src=' + encodeURIComponent(events.url);
var description = 'playlist: ' + "<a href=\"" + events.url + "\">" + events.url + "</a>" + '<br>replay: ' + "<a href=\"" + hlsLink + "\">" + hlsLink + "</a>";
$("#StreamPermalink").html(description);
var playlistLink = document.createElement("a");
playlistLink.setAttribute("href", events.url);
playlistLink.textContent = events.url;

var replayLink = document.createElement("a");
replayLink.setAttribute("href", hlsLink);
replayLink.textContent = hlsLink;

var fragment = document.createDocumentFragment();
fragment.appendChild(document.createTextNode('playlist: '));
fragment.appendChild(playlistLink);
fragment.appendChild(document.createElement("br"));
fragment.appendChild(document.createTextNode('replay: '));
fragment.appendChild(replayLink);

$("#StreamPermalink").html(fragment);
$("#HlsDate").text("session Start Date:" + new Date(events.t0));
metricsDisplayed=true;
showMetrics();
Expand Down
70 changes: 45 additions & 25 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
- [`hls.startLevel`](#hlsstartlevel)
- [`hls.autoLevelEnabled`](#hlsautolevelenabled)
- [`hls.autoLevelCapping`](#hlsautolevelcapping)
- [`hls.capLevelToPlayerSize`](#hlscapleveltoplayersize)
- [`hls.bandwidthEstimate`](#hlsbandwidthestimate)
- [Version Control](#version-control)
- [`Hls.version`](#hlsversion)
Expand Down Expand Up @@ -134,7 +135,7 @@ Invoke the following static method: `Hls.isSupported()` to check whether your br
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script>
if (Hls.isSupported()) {
console.log("hello hls.js!");
console.log("hello hls.js!");
}
</script>
```
Expand All @@ -159,7 +160,7 @@ Let's
hls.attachMedia(video);
// MEDIA_ATTACHED event is fired by hls object once MediaSource is ready
hls.on(Hls.Events.MEDIA_ATTACHED, function () {
console.log("video and hls.js are now bound together !");
console.log("video and hls.js are now bound together !");
});
}
</script>
Expand Down Expand Up @@ -227,7 +228,7 @@ See sample code below to listen to errors:
var errorFatal = data.fatal;

switch(data.details) {
case hls.ErrorDetails.FRAG_LOAD_ERROR:
case Hls.ErrorDetails.FRAG_LOAD_ERROR:
// ....
break;
default:
Expand All @@ -238,7 +239,7 @@ See sample code below to listen to errors:

#### Fatal Error Recovery

Hls.js provides means to 'try to' recover fatal network and media errors, through these 2 methods:
hls.js provides means to 'try to' recover fatal network and media errors, through these 2 methods:

##### `hls.startLoad()`

Expand Down Expand Up @@ -294,9 +295,10 @@ Configuration parameters could be provided to hls.js upon instantiation of `Hls`
```js
var config = {
autoStartLoad: true,
startPosition : -1,
capLevelToPlayerSize: false,
startPosition: -1,
debug: false,
capLevelOnFPSDrop: false,
capLevelToPlayerSize: false,
defaultAudioCodec: undefined,
initialLiveManifestSize: 1,
maxBufferLength: 30,
Expand All @@ -306,47 +308,58 @@ Configuration parameters could be provided to hls.js upon instantiation of `Hls`
lowBufferWatchdogPeriod: 0.5,
highBufferWatchdogPeriod: 3,
nudgeOffset: 0.1,
nudgeMaxRetry : 3,
maxFragLookUpTolerance: 0.2,
nudgeMaxRetry: 3,
maxFragLookUpTolerance: 0.25,
liveSyncDurationCount: 3,
liveMaxLatencyDurationCount: 10,
liveMaxLatencyDurationCount: Infinity,
enableWorker: true,
enableSoftwareAES: true,
manifestLoadingTimeOut: 10000,
manifestLoadingMaxRetry: 1,
manifestLoadingRetryDelay: 500,
manifestLoadingMaxRetryTimeout : 64000,
manifestLoadingRetryDelay: 1000,
manifestLoadingMaxRetryTimeout: 64000,
startLevel: undefined,
levelLoadingTimeOut: 10000,
levelLoadingMaxRetry: 4,
levelLoadingRetryDelay: 500,
levelLoadingRetryDelay: 1000,
levelLoadingMaxRetryTimeout: 64000,
fragLoadingTimeOut: 20000,
fragLoadingMaxRetry: 6,
fragLoadingRetryDelay: 500,
fragLoadingRetryDelay: 1000,
fragLoadingMaxRetryTimeout: 64000,
startFragPrefetch: false,
fpsDroppedMonitoringPeriod: 5000,
fpsDroppedMonitoringThreshold: 0.2,
appendErrorMaxRetry: 3,
loader: customLoader,
fLoader: customFragmentLoader,
pLoader: customPlaylistLoader,
xhrSetup: XMLHttpRequestSetupCallback,
fetchSetup: FetchSetupCallback,
abrController: customAbrController,
abrController: AbrController,
bufferController: BufferController,
capLevelController: CapLevelController,
fpsController: FPSController,
timelineController: TimelineController,
enableWebVTT: true,
enableCEA708Captions: true,
stretchShortVideoTrack: false,
maxAudioFramesDrift : 1,
maxAudioFramesDrift: 1,
forceKeyFrameOnDiscontinuity: true,
abrEwmaFastLive: 5.0,
abrEwmaFastLive: 3.0,
abrEwmaSlowLive: 9.0,
abrEwmaFastVoD: 4.0,
abrEwmaSlowVoD: 15.0,
abrEwmaFastVoD: 3.0,
abrEwmaSlowVoD: 9.0,
abrEwmaDefaultEstimate: 500000,
abrBandWidthFactor: 0.95,
abrBandWidthUpFactor: 0.7,
minAutoBitrate: 0
abrMaxWithRealBitrate: false,
maxStarvationDelay: 4,
maxLoadingDelay: 4,
minAutoBitrate: 0,
emeEnabled: false,
widevineLicenseUrl: undefined,
requestMediaKeySystemAccessFunc: requestMediaKeySystemAccess
};

var hls = new Hls(config);
Expand Down Expand Up @@ -463,7 +476,7 @@ Max nb of nudge retries before hls.js raise a fatal BUFFER_STALLED_ERROR

### `maxFragLookUpTolerance`

(default 0.2s)
(default 0.25s)

This tolerance factor is used during fragment lookup.
Instead of checking whether buffered.end is located within [start, end] range, frag lookup will be done by checking within [start-maxFragLookUpTolerance, end-maxFragLookUpTolerance] range.
Expand Down Expand Up @@ -743,7 +756,7 @@ class pLoader extends Hls.DefaultConfig.loader {
}

var hls = new Hls({
pLoader : pLoader,
pLoader: pLoader,
});

```
Expand Down Expand Up @@ -897,7 +910,7 @@ parameter should be a boolean

### `abrEwmaFastLive`

(default: `5.0`)
(default: `3.0`)

Fast bitrate Exponential moving average half-life, used to compute average bitrate for Live streams.
Half of the estimate is based on the last abrEwmaFastLive seconds of sample history.
Expand All @@ -917,7 +930,7 @@ parameter should be a float greater than [abrEwmaFastLive](#abrewmafastlive)

### `abrEwmaFastVoD`

(default: `4.0`)
(default: `3.0`)

Fast bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
Half of the estimate is based on the last abrEwmaFastVoD seconds of sample history.
Expand All @@ -927,7 +940,7 @@ parameter should be a float greater than 0

### `abrEwmaSlowVoD`

(default: `15.0`)
(default: `9.0`)

Slow bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
Half of the estimate is based on the last abrEwmaSlowVoD seconds of sample history.
Expand Down Expand Up @@ -1054,6 +1067,13 @@ Default value is `hls.firstLevel`.

Default value is `-1` (no level capping).

### `hls.capLevelToPlayerSize`

- get: Enables or disables level capping. If disabled after previously enabled, `nextLevelSwitch` will be immediately called.
- set: Whether level capping is enabled.

Default value is set via [`capLevelToPlayerSize`](#capleveltoplayersize) in config.

### `hls.bandwidthEstimate`

get: Returns the current bandwidth estimate in bits/s, if available. Otherwise, `NaN` is returned.
Expand Down Expand Up @@ -1115,7 +1135,7 @@ get : position of live sync point (ie edge of live position minus safety delay d

## Runtime Events

Hls.js fires a bunch of events, that could be registered as below:
hls.js fires a bunch of events, that could be registered as below:

```js
hls.on(Hls.Events.LEVEL_LOADED,function(event,data) {
Expand Down
Loading

0 comments on commit a6a7c29

Please sign in to comment.