Skip to content

Commit

Permalink
Release 2.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa8626 committed Jun 26, 2021
1 parent 3c016fe commit c08b8d7
Show file tree
Hide file tree
Showing 24 changed files with 1,957 additions and 1,912 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v2.7.4](https://github.com/openplayerjs/openplayerjs/compare/v2.7.3...v2.7.4)

> 26 June 2021
- fix: upgrade core-js from 3.15.0 to 3.15.1 [`#250`](https://github.com/openplayerjs/openplayerjs/pull/250)
- fix: upgrade core-js from 3.14.0 to 3.15.0 [`#249`](https://github.com/openplayerjs/openplayerjs/pull/249)
- fix: upgrade core-js from 3.13.1 to 3.14.0 [`#248`](https://github.com/openplayerjs/openplayerjs/pull/248)
- fix: upgrade core-js from 3.13.0 to 3.13.1 [`#247`](https://github.com/openplayerjs/openplayerjs/pull/247)
- fix: upgrade core-js from 3.12.1 to 3.13.0 [`#245`](https://github.com/openplayerjs/openplayerjs/pull/245)
- feat(player): Added new methods to create more advanced controls; added new element to override content of the custom control [`3c016fe`](https://github.com/openplayerjs/openplayerjs/commit/3c016fe41c127cdfb1ec2eff54c6c58f3f25389b)

#### [v2.7.3](https://github.com/openplayerjs/openplayerjs/compare/v2.7.2...v2.7.3)

> 13 May 2021
Expand All @@ -17,7 +28,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(player): Supported server-side rendering by using properly element-closest library, and added data for events in HLS and FLV properly; fixes #119 and #242 [`#119`](https://github.com/openplayerjs/openplayerjs/issues/119)
- feat(player): Added new samples for React and Vue; added section to use OpenPlayerJS with Vue.js [`498b232`](https://github.com/openplayerjs/openplayerjs/commit/498b2325d5c2575a79ed252af3146db2a44f8c75)
- fix(player): Added missing documentation about how to obtain event data [`79e8731`](https://github.com/openplayerjs/openplayerjs/commit/79e8731de444c05847e2ad9b31b177e8d30454b8)
- fix(player): Added data for events in DASH properly [`9805e33`](https://github.com/openplayerjs/openplayerjs/commit/9805e3380a25166b475e586abfb7d03ac00e491e)
- Release 2.7.3 [`3771ed4`](https://github.com/openplayerjs/openplayerjs/commit/3771ed486d209e08522b23c4ff7fbd0db8fe3a9d)

#### [v2.7.2](https://github.com/openplayerjs/openplayerjs/compare/v2.7.1...v2.7.2)

Expand Down
204 changes: 104 additions & 100 deletions dist/esm/controls.js

Large diffs are not rendered by default.

328 changes: 163 additions & 165 deletions dist/esm/controls/captions.js

Large diffs are not rendered by default.

152 changes: 75 additions & 77 deletions dist/esm/controls/fullscreen.js

Large diffs are not rendered by default.

248 changes: 123 additions & 125 deletions dist/esm/controls/levels.js

Large diffs are not rendered by default.

202 changes: 100 additions & 102 deletions dist/esm/controls/play.js

Large diffs are not rendered by default.

428 changes: 213 additions & 215 deletions dist/esm/controls/progress.js

Large diffs are not rendered by default.

192 changes: 95 additions & 97 deletions dist/esm/controls/settings.js

Large diffs are not rendered by default.

188 changes: 93 additions & 95 deletions dist/esm/controls/time.js

Large diffs are not rendered by default.

226 changes: 112 additions & 114 deletions dist/esm/controls/volume.js

Large diffs are not rendered by default.

224 changes: 111 additions & 113 deletions dist/esm/media.js

Large diffs are not rendered by default.

554 changes: 276 additions & 278 deletions dist/esm/media/ads.js

Large diffs are not rendered by default.

102 changes: 50 additions & 52 deletions dist/esm/media/dash.js
@@ -1,17 +1,15 @@
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _player, _events, _options;
var _DashMedia_player, _DashMedia_events, _DashMedia_options;
import { HAS_MSE } from '../utils/constants';
import { addEvent } from '../utils/events';
import { loadScript } from '../utils/general';
Expand All @@ -20,18 +18,18 @@ import Native from './native';
class DashMedia extends Native {
constructor(element, mediaSource, options) {
super(element, mediaSource);
_player.set(this, void 0);
_events.set(this, {});
_options.set(this, {});
__classPrivateFieldSet(this, _options, options);
_DashMedia_player.set(this, void 0);
_DashMedia_events.set(this, {});
_DashMedia_options.set(this, {});
__classPrivateFieldSet(this, _DashMedia_options, options, "f");
this.promise = (typeof dashjs === 'undefined') ?
loadScript('https://cdn.dashjs.org/latest/dash.all.min.js') :
new Promise(resolve => {
resolve({});
});
this.promise.then(() => {
__classPrivateFieldSet(this, _player, dashjs.MediaPlayer().create());
this.instance = __classPrivateFieldGet(this, _player);
__classPrivateFieldSet(this, _DashMedia_player, dashjs.MediaPlayer().create(), "f");
this.instance = __classPrivateFieldGet(this, _DashMedia_player, "f");
});
return this;
}
Expand All @@ -40,13 +38,13 @@ class DashMedia extends Native {
}
load() {
this._preparePlayer();
__classPrivateFieldGet(this, _player).attachSource(this.media.src);
__classPrivateFieldGet(this, _DashMedia_player, "f").attachSource(this.media.src);
const e = addEvent('loadedmetadata');
this.element.dispatchEvent(e);
if (!__classPrivateFieldGet(this, _events)) {
__classPrivateFieldSet(this, _events, dashjs.MediaPlayer.events);
Object.keys(__classPrivateFieldGet(this, _events)).forEach(event => {
__classPrivateFieldGet(this, _player).on(__classPrivateFieldGet(this, _events)[event], this._assign.bind(this));
if (!__classPrivateFieldGet(this, _DashMedia_events, "f")) {
__classPrivateFieldSet(this, _DashMedia_events, dashjs.MediaPlayer.events, "f");
Object.keys(__classPrivateFieldGet(this, _DashMedia_events, "f")).forEach(event => {
__classPrivateFieldGet(this, _DashMedia_player, "f").on(__classPrivateFieldGet(this, _DashMedia_events, "f")[event], this._assign.bind(this));
});
}
}
Expand All @@ -56,19 +54,19 @@ class DashMedia extends Native {
set src(media) {
if (isDashSource(media)) {
this._revoke();
__classPrivateFieldSet(this, _player, dashjs.MediaPlayer().create());
__classPrivateFieldSet(this, _DashMedia_player, dashjs.MediaPlayer().create(), "f");
this._preparePlayer();
__classPrivateFieldGet(this, _player).attachSource(media.src);
__classPrivateFieldSet(this, _events, dashjs.MediaPlayer.events);
Object.keys(__classPrivateFieldGet(this, _events)).forEach(event => {
__classPrivateFieldGet(this, _player).on(__classPrivateFieldGet(this, _events)[event], this._assign.bind(this));
__classPrivateFieldGet(this, _DashMedia_player, "f").attachSource(media.src);
__classPrivateFieldSet(this, _DashMedia_events, dashjs.MediaPlayer.events, "f");
Object.keys(__classPrivateFieldGet(this, _DashMedia_events, "f")).forEach(event => {
__classPrivateFieldGet(this, _DashMedia_player, "f").on(__classPrivateFieldGet(this, _DashMedia_events, "f")[event], this._assign.bind(this));
});
}
}
get levels() {
const levels = [];
if (__classPrivateFieldGet(this, _player)) {
const bitrates = __classPrivateFieldGet(this, _player).getBitrateInfoListFor('video');
if (__classPrivateFieldGet(this, _DashMedia_player, "f")) {
const bitrates = __classPrivateFieldGet(this, _DashMedia_player, "f").getBitrateInfoListFor('video');
if (bitrates.length) {
bitrates.forEach((item) => {
if (bitrates[item]) {
Expand All @@ -87,15 +85,15 @@ class DashMedia extends Native {
}
set level(level) {
if (level === 0) {
__classPrivateFieldGet(this, _player).setAutoSwitchQuality(true);
__classPrivateFieldGet(this, _DashMedia_player, "f").setAutoSwitchQuality(true);
}
else {
__classPrivateFieldGet(this, _player).setAutoSwitchQuality(false);
__classPrivateFieldGet(this, _player).setQualityFor('video', level);
__classPrivateFieldGet(this, _DashMedia_player, "f").setAutoSwitchQuality(false);
__classPrivateFieldGet(this, _DashMedia_player, "f").setQualityFor('video', level);
}
}
get level() {
return __classPrivateFieldGet(this, _player) ? __classPrivateFieldGet(this, _player).getQualityFor('video') : -1;
return __classPrivateFieldGet(this, _DashMedia_player, "f") ? __classPrivateFieldGet(this, _DashMedia_player, "f").getQualityFor('video') : -1;
}
_assign(event) {
if (event.type === 'error') {
Expand All @@ -114,17 +112,17 @@ class DashMedia extends Native {
}
}
_revoke() {
if (__classPrivateFieldGet(this, _events)) {
Object.keys(__classPrivateFieldGet(this, _events)).forEach(event => {
__classPrivateFieldGet(this, _player).off(__classPrivateFieldGet(this, _events)[event], this._assign.bind(this));
if (__classPrivateFieldGet(this, _DashMedia_events, "f")) {
Object.keys(__classPrivateFieldGet(this, _DashMedia_events, "f")).forEach(event => {
__classPrivateFieldGet(this, _DashMedia_player, "f").off(__classPrivateFieldGet(this, _DashMedia_events, "f")[event], this._assign.bind(this));
});
__classPrivateFieldSet(this, _events, []);
__classPrivateFieldSet(this, _DashMedia_events, [], "f");
}
__classPrivateFieldGet(this, _player).reset();
__classPrivateFieldGet(this, _DashMedia_player, "f").reset();
}
_preparePlayer() {
if (typeof __classPrivateFieldGet(this, _player).getDebug().setLogToBrowserConsole === 'undefined') {
__classPrivateFieldGet(this, _player).updateSettings({
if (typeof __classPrivateFieldGet(this, _DashMedia_player, "f").getDebug().setLogToBrowserConsole === 'undefined') {
__classPrivateFieldGet(this, _DashMedia_player, "f").updateSettings({
debug: {
logLevel: dashjs.Debug.LOG_LEVEL_NONE,
},
Expand All @@ -135,20 +133,20 @@ class DashMedia extends Native {
});
}
else {
__classPrivateFieldGet(this, _player).getDebug().setLogToBrowserConsole(false);
__classPrivateFieldGet(this, _player).setScheduleWhilePaused(false);
__classPrivateFieldGet(this, _player).setFastSwitchEnabled(true);
__classPrivateFieldGet(this, _DashMedia_player, "f").getDebug().setLogToBrowserConsole(false);
__classPrivateFieldGet(this, _DashMedia_player, "f").setScheduleWhilePaused(false);
__classPrivateFieldGet(this, _DashMedia_player, "f").setFastSwitchEnabled(true);
}
__classPrivateFieldGet(this, _player).initialize();
__classPrivateFieldGet(this, _player).attachView(this.element);
__classPrivateFieldGet(this, _player).setAutoPlay(false);
if (__classPrivateFieldGet(this, _options) && typeof __classPrivateFieldGet(this, _options).drm === 'object' && Object.keys(__classPrivateFieldGet(this, _options).drm).length) {
__classPrivateFieldGet(this, _player).setProtectionData(__classPrivateFieldGet(this, _options).drm);
if (__classPrivateFieldGet(this, _options).robustnessLevel && __classPrivateFieldGet(this, _options).robustnessLevel) {
__classPrivateFieldGet(this, _player).getProtectionController().setRobustnessLevel(__classPrivateFieldGet(this, _options).robustnessLevel);
__classPrivateFieldGet(this, _DashMedia_player, "f").initialize();
__classPrivateFieldGet(this, _DashMedia_player, "f").attachView(this.element);
__classPrivateFieldGet(this, _DashMedia_player, "f").setAutoPlay(false);
if (__classPrivateFieldGet(this, _DashMedia_options, "f") && typeof __classPrivateFieldGet(this, _DashMedia_options, "f").drm === 'object' && Object.keys(__classPrivateFieldGet(this, _DashMedia_options, "f").drm).length) {
__classPrivateFieldGet(this, _DashMedia_player, "f").setProtectionData(__classPrivateFieldGet(this, _DashMedia_options, "f").drm);
if (__classPrivateFieldGet(this, _DashMedia_options, "f").robustnessLevel && __classPrivateFieldGet(this, _DashMedia_options, "f").robustnessLevel) {
__classPrivateFieldGet(this, _DashMedia_player, "f").getProtectionController().setRobustnessLevel(__classPrivateFieldGet(this, _DashMedia_options, "f").robustnessLevel);
}
}
}
}
_player = new WeakMap(), _events = new WeakMap(), _options = new WeakMap();
_DashMedia_player = new WeakMap(), _DashMedia_events = new WeakMap(), _DashMedia_options = new WeakMap();
export default DashMedia;

0 comments on commit c08b8d7

Please sign in to comment.