hr-design-system-handlebars 0.120.5 → 0.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/chromatic.yml +1 -6
- package/CHANGELOG.md +16 -0
- package/dist/assets/index.css +3 -6
- package/dist/assets/js/components/mediaplayer/ardPlayerLoader.subfeature.js +5 -1
- package/dist/assets/vendor/ardplayer/ardplayer-hr-6.3.11.79310671.css +2 -0
- package/dist/assets/vendor/ardplayer/ardplayer-hr-6.3.11.c442fe17.js +6 -0
- package/dist/assets/vendor/ardplayer/ardplayer-libimsc.304b8154.chunk.js +12 -0
- package/dist/assets/vendor/ardplayer/ardplayer-pluginchromecast.68c280ed.chunk.js +1 -0
- package/dist/assets/vendor/ardplayer/ardplayer-plugindash.a7275c59.chunk.js +1174 -0
- package/dist/assets/vendor/ardplayer/ardplayer-pluginhls.f615d5a2.chunk.js +365 -0
- package/dist/assets/vendor/ardplayer/ardplayer-pluginhtmla.d04cedbb.chunk.js +1 -0
- package/dist/assets/vendor/ardplayer/ardplayer-pluginhtmlv.866c1fbf.chunk.js +1 -0
- package/dist/assets/vendor/ardplayer/ardplayer-sandlibrary.a58cd041.chunk.js +0 -0
- package/package.json +1 -1
- package/src/assets/fixtures/audio/audios.inc.json +6 -6
- package/src/assets/fixtures/video/videos.inc.json +5 -4
- package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.11.79310671.css +2 -0
- package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.11.c442fe17.js +6 -0
- package/src/assets/vendor/ardplayer/ardplayer-libimsc.304b8154.chunk.js +12 -0
- package/src/assets/vendor/ardplayer/ardplayer-pluginchromecast.68c280ed.chunk.js +1 -0
- package/src/assets/vendor/ardplayer/ardplayer-plugindash.a7275c59.chunk.js +1174 -0
- package/src/assets/vendor/ardplayer/ardplayer-pluginhls.f615d5a2.chunk.js +365 -0
- package/src/assets/vendor/ardplayer/ardplayer-pluginhtmla.d04cedbb.chunk.js +1 -0
- package/src/assets/vendor/ardplayer/ardplayer-pluginhtmlv.866c1fbf.chunk.js +1 -0
- package/src/assets/vendor/ardplayer/ardplayer-sandlibrary.a58cd041.chunk.js +0 -0
- package/src/stories/views/components/mediaplayer/ardPlayerLoader.subfeature.js +5 -1
- package/src/stories/views/components/teaser/fixtures/cluster_teaser_Podcast_Channel.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_audio.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_live.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_video.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_audio.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_live.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_video.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_audio.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_live.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_video.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_group_100 copy.json +726 -1
- package/src/stories/views/components/teaser/fixtures/teaser_group_100.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_group_100_highlight.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_group_100_highlight_2.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_group_related_content_100.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_index.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_podcast.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_podcast_50.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_podcast_playlist.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_podcast_playlist_50.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_audio.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_audio_livestream.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_live.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_podcast.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_video.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_audio.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_audio_livestream.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_live.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_podcast.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_video.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_tabbox.json +1 -1
- package/dist/assets/vendor/ardplayer/ardplayer-hr-6.3.4.4fc164e9.css +0 -7497
- package/dist/assets/vendor/ardplayer/ardplayer-hr-6.3.4.8ea4ea3d.js +0 -6322
- package/dist/assets/vendor/ardplayer/ardplayer-libimsc.179db74a.chunk.js +0 -444
- package/dist/assets/vendor/ardplayer/ardplayer-pluginhtmlv.4f6a1291.chunk.js +0 -27
- package/dist/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast.1fb1b290.chunk.js +0 -27
- package/dist/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast~plugindash~pluginhls~pluginhtmla~pluginhtmlv.a52f1cc9.chunk.js +0 -27
- package/dist/assets/vendor/ardplayer/ardplayer-vendors~plugindash.446f5c07.chunk.js +0 -38
- package/dist/assets/vendor/ardplayer/ardplayer-vendors~pluginhls.ab9656f5.chunk.js +0 -38
- package/dist/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla.aadd9d24.chunk.js +0 -27
- package/dist/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla~pluginhtmlv.08e5de97.chunk.js +0 -15
- package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.4fc164e9.css +0 -7497
- package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.8ea4ea3d.js +0 -6322
- package/src/assets/vendor/ardplayer/ardplayer-libimsc.179db74a.chunk.js +0 -444
- package/src/assets/vendor/ardplayer/ardplayer-pluginhtmlv.4f6a1291.chunk.js +0 -27
- package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast.1fb1b290.chunk.js +0 -27
- package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast~plugindash~pluginhls~pluginhtmla~pluginhtmlv.a52f1cc9.chunk.js +0 -27
- package/src/assets/vendor/ardplayer/ardplayer-vendors~plugindash.446f5c07.chunk.js +0 -38
- package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhls.ab9656f5.chunk.js +0 -38
- package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla.aadd9d24.chunk.js +0 -27
- package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla~pluginhtmlv.08e5de97.chunk.js +0 -15
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
(window["webpackJsonpardplayer"] = window["webpackJsonpardplayer"] || []).push([["vendors~pluginhtmla"],{
|
|
2
|
-
|
|
3
|
-
/***/ "./app/extensions/plugins/html-audio/PluginHTMLAudioLibrary.ts":
|
|
4
|
-
/*!*********************************************************************!*\
|
|
5
|
-
!*** ./app/extensions/plugins/html-audio/PluginHTMLAudioLibrary.ts ***!
|
|
6
|
-
\*********************************************************************/
|
|
7
|
-
/*! exports provided: default */
|
|
8
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9
|
-
|
|
10
|
-
"use strict";
|
|
11
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _logic_HtmlAudioCtrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./logic/HtmlAudioCtrl */ \"./app/extensions/plugins/html-audio/logic/HtmlAudioCtrl.ts\");\n/* harmony import */ var _MediaElementGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../MediaElementGenerator */ \"./app/extensions/plugins/MediaElementGenerator.ts\");\n\n\nvar exports = {\n Generator: _MediaElementGenerator__WEBPACK_IMPORTED_MODULE_1__[\"DefaultMediaElementGenerator\"],\n Controller: _logic_HtmlAudioCtrl__WEBPACK_IMPORTED_MODULE_0__[\"HtmlAudioCtrl\"]\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (exports);\n\n//# sourceURL=webpack://ardplayer/./app/extensions/plugins/html-audio/PluginHTMLAudioLibrary.ts?");
|
|
12
|
-
|
|
13
|
-
/***/ }),
|
|
14
|
-
|
|
15
|
-
/***/ "./app/extensions/plugins/html-audio/logic/HtmlAudioCtrl.ts":
|
|
16
|
-
/*!******************************************************************!*\
|
|
17
|
-
!*** ./app/extensions/plugins/html-audio/logic/HtmlAudioCtrl.ts ***!
|
|
18
|
-
\******************************************************************/
|
|
19
|
-
/*! exports provided: HtmlAudioCtrl */
|
|
20
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
21
|
-
|
|
22
|
-
"use strict";
|
|
23
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HtmlAudioCtrl\", function() { return HtmlAudioCtrl; });\n/* harmony import */ var _controller_AbstractPlayerCtrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../controller/AbstractPlayerCtrl */ \"./app/controller/AbstractPlayerCtrl.ts\");\n/* harmony import */ var _utils_DVRUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../utils/DVRUtil */ \"./app/utils/DVRUtil.ts\");\n/* harmony import */ var _model_PlayerModel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../model/PlayerModel */ \"./app/model/PlayerModel.ts\");\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../.. */ \"./app/index.ts\");\n/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../utils/Utils */ \"./app/utils/Utils.ts\");\n/* harmony import */ var _utils_Decorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../utils/Decorators */ \"./app/utils/Decorators.ts\");\nvar __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\nvar __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n 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\");\n return kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;\n};\n\nvar __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n 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\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\n\nvar _HtmlAudioCtrl_lastTimeupdate, _HtmlAudioCtrl_forcedBuffering;\n\n\n\n\n\n\n\nvar HtmlAudioCtrl = class HtmlAudioCtrl extends _controller_AbstractPlayerCtrl__WEBPACK_IMPORTED_MODULE_0__[\"AbstractPlayerCtrl\"] {\n constructor(player, htmlPlayer) {\n super(player, htmlPlayer);\n\n _HtmlAudioCtrl_lastTimeupdate.set(this, 0);\n\n _HtmlAudioCtrl_forcedBuffering.set(this, false);\n\n this.streamResetUrl = 'javascript:void(0)'; // avoid the browser trying to resolve hostname as new sorce\n\n var isSafari = navigator.userAgent.match(/Safari/i) && !navigator.userAgent.match(/Chrome/i);\n\n if (isSafari && this.mc.isLive && this.pc.generic.isDvrEnabled) {\n this.dvrUtil = new _utils_DVRUtil__WEBPACK_IMPORTED_MODULE_1__[\"DVRUtil\"](player, htmlPlayer, this);\n }\n }\n\n addSource(stream) {\n var _a, _b;\n\n (_b = (_a = this.player) === null || _a === void 0 ? void 0 : _a.pixelController) === null || _b === void 0 ? void 0 : _b.loadStream(stream.url);\n var stl = stream.url.toLowerCase(); // for iOS we nee to add the #t= param to the stream to perform our initial seek\n\n if (___WEBPACK_IMPORTED_MODULE_3__[\"Environment\"].instance.browserIsSafari && this._pendingSeek > 0) {\n stream.url += \"#t=\" + this._pendingSeek;\n this._pendingSeek = 0;\n this.__seeking = true;\n }\n\n var createdMappedSource = mimetype => {\n var source = document.createElement('source');\n source.src = stream.url;\n source.type = mimetype;\n this.mediaElement.appendChild(source);\n this.emap.map(source, 'error', this.onSourceError, this);\n };\n\n switch (true) {\n case stl.indexOf('.mp3') > 0:\n createdMappedSource('audio/mpeg');\n break;\n\n case stl.indexOf('.ogg') > 0:\n createdMappedSource('audio/ogg');\n break;\n\n case stl.indexOf('.wav') > 0:\n createdMappedSource('audio/x-wav');\n break;\n\n case stl.indexOf('.m3u8') > 0:\n createdMappedSource('audio/x-mpegurl');\n break;\n\n case !Object(_utils_Utils__WEBPACK_IMPORTED_MODULE_4__[\"isBlank\"])(stream.mimeType):\n createdMappedSource(stream.mimeType);\n break;\n\n default:\n this.handleError(\"Unknown mimetype \\\"\" + stream.mimeType + \"\\\" for stream \" + stl);\n break;\n }\n\n if (this.dvrUtil) {\n this.dvrUtil.initStream(stream.url);\n }\n }\n /**\r\n * hls special: seek to live playhead for non-dvr enabled liveclips.\r\n * @inheritDoc\r\n */\n\n\n play() {\n // if the livestream is paused and has no dvr capabilities,\n // seek to live position as we do not want to play in cache\n // to prevent buffer holes.\n if (this.isNonDvrLive() && this.model.playstate === _model_PlayerModel__WEBPACK_IMPORTED_MODULE_2__[\"PlayerModel\"].PLAYSTATE_PAUSED) {\n this.seekToLive();\n }\n\n __classPrivateFieldSet(this, _HtmlAudioCtrl_lastTimeupdate, Date.now(), \"f\");\n\n __classPrivateFieldSet(this, _HtmlAudioCtrl_forcedBuffering, false, \"f\");\n\n super.play();\n }\n\n isNonDvrLive() {\n return this.mc.isLive && !this.mediaElement.webkitCurrentPlaybackTargetIsWireless && // not for airplay\n !this.pc.generic.isDvrEnabled;\n }\n\n pause() {\n if (this.isNonDvrLive()) {\n var currSource = this.mediaElement.querySelector('source');\n\n if (currSource) {\n console.info('stopping non-dvr live stream'); // remove error handler, we will be causing errors shortly\n\n this.emap.unmap(currSource, 'error', this.onSourceError, this); // store the important info\n\n currSource.dataset.src = currSource.src;\n currSource.dataset.type = currSource.type; // replace it with definite locally-resolved error\n\n currSource.src = this.streamResetUrl;\n currSource.type = 'void';\n this.mediaElement.pause(); // after pause is done, reload and _stop stream_ via the error configured above\n\n this.player.safeTimeout(() => {\n this.mediaElement.load();\n }); // skip super impl\n\n return;\n }\n } // no special case -> call super\n\n\n super.pause();\n }\n\n seekToLive() {\n var _a, _b;\n\n if (this.isNonDvrLive()) {\n var currSource = this.mediaElement.querySelector('source');\n\n if (currSource && currSource.src === this.streamResetUrl) {\n // check if the reset-url is set just to make doubly sure\n console.info('seekToLive on non-dvr audio - reload stream');\n currSource.src = (_a = currSource.dataset.src) !== null && _a !== void 0 ? _a : '';\n currSource.type = (_b = currSource.dataset.type) !== null && _b !== void 0 ? _b : ''; // make sure the browser does not re-use the previous buffer/cache\n\n var cleanSrc = currSource.src.replace(/[?&]bufferBuster=\\d+/, '');\n currSource.src = \"\" + cleanSrc + (cleanSrc.includes('?') ? '&' : '?') + \"bufferBuster=\" + Date.now(); // restore error event handler and start loading\n\n this.emap.map(currSource, 'error', this.onSourceError, this);\n this.mediaElement.load(); // skip super implementation\n\n return;\n }\n }\n\n super.seekToLive();\n }\n /**\r\n * @inheritDoc\r\n */\n\n\n onTimeUpdate() {\n __classPrivateFieldSet(this, _HtmlAudioCtrl_lastTimeupdate, Date.now(), \"f\");\n }\n /**\r\n * @inheritDoc\r\n */\n\n\n updateTicker() {\n super.updateTicker(); // no time updates since 2 sec\n\n if (this.model.playstate === _model_PlayerModel__WEBPACK_IMPORTED_MODULE_2__[\"PlayerModel\"].PLAYSTATE_PLAYING && Date.now() - __classPrivateFieldGet(this, _HtmlAudioCtrl_lastTimeupdate, \"f\") > 2000) {\n __classPrivateFieldSet(this, _HtmlAudioCtrl_forcedBuffering, true, \"f\"); // force buffering\n\n\n this.bufferingEventHandler(true);\n } else {\n // and reverse it if we are back on time\n if (__classPrivateFieldGet(this, _HtmlAudioCtrl_forcedBuffering, \"f\")) {\n // force un-buffer\n this.bufferingEventHandler(false);\n }\n }\n }\n\n getClassTypeString() {\n return 'HtmlAudioCtrl';\n }\n\n getDvrToDateSync() {\n if (this.dvrUtil) {\n return this.dvrUtil.dvrToDateSync;\n }\n\n return null;\n }\n\n getCurrentTime() {\n if (this.dvrUtil) {\n return this.dvrUtil.getVideoTime();\n }\n\n return super.getCurrentTime();\n }\n\n getDuration() {\n if (this.dvrUtil) {\n return this.dvrUtil.getCurrentDuration();\n }\n\n return super.getDuration();\n }\n\n setTimeByPercent(percent) {\n if (this.dvrUtil) {\n var targetTime = percent / 100 * this.dvrUtil.getCurrentDuration();\n\n if (percent > 99.9) {\n this.dvrUtil.seekToLive();\n } else {\n this.dvrUtil.seek(targetTime);\n }\n\n return targetTime;\n } else {\n return super.setTimeByPercent(percent);\n }\n }\n\n setCurrentTime(seconds, preventPlay, preventSeek, isSubclipSeek) {\n if (preventPlay === void 0) {\n preventPlay = false;\n }\n\n if (preventSeek === void 0) {\n preventSeek = false;\n }\n\n if (isSubclipSeek === void 0) {\n isSubclipSeek = false;\n }\n\n // if seconds are detected as UTC Timestamp, we need to convert them to a relative (seekable) time.\n if (this.dvrUtil && seconds >= this.dvrRelToUnix(0)) {\n seconds = this.dvrUnixToRel(seconds); // switch format\n }\n\n var performSeekToTime = Math.min(seconds, this.getDuration() - 0.1);\n return super.setCurrentTime(performSeekToTime, preventPlay, preventSeek, isSubclipSeek);\n }\n\n getAudioTrack() {\n var _a;\n\n var playing = this.player.currentAudio;\n return playing ? {\n id: '0',\n label: playing.kind,\n enabled: true,\n language: (_a = playing === null || playing === void 0 ? void 0 : playing.languageCode) !== null && _a !== void 0 ? _a : 'de'\n } : null;\n }\n\n getAudioTracks() {\n var curr = this.getAudioTrack();\n return curr ? [curr] : [];\n }\n\n setAudioTrack(audioTrack) {}\n\n setAudioTrackById(id) {}\n\n dispose() {\n super.dispose();\n\n if (this.dvrUtil) {\n this.dvrUtil.dispose();\n }\n }\n\n};\n_HtmlAudioCtrl_lastTimeupdate = new WeakMap(), _HtmlAudioCtrl_forcedBuffering = new WeakMap();\nHtmlAudioCtrl = __decorate([_utils_Decorators__WEBPACK_IMPORTED_MODULE_5__[\"sealed\"]], HtmlAudioCtrl);\n\n\n//# sourceURL=webpack://ardplayer/./app/extensions/plugins/html-audio/logic/HtmlAudioCtrl.ts?");
|
|
24
|
-
|
|
25
|
-
/***/ })
|
|
26
|
-
|
|
27
|
-
}]);
|
package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla~pluginhtmlv.08e5de97.chunk.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
(window["webpackJsonpardplayer"] = window["webpackJsonpardplayer"] || []).push([["vendors~pluginhtmla~pluginhtmlv"],{
|
|
2
|
-
|
|
3
|
-
/***/ "./app/utils/DVRUtil.ts":
|
|
4
|
-
/*!******************************!*\
|
|
5
|
-
!*** ./app/utils/DVRUtil.ts ***!
|
|
6
|
-
\******************************/
|
|
7
|
-
/*! exports provided: DVRUtil */
|
|
8
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9
|
-
|
|
10
|
-
"use strict";
|
|
11
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DVRUtil\", function() { return DVRUtil; });\n/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils */ \"./app/utils/Utils.ts\");\n/* harmony import */ var emap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! emap */ \"../emap/js/emap.js\");\n/* harmony import */ var emap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(emap__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Decorators */ \"./app/utils/Decorators.ts\");\nvar __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nvar __classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n 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\");\n return kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;\n};\n\nvar __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n 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\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\n\nvar _DVRUtil_masterUrl, _DVRUtil_masterManifest, _DVRUtil_segmentsManifest, _DVRUtil_manifestTimeout, _DVRUtil_lastDispatched;\n\n\n\n\nvar DVRUtil = class DVRUtil {\n constructor(player, mediaElement, playerCtrl) {\n this.hasDvr = false;\n this.endTime = 0;\n this.lastSegmentIndex = 0;\n this.lastCurrentTime = 0;\n this.lastDuration = 0;\n this.dvrDuration = 0;\n this.durationDelta = 0;\n this.segmentDuration = 0;\n this.liveSyncDurationCount = 3;\n this.lastMediaSequence = null;\n this.lastNumSegments = 0;\n this.growingWindow = false;\n this.initialTimestamp = 0;\n this.dvrData = null;\n this.dvrToDateSync = null;\n\n _DVRUtil_masterUrl.set(this, '');\n\n _DVRUtil_masterManifest.set(this, null);\n\n _DVRUtil_segmentsManifest.set(this, null);\n\n _DVRUtil_manifestTimeout.set(this, -1);\n\n _DVRUtil_lastDispatched.set(this, null);\n\n this.player = player;\n this.mediaElement = mediaElement;\n this.playerCtrl = playerCtrl;\n this.emap = new emap__WEBPACK_IMPORTED_MODULE_1___default.a();\n }\n\n initStream(masterUrl) {\n __classPrivateFieldSet(this, _DVRUtil_masterUrl, masterUrl, \"f\");\n\n this.loadManifest(masterUrl, true, manifest => {\n __classPrivateFieldSet(this, _DVRUtil_masterManifest, manifest, \"f\");\n\n this.loadManifest(this.getSegmentsUrl(), false, manifest => {\n __classPrivateFieldSet(this, _DVRUtil_segmentsManifest, manifest, \"f\");\n\n this.hasDvr = manifest.isLive || manifest.duration > 60; // init endTime -> endTime is growing over time (not constantly equal to manifest.duration)\n\n this.endTime = manifest.duration;\n this.dvrDuration = manifest.duration;\n this.segmentDuration = manifest.targetDuration;\n this.hasDvr = manifest.isLive || manifest.duration > 60;\n this.initialTimestamp = Math.floor(Date.now() / 1000);\n this.lastSegmentIndex = manifest.segmentsList[manifest.segmentsList.length - 1].index;\n this.emap.map(this.mediaElement, 'timeupdate', this.handleVideoTimeUpdate, this);\n this.emap.map(this.mediaElement, 'durationchange', this.handleVideoDurationChange, this);\n this.dispatchDVRInfo();\n this.startManifestTimeout();\n });\n });\n }\n\n getSegmentsUrl() {\n var _a, _b;\n\n var url = (_b = (_a = __classPrivateFieldGet(this, _DVRUtil_masterManifest, \"f\")) === null || _a === void 0 ? void 0 : _a.streams[0].url) !== null && _b !== void 0 ? _b : '';\n\n if (Object(_Utils__WEBPACK_IMPORTED_MODULE_0__[\"isBlank\"])(__classPrivateFieldGet(this, _DVRUtil_masterUrl, \"f\")) || /^http/.test(url)) {\n return url;\n }\n\n if (!url.includes('/')) {\n var parts = __classPrivateFieldGet(this, _DVRUtil_masterUrl, \"f\").split('/');\n\n parts.pop();\n return parts.join('/') + '/' + url;\n }\n\n var urlObj = new URL(__classPrivateFieldGet(this, _DVRUtil_masterUrl, \"f\"));\n return urlObj.protocol + \"//\" + urlObj.host + url;\n }\n\n loadManifest(url, isMaster, callback) {\n fetch(url).then(response => __awaiter(this, void 0, void 0, function* () {\n return yield response.text();\n })).then(text => {\n try {\n this.player.checkState();\n } catch (e) {\n console.warn('aborting async', e);\n return;\n }\n\n var parser = new M3u8Parser(text);\n\n if (callback) {\n callback(parser.parse());\n }\n }).catch(_ => {\n var _a, _b, _c, _d;\n\n try {\n this.player.checkState();\n } catch (e) {\n console.warn('aborting async', e);\n return;\n }\n\n if (!isMaster) {\n // @ts-expect-error\n if (((_b = (_a = __classPrivateFieldGet(this, _DVRUtil_masterManifest, \"f\")) === null || _a === void 0 ? void 0 : _a.streams) === null || _b === void 0 ? void 0 : _b.length) > 1) {\n (_d = (_c = __classPrivateFieldGet(this, _DVRUtil_masterManifest, \"f\")) === null || _c === void 0 ? void 0 : _c.streams) === null || _d === void 0 ? void 0 : _d.shift();\n this.loadManifest(this.getSegmentsUrl(), false, callback);\n } else {\n this.hasDvr = false;\n clearTimeout(__classPrivateFieldGet(this, _DVRUtil_manifestTimeout, \"f\"));\n }\n } else {\n this.hasDvr = false;\n clearTimeout(__classPrivateFieldGet(this, _DVRUtil_manifestTimeout, \"f\"));\n }\n });\n }\n\n startManifestTimeout() {\n var _a, _b;\n\n clearTimeout(__classPrivateFieldGet(this, _DVRUtil_manifestTimeout, \"f\"));\n\n __classPrivateFieldSet(this, _DVRUtil_manifestTimeout, this.player.safeTimeout(() => {\n this.loadManifest(this.getSegmentsUrl(), false, manifest => {\n __classPrivateFieldSet(this, _DVRUtil_segmentsManifest, manifest, \"f\");\n\n this.hasDvr = manifest.isLive || manifest.duration > 60;\n var endTime = this.endTime;\n var i, segment;\n\n for (i = 0; i < manifest.segmentsList.length; ++i) {\n segment = manifest.segmentsList[i];\n\n if (segment.index > this.lastSegmentIndex) {\n this.endTime += segment.duration;\n }\n }\n\n this.lastSegmentIndex = manifest.segmentsList[manifest.segmentsList.length - 1].index;\n\n if (this.endTime !== endTime) {\n this.handleVideoDurationChange();\n }\n\n this.setDvrToDateSync();\n this.startManifestTimeout();\n });\n }, ((_b = (_a = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\")) === null || _a === void 0 ? void 0 : _a.targetDuration) !== null && _b !== void 0 ? _b : 5) * 1000), \"f\");\n }\n\n dispatchDVRInfo() {\n if (__classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\") !== null) {\n if (this.lastCurrentTime < Math.round(this.getVideoTime())) {\n ++this.durationDelta;\n }\n\n var start = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").firstProgTime;\n\n var end = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").lastProgTime;\n\n if (this.lastMediaSequence == null) {\n this.lastMediaSequence = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").mediaSequence;\n this.lastNumSegments = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").numSegments;\n } else {\n if (this.lastMediaSequence === __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").mediaSequence) {\n if (__classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").numSegments > this.lastNumSegments) {\n this.lastNumSegments = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\").numSegments;\n this.growingWindow = true;\n }\n } else {\n this.growingWindow = false;\n }\n }\n\n if (this.growingWindow) {\n this.dvrDuration = (end - start) / 1000;\n this.endTime = this.dvrDuration;\n }\n\n var dvrDuration = this.dvrDuration - this.segmentDuration * this.liveSyncDurationCount;\n var duration = dvrDuration + this.durationDelta;\n var time = this.getVideoTime();\n var isLive = duration - time <= this.segmentDuration * this.liveSyncDurationCount + this.segmentDuration;\n var liveTimeStamp;\n\n if (this.growingWindow) {\n liveTimeStamp = start / 1000 + this.mediaElement.currentTime;\n } else {\n liveTimeStamp = this.initialTimestamp - (this.dvrDuration - this.segmentDuration * this.liveSyncDurationCount) + this.mediaElement.currentTime;\n }\n\n this.dvrData = {\n dvrDuration: dvrDuration,\n currentTime: time,\n duration: duration,\n liveTimestamp: liveTimeStamp,\n start: start,\n end: end,\n isLive: isLive\n };\n this.setDvrToDateSync();\n }\n }\n\n setDvrToDateSync() {\n var _a, _b;\n\n var start = (_b = (_a = __classPrivateFieldGet(this, _DVRUtil_segmentsManifest, \"f\")) === null || _a === void 0 ? void 0 : _a.firstProgTime) !== null && _b !== void 0 ? _b : 0;\n var time = this.getVideoTime();\n var liveTimeStamp;\n\n if (this.growingWindow) {\n liveTimeStamp = start / 1000 + this.mediaElement.currentTime;\n } else {\n liveTimeStamp = this.initialTimestamp - this.dvrDuration + this.mediaElement.currentTime;\n }\n\n this.dvrToDateSync = {\n rel: time,\n real: liveTimeStamp * 1000,\n at: Date.now()\n };\n this.onDVRCallback();\n }\n\n getVideoTime() {\n return Math.max(0, this.mediaElement.currentTime - (this.endTime - this.dvrDuration));\n }\n\n getVideoDuration() {\n return this.endTime;\n }\n\n getCurrentDuration() {\n return this.dvrDuration - this.segmentDuration * this.liveSyncDurationCount + this.durationDelta;\n }\n\n seek(time) {\n this.mediaElement.currentTime = Math.max(1, Math.min(this.endTime, time)) + this.endTime - this.dvrDuration;\n }\n\n seekToLive() {\n // directly notify about buffering\n this.playerCtrl.bufferingEventHandler(true); // reload source to get back to live location\n\n this.mediaElement.load();\n this.initStream(__classPrivateFieldGet(this, _DVRUtil_masterUrl, \"f\"));\n }\n\n onDVRCallback() {\n var _a, _b, _c, _d, _e;\n\n if (__classPrivateFieldGet(this, _DVRUtil_lastDispatched, \"f\") !== null && __classPrivateFieldGet(this, _DVRUtil_lastDispatched, \"f\").dvrEnabled === this.hasDvr && __classPrivateFieldGet(this, _DVRUtil_lastDispatched, \"f\").dvrDuration === ((_a = this.dvrData) === null || _a === void 0 ? void 0 : _a.dvrDuration) && __classPrivateFieldGet(this, _DVRUtil_lastDispatched, \"f\").dvrIsLive === this.dvrData.isLive) {\n return; // do not repeat same data over and over again\n }\n\n __classPrivateFieldSet(this, _DVRUtil_lastDispatched, {\n dvrEnabled: this.hasDvr,\n dvrDuration: (_b = this.dvrData) === null || _b === void 0 ? void 0 : _b.dvrDuration,\n dvrIsLive: (_c = this.dvrData) === null || _c === void 0 ? void 0 : _c.isLive\n }, \"f\");\n\n this.playerCtrl.onDVRCallback(this.hasDvr, (_d = this.dvrData) === null || _d === void 0 ? void 0 : _d.dvrDuration, (_e = this.dvrData) === null || _e === void 0 ? void 0 : _e.isLive);\n }\n\n dispose() {\n this.emap.all();\n clearTimeout(__classPrivateFieldGet(this, _DVRUtil_manifestTimeout, \"f\"));\n }\n\n handleVideoTimeUpdate() {\n this.dispatchDVRInfo();\n this.lastCurrentTime = Math.round(this.getVideoTime());\n }\n\n handleVideoDurationChange() {\n var duration = Math.round(this.endTime);\n this.durationDelta = 0;\n /* some browsers reports several duration change events with almost the same value */\n\n if (this.lastDuration === duration) {\n return;\n }\n\n this.lastDuration = duration;\n this.dispatchDVRInfo();\n }\n\n};\n_DVRUtil_masterUrl = new WeakMap(), _DVRUtil_masterManifest = new WeakMap(), _DVRUtil_segmentsManifest = new WeakMap(), _DVRUtil_manifestTimeout = new WeakMap(), _DVRUtil_lastDispatched = new WeakMap();\nDVRUtil = __decorate([_Decorators__WEBPACK_IMPORTED_MODULE_2__[\"sealed\"]], DVRUtil);\n // Adapted from: https://github.com/meisterplayer/media-nativehls/blob/develop/src/js/utils/M3u8Parser.js\n\nfunction extractKeyInfo(keyLine) {\n return keyLine.replace('#EXT-X-KEY:', '') // All key value pairs are split with a ,\n .split(',').reduce((result, keyValString) => {\n // We only use the first equal sign per string\n // Otherwise we might split something in an URL.\n var firstEqualIndex = keyValString.indexOf('='); // Retrieve key value pairs.\n\n var key = keyValString.substring(0, firstEqualIndex);\n var val = keyValString.substring(firstEqualIndex + 1); // The values are displayed like: \"\"value\"\", so we remove the extra pair of \"\".\n // @ts-expect-error\n\n result[key] = val.replace(/\"/g, '');\n return result;\n }, {});\n}\n\nclass M3u8Parser {\n constructor(text) {\n this.text = text;\n }\n\n parse() {\n var lines = this.text.split('\\n');\n var result = {\n keyInfo: {},\n firstProgTime: 0,\n lastProgTime: 0,\n streams: [],\n segments: {},\n segmentsList: [],\n mediaSequence: 0,\n duration: 0,\n isLive: true,\n targetDuration: 0,\n numSegments: 0\n };\n var nextLineIsStream = false;\n var previousMediaNumber = result.mediaSequence;\n var streamInfo = {};\n var firstProgTime = 0;\n var lastProgTime = 0;\n var t;\n lines.forEach(line => {\n var _a, _b, _c, _d, _e;\n\n if (nextLineIsStream) {\n streamInfo.url = line;\n result.streams.push(streamInfo);\n streamInfo = {};\n nextLineIsStream = false;\n }\n\n if (line.indexOf('#EXT-X-PROGRAM-DATE-TIME:') === 0) {\n t = new Date(line.substr('#EXT-X-PROGRAM-DATE-TIME:'.length)).getTime();\n\n if (firstProgTime === 0) {\n firstProgTime = t;\n }\n\n lastProgTime = new Date(line.substr('#EXT-X-PROGRAM-DATE-TIME:'.length)).getTime();\n }\n\n if (line.startsWith('#EXT-X-STREAM-INF')) {\n nextLineIsStream = true;\n }\n\n if (line.startsWith('#EXT-X-ENDLIST')) {\n result.isLive = false;\n }\n\n if (line.startsWith('#EXT-X-KEY')) {\n // Extracting the URI out of the key section\n result.keyInfo = extractKeyInfo(line);\n } // #EXT-X-TARGETDURATION:10\n\n\n var matchTargetDuration = /^#EXT-X-TARGETDURATION:?(-?[0-9.]*)?/.exec(line);\n\n if (matchTargetDuration === null || matchTargetDuration === void 0 ? void 0 : matchTargetDuration[1]) {\n result.targetDuration = parseInt(matchTargetDuration[1], 10);\n } // #EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=600x338,BANDWIDTH=712704\n\n\n var matchBandwidth = /^#EXT-X-STREAM-INF:.*BANDWIDTH=(\\d*)?/.exec(line);\n\n if (((_a = matchBandwidth === null || matchBandwidth === void 0 ? void 0 : matchBandwidth[1]) !== null && _a !== void 0 ? _a : '') !== '') {\n streamInfo.bandwidth = matchBandwidth === null || matchBandwidth === void 0 ? void 0 : matchBandwidth[1];\n }\n\n var matchResolution = /^#EXT-X-STREAM-INF:.*RESOLUTION=(\\d*x\\d*)?/.exec(line);\n\n if (((_b = matchResolution === null || matchResolution === void 0 ? void 0 : matchResolution[1]) !== null && _b !== void 0 ? _b : '') !== '') {\n var resolutions = matchResolution === null || matchResolution === void 0 ? void 0 : matchResolution[1].split('x');\n\n if (!resolutions || resolutions.length < 2) {\n streamInfo.resolution = {\n width: 0,\n height: 0\n };\n } else {\n streamInfo.resolution = {\n width: parseInt(resolutions[0], 10),\n height: parseInt(resolutions[1], 10)\n };\n }\n }\n\n var matchInfo = /^#EXTINF:?([0-9.]*)?,?(.*)?/.exec(line);\n\n if (((_c = matchInfo === null || matchInfo === void 0 ? void 0 : matchInfo[1]) !== null && _c !== void 0 ? _c : '') !== '') {\n t = parseFloat((_d = matchInfo === null || matchInfo === void 0 ? void 0 : matchInfo[1]) !== null && _d !== void 0 ? _d : ''); // @ts-expect-error\n\n result.segments[previousMediaNumber] = t;\n result.segmentsList.push({\n index: previousMediaNumber,\n duration: t\n });\n previousMediaNumber += 1;\n result.duration += t;\n ++result.numSegments;\n\n if (lastProgTime !== 0) {\n lastProgTime += t * 1000;\n }\n }\n\n var matchMediaSequence = /^#EXT-X-MEDIA-SEQUENCE:?(-?[0-9.]*)?/.exec(line);\n var seq = (_e = matchMediaSequence === null || matchMediaSequence === void 0 ? void 0 : matchMediaSequence[1]) !== null && _e !== void 0 ? _e : '';\n\n if (seq !== '') {\n result.mediaSequence = parseInt(seq, 10);\n previousMediaNumber = parseInt(seq, 10);\n }\n });\n result.firstProgTime = firstProgTime;\n result.lastProgTime = lastProgTime;\n return result;\n }\n\n}\n\n//# sourceURL=webpack://ardplayer/./app/utils/DVRUtil.ts?");
|
|
12
|
-
|
|
13
|
-
/***/ })
|
|
14
|
-
|
|
15
|
-
}]);
|