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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmuxer",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "jMuxer - a simple javascript mp4 muxer for non-standard streaming communications protocol",
5
5
  "main": "dist/jmuxer.min.js",
6
6
  "scripts": {
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: 1500,
22
+ flushingTime: 500,
23
23
  maxDelay: 500,
24
24
  clearBuffer: true,
25
25
  fps: 30,
26
- readFpsFromTrack: false, // defaults to false to keep existing functionality
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.options.node.buffered && this.options.node.buffered.length > 0 && !this.options.node.seeking) {
329
- const end = this.options.node.buffered.end(0);
330
- if (end - this.options.node.currentTime > (this.options.maxDelay / 1000)) {
331
- console.log('delay', this.delay++);
332
- this.options.node.currentTime = end - 0.001;
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
  }