jmuxer 2.0.4 → 2.0.6

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.
@@ -0,0 +1,13 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <JSCodeStyleSettings version="0">
4
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
5
+ <option name="USE_DOUBLE_QUOTES" value="false" />
6
+ <option name="FORCE_QUOTE_STYlE" value="true" />
7
+ </JSCodeStyleSettings>
8
+ <codeStyleSettings language="JavaScript">
9
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
10
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
11
+ </codeStyleSettings>
12
+ </code_scheme>
13
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
package/.idea/misc.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager">
4
+ <output url="file://$PROJECT_DIR$/out" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/jmuxer.iml" filepath="$PROJECT_DIR$/.idea/jmuxer.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
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/2024.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,24 @@ 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
+ *onData* - function. Will be called when muxed data is ready to be used. First argument is the muxed data.
44
+
45
+ *onError* - function. Will be fired if jMuxer encounters any buffer related errors.
46
+
47
+ *onMissingVideoFrames* - function. Will be fired if jMuxer encounters any missing video frames.
48
+
49
+ *onMissingAudioFrames* - function. Will be fired if jMuxer encounters any missing audio frames.
44
50
 
45
51
  *debug* - true/false. Will print debug log in browser console. Default is false.
46
52
 
47
53
  **Complete example:**
48
54
 
49
55
  ```html
50
-
56
+
51
57
  <script type="text/javascript" src="dist/jmuxer.min.js"></script>
52
-
58
+
53
59
  <video id="player"></video>
54
-
60
+
55
61
  <script>
56
62
  var jmuxer = new JMuxer({
57
63
  node: 'player',
@@ -65,7 +71,7 @@ Available options are:
65
71
  video: video,
66
72
  duration: duration
67
73
  });
68
-
74
+
69
75
  </script>
70
76
 
71
77
  ```
@@ -78,6 +84,8 @@ Media dataObject may have following properties:
78
84
 
79
85
  *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
86
 
87
+ *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.
88
+
81
89
  **ES6 Example:**
82
90
 
83
91
  Install module through `npm`
@@ -92,7 +100,7 @@ const jmuxer = new JMuxer({
92
100
  node: 'player',
93
101
  debug: true
94
102
  });
95
-
103
+
96
104
  /* Now feed media data using feed method. audio and video is buffer data and duration is in milliseconds */
97
105
  jmuxer.feed({
98
106
  audio: audio,
@@ -115,13 +123,29 @@ const jmuxer = new JMuxer({
115
123
  debug: true
116
124
  });
117
125
 
118
- /*
126
+ /*
119
127
  Stream in Object mode. Please check the example file for more details
120
128
  */
121
129
  let h264_feeder = getFeederStreamSomehow();
122
130
  let http_or_ws_or_any = getWritterStreamSomehow();
123
131
  h264_feeder.pipe(jmuxer.createStream()).pipe(http_or_ws_or_any);
124
132
 
133
+
134
+ // OR another way
135
+
136
+ const jmuxer = new JMuxer({
137
+ onData: function(data) {
138
+ res.write(data); // send data to client
139
+ }
140
+ debug: true
141
+ });
142
+
143
+ jmuxer.feed({
144
+ audio: audio,
145
+ video: video,
146
+ duration: duration
147
+ }); // feed data
148
+
125
149
  ```
126
150
 
127
151
  **Available Methods**
@@ -135,12 +159,12 @@ h264_feeder.pipe(jmuxer.createStream()).pipe(http_or_ws_or_any);
135
159
 
136
160
  **Typescript definition**
137
161
 
138
-
162
+
139
163
  npm install --save @types/jmuxer
140
164
 
141
-
165
+
142
166
  **Compatibility**
143
-
167
+
144
168
  compatible with browsers supporting MSE with 'video/MP4. it is supported on:
145
169
 
146
170
  * Chrome for Android 34+
@@ -200,7 +224,7 @@ A distribution version is available inside *dist* directory. However, if you nee
200
224
 
201
225
  Support
202
226
  -----------
203
- If the project helps you, [buy me a cup of coffee!](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=USD&business=payment2ocm@gmail.com&item_name=donation%20for%20jMuxer)
227
+ If the project helps you, [buy me a cup of coffee!](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=USD&business=samir@ascendtechnologies.net&item_name=donation%20for%20jMuxer)
204
228
 
205
229
  Credits
206
230
  -----------