@cycjimmy/jsmpeg-player 5.0.1 → 5.1.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/README.md +0 -4
- package/dist/jsmpeg-player.cjs.js +30 -76
- package/dist/jsmpeg-player.esm.js +31 -77
- package/dist/jsmpeg-player.umd.js +33 -79
- package/dist/jsmpeg-player.umd.min.js +3 -3
- package/package.json +23 -23
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
[![Release date][release-date-image]][release-url]
|
|
8
8
|
[![rollup][rollup-image]][rollup-url]
|
|
9
9
|
[![semantic-release][semantic-image]][semantic-url]
|
|
10
|
-
[![jest][jest-image]][jest-url]
|
|
11
10
|
[![npm license][license-image]][download-url]
|
|
12
11
|
|
|
13
12
|
|
|
@@ -132,9 +131,6 @@ $ ffmpeg -i input.mp4 -f mpegts \
|
|
|
132
131
|
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
|
133
132
|
[semantic-url]: https://github.com/semantic-release/semantic-release
|
|
134
133
|
|
|
135
|
-
[jest-image]: https://img.shields.io/badge/tested_with-jest-99424f.svg
|
|
136
|
-
[jest-url]: https://github.com/facebook/jest
|
|
137
|
-
|
|
138
134
|
[license-image]: https://img.shields.io/npm/l/@cycjimmy/jsmpeg-player
|
|
139
135
|
|
|
140
136
|
[github-pages-url]: https://cycjimmy.github.io/jsmpeg-player/
|
|
@@ -21,73 +21,33 @@ function _extends() {
|
|
|
21
21
|
function _inheritsLoose(subClass, superClass) {
|
|
22
22
|
subClass.prototype = Object.create(superClass.prototype);
|
|
23
23
|
subClass.prototype.constructor = subClass;
|
|
24
|
-
subClass.__proto__ = superClass;
|
|
25
|
-
}
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
25
|
+
_setPrototypeOf(subClass, superClass);
|
|
29
26
|
}
|
|
30
27
|
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
function _setPrototypeOf(o, p) {
|
|
29
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
30
|
+
o.__proto__ = p;
|
|
31
|
+
return o;
|
|
32
|
+
};
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
return _setPrototypeOf(o, p);
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
Object.defineProperty(exports, "__esModule", {
|
|
38
|
-
value: true
|
|
39
|
-
});
|
|
40
|
-
exports["default"] = void 0;
|
|
41
37
|
/**
|
|
42
38
|
* determine a string type
|
|
43
39
|
* @param str
|
|
44
40
|
* @returns {boolean}
|
|
45
41
|
*/
|
|
42
|
+
var isString = (str => typeof str === 'string' && str.constructor === String);
|
|
46
43
|
|
|
47
|
-
var _default = function _default(str) {
|
|
48
|
-
return typeof str === 'string' && str.constructor === String;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
exports["default"] = _default;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
var isString$1 = unwrapExports(isString);
|
|
55
|
-
|
|
56
|
-
var isPromise = createCommonjsModule(function (module, exports) {
|
|
57
|
-
|
|
58
|
-
Object.defineProperty(exports, "__esModule", {
|
|
59
|
-
value: true
|
|
60
|
-
});
|
|
61
|
-
exports["default"] = void 0;
|
|
62
44
|
/**
|
|
63
45
|
* determine a promise type
|
|
64
46
|
* @param promise
|
|
65
47
|
* @returns {boolean}
|
|
66
48
|
*/
|
|
49
|
+
var isPromise = (promise => Object.prototype.toString.call(promise).slice(8, -1) === 'Promise');
|
|
67
50
|
|
|
68
|
-
var _default = function _default(promise) {
|
|
69
|
-
return Object.prototype.toString.call(promise).slice(8, -1) === 'Promise';
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
exports["default"] = _default;
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
unwrapExports(isPromise);
|
|
76
|
-
|
|
77
|
-
var functionToPromise = createCommonjsModule(function (module, exports) {
|
|
78
|
-
|
|
79
|
-
Object.defineProperty(exports, "__esModule", {
|
|
80
|
-
value: true
|
|
81
|
-
});
|
|
82
|
-
exports["default"] = void 0;
|
|
83
|
-
|
|
84
|
-
var _isPromise = _interopRequireDefault(isPromise);
|
|
85
|
-
|
|
86
|
-
function _interopRequireDefault(obj) {
|
|
87
|
-
return obj && obj.__esModule ? obj : {
|
|
88
|
-
"default": obj
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
51
|
/**
|
|
92
52
|
* function to promise
|
|
93
53
|
* @param normalFunction
|
|
@@ -95,26 +55,20 @@ function _interopRequireDefault(obj) {
|
|
|
95
55
|
* @returns {Promise<any>}
|
|
96
56
|
*/
|
|
97
57
|
|
|
98
|
-
|
|
99
|
-
var _default = function _default(normalFunction) {
|
|
58
|
+
var functionToPromise = (function (normalFunction) {
|
|
100
59
|
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
101
60
|
|
|
102
|
-
if ((
|
|
61
|
+
if (isPromise(normalFunction)) {
|
|
103
62
|
return normalFunction;
|
|
104
63
|
} // eslint-disable-next-line no-undef
|
|
105
64
|
|
|
106
65
|
|
|
107
|
-
return new Promise(
|
|
66
|
+
return new Promise(resolve => {
|
|
108
67
|
normalFunction();
|
|
109
68
|
setTimeout(resolve, timeout);
|
|
110
69
|
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
exports["default"] = _default;
|
|
114
70
|
});
|
|
115
71
|
|
|
116
|
-
var functionToPromise$1 = unwrapExports(functionToPromise);
|
|
117
|
-
|
|
118
72
|
function styleInject(css, ref) {
|
|
119
73
|
if (ref === void 0) ref = {};
|
|
120
74
|
var insertAt = ref.insertAt;
|
|
@@ -144,8 +98,8 @@ function styleInject(css, ref) {
|
|
|
144
98
|
}
|
|
145
99
|
}
|
|
146
100
|
|
|
147
|
-
var css_248z = ".
|
|
148
|
-
var _style = {"canvas":"
|
|
101
|
+
var css_248z = ".WJ3NAvwFY9,.ZgIIHVSSYI,.kAA8SjbHe2,.tR2-0dd-e1{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ZgIIHVSSYI{-ms-flex-pack:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center}.WJ3NAvwFY9,.tR2-0dd-e1{display:block}.tR2-0dd-e1.OueN4AU4CJ{display:none}.ZgIIHVSSYI,.kAA8SjbHe2{-webkit-tap-highlight-color:rgba(255,0,0,0);cursor:pointer;opacity:.7}.OueN4AU4CJ.ZgIIHVSSYI,.OueN4AU4CJ.kAA8SjbHe2{display:none}.ZgIIHVSSYI{z-index:10}.ZgIIHVSSYI>svg{fill:#fff;height:12vw;max-height:60px;max-width:60px;width:12vw}.kAA8SjbHe2{-ms-flex-pack:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:flex-end;justify-content:flex-end;z-index:10}.kAA8SjbHe2>svg{fill:#fff;height:9vw;margin:0 15px 15px 0;max-height:40px;max-width:40px;width:9vw}";
|
|
102
|
+
var _style = {"canvas":"WJ3NAvwFY9","poster":"tR2-0dd-e1","playButton":"ZgIIHVSSYI","unmuteButton":"kAA8SjbHe2","hidden":"OueN4AU4CJ"};
|
|
149
103
|
styleInject(css_248z);
|
|
150
104
|
|
|
151
105
|
/**
|
|
@@ -213,7 +167,7 @@ var VideoElement = /*#__PURE__*/function () {
|
|
|
213
167
|
this.player = null; // Setup canvas and play button
|
|
214
168
|
|
|
215
169
|
this.els = {
|
|
216
|
-
wrapper: isString
|
|
170
|
+
wrapper: isString(wrapper) ? document.querySelector(wrapper) : wrapper,
|
|
217
171
|
canvas: null,
|
|
218
172
|
playButton: document.createElement('div'),
|
|
219
173
|
unmuteButton: null,
|
|
@@ -234,7 +188,7 @@ var VideoElement = /*#__PURE__*/function () {
|
|
|
234
188
|
|
|
235
189
|
_proto.initCanvas = function initCanvas() {
|
|
236
190
|
if (this.options.canvas) {
|
|
237
|
-
this.els.canvas = isString
|
|
191
|
+
this.els.canvas = isString(this.options.canvas) ? document.querySelector(this.options.canvas) : this.options.canvas;
|
|
238
192
|
} else {
|
|
239
193
|
this.els.canvas = document.createElement('canvas');
|
|
240
194
|
this.els.canvas.classList.add(_style.canvas);
|
|
@@ -361,7 +315,7 @@ var VideoElement = /*#__PURE__*/function () {
|
|
|
361
315
|
}
|
|
362
316
|
|
|
363
317
|
return Promise.resolve().then(function () {
|
|
364
|
-
return functionToPromise
|
|
318
|
+
return functionToPromise(function () {
|
|
365
319
|
_this2.els.wrapper.style.width = destination.width + "px";
|
|
366
320
|
_this2.els.wrapper.style.height = destination.height + "px";
|
|
367
321
|
});
|
|
@@ -803,10 +757,10 @@ var BitBuffer = /*#__PURE__*/function () {
|
|
|
803
757
|
|
|
804
758
|
if (this.index === this.byteLength << 3 || sizeNeeded > available + bytePos // emergency evac
|
|
805
759
|
) {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
760
|
+
this.byteLength = 0;
|
|
761
|
+
this.index = 0;
|
|
762
|
+
return;
|
|
763
|
+
} else if (bytePos === 0) {
|
|
810
764
|
// Nothing read yet - we can't evict anything
|
|
811
765
|
return;
|
|
812
766
|
} // Some browsers don't support copyWithin() yet - we may have to do
|
|
@@ -988,16 +942,16 @@ var TS = /*#__PURE__*/function () {
|
|
|
988
942
|
|
|
989
943
|
var end = (this.bits.index >> 3) + 187; // eslint-disable-next-line no-unused-vars
|
|
990
944
|
|
|
991
|
-
|
|
945
|
+
this.bits.read(1);
|
|
992
946
|
var payloadStart = this.bits.read(1); // eslint-disable-next-line no-unused-vars
|
|
993
947
|
|
|
994
|
-
|
|
948
|
+
this.bits.read(1);
|
|
995
949
|
var pid = this.bits.read(13); // eslint-disable-next-line no-unused-vars
|
|
996
950
|
|
|
997
|
-
|
|
951
|
+
this.bits.read(2);
|
|
998
952
|
var adaptationField = this.bits.read(2); // eslint-disable-next-line no-unused-vars
|
|
999
953
|
|
|
1000
|
-
|
|
954
|
+
this.bits.read(4); // If this is the start of a new payload; signal the end of the previous
|
|
1001
955
|
// frame, if we didn't do so already.
|
|
1002
956
|
|
|
1003
957
|
var streamId = this.pidsToStreamIds[pid];
|
|
@@ -3102,7 +3056,7 @@ var MP2 = /*#__PURE__*/function (_BaseDecoder) {
|
|
|
3102
3056
|
|
|
3103
3057
|
var padding = this.bits.read(1); // eslint-disable-next-line no-unused-vars
|
|
3104
3058
|
|
|
3105
|
-
|
|
3059
|
+
this.bits.read(1);
|
|
3106
3060
|
var mode = this.bits.read(2); // Parse the mode_extension, set up the stereo bound
|
|
3107
3061
|
|
|
3108
3062
|
var bound = 0;
|
|
@@ -4503,7 +4457,7 @@ var WASM = /*#__PURE__*/function () {
|
|
|
4503
4457
|
|
|
4504
4458
|
next = 9; // eslint-disable-next-line no-unused-vars
|
|
4505
4459
|
|
|
4506
|
-
|
|
4460
|
+
readVarUint();
|
|
4507
4461
|
|
|
4508
4462
|
if (!matchNextBytes([6, 'd', 'y', 'l', 'i', 'n', 'k'])) {
|
|
4509
4463
|
console.warn('JSMpeg: No dylink section found in WASM');
|
|
@@ -4859,8 +4813,8 @@ var Player = /*#__PURE__*/function () {
|
|
|
4859
4813
|
} // If there's not enough data and the source is not completed, we have
|
|
4860
4814
|
// just stalled.
|
|
4861
4815
|
else if (notEnoughData && this.options.onStalled) {
|
|
4862
|
-
|
|
4863
|
-
|
|
4816
|
+
this.options.onStalled(this);
|
|
4817
|
+
}
|
|
4864
4818
|
};
|
|
4865
4819
|
|
|
4866
4820
|
return Player;
|
|
@@ -19,73 +19,33 @@ function _extends() {
|
|
|
19
19
|
function _inheritsLoose(subClass, superClass) {
|
|
20
20
|
subClass.prototype = Object.create(superClass.prototype);
|
|
21
21
|
subClass.prototype.constructor = subClass;
|
|
22
|
-
subClass.__proto__ = superClass;
|
|
23
|
-
}
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
23
|
+
_setPrototypeOf(subClass, superClass);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
function _setPrototypeOf(o, p) {
|
|
27
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
28
|
+
o.__proto__ = p;
|
|
29
|
+
return o;
|
|
30
|
+
};
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
return _setPrototypeOf(o, p);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
Object.defineProperty(exports, "__esModule", {
|
|
36
|
-
value: true
|
|
37
|
-
});
|
|
38
|
-
exports["default"] = void 0;
|
|
39
35
|
/**
|
|
40
36
|
* determine a string type
|
|
41
37
|
* @param str
|
|
42
38
|
* @returns {boolean}
|
|
43
39
|
*/
|
|
40
|
+
var isString = (str => typeof str === 'string' && str.constructor === String);
|
|
44
41
|
|
|
45
|
-
var _default = function _default(str) {
|
|
46
|
-
return typeof str === 'string' && str.constructor === String;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
exports["default"] = _default;
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var isString$1 = unwrapExports(isString);
|
|
53
|
-
|
|
54
|
-
var isPromise = createCommonjsModule(function (module, exports) {
|
|
55
|
-
|
|
56
|
-
Object.defineProperty(exports, "__esModule", {
|
|
57
|
-
value: true
|
|
58
|
-
});
|
|
59
|
-
exports["default"] = void 0;
|
|
60
42
|
/**
|
|
61
43
|
* determine a promise type
|
|
62
44
|
* @param promise
|
|
63
45
|
* @returns {boolean}
|
|
64
46
|
*/
|
|
47
|
+
var isPromise = (promise => Object.prototype.toString.call(promise).slice(8, -1) === 'Promise');
|
|
65
48
|
|
|
66
|
-
var _default = function _default(promise) {
|
|
67
|
-
return Object.prototype.toString.call(promise).slice(8, -1) === 'Promise';
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
exports["default"] = _default;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
unwrapExports(isPromise);
|
|
74
|
-
|
|
75
|
-
var functionToPromise = createCommonjsModule(function (module, exports) {
|
|
76
|
-
|
|
77
|
-
Object.defineProperty(exports, "__esModule", {
|
|
78
|
-
value: true
|
|
79
|
-
});
|
|
80
|
-
exports["default"] = void 0;
|
|
81
|
-
|
|
82
|
-
var _isPromise = _interopRequireDefault(isPromise);
|
|
83
|
-
|
|
84
|
-
function _interopRequireDefault(obj) {
|
|
85
|
-
return obj && obj.__esModule ? obj : {
|
|
86
|
-
"default": obj
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
49
|
/**
|
|
90
50
|
* function to promise
|
|
91
51
|
* @param normalFunction
|
|
@@ -93,26 +53,20 @@ function _interopRequireDefault(obj) {
|
|
|
93
53
|
* @returns {Promise<any>}
|
|
94
54
|
*/
|
|
95
55
|
|
|
96
|
-
|
|
97
|
-
var _default = function _default(normalFunction) {
|
|
56
|
+
var functionToPromise = (function (normalFunction) {
|
|
98
57
|
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
99
58
|
|
|
100
|
-
if ((
|
|
59
|
+
if (isPromise(normalFunction)) {
|
|
101
60
|
return normalFunction;
|
|
102
61
|
} // eslint-disable-next-line no-undef
|
|
103
62
|
|
|
104
63
|
|
|
105
|
-
return new Promise(
|
|
64
|
+
return new Promise(resolve => {
|
|
106
65
|
normalFunction();
|
|
107
66
|
setTimeout(resolve, timeout);
|
|
108
67
|
});
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
exports["default"] = _default;
|
|
112
68
|
});
|
|
113
69
|
|
|
114
|
-
var functionToPromise$1 = unwrapExports(functionToPromise);
|
|
115
|
-
|
|
116
70
|
function styleInject(css, ref) {
|
|
117
71
|
if (ref === void 0) ref = {};
|
|
118
72
|
var insertAt = ref.insertAt;
|
|
@@ -142,8 +96,8 @@ function styleInject(css, ref) {
|
|
|
142
96
|
}
|
|
143
97
|
}
|
|
144
98
|
|
|
145
|
-
var css_248z = ".
|
|
146
|
-
var _style = {"canvas":"
|
|
99
|
+
var css_248z = ".WJ3NAvwFY9,.ZgIIHVSSYI,.kAA8SjbHe2,.tR2-0dd-e1{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ZgIIHVSSYI{-ms-flex-pack:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:center;justify-content:center}.WJ3NAvwFY9,.tR2-0dd-e1{display:block}.tR2-0dd-e1.OueN4AU4CJ{display:none}.ZgIIHVSSYI,.kAA8SjbHe2{-webkit-tap-highlight-color:rgba(255,0,0,0);cursor:pointer;opacity:.7}.OueN4AU4CJ.ZgIIHVSSYI,.OueN4AU4CJ.kAA8SjbHe2{display:none}.ZgIIHVSSYI{z-index:10}.ZgIIHVSSYI>svg{fill:#fff;height:12vw;max-height:60px;max-width:60px;width:12vw}.kAA8SjbHe2{-ms-flex-pack:end;-ms-flex-align:end;-webkit-align-items:flex-end;align-items:flex-end;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-justify-content:flex-end;justify-content:flex-end;z-index:10}.kAA8SjbHe2>svg{fill:#fff;height:9vw;margin:0 15px 15px 0;max-height:40px;max-width:40px;width:9vw}";
|
|
100
|
+
var _style = {"canvas":"WJ3NAvwFY9","poster":"tR2-0dd-e1","playButton":"ZgIIHVSSYI","unmuteButton":"kAA8SjbHe2","hidden":"OueN4AU4CJ"};
|
|
147
101
|
styleInject(css_248z);
|
|
148
102
|
|
|
149
103
|
/**
|
|
@@ -211,7 +165,7 @@ var VideoElement = /*#__PURE__*/function () {
|
|
|
211
165
|
this.player = null; // Setup canvas and play button
|
|
212
166
|
|
|
213
167
|
this.els = {
|
|
214
|
-
wrapper: isString
|
|
168
|
+
wrapper: isString(wrapper) ? document.querySelector(wrapper) : wrapper,
|
|
215
169
|
canvas: null,
|
|
216
170
|
playButton: document.createElement('div'),
|
|
217
171
|
unmuteButton: null,
|
|
@@ -232,7 +186,7 @@ var VideoElement = /*#__PURE__*/function () {
|
|
|
232
186
|
|
|
233
187
|
_proto.initCanvas = function initCanvas() {
|
|
234
188
|
if (this.options.canvas) {
|
|
235
|
-
this.els.canvas = isString
|
|
189
|
+
this.els.canvas = isString(this.options.canvas) ? document.querySelector(this.options.canvas) : this.options.canvas;
|
|
236
190
|
} else {
|
|
237
191
|
this.els.canvas = document.createElement('canvas');
|
|
238
192
|
this.els.canvas.classList.add(_style.canvas);
|
|
@@ -359,7 +313,7 @@ var VideoElement = /*#__PURE__*/function () {
|
|
|
359
313
|
}
|
|
360
314
|
|
|
361
315
|
return Promise.resolve().then(function () {
|
|
362
|
-
return functionToPromise
|
|
316
|
+
return functionToPromise(function () {
|
|
363
317
|
_this2.els.wrapper.style.width = destination.width + "px";
|
|
364
318
|
_this2.els.wrapper.style.height = destination.height + "px";
|
|
365
319
|
});
|
|
@@ -801,10 +755,10 @@ var BitBuffer = /*#__PURE__*/function () {
|
|
|
801
755
|
|
|
802
756
|
if (this.index === this.byteLength << 3 || sizeNeeded > available + bytePos // emergency evac
|
|
803
757
|
) {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
758
|
+
this.byteLength = 0;
|
|
759
|
+
this.index = 0;
|
|
760
|
+
return;
|
|
761
|
+
} else if (bytePos === 0) {
|
|
808
762
|
// Nothing read yet - we can't evict anything
|
|
809
763
|
return;
|
|
810
764
|
} // Some browsers don't support copyWithin() yet - we may have to do
|
|
@@ -986,16 +940,16 @@ var TS = /*#__PURE__*/function () {
|
|
|
986
940
|
|
|
987
941
|
var end = (this.bits.index >> 3) + 187; // eslint-disable-next-line no-unused-vars
|
|
988
942
|
|
|
989
|
-
|
|
943
|
+
this.bits.read(1);
|
|
990
944
|
var payloadStart = this.bits.read(1); // eslint-disable-next-line no-unused-vars
|
|
991
945
|
|
|
992
|
-
|
|
946
|
+
this.bits.read(1);
|
|
993
947
|
var pid = this.bits.read(13); // eslint-disable-next-line no-unused-vars
|
|
994
948
|
|
|
995
|
-
|
|
949
|
+
this.bits.read(2);
|
|
996
950
|
var adaptationField = this.bits.read(2); // eslint-disable-next-line no-unused-vars
|
|
997
951
|
|
|
998
|
-
|
|
952
|
+
this.bits.read(4); // If this is the start of a new payload; signal the end of the previous
|
|
999
953
|
// frame, if we didn't do so already.
|
|
1000
954
|
|
|
1001
955
|
var streamId = this.pidsToStreamIds[pid];
|
|
@@ -3100,7 +3054,7 @@ var MP2 = /*#__PURE__*/function (_BaseDecoder) {
|
|
|
3100
3054
|
|
|
3101
3055
|
var padding = this.bits.read(1); // eslint-disable-next-line no-unused-vars
|
|
3102
3056
|
|
|
3103
|
-
|
|
3057
|
+
this.bits.read(1);
|
|
3104
3058
|
var mode = this.bits.read(2); // Parse the mode_extension, set up the stereo bound
|
|
3105
3059
|
|
|
3106
3060
|
var bound = 0;
|
|
@@ -4501,7 +4455,7 @@ var WASM = /*#__PURE__*/function () {
|
|
|
4501
4455
|
|
|
4502
4456
|
next = 9; // eslint-disable-next-line no-unused-vars
|
|
4503
4457
|
|
|
4504
|
-
|
|
4458
|
+
readVarUint();
|
|
4505
4459
|
|
|
4506
4460
|
if (!matchNextBytes([6, 'd', 'y', 'l', 'i', 'n', 'k'])) {
|
|
4507
4461
|
console.warn('JSMpeg: No dylink section found in WASM');
|
|
@@ -4857,8 +4811,8 @@ var Player = /*#__PURE__*/function () {
|
|
|
4857
4811
|
} // If there's not enough data and the source is not completed, we have
|
|
4858
4812
|
// just stalled.
|
|
4859
4813
|
else if (notEnoughData && this.options.onStalled) {
|
|
4860
|
-
|
|
4861
|
-
|
|
4814
|
+
this.options.onStalled(this);
|
|
4815
|
+
}
|
|
4862
4816
|
};
|
|
4863
4817
|
|
|
4864
4818
|
return Player;
|
|
@@ -5037,4 +4991,4 @@ var JSMpeg = {
|
|
|
5037
4991
|
WASM_BINARY_INLINED: WASM_BINARY
|
|
5038
4992
|
};
|
|
5039
4993
|
|
|
5040
|
-
export default
|
|
4994
|
+
export { JSMpeg as default };
|