jmuxer 2.0.4 → 2.0.5

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Build Status](https://travis-ci.org/samirkumardas/jmuxer.svg?branch=master)](https://travis-ci.org/samirkumardas/jmuxer)
2
- ![Maintenance](https://img.shields.io/maintenance/yes/2021.svg)
2
+ ![Maintenance](https://img.shields.io/maintenance/yes/2022.svg)
3
3
  ![license](https://img.shields.io/github/license/mashape/apistatus.svg)
4
4
 
5
5
  jMuxer
@@ -15,10 +15,10 @@ Live Demo
15
15
  How to use?
16
16
  -------
17
17
  A distribution version is available on dist folder.
18
-
18
+
19
19
  ```html
20
20
  <script type="text/javascript" src="dist/jmuxer.min.js"></script>
21
-
21
+
22
22
  var jmuxer = new JMuxer(option);
23
23
  ```
24
24
 
@@ -40,18 +40,22 @@ Available options are:
40
40
 
41
41
  *onReady* - function. Will be called once MSE is ready.
42
42
 
43
- *onError* - function. Will be fired if jMuxer encounters any buffer error.
43
+ *onError* - function. Will be fired if jMuxer encounters any buffer related errors.
44
+
45
+ *onMissingVideoFrames* - function. Will be fired if jMuxer encounters any missing video frames.
46
+
47
+ *onMissingAudioFrames* - function. Will be fired if jMuxer encounters any missing audio frames.
44
48
 
45
49
  *debug* - true/false. Will print debug log in browser console. Default is false.
46
50
 
47
51
  **Complete example:**
48
52
 
49
53
  ```html
50
-
54
+
51
55
  <script type="text/javascript" src="dist/jmuxer.min.js"></script>
52
-
56
+
53
57
  <video id="player"></video>
54
-
58
+
55
59
  <script>
56
60
  var jmuxer = new JMuxer({
57
61
  node: 'player',
@@ -65,7 +69,7 @@ Available options are:
65
69
  video: video,
66
70
  duration: duration
67
71
  });
68
-
72
+
69
73
  </script>
70
74
 
71
75
  ```
@@ -78,6 +82,8 @@ Media dataObject may have following properties:
78
82
 
79
83
  *duration* - duration in milliseconds of the provided chunk. If duration is not provided, it will calculate frame duration wtih the provided frame rate (fps).
80
84
 
85
+ *compositionTimeOffset* - Composition time offset, difference between decode time and presentation time of frames, in milliseconds. This is only used for video and usually needed when B-frames are present in video stream.
86
+
81
87
  **ES6 Example:**
82
88
 
83
89
  Install module through `npm`
@@ -92,7 +98,7 @@ const jmuxer = new JMuxer({
92
98
  node: 'player',
93
99
  debug: true
94
100
  });
95
-
101
+
96
102
  /* Now feed media data using feed method. audio and video is buffer data and duration is in milliseconds */
97
103
  jmuxer.feed({
98
104
  audio: audio,
@@ -115,7 +121,7 @@ const jmuxer = new JMuxer({
115
121
  debug: true
116
122
  });
117
123
 
118
- /*
124
+ /*
119
125
  Stream in Object mode. Please check the example file for more details
120
126
  */
121
127
  let h264_feeder = getFeederStreamSomehow();
@@ -135,12 +141,12 @@ h264_feeder.pipe(jmuxer.createStream()).pipe(http_or_ws_or_any);
135
141
 
136
142
  **Typescript definition**
137
143
 
138
-
144
+
139
145
  npm install --save @types/jmuxer
140
146
 
141
-
147
+
142
148
  **Compatibility**
143
-
149
+
144
150
  compatible with browsers supporting MSE with 'video/MP4. it is supported on:
145
151
 
146
152
  * Chrome for Android 34+