jmuxer 2.0.3 → 2.0.4
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 +1 -1
- package/dist/jmuxer.min.js +1 -2811
- package/package.json +1 -1
- package/src/jmuxer.js +7 -7
package/package.json
CHANGED
package/src/jmuxer.js
CHANGED
|
@@ -19,11 +19,11 @@ export default class JMuxer extends Event {
|
|
|
19
19
|
let defaults = {
|
|
20
20
|
node: '',
|
|
21
21
|
mode: 'both', // both, audio, video
|
|
22
|
-
flushingTime:
|
|
22
|
+
flushingTime: 500,
|
|
23
23
|
maxDelay: 500,
|
|
24
24
|
clearBuffer: true,
|
|
25
25
|
fps: 30,
|
|
26
|
-
readFpsFromTrack: false, //
|
|
26
|
+
readFpsFromTrack: false, // set true to fetch fps value from NALu
|
|
27
27
|
debug: false,
|
|
28
28
|
onReady: function() {}, // function called when MSE is ready to accept frames
|
|
29
29
|
onError: function() {}, // function called when jmuxer encounters any buffer related error
|
|
@@ -325,11 +325,11 @@ export default class JMuxer extends Event {
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
cancelDelay() {
|
|
328
|
-
if (this.
|
|
329
|
-
const end = this.
|
|
330
|
-
if (end - this.
|
|
331
|
-
console.log('delay'
|
|
332
|
-
this.
|
|
328
|
+
if (this.node.buffered && this.node.buffered.length > 0 && !this.node.seeking) {
|
|
329
|
+
const end = this.node.buffered.end(0);
|
|
330
|
+
if (end - this.node.currentTime > (this.options.maxDelay / 1000)) {
|
|
331
|
+
console.log('delay');
|
|
332
|
+
this.node.currentTime = end - 0.001;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
}
|