Skip to content

Commit

Permalink
Merge branch 'release/0.3.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
towerz committed Jun 22, 2019
2 parents f7338b1 + 693ae8c commit a93750b
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "clappr",
"description": "An extensible media player for the web",
"version": "0.3.5",
"version": "0.3.6",
"homepage": "https://github.com/clappr/clappr",
"authors": [
"Globo.com"
Expand Down
2 changes: 1 addition & 1 deletion bump
Expand Up @@ -6,7 +6,7 @@ update_dependencies() {
}

update_version() {
current_tag=$(git describe --abbrev=0 --tags) &&
current_tag=$(git describe --abbrev=0 --tags master) &&
echo 'bump from '$current_tag' to '$1 &&
sed -i ".bkp" "s/\(version\":[ ]*\"\)$current_tag/\1$1/" package.json &&
sed -i ".bkp" "s/\(version\":[ ]*\"\)$current_tag/\1$1/" yuidoc.json
Expand Down
18 changes: 17 additions & 1 deletion dist/clappr.js
Expand Up @@ -30386,7 +30386,7 @@ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var version = "0.3.5"; // Copyright 2014 Globo.com Player authors. All rights reserved.
var version = "0.3.6"; // Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -32386,12 +32386,28 @@ var HLS = function (_HTML5VideoPlayback) {
this.stop();
}
} else {
// Transforms HLSJS.ErrorDetails.KEY_LOAD_ERROR non-fatal error to
// playback fatal error if triggerFatalErrorOnResourceDenied playback
// option is set. HLSJS.ErrorTypes.KEY_SYSTEM_ERROR are fatal errors
// and therefore already handled.
if (this.options.playback.triggerFatalErrorOnResourceDenied && this._keyIsDenied(data)) {
_log2.default.error('hlsjs: could not load decrypt key.', { evt: evt, data: data });
formattedError = this.createError(error);
this.trigger(_events2.default.PLAYBACK_ERROR, formattedError);
this.stop();
return;
}

error.level = _error2.default.Levels.WARN;
this.createError(error);
_log2.default.warn('hlsjs: non-fatal error occurred', { evt: evt, data: data });
}
};

HLS.prototype._keyIsDenied = function _keyIsDenied(data) {
return data.type === _hls2.default.ErrorTypes.NETWORK_ERROR && data.details === _hls2.default.ErrorDetails.KEY_LOAD_ERROR && data.response && data.response.code >= 400;
};

HLS.prototype._onTimeUpdate = function _onTimeUpdate() {
var update = { current: this.getCurrentTime(), total: this.getDuration(), firstFragDateTime: this.getProgramDateTime() };
var isSame = this._lastTimeUpdate && update.current === this._lastTimeUpdate.current && update.total === this._lastTimeUpdate.total;
Expand Down
2 changes: 1 addition & 1 deletion dist/clappr.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.plainhtml5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/clappr.plainhtml5.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions doc/BUILTIN_PLUGINS.md
Expand Up @@ -82,13 +82,17 @@ The configuration for the playback, it's still only compatible with `html5_video
playInline: true, // allows inline playback when running on iOS UIWebview
crossOrigin: 'use-credentials',
recycleVideo: Clappr.Browser.isMobile, // Recycle <video> element only for mobile. (default is false)
triggerFatalErrorOnResourceDenied: true, // Triggers playback fatal error if resource is denied. (default is false)
externalTracks: [ // Add external <track> (if supported by browser, see also https://www.w3.org/TR/html5/embedded-content-0.html#the-track-element)
{lang: 'en', label: 'English', src: 'http://example.com/en.vtt', kind: 'subtitles'},
{lang: 'fr', label: 'French', src: 'http://example.com/fr.vtt'} // 'kind' default value is 'subtitles'
]
}
}
```

With HLS.JS playback, if `triggerFatalErrorOnResourceDenied` is set to true, it will triggers a playback fatal error event if decrypt key http response code is greater than or equal to 400. (Default behaviour is to automatically retry key request). This option is used to attempt to reproduce iOS devices behaviour which internally use html5 video playback.

#### HLS configuration

All options to configure the HLS playback should be under `playback`. Any specific settings for hls.js should be in the option `hlsjsConfig`:
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "clappr",
"version": "0.3.5",
"version": "0.3.6",
"description": "An extensible media player for the web",
"main": "./dist/clappr.js",
"scripts": {
Expand Down
19 changes: 19 additions & 0 deletions src/playbacks/hls/hls.js
Expand Up @@ -335,12 +335,31 @@ export default class HLS extends HTML5VideoPlayback {
this.stop()
}
} else {
// Transforms HLSJS.ErrorDetails.KEY_LOAD_ERROR non-fatal error to
// playback fatal error if triggerFatalErrorOnResourceDenied playback
// option is set. HLSJS.ErrorTypes.KEY_SYSTEM_ERROR are fatal errors
// and therefore already handled.
if (this.options.playback.triggerFatalErrorOnResourceDenied && this._keyIsDenied(data)) {
Log.error('hlsjs: could not load decrypt key.', { evt, data })
formattedError = this.createError(error)
this.trigger(Events.PLAYBACK_ERROR, formattedError)
this.stop()
return
}

error.level = PlayerError.Levels.WARN
this.createError(error)
Log.warn('hlsjs: non-fatal error occurred', { evt, data })
}
}

_keyIsDenied(data) {
return data.type === HLSJS.ErrorTypes.NETWORK_ERROR
&& data.details === HLSJS.ErrorDetails.KEY_LOAD_ERROR
&& data.response
&& data.response.code >= 400
}

_onTimeUpdate() {
let update = { current: this.getCurrentTime(), total: this.getDuration(), firstFragDateTime: this.getProgramDateTime() }
let isSame = this._lastTimeUpdate && (
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -10689,9 +10689,9 @@ stringify-author@^0.1.3:
integrity sha1-1YHgLOC1XNo8lT5irdIR+uSw72Y=

stringstream@~0.0.4, stringstream@~0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878"
integrity sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=
version "0.0.6"
resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72"
integrity sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==

strip-ansi@^3.0.0, strip-ansi@^3.0.1:
version "3.0.1"
Expand Down

0 comments on commit a93750b

Please sign in to comment.