@svta/cml-id3 1.0.9 → 1.0.10

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/dist/index.d.ts CHANGED
@@ -1,114 +1,114 @@
1
1
  //#region src/canParseId3.d.ts
2
2
  /**
3
- * Checks if the given data contains an ID3 tag.
4
- *
5
- * @param data - The data to check
6
- * @param offset - The offset at which to start checking
7
- *
8
- * @returns `true` if an ID3 tag is found
9
- *
10
- * @public
11
- */
12
- declare function canParseId3(data: Uint8Array, offset: number): boolean;
3
+ * Checks if the given data contains an ID3 tag.
4
+ *
5
+ * @param data - The data to check
6
+ * @param offset - The offset at which to start checking
7
+ *
8
+ * @returns `true` if an ID3 tag is found
9
+ *
10
+ * @public
11
+ */
12
+ export declare function canParseId3(data: Uint8Array, offset: number): boolean;
13
13
  //#endregion
14
14
  //#region src/DecodedId3Frame.d.ts
15
15
  /**
16
- * Decoded ID3 frame.
17
- *
18
- * @public
19
- */
16
+ * Decoded ID3 frame.
17
+ *
18
+ * @public
19
+ */
20
20
  type DecodedId3Frame<T> = {
21
21
  /**
22
- * The four letter frame ID.
23
- */
22
+ * The four letter frame ID.
23
+ */
24
24
  key: string;
25
25
  /**
26
- * The data payload.
27
- */
26
+ * The data payload.
27
+ */
28
28
  data: T;
29
29
  /**
30
- * A text description of the frame if provided.
31
- */
30
+ * A text description of the frame if provided.
31
+ */
32
32
  info?: any;
33
33
  };
34
34
  //#endregion
35
35
  //#region src/getId3Data.d.ts
36
36
  /**
37
- * Returns any adjacent ID3 tags found in data starting at offset, as one block of data
38
- *
39
- * @param data - The data to search in
40
- * @param offset - The offset at which to start searching
41
- *
42
- * @returns The block of data containing any ID3 tags found
43
- * or `undefined` if no header is found at the starting offset
44
- *
45
- * @internal
46
- *
47
- */
48
- declare function getId3Data(data: Uint8Array, offset: number): Uint8Array | undefined;
37
+ * Returns any adjacent ID3 tags found in data starting at offset, as one block of data
38
+ *
39
+ * @param data - The data to search in
40
+ * @param offset - The offset at which to start searching
41
+ *
42
+ * @returns The block of data containing any ID3 tags found
43
+ * or `undefined` if no header is found at the starting offset
44
+ *
45
+ * @internal
46
+ *
47
+ */
48
+ export declare function getId3Data(data: Uint8Array, offset: number): Uint8Array | undefined;
49
49
  //#endregion
50
50
  //#region src/Id3Frame.d.ts
51
51
  /**
52
- * ID3 frame.
53
- *
54
- * @public
55
- */
52
+ * ID3 frame.
53
+ *
54
+ * @public
55
+ */
56
56
  type Id3Frame = DecodedId3Frame<ArrayBufferLike | string | number>;
57
57
  //#endregion
58
58
  //#region src/getId3Frames.d.ts
59
59
  /**
60
- * Returns an array of ID3 frames found in all the ID3 tags in the id3Data
61
- *
62
- * @param id3Data - The ID3 data containing one or more ID3 tags
63
- *
64
- * @returns Array of ID3 frame objects
65
- *
66
- * @public
67
- */
68
- declare function getId3Frames(id3Data: Uint8Array): Id3Frame[];
60
+ * Returns an array of ID3 frames found in all the ID3 tags in the id3Data
61
+ *
62
+ * @param id3Data - The ID3 data containing one or more ID3 tags
63
+ *
64
+ * @returns Array of ID3 frame objects
65
+ *
66
+ * @public
67
+ */
68
+ export declare function getId3Frames(id3Data: Uint8Array): Id3Frame[];
69
69
  //#endregion
70
70
  //#region src/getId3Timestamp.d.ts
71
71
  /**
72
- * Searches for the Elementary Stream timestamp found in the ID3 data chunk
73
- *
74
- * @param data - Block of data containing one or more ID3 tags
75
- *
76
- * @returns The timestamp
77
- *
78
- * @public
79
- */
80
- declare function getId3Timestamp(data: Uint8Array): number | undefined;
72
+ * Searches for the Elementary Stream timestamp found in the ID3 data chunk
73
+ *
74
+ * @param data - Block of data containing one or more ID3 tags
75
+ *
76
+ * @returns The timestamp
77
+ *
78
+ * @public
79
+ */
80
+ export declare function getId3Timestamp(data: Uint8Array): number | undefined;
81
81
  //#endregion
82
82
  //#region src/ID3_SCHEME_ID_URI.d.ts
83
83
  /**
84
- * The scheme ID URI for ID3 tags.
85
- *
86
- * @public
87
- *
88
- * @see {@link https://aomediacodec.github.io/id3-emsg/ | Carriage of ID3 Timed Metadata in the Common Media Application Format (CMAF)}
89
- * @see {@link https://developer.apple.com/documentation/http-live-streaming/about-the-common-media-application-format-with-http-live-streaming-hls#CMAF-Tracks-Segments-Headers-and-Fragments | CMAF Tracks, Segments, Headers, and Fragments}
90
- */
91
- declare const ID3_SCHEME_ID_URI = "https://aomedia.org/emsg/ID3";
84
+ * The scheme ID URI for ID3 tags.
85
+ *
86
+ * @public
87
+ *
88
+ * @see {@link https://aomediacodec.github.io/id3-emsg/ | Carriage of ID3 Timed Metadata in the Common Media Application Format (CMAF)}
89
+ * @see {@link https://developer.apple.com/documentation/http-live-streaming/about-the-common-media-application-format-with-http-live-streaming-hls#CMAF-Tracks-Segments-Headers-and-Fragments | CMAF Tracks, Segments, Headers, and Fragments}
90
+ */
91
+ export declare const ID3_SCHEME_ID_URI = "https://aomedia.org/emsg/ID3";
92
92
  //#endregion
93
93
  //#region src/isId3TimestampFrame.d.ts
94
94
  /**
95
- * Returns true if the ID3 frame is an Elementary Stream timestamp frame
96
- *
97
- * @param frame - the ID3 frame
98
- *
99
- * @returns `true` if the ID3 frame is an Elementary Stream timestamp frame
100
- *
101
- * @internal
102
- *
103
- */
104
- declare function isId3TimestampFrame(frame: Id3Frame): frame is DecodedId3Frame<ArrayBufferLike>;
95
+ * Returns true if the ID3 frame is an Elementary Stream timestamp frame
96
+ *
97
+ * @param frame - the ID3 frame
98
+ *
99
+ * @returns `true` if the ID3 frame is an Elementary Stream timestamp frame
100
+ *
101
+ * @internal
102
+ *
103
+ */
104
+ export declare function isId3TimestampFrame(frame: Id3Frame): frame is DecodedId3Frame<ArrayBufferLike>;
105
105
  //#endregion
106
106
  //#region src/util/RawId3Frame.d.ts
107
107
  /**
108
- * Raw ID3 frame.
109
- *
110
- * @internal
111
- */
108
+ * Raw ID3 frame.
109
+ *
110
+ * @internal
111
+ */
112
112
  type RawId3Frame = {
113
113
  type: string;
114
114
  size: number;
@@ -117,95 +117,95 @@ type RawId3Frame = {
117
117
  //#endregion
118
118
  //#region src/util/decodeId3Frame.d.ts
119
119
  /**
120
- * Decode an ID3 frame.
121
- *
122
- * @param frame - the ID3 frame
123
- *
124
- * @returns The decoded ID3 frame
125
- *
126
- * @internal
127
- */
128
- declare function decodeId3Frame(frame: RawId3Frame): Id3Frame | undefined;
120
+ * Decode an ID3 frame.
121
+ *
122
+ * @param frame - the ID3 frame
123
+ *
124
+ * @returns The decoded ID3 frame
125
+ *
126
+ * @internal
127
+ */
128
+ export declare function decodeId3Frame(frame: RawId3Frame): Id3Frame | undefined;
129
129
  //#endregion
130
130
  //#region src/util/decodeId3TextFrame.d.ts
131
131
  /**
132
- * Decodes an ID3 text frame
133
- *
134
- * @param frame - the ID3 text frame
135
- *
136
- * @returns The decoded ID3 text frame
137
- *
138
- * @internal
139
- */
140
- declare function decodeId3TextFrame(frame: RawId3Frame): DecodedId3Frame<string> | undefined;
132
+ * Decodes an ID3 text frame
133
+ *
134
+ * @param frame - the ID3 text frame
135
+ *
136
+ * @returns The decoded ID3 text frame
137
+ *
138
+ * @internal
139
+ */
140
+ export declare function decodeId3TextFrame(frame: RawId3Frame): DecodedId3Frame<string> | undefined;
141
141
  //#endregion
142
142
  //#region src/util/isId3Footer.d.ts
143
143
  /**
144
- * Returns true if an ID3 footer can be found at offset in data
145
- *
146
- * @param data - The data to search in
147
- * @param offset - The offset at which to start searching
148
- *
149
- * @returns `true` if an ID3 footer is found
150
- *
151
- * @internal
152
- */
153
- declare function isId3Footer(data: Uint8Array, offset: number): boolean;
144
+ * Returns true if an ID3 footer can be found at offset in data
145
+ *
146
+ * @param data - The data to search in
147
+ * @param offset - The offset at which to start searching
148
+ *
149
+ * @returns `true` if an ID3 footer is found
150
+ *
151
+ * @internal
152
+ */
153
+ export declare function isId3Footer(data: Uint8Array, offset: number): boolean;
154
154
  //#endregion
155
155
  //#region src/util/isId3Header.d.ts
156
156
  /**
157
- * Returns true if an ID3 header can be found at offset in data
158
- *
159
- * @param data - The data to search in
160
- * @param offset - The offset at which to start searching
161
- *
162
- * @returns `true` if an ID3 header is found
163
- *
164
- * @internal
165
- */
166
- declare function isId3Header(data: Uint8Array, offset: number): boolean;
157
+ * Returns true if an ID3 header can be found at offset in data
158
+ *
159
+ * @param data - The data to search in
160
+ * @param offset - The offset at which to start searching
161
+ *
162
+ * @returns `true` if an ID3 header is found
163
+ *
164
+ * @internal
165
+ */
166
+ export declare function isId3Header(data: Uint8Array, offset: number): boolean;
167
167
  //#endregion
168
168
  //#region src/util/readId3Size.d.ts
169
169
  /**
170
- * Read ID3 size
171
- *
172
- * @param data - The data to read from
173
- * @param offset - The offset at which to start reading
174
- *
175
- * @returns The size
176
- *
177
- * @internal
178
- */
179
- declare function readId3Size(data: Uint8Array, offset: number): number;
170
+ * Read ID3 size
171
+ *
172
+ * @param data - The data to read from
173
+ * @param offset - The offset at which to start reading
174
+ *
175
+ * @returns The size
176
+ *
177
+ * @internal
178
+ */
179
+ export declare function readId3Size(data: Uint8Array, offset: number): number;
180
180
  //#endregion
181
181
  //#region src/util/toArrayBuffer.d.ts
182
182
  /**
183
- * @internal
184
- */
185
- type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | Uint8ClampedArray;
183
+ * @internal
184
+ */
185
+ export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | Uint8ClampedArray;
186
186
  /**
187
- * @internal
188
- */
189
- declare function toArrayBuffer(view: ArrayBufferLike | TypedArray): ArrayBufferLike;
187
+ * @internal
188
+ */
189
+ export declare function toArrayBuffer(view: ArrayBufferLike | TypedArray): ArrayBufferLike;
190
190
  //#endregion
191
191
  //#region src/util/utf8.d.ts
192
192
  /**
193
- * @internal
194
- */
195
- declare function toUint8(data: BufferSource, offset?: number, length?: number): Uint8Array;
193
+ * @internal
194
+ */
195
+ export declare function toUint8(data: BufferSource, offset?: number, length?: number): Uint8Array;
196
196
  //#endregion
197
197
  //#region src/util/utf8ArrayToStr.d.ts
198
198
  /**
199
- * Converts a UTF-8 array to a string.
200
- *
201
- * @param array - The UTF-8 array to convert
202
- * @param exitOnNull - Whether to exit on the first null byte
203
- *
204
- * @returns The string
205
- *
206
- * @internal
207
- */
208
- declare function utf8ArrayToStr(array: Uint8Array, exitOnNull?: boolean): string;
209
- //#endregion
210
- export { DecodedId3Frame, ID3_SCHEME_ID_URI, Id3Frame, RawId3Frame, TypedArray, canParseId3, decodeId3Frame, decodeId3TextFrame, getId3Data, getId3Frames, getId3Timestamp, isId3Footer, isId3Header, isId3TimestampFrame, readId3Size, toArrayBuffer, toUint8, utf8ArrayToStr };
199
+ * Converts a UTF-8 array to a string.
200
+ *
201
+ * @param array - The UTF-8 array to convert
202
+ * @param exitOnNull - Whether to exit on the first null byte
203
+ *
204
+ * @returns The string
205
+ *
206
+ * @internal
207
+ */
208
+ export declare function utf8ArrayToStr(array: Uint8Array, exitOnNull?: boolean): string;
209
+ //#endregion
210
+ export type { DecodedId3Frame, Id3Frame, RawId3Frame };
211
211
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/canParseId3.ts","../src/DecodedId3Frame.ts","../src/getId3Data.ts","../src/Id3Frame.ts","../src/getId3Frames.ts","../src/getId3Timestamp.ts","../src/ID3_SCHEME_ID_URI.ts","../src/isId3TimestampFrame.ts","../src/util/RawId3Frame.ts","../src/util/decodeId3Frame.ts","../src/util/decodeId3TextFrame.ts","../src/util/isId3Footer.ts","../src/util/isId3Header.ts","../src/util/readId3Size.ts","../src/util/toArrayBuffer.ts","../src/util/utf8.ts","../src/util/utf8ArrayToStr.ts"],"sourcesContent":[],"mappings":";;AAaA;;;;ACRA;;;;ACWA;iBFHgB,WAAA,OAAkB;;;;AAAlC;;;;ACRY,KAAA,eAAA,CAAA,CAAA,CAAA,GAAA;;;;ECWZ,GAAgB,EAAA,MAAA;;;;ECThB,IAAY,EFOL,CEPK;;;;ECaZ,IAAgB,CAAA,EAAA,GAAA;;;;;AJPhB;;;;ACRA;;;;ACWA;;;iBAAgB,UAAA,OACT,6BAEJ;;;AFNH;;;;ACRA;KEEY,QAAA,GAAW,gBAAgB;;;AHMvC;;;;ACRA;;;;ACWA;iBEIgB,YAAA,UAAsB,aAAa;;;;AJPnD;;;;ACRA;;;;ACWgB,iBGFA,eAAA,CHKb,IAAA,EGLmC,UHKnC,CAAA,EAAA,MAAA,GAAA,SAAA;;;;AFNH;;;;ACRA;;;cKGa,iBAAA;;;;;;ALHb;;;;ACWA;;;iBKHgB,mBAAA,QAA2B,oBAAoB,gBAAgB;;;;APA/E;;;;ACRY,KOAA,WAAA,GPAA;;;QOAkD;ANW9D,CAAA;;;;;;ADXA;;;;ACWA;;iBOAgB,cAAA,QAAsB,cAAc;;;;;;ARXpD;;;;ACWA;;iBQHgB,kBAAA,QAA0B,cAAc;;;;AVAxD;;;;ACRA;;;;ACWA;iBSNgB,WAAA,OAAkB;;;;AXGlC;;;;ACRA;;;;ACWA;iBUNgB,WAAA,OAAkB;;;;AZGlC;;;;ACRA;;;;ACWA;iBWNgB,WAAA,OAAkB;;;;AbGlC;;KcRY,UAAA,GACT,YACA,aACA,aACA,cACA,aACA,cACA,eACA,eACA;;AbTH;;iBacgB,aAAA,OAAoB,kBAAkB,aAAa;;;;AdNnE;;iBeRgB,OAAA,OACT,iDAGJ;;;;AfIH;;;;ACRA;;;;ACWA;iBcJgB,cAAA,QACR"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/canParseId3.ts","../src/DecodedId3Frame.ts","../src/getId3Data.ts","../src/Id3Frame.ts","../src/getId3Frames.ts","../src/getId3Timestamp.ts","../src/ID3_SCHEME_ID_URI.ts","../src/isId3TimestampFrame.ts","../src/util/RawId3Frame.ts","../src/util/decodeId3Frame.ts","../src/util/decodeId3TextFrame.ts","../src/util/isId3Footer.ts","../src/util/isId3Header.ts","../src/util/readId3Size.ts","../src/util/toArrayBuffer.ts","../src/util/utf8.ts","../src/util/utf8ArrayToStr.ts"],"mappings":";;;;;;;;;;;wBAagB,YAAY,MAAM,YAAY;;;;;;;;KCRlC,gBAAgB;;;;EAI3B;;;;EAKA,MAAM;;;;EAKN;;;;;;;;;;;;;;;;wBCHe,WACf,MAAM,YACN,iBACE;;;;;;;;KCZS,WAAW,gBAAgB;;;;;;;;;;;;wBCavB,aAAa,SAAS,aAAa;;;;;;;;;;;;wBCNnC,gBAAgB,MAAM;;;;;;;;;;;qBCNzB;;;;;;;;;;;;;wBCKG,oBAAoB,OAAO,WAAW,SAAS,gBAAgB;;;;;;;;KCRnE;EAAgB;EAAc;EAAc,MAAM;;;;;;;;;;;;;wBCW9C,eAAe,OAAO,cAAc;;;;;;;;;;;;wBCHpC,mBAAmB,OAAO,cAAc;;;;;;;;;;;;;wBCHxC,YAAY,MAAM,YAAY;;;;;;;;;;;;;wBCA9B,YAAY,MAAM,YAAY;;;;;;;;;;;;;wBCA9B,YAAY,MAAM,YAAY;;;;;;YCLlC,aACT,YACA,aACA,aACA,cACA,aACA,cACA,eACA,eACA;;;;wBAKa,cAAc,MAAM,kBAAkB,aAAa;;;;;;wBCdnD,QACf,MAAM,cACN,iBACA,kBACE;;;;;;;;;;;;;wBCGa,eACf,OAAO,YACP"}
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { UTF_8, decodeText, isArrayBufferLike } from "@svta/cml-utils";
2
-
3
2
  //#region src/util/isId3Header.ts
4
3
  /**
5
4
  * Returns true if an ID3 header can be found at offset in data
@@ -21,7 +20,6 @@ function isId3Header(data, offset) {
21
20
  }
22
21
  return false;
23
22
  }
24
-
25
23
  //#endregion
26
24
  //#region src/util/readId3Size.ts
27
25
  /**
@@ -42,7 +40,6 @@ function readId3Size(data, offset) {
42
40
  size |= data[offset + 3] & 127;
43
41
  return size;
44
42
  }
45
-
46
43
  //#endregion
47
44
  //#region src/canParseId3.ts
48
45
  /**
@@ -58,7 +55,6 @@ function readId3Size(data, offset) {
58
55
  function canParseId3(data, offset) {
59
56
  return isId3Header(data, offset) && readId3Size(data, offset + 6) + 10 <= data.length - offset;
60
57
  }
61
-
62
58
  //#endregion
63
59
  //#region src/util/isId3Footer.ts
64
60
  /**
@@ -81,7 +77,6 @@ function isId3Footer(data, offset) {
81
77
  }
82
78
  return false;
83
79
  }
84
-
85
80
  //#endregion
86
81
  //#region src/getId3Data.ts
87
82
  /**
@@ -108,20 +103,18 @@ function getId3Data(data, offset) {
108
103
  }
109
104
  if (length > 0) return data.subarray(front, front + length);
110
105
  }
111
-
112
106
  //#endregion
113
107
  //#region src/util/toArrayBuffer.ts
114
108
  /**
115
109
  * @internal
116
110
  */
117
- function toArrayBuffer(view$1) {
118
- if (isArrayBufferLike(view$1)) return view$1;
111
+ function toArrayBuffer(view) {
112
+ if (isArrayBufferLike(view)) return view;
119
113
  else {
120
- if (view$1.byteOffset == 0 && view$1.byteLength == view$1.buffer.byteLength) return view$1.buffer;
121
- return new Uint8Array(view$1).buffer;
114
+ if (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) return view.buffer;
115
+ return new Uint8Array(view).buffer;
122
116
  }
123
117
  }
124
-
125
118
  //#endregion
126
119
  //#region src/util/utf8.ts
127
120
  /**
@@ -140,14 +133,13 @@ function view(data, offset, length, Type) {
140
133
  const start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)));
141
134
  return new Type(buffer, start, Math.floor(Math.min(start + Math.max(length, 0), dataEnd)) - start);
142
135
  }
143
- function unsafeGetArrayBuffer(view$1) {
144
- if (isArrayBufferLike(view$1)) return view$1;
145
- else return view$1.buffer;
136
+ function unsafeGetArrayBuffer(view) {
137
+ if (isArrayBufferLike(view)) return view;
138
+ else return view.buffer;
146
139
  }
147
140
  function isArrayBufferView(obj) {
148
141
  return obj && isArrayBufferLike(obj.buffer) && obj.byteLength !== void 0 && obj.byteOffset !== void 0;
149
142
  }
150
-
151
143
  //#endregion
152
144
  //#region src/util/utf8ArrayToStr.ts
153
145
  /**
@@ -162,10 +154,10 @@ function isArrayBufferView(obj) {
162
154
  */
163
155
  function utf8ArrayToStr(array, exitOnNull = false) {
164
156
  const byteLength = exitOnNull ? array.indexOf(0) : array.length;
165
- const result = decodeText(new DataView(array.buffer, array.byteOffset, byteLength), { encoding: UTF_8 });
157
+ const view = new DataView(array.buffer, array.byteOffset, byteLength);
158
+ const result = decodeText(view, { encoding: UTF_8 });
166
159
  return exitOnNull ? result : result.replace(/\0/g, "");
167
160
  }
168
-
169
161
  //#endregion
170
162
  //#region src/util/decodeId3ImageFrame.ts
171
163
  /**
@@ -207,7 +199,6 @@ function decodeId3ImageFrame(frame) {
207
199
  metadataFrame.data = data;
208
200
  return metadataFrame;
209
201
  }
210
-
211
202
  //#endregion
212
203
  //#region src/util/decodeId3PrivFrame.ts
213
204
  /**
@@ -229,7 +220,6 @@ function decodeId3PrivFrame(frame) {
229
220
  data: privateData.buffer
230
221
  };
231
222
  }
232
-
233
223
  //#endregion
234
224
  //#region src/util/decodeId3TextFrame.ts
235
225
  /**
@@ -262,7 +252,6 @@ function decodeId3TextFrame(frame) {
262
252
  data: text
263
253
  };
264
254
  }
265
-
266
255
  //#endregion
267
256
  //#region src/util/decodeId3UrlFrame.ts
268
257
  /**
@@ -294,7 +283,6 @@ function decodeId3UrlFrame(frame) {
294
283
  data: url
295
284
  };
296
285
  }
297
-
298
286
  //#endregion
299
287
  //#region src/util/decodeId3Frame.ts
300
288
  /**
@@ -312,7 +300,6 @@ function decodeId3Frame(frame) {
312
300
  else if (frame.type === "APIC") return decodeId3ImageFrame(frame);
313
301
  return decodeId3TextFrame(frame);
314
302
  }
315
-
316
303
  //#endregion
317
304
  //#region src/util/getId3FrameData.ts
318
305
  /**
@@ -334,7 +321,6 @@ function getId3FrameData(data) {
334
321
  data: data.subarray(offset, offset + size)
335
322
  };
336
323
  }
337
-
338
324
  //#endregion
339
325
  //#region src/getId3Frames.ts
340
326
  const HEADER_FOOTER_SIZE = 10;
@@ -366,7 +352,6 @@ function getId3Frames(id3Data) {
366
352
  }
367
353
  return frames;
368
354
  }
369
-
370
355
  //#endregion
371
356
  //#region src/isId3TimestampFrame.ts
372
357
  /**
@@ -382,7 +367,6 @@ function getId3Frames(id3Data) {
382
367
  function isId3TimestampFrame(frame) {
383
368
  return frame && frame.key === "PRIV" && frame.info === "com.apple.streaming.transportStreamTimestamp";
384
369
  }
385
-
386
370
  //#endregion
387
371
  //#region src/util/readId3Timestamp.ts
388
372
  /**
@@ -404,7 +388,6 @@ function readId3Timestamp(timeStampFrame) {
404
388
  return Math.round(timestamp);
405
389
  }
406
390
  }
407
-
408
391
  //#endregion
409
392
  //#region src/getId3Timestamp.ts
410
393
  /**
@@ -420,7 +403,6 @@ function getId3Timestamp(data) {
420
403
  const frames = getId3Frames(data);
421
404
  for (const frame of frames) if (isId3TimestampFrame(frame)) return readId3Timestamp(frame);
422
405
  }
423
-
424
406
  //#endregion
425
407
  //#region src/ID3_SCHEME_ID_URI.ts
426
408
  /**
@@ -432,7 +414,7 @@ function getId3Timestamp(data) {
432
414
  * @see {@link https://developer.apple.com/documentation/http-live-streaming/about-the-common-media-application-format-with-http-live-streaming-hls#CMAF-Tracks-Segments-Headers-and-Fragments | CMAF Tracks, Segments, Headers, and Fragments}
433
415
  */
434
416
  const ID3_SCHEME_ID_URI = "https://aomedia.org/emsg/ID3";
435
-
436
417
  //#endregion
437
418
  export { ID3_SCHEME_ID_URI, canParseId3, decodeId3Frame, decodeId3TextFrame, getId3Data, getId3Frames, getId3Timestamp, isId3Footer, isId3Header, isId3TimestampFrame, readId3Size, toArrayBuffer, toUint8, utf8ArrayToStr };
419
+
438
420
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["view","bytesPerElement: any","view","metadataFrame: MetadataFrame","description: string","value: string","url: string","type: string","size: number","frames: Id3Frame[]","frameData: RawId3Frame","frame: Id3Frame | undefined","frames: Id3Frame[]"],"sources":["../src/util/isId3Header.ts","../src/util/readId3Size.ts","../src/canParseId3.ts","../src/util/isId3Footer.ts","../src/getId3Data.ts","../src/util/toArrayBuffer.ts","../src/util/utf8.ts","../src/util/utf8ArrayToStr.ts","../src/util/decodeId3ImageFrame.ts","../src/util/decodeId3PrivFrame.ts","../src/util/decodeId3TextFrame.ts","../src/util/decodeId3UrlFrame.ts","../src/util/decodeId3Frame.ts","../src/util/getId3FrameData.ts","../src/getId3Frames.ts","../src/isId3TimestampFrame.ts","../src/util/readId3Timestamp.ts","../src/getId3Timestamp.ts","../src/ID3_SCHEME_ID_URI.ts"],"sourcesContent":["/**\n * Returns true if an ID3 header can be found at offset in data\n *\n * @param data - The data to search in\n * @param offset - The offset at which to start searching\n *\n * @returns `true` if an ID3 header is found\n *\n * @internal\n */\nexport function isId3Header(data: Uint8Array, offset: number): boolean {\n\t/*\n\t * http://id3.org/id3v2.3.0\n\t * [0] = 'I'\n\t * [1] = 'D'\n\t * [2] = '3'\n\t * [3,4] = {Version}\n\t * [5] = {Flags}\n\t * [6-9] = {ID3 Size}\n\t *\n\t * An ID3v2 tag can be detected with the following pattern:\n\t * $49 44 33 yy yy xx zz zz zz zz\n\t * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80\n\t */\n\tif (offset + 10 <= data.length) {\n\t\t// look for 'ID3' identifier\n\t\tif (\n\t\t\tdata[offset] === 0x49 &&\n\t\t\tdata[offset + 1] === 0x44 &&\n\t\t\tdata[offset + 2] === 0x33\n\t\t) {\n\t\t\t// check version is within range\n\t\t\tif (data[offset + 3] < 0xff && data[offset + 4] < 0xff) {\n\t\t\t\t// check size is within range\n\t\t\t\tif (\n\t\t\t\t\tdata[offset + 6] < 0x80 &&\n\t\t\t\t\tdata[offset + 7] < 0x80 &&\n\t\t\t\t\tdata[offset + 8] < 0x80 &&\n\t\t\t\t\tdata[offset + 9] < 0x80\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n","/**\n * Read ID3 size\n *\n * @param data - The data to read from\n * @param offset - The offset at which to start reading\n *\n * @returns The size\n *\n * @internal\n */\nexport function readId3Size(data: Uint8Array, offset: number): number {\n\tlet size = 0\n\tsize = (data[offset] & 0x7f) << 21\n\tsize |= (data[offset + 1] & 0x7f) << 14\n\tsize |= (data[offset + 2] & 0x7f) << 7\n\tsize |= data[offset + 3] & 0x7f\n\treturn size\n}\n","import { isId3Header } from './util/isId3Header.ts'\nimport { readId3Size } from './util/readId3Size.ts'\n\n/**\n * Checks if the given data contains an ID3 tag.\n *\n * @param data - The data to check\n * @param offset - The offset at which to start checking\n *\n * @returns `true` if an ID3 tag is found\n *\n * @public\n */\nexport function canParseId3(data: Uint8Array, offset: number): boolean {\n\treturn (\n\t\tisId3Header(data, offset) &&\n\t\treadId3Size(data, offset + 6) + 10 <= data.length - offset\n\t)\n}\n","/**\n * Returns true if an ID3 footer can be found at offset in data\n *\n * @param data - The data to search in\n * @param offset - The offset at which to start searching\n *\n * @returns `true` if an ID3 footer is found\n *\n * @internal\n */\nexport function isId3Footer(data: Uint8Array, offset: number): boolean {\n\t/*\n\t * The footer is a copy of the header, but with a different identifier\n\t */\n\tif (offset + 10 <= data.length) {\n\t\t// look for '3DI' identifier\n\t\tif (\n\t\t\tdata[offset] === 0x33 &&\n\t\t\tdata[offset + 1] === 0x44 &&\n\t\t\tdata[offset + 2] === 0x49\n\t\t) {\n\t\t\t// check version is within range\n\t\t\tif (data[offset + 3] < 0xff && data[offset + 4] < 0xff) {\n\t\t\t\t// check size is within range\n\t\t\t\tif (\n\t\t\t\t\tdata[offset + 6] < 0x80 &&\n\t\t\t\t\tdata[offset + 7] < 0x80 &&\n\t\t\t\t\tdata[offset + 8] < 0x80 &&\n\t\t\t\t\tdata[offset + 9] < 0x80\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n","import { isId3Footer } from './util/isId3Footer.ts'\nimport { isId3Header } from './util/isId3Header.ts'\nimport { readId3Size } from './util/readId3Size.ts'\n\n/**\n * Returns any adjacent ID3 tags found in data starting at offset, as one block of data\n *\n * @param data - The data to search in\n * @param offset - The offset at which to start searching\n *\n * @returns The block of data containing any ID3 tags found\n * or `undefined` if no header is found at the starting offset\n *\n * @internal\n *\n */\nexport function getId3Data(\n\tdata: Uint8Array,\n\toffset: number,\n): Uint8Array | undefined {\n\tconst front = offset\n\tlet length = 0\n\n\twhile (isId3Header(data, offset)) {\n\t\t// ID3 header is 10 bytes\n\t\tlength += 10\n\n\t\tconst size = readId3Size(data, offset + 6)\n\t\tlength += size\n\n\t\tif (isId3Footer(data, offset + 10)) {\n\t\t\t// ID3 footer is 10 bytes\n\t\t\tlength += 10\n\t\t}\n\n\t\toffset += length\n\t}\n\n\tif (length > 0) {\n\t\treturn data.subarray(front, front + length)\n\t}\n\n\treturn undefined\n}\n","import { isArrayBufferLike } from '@svta/cml-utils'\n\n/**\n * @internal\n */\nexport type TypedArray =\n\t| Int8Array\n\t| Uint8Array\n\t| Int16Array\n\t| Uint16Array\n\t| Int32Array\n\t| Uint32Array\n\t| Float32Array\n\t| Float64Array\n\t| Uint8ClampedArray;\n\n/**\n * @internal\n */\nexport function toArrayBuffer(view: ArrayBufferLike | TypedArray): ArrayBufferLike {\n\tif (isArrayBufferLike(view)) {\n\t\treturn view\n\t}\n\telse {\n\t\tif (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {\n\t\t\t// This is a TypedArray over the whole buffer.\n\t\t\treturn view.buffer as ArrayBuffer\n\t\t}\n\t\t// This is a 'view' on the buffer. Create a new buffer that only contains\n\t\t// the data. Note that since this isn't an ArrayBuffer, the 'new' call\n\t\t// will allocate a new buffer to hold the copy.\n\t\treturn new Uint8Array(view).buffer\n\t}\n}\n","import { isArrayBufferLike } from '@svta/cml-utils'\n\n/**\n * @internal\n */\nexport function toUint8(\n\tdata: BufferSource,\n\toffset: number = 0,\n\tlength: number = Infinity,\n): Uint8Array {\n\treturn view(data, offset, length, Uint8Array)\n}\n\nfunction view<T extends ArrayBufferView>(\n\tdata: BufferSource,\n\toffset: number,\n\tlength: number,\n\tType: new (buffer: ArrayBufferLike, byteOffset: number, length: number) => T,\n): T {\n\tconst buffer = unsafeGetArrayBuffer(data)\n\tlet bytesPerElement: any = 1\n\tif ('BYTES_PER_ELEMENT' in Type) {\n\t\tbytesPerElement = Type.BYTES_PER_ELEMENT\n\t}\n\t// Absolute end of the |data| view within |buffer|.\n\tconst dataOffset = isArrayBufferView(data) ? data.byteOffset : 0\n\tconst dataEnd = ((dataOffset) + data.byteLength) / bytesPerElement\n\t// Absolute start of the result within |buffer|.\n\tconst rawStart = ((dataOffset) + offset) / bytesPerElement\n\tconst start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)))\n\t// Absolute end of the result within |buffer|.\n\tconst end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd))\n\treturn new Type(buffer as ArrayBuffer, start, end - start)\n}\n\nfunction unsafeGetArrayBuffer(view: BufferSource) {\n\tif (isArrayBufferLike(view)) {\n\t\treturn view\n\t}\n\telse {\n\t\treturn view.buffer\n\t}\n}\n\nfunction isArrayBufferView(obj: any): obj is ArrayBufferView {\n\treturn obj && isArrayBufferLike(obj.buffer) && obj.byteLength !== undefined && obj.byteOffset !== undefined\n}\n","import { decodeText, UTF_8 } from '@svta/cml-utils'\n\n/**\n * Converts a UTF-8 array to a string.\n *\n * @param array - The UTF-8 array to convert\n * @param exitOnNull - Whether to exit on the first null byte\n *\n * @returns The string\n *\n * @internal\n */\nexport function utf8ArrayToStr(\n\tarray: Uint8Array,\n\texitOnNull: boolean = false,\n): string {\n\tconst byteLength = exitOnNull ? array.indexOf(0) : array.length\n\tconst view = new DataView(array.buffer, array.byteOffset, byteLength)\n\tconst result = decodeText(view, { encoding: UTF_8 })\n\n\treturn exitOnNull ? result : result.replace(/\\0/g, '')\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { toArrayBuffer } from './toArrayBuffer.ts'\nimport { toUint8 } from './utf8.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\ntype MetadataFrame = {\n\tkey: string;\n\tdescription: string;\n\tdata: string | ArrayBufferLike;\n\tmimeType: string | null;\n\tpictureType: number | null;\n};\n\n/**\n * Decode an ID3 APIC frame.\n *\n * @param frame - the ID3 APIC frame\n *\n * @returns The decoded ID3 APIC frame\n *\n * @internal\n */\nexport function decodeId3ImageFrame(\n\tframe: RawId3Frame,\n): DecodedId3Frame<string | ArrayBufferLike> | undefined {\n\tconst metadataFrame: MetadataFrame = {\n\t\tkey: frame.type,\n\t\tdescription: '',\n\t\tdata: '',\n\t\tmimeType: null,\n\t\tpictureType: null,\n\t}\n\n\tconst utf8Encoding = 0x03\n\n\tif (frame.size < 2) {\n\t\treturn undefined\n\t}\n\tif (frame.data[0] !== utf8Encoding) {\n\t\tconsole.log('Ignore frame with unrecognized character ' + 'encoding')\n\t\treturn undefined\n\t}\n\n\tconst mimeTypeEndIndex = frame.data.subarray(1).indexOf(0)\n\tif (mimeTypeEndIndex === -1) {\n\t\treturn undefined\n\t}\n\tconst mimeType = utf8ArrayToStr(toUint8(frame.data, 1, mimeTypeEndIndex))\n\tconst pictureType = frame.data[2 + mimeTypeEndIndex]\n\tconst descriptionEndIndex = frame.data\n\t\t.subarray(3 + mimeTypeEndIndex)\n\t\t.indexOf(0)\n\tif (descriptionEndIndex === -1) {\n\t\treturn undefined\n\t}\n\tconst description = utf8ArrayToStr(\n\t\ttoUint8(frame.data, 3 + mimeTypeEndIndex, descriptionEndIndex),\n\t)\n\n\tlet data\n\tif (mimeType === '-->') {\n\t\tdata = utf8ArrayToStr(\n\t\t\ttoUint8(frame.data, 4 + mimeTypeEndIndex + descriptionEndIndex),\n\t\t)\n\t}\n\telse {\n\t\tdata = toArrayBuffer(\n\t\t\tframe.data.subarray(4 + mimeTypeEndIndex + descriptionEndIndex),\n\t\t)\n\t}\n\n\tmetadataFrame.mimeType = mimeType\n\tmetadataFrame.pictureType = pictureType\n\tmetadataFrame.description = description\n\tmetadataFrame.data = data\n\n\treturn metadataFrame\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\n/**\n * Decode an ID3 PRIV frame.\n *\n * @param frame - the ID3 PRIV frame\n *\n * @returns The decoded ID3 PRIV frame\n *\n * @internal\n */\nexport function decodeId3PrivFrame(\n\tframe: RawId3Frame,\n): DecodedId3Frame<ArrayBufferLike> | undefined {\n\t/*\n\tFormat: <text string>\\0<binary data>\n\t*/\n\tif (frame.size < 2) {\n\t\treturn undefined\n\t}\n\n\tconst owner = utf8ArrayToStr(frame.data, true)\n\tconst privateData = new Uint8Array(frame.data.subarray(owner.length + 1))\n\n\treturn { key: frame.type, info: owner, data: privateData.buffer }\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\n/**\n * Decodes an ID3 text frame\n *\n * @param frame - the ID3 text frame\n *\n * @returns The decoded ID3 text frame\n *\n * @internal\n */\nexport function decodeId3TextFrame(frame: RawId3Frame): DecodedId3Frame<string> | undefined {\n\tif (frame.size < 2) {\n\t\treturn undefined\n\t}\n\n\tif (frame.type === 'TXXX') {\n\t\t/*\n\t\tFormat:\n\t\t[0] = {Text Encoding}\n\t\t[1-?] = {Description}\\0{Value}\n\t\t*/\n\t\tlet index = 1\n\t\tconst { data } = frame\n\t\tconst description = utf8ArrayToStr(data.subarray(index), true)\n\n\t\tindex += description.length + 1\n\t\tconst value = utf8ArrayToStr(data.subarray(index))\n\n\t\treturn { key: frame.type, info: description, data: value }\n\t}\n\t/*\n\tFormat:\n\t[0] = {Text Encoding}\n\t[1-?] = {Value}\n\t*/\n\tconst text = utf8ArrayToStr(frame.data.subarray(1))\n\treturn { key: frame.type, info: '', data: text }\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\n/**\n * Decode a URL frame\n *\n * @param frame - the ID3 URL frame\n *\n * @returns The decoded ID3 URL frame\n *\n * @internal\n */\nexport function decodeId3UrlFrame(frame: RawId3Frame): DecodedId3Frame<string> | undefined {\n\tif (frame.type === 'WXXX') {\n\t\t/*\n\t\tFormat:\n\t\t[0] = {Text Encoding}\n\t\t[1-?] = {Description}\\0{URL}\n\t\t*/\n\t\tif (frame.size < 2) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tlet index = 1\n\t\tconst description: string = utf8ArrayToStr(\n\t\t\tframe.data.subarray(index),\n\t\t\ttrue,\n\t\t)\n\n\t\tindex += description.length + 1\n\t\tconst value: string = utf8ArrayToStr(frame.data.subarray(index))\n\n\t\treturn { key: frame.type, info: description, data: value }\n\t}\n\t/*\n\tFormat:\n\t[0-?] = {URL}\n\t*/\n\tconst url: string = utf8ArrayToStr(frame.data)\n\treturn { key: frame.type, info: '', data: url }\n}\n","import type { Id3Frame } from '../Id3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { decodeId3ImageFrame } from './decodeId3ImageFrame.ts'\nimport { decodeId3PrivFrame } from './decodeId3PrivFrame.ts'\nimport { decodeId3TextFrame } from './decodeId3TextFrame.ts'\nimport { decodeId3UrlFrame } from './decodeId3UrlFrame.ts'\n\n/**\n * Decode an ID3 frame.\n *\n * @param frame - the ID3 frame\n *\n * @returns The decoded ID3 frame\n *\n * @internal\n */\nexport function decodeId3Frame(frame: RawId3Frame): Id3Frame | undefined {\n\tif (frame.type === 'PRIV') {\n\t\treturn decodeId3PrivFrame(frame)\n\t}\n\telse if (frame.type[0] === 'W') {\n\t\treturn decodeId3UrlFrame(frame)\n\t}\n\n\telse if (frame.type === 'APIC') {\n\t\treturn decodeId3ImageFrame(frame)\n\t}\n\n\treturn decodeId3TextFrame(frame)\n}\n","import type { RawId3Frame } from './RawId3Frame.ts'\nimport { readId3Size } from './readId3Size.ts'\n\n/**\n * Returns the data of an ID3 frame.\n *\n * @param data - The data to read from\n *\n * @returns The data of the ID3 frame\n *\n * @internal\n */\nexport function getId3FrameData(data: Uint8Array): RawId3Frame {\n\t/*\n\tFrame ID $xx xx xx xx (four characters)\n\tSize $xx xx xx xx\n\tFlags $xx xx\n\t*/\n\tconst type: string = String.fromCharCode(data[0], data[1], data[2], data[3])\n\tconst size: number = readId3Size(data, 4)\n\n\t// skip frame id, size, and flags\n\tconst offset = 10\n\n\treturn { type, size, data: data.subarray(offset, offset + size) }\n}\n","import type { Id3Frame } from './Id3Frame.ts'\nimport type { RawId3Frame } from './util/RawId3Frame.ts'\nimport { decodeId3Frame } from './util/decodeId3Frame.ts'\nimport { getId3FrameData } from './util/getId3FrameData.ts'\nimport { isId3Footer } from './util/isId3Footer.ts'\nimport { isId3Header } from './util/isId3Header.ts'\nimport { readId3Size } from './util/readId3Size.ts'\n\nconst HEADER_FOOTER_SIZE = 10\nconst FRAME_SIZE = 10\n\n/**\n * Returns an array of ID3 frames found in all the ID3 tags in the id3Data\n *\n * @param id3Data - The ID3 data containing one or more ID3 tags\n *\n * @returns Array of ID3 frame objects\n *\n * @public\n */\nexport function getId3Frames(id3Data: Uint8Array): Id3Frame[] {\n\tlet offset = 0\n\tconst frames: Id3Frame[] = []\n\n\twhile (isId3Header(id3Data, offset)) {\n\t\tconst size = readId3Size(id3Data, offset + 6)\n\n\t\tif ((id3Data[offset + 5] >> 6) & 1) {\n\t\t\t// skip extended header\n\t\t\toffset += HEADER_FOOTER_SIZE\n\t\t}\n\t\t// skip past ID3 header\n\t\toffset += HEADER_FOOTER_SIZE\n\t\tconst end = offset + size\n\t\t// loop through frames in the ID3 tag\n\t\twhile (offset + FRAME_SIZE < end) {\n\t\t\tconst frameData: RawId3Frame = getId3FrameData(id3Data.subarray(offset))\n\t\t\tconst frame: Id3Frame | undefined = decodeId3Frame(frameData)\n\t\t\tif (frame) {\n\t\t\t\tframes.push(frame)\n\t\t\t}\n\n\t\t\t// skip frame header and frame data\n\t\t\toffset += frameData.size + HEADER_FOOTER_SIZE\n\t\t}\n\n\t\tif (isId3Footer(id3Data, offset)) {\n\t\t\toffset += HEADER_FOOTER_SIZE\n\t\t}\n\t}\n\n\treturn frames\n}\n","import type { DecodedId3Frame } from './DecodedId3Frame.ts'\nimport type { Id3Frame } from './Id3Frame.ts'\n\n/**\n * Returns true if the ID3 frame is an Elementary Stream timestamp frame\n *\n * @param frame - the ID3 frame\n *\n * @returns `true` if the ID3 frame is an Elementary Stream timestamp frame\n *\n * @internal\n *\n */\nexport function isId3TimestampFrame(frame: Id3Frame): frame is DecodedId3Frame<ArrayBufferLike> {\n\treturn (\n\t\tframe &&\n\t\tframe.key === 'PRIV' &&\n\t\tframe.info === 'com.apple.streaming.transportStreamTimestamp'\n\t)\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\n\n/**\n * Read a 33 bit timestamp from an ID3 frame.\n *\n * @param timeStampFrame - the ID3 frame\n *\n * @returns The timestamp\n *\n * @internal\n */\nexport function readId3Timestamp(\n\ttimeStampFrame: DecodedId3Frame<ArrayBufferLike>,\n): number | undefined {\n\tif (timeStampFrame.data.byteLength === 8) {\n\t\tconst data = new Uint8Array(timeStampFrame.data)\n\t\t// timestamp is 33 bit expressed as a big-endian eight-octet number,\n\t\t// with the upper 31 bits set to zero.\n\t\tconst pts33Bit = data[3] & 0x1\n\t\tlet timestamp =\n\t\t\t(data[4] << 23) + (data[5] << 15) + (data[6] << 7) + data[7]\n\t\ttimestamp /= 45\n\n\t\tif (pts33Bit) {\n\t\t\ttimestamp += 47721858.84\n\t\t} // 2^32 / 90\n\n\t\treturn Math.round(timestamp)\n\t}\n\n\treturn undefined\n}\n","import type { Id3Frame } from './Id3Frame.ts'\nimport { getId3Frames } from './getId3Frames.ts'\nimport { isId3TimestampFrame } from './isId3TimestampFrame.ts'\nimport { readId3Timestamp } from './util/readId3Timestamp.ts'\n\n/**\n * Searches for the Elementary Stream timestamp found in the ID3 data chunk\n *\n * @param data - Block of data containing one or more ID3 tags\n *\n * @returns The timestamp\n *\n * @public\n */\nexport function getId3Timestamp(data: Uint8Array): number | undefined {\n\tconst frames: Id3Frame[] = getId3Frames(data)\n\n\tfor (const frame of frames) {\n\t\tif (isId3TimestampFrame(frame)) {\n\t\t\treturn readId3Timestamp(frame)\n\t\t}\n\t}\n\n\treturn undefined\n}\n","/**\n * The scheme ID URI for ID3 tags.\n *\n * @public\n *\n * @see {@link https://aomediacodec.github.io/id3-emsg/ | Carriage of ID3 Timed Metadata in the Common Media Application Format (CMAF)}\n * @see {@link https://developer.apple.com/documentation/http-live-streaming/about-the-common-media-application-format-with-http-live-streaming-hls#CMAF-Tracks-Segments-Headers-and-Fragments | CMAF Tracks, Segments, Headers, and Fragments}\n */\nexport const ID3_SCHEME_ID_URI = 'https://aomedia.org/emsg/ID3'\n"],"mappings":";;;;;;;;;;;;;AAUA,SAAgB,YAAY,MAAkB,QAAyB;AActE,KAAI,SAAS,MAAM,KAAK,QAEvB;MACC,KAAK,YAAY,MACjB,KAAK,SAAS,OAAO,MACrB,KAAK,SAAS,OAAO,IAGrB;OAAI,KAAK,SAAS,KAAK,OAAQ,KAAK,SAAS,KAAK,KAEjD;QACC,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,IAEnB,QAAO;;;;AAKX,QAAO;;;;;;;;;;;;;;;ACnCR,SAAgB,YAAY,MAAkB,QAAwB;CACrE,IAAI,OAAO;AACX,SAAQ,KAAK,UAAU,QAAS;AAChC,UAAS,KAAK,SAAS,KAAK,QAAS;AACrC,UAAS,KAAK,SAAS,KAAK,QAAS;AACrC,SAAQ,KAAK,SAAS,KAAK;AAC3B,QAAO;;;;;;;;;;;;;;;ACHR,SAAgB,YAAY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,UAAU,OAAO;;AAG5B,MAAI,YAAY,SAAS,OAAO,CAC/B,WAAU;;AAIZ,QAAO;;;;;;;;;;;;;;;ACtCR,SAAgB,oBAAoB,OAA4D;AAC/F,QACC,SACA,MAAM,QAAQ,UACd,MAAM,SAAS;;;;;;;;;;;;;;ACNjB,SAAgB,iBACf,gBACqB;AACrB,KAAI,eAAe,KAAK,eAAe,GAAG;EACzC,MAAM,OAAO,IAAI,WAAW,eAAe,KAAK;EAGhD,MAAM,WAAW,KAAK,KAAK;EAC3B,IAAI,aACF,KAAK,MAAM,OAAO,KAAK,MAAM,OAAO,KAAK,MAAM,KAAK,KAAK;AAC3D,eAAa;AAEb,MAAI,SACH,cAAa;AAGd,SAAO,KAAK,MAAM,UAAU;;;;;;;;;;;;;;;ACb9B,SAAgB,gBAAgB,MAAsC;CACrE,MAAMC,SAAqB,aAAa,KAAK;AAE7C,MAAK,MAAM,SAAS,OACnB,KAAI,oBAAoB,MAAM,CAC7B,QAAO,iBAAiB,MAAM;;;;;;;;;;;;;ACXjC,MAAa,oBAAoB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/util/isId3Header.ts","../src/util/readId3Size.ts","../src/canParseId3.ts","../src/util/isId3Footer.ts","../src/getId3Data.ts","../src/util/toArrayBuffer.ts","../src/util/utf8.ts","../src/util/utf8ArrayToStr.ts","../src/util/decodeId3ImageFrame.ts","../src/util/decodeId3PrivFrame.ts","../src/util/decodeId3TextFrame.ts","../src/util/decodeId3UrlFrame.ts","../src/util/decodeId3Frame.ts","../src/util/getId3FrameData.ts","../src/getId3Frames.ts","../src/isId3TimestampFrame.ts","../src/util/readId3Timestamp.ts","../src/getId3Timestamp.ts","../src/ID3_SCHEME_ID_URI.ts"],"sourcesContent":["/**\n * Returns true if an ID3 header can be found at offset in data\n *\n * @param data - The data to search in\n * @param offset - The offset at which to start searching\n *\n * @returns `true` if an ID3 header is found\n *\n * @internal\n */\nexport function isId3Header(data: Uint8Array, offset: number): boolean {\n\t/*\n\t * http://id3.org/id3v2.3.0\n\t * [0] = 'I'\n\t * [1] = 'D'\n\t * [2] = '3'\n\t * [3,4] = {Version}\n\t * [5] = {Flags}\n\t * [6-9] = {ID3 Size}\n\t *\n\t * An ID3v2 tag can be detected with the following pattern:\n\t * $49 44 33 yy yy xx zz zz zz zz\n\t * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80\n\t */\n\tif (offset + 10 <= data.length) {\n\t\t// look for 'ID3' identifier\n\t\tif (\n\t\t\tdata[offset] === 0x49 &&\n\t\t\tdata[offset + 1] === 0x44 &&\n\t\t\tdata[offset + 2] === 0x33\n\t\t) {\n\t\t\t// check version is within range\n\t\t\tif (data[offset + 3] < 0xff && data[offset + 4] < 0xff) {\n\t\t\t\t// check size is within range\n\t\t\t\tif (\n\t\t\t\t\tdata[offset + 6] < 0x80 &&\n\t\t\t\t\tdata[offset + 7] < 0x80 &&\n\t\t\t\t\tdata[offset + 8] < 0x80 &&\n\t\t\t\t\tdata[offset + 9] < 0x80\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n","/**\n * Read ID3 size\n *\n * @param data - The data to read from\n * @param offset - The offset at which to start reading\n *\n * @returns The size\n *\n * @internal\n */\nexport function readId3Size(data: Uint8Array, offset: number): number {\n\tlet size = 0\n\tsize = (data[offset] & 0x7f) << 21\n\tsize |= (data[offset + 1] & 0x7f) << 14\n\tsize |= (data[offset + 2] & 0x7f) << 7\n\tsize |= data[offset + 3] & 0x7f\n\treturn size\n}\n","import { isId3Header } from './util/isId3Header.ts'\nimport { readId3Size } from './util/readId3Size.ts'\n\n/**\n * Checks if the given data contains an ID3 tag.\n *\n * @param data - The data to check\n * @param offset - The offset at which to start checking\n *\n * @returns `true` if an ID3 tag is found\n *\n * @public\n */\nexport function canParseId3(data: Uint8Array, offset: number): boolean {\n\treturn (\n\t\tisId3Header(data, offset) &&\n\t\treadId3Size(data, offset + 6) + 10 <= data.length - offset\n\t)\n}\n","/**\n * Returns true if an ID3 footer can be found at offset in data\n *\n * @param data - The data to search in\n * @param offset - The offset at which to start searching\n *\n * @returns `true` if an ID3 footer is found\n *\n * @internal\n */\nexport function isId3Footer(data: Uint8Array, offset: number): boolean {\n\t/*\n\t * The footer is a copy of the header, but with a different identifier\n\t */\n\tif (offset + 10 <= data.length) {\n\t\t// look for '3DI' identifier\n\t\tif (\n\t\t\tdata[offset] === 0x33 &&\n\t\t\tdata[offset + 1] === 0x44 &&\n\t\t\tdata[offset + 2] === 0x49\n\t\t) {\n\t\t\t// check version is within range\n\t\t\tif (data[offset + 3] < 0xff && data[offset + 4] < 0xff) {\n\t\t\t\t// check size is within range\n\t\t\t\tif (\n\t\t\t\t\tdata[offset + 6] < 0x80 &&\n\t\t\t\t\tdata[offset + 7] < 0x80 &&\n\t\t\t\t\tdata[offset + 8] < 0x80 &&\n\t\t\t\t\tdata[offset + 9] < 0x80\n\t\t\t\t) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n","import { isId3Footer } from './util/isId3Footer.ts'\nimport { isId3Header } from './util/isId3Header.ts'\nimport { readId3Size } from './util/readId3Size.ts'\n\n/**\n * Returns any adjacent ID3 tags found in data starting at offset, as one block of data\n *\n * @param data - The data to search in\n * @param offset - The offset at which to start searching\n *\n * @returns The block of data containing any ID3 tags found\n * or `undefined` if no header is found at the starting offset\n *\n * @internal\n *\n */\nexport function getId3Data(\n\tdata: Uint8Array,\n\toffset: number,\n): Uint8Array | undefined {\n\tconst front = offset\n\tlet length = 0\n\n\twhile (isId3Header(data, offset)) {\n\t\t// ID3 header is 10 bytes\n\t\tlength += 10\n\n\t\tconst size = readId3Size(data, offset + 6)\n\t\tlength += size\n\n\t\tif (isId3Footer(data, offset + 10)) {\n\t\t\t// ID3 footer is 10 bytes\n\t\t\tlength += 10\n\t\t}\n\n\t\toffset += length\n\t}\n\n\tif (length > 0) {\n\t\treturn data.subarray(front, front + length)\n\t}\n\n\treturn undefined\n}\n","import { isArrayBufferLike } from '@svta/cml-utils'\n\n/**\n * @internal\n */\nexport type TypedArray =\n\t| Int8Array\n\t| Uint8Array\n\t| Int16Array\n\t| Uint16Array\n\t| Int32Array\n\t| Uint32Array\n\t| Float32Array\n\t| Float64Array\n\t| Uint8ClampedArray;\n\n/**\n * @internal\n */\nexport function toArrayBuffer(view: ArrayBufferLike | TypedArray): ArrayBufferLike {\n\tif (isArrayBufferLike(view)) {\n\t\treturn view\n\t}\n\telse {\n\t\tif (view.byteOffset == 0 && view.byteLength == view.buffer.byteLength) {\n\t\t\t// This is a TypedArray over the whole buffer.\n\t\t\treturn view.buffer as ArrayBuffer\n\t\t}\n\t\t// This is a 'view' on the buffer. Create a new buffer that only contains\n\t\t// the data. Note that since this isn't an ArrayBuffer, the 'new' call\n\t\t// will allocate a new buffer to hold the copy.\n\t\treturn new Uint8Array(view).buffer\n\t}\n}\n","import { isArrayBufferLike } from '@svta/cml-utils'\n\n/**\n * @internal\n */\nexport function toUint8(\n\tdata: BufferSource,\n\toffset: number = 0,\n\tlength: number = Infinity,\n): Uint8Array {\n\treturn view(data, offset, length, Uint8Array)\n}\n\nfunction view<T extends ArrayBufferView>(\n\tdata: BufferSource,\n\toffset: number,\n\tlength: number,\n\tType: new (buffer: ArrayBufferLike, byteOffset: number, length: number) => T,\n): T {\n\tconst buffer = unsafeGetArrayBuffer(data)\n\tlet bytesPerElement: any = 1\n\tif ('BYTES_PER_ELEMENT' in Type) {\n\t\tbytesPerElement = Type.BYTES_PER_ELEMENT\n\t}\n\t// Absolute end of the |data| view within |buffer|.\n\tconst dataOffset = isArrayBufferView(data) ? data.byteOffset : 0\n\tconst dataEnd = ((dataOffset) + data.byteLength) / bytesPerElement\n\t// Absolute start of the result within |buffer|.\n\tconst rawStart = ((dataOffset) + offset) / bytesPerElement\n\tconst start = Math.floor(Math.max(0, Math.min(rawStart, dataEnd)))\n\t// Absolute end of the result within |buffer|.\n\tconst end = Math.floor(Math.min(start + Math.max(length, 0), dataEnd))\n\treturn new Type(buffer as ArrayBuffer, start, end - start)\n}\n\nfunction unsafeGetArrayBuffer(view: BufferSource) {\n\tif (isArrayBufferLike(view)) {\n\t\treturn view\n\t}\n\telse {\n\t\treturn view.buffer\n\t}\n}\n\nfunction isArrayBufferView(obj: any): obj is ArrayBufferView {\n\treturn obj && isArrayBufferLike(obj.buffer) && obj.byteLength !== undefined && obj.byteOffset !== undefined\n}\n","import { decodeText, UTF_8 } from '@svta/cml-utils'\n\n/**\n * Converts a UTF-8 array to a string.\n *\n * @param array - The UTF-8 array to convert\n * @param exitOnNull - Whether to exit on the first null byte\n *\n * @returns The string\n *\n * @internal\n */\nexport function utf8ArrayToStr(\n\tarray: Uint8Array,\n\texitOnNull: boolean = false,\n): string {\n\tconst byteLength = exitOnNull ? array.indexOf(0) : array.length\n\tconst view = new DataView(array.buffer, array.byteOffset, byteLength)\n\tconst result = decodeText(view, { encoding: UTF_8 })\n\n\treturn exitOnNull ? result : result.replace(/\\0/g, '')\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { toArrayBuffer } from './toArrayBuffer.ts'\nimport { toUint8 } from './utf8.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\ntype MetadataFrame = {\n\tkey: string;\n\tdescription: string;\n\tdata: string | ArrayBufferLike;\n\tmimeType: string | null;\n\tpictureType: number | null;\n};\n\n/**\n * Decode an ID3 APIC frame.\n *\n * @param frame - the ID3 APIC frame\n *\n * @returns The decoded ID3 APIC frame\n *\n * @internal\n */\nexport function decodeId3ImageFrame(\n\tframe: RawId3Frame,\n): DecodedId3Frame<string | ArrayBufferLike> | undefined {\n\tconst metadataFrame: MetadataFrame = {\n\t\tkey: frame.type,\n\t\tdescription: '',\n\t\tdata: '',\n\t\tmimeType: null,\n\t\tpictureType: null,\n\t}\n\n\tconst utf8Encoding = 0x03\n\n\tif (frame.size < 2) {\n\t\treturn undefined\n\t}\n\tif (frame.data[0] !== utf8Encoding) {\n\t\tconsole.log('Ignore frame with unrecognized character ' + 'encoding')\n\t\treturn undefined\n\t}\n\n\tconst mimeTypeEndIndex = frame.data.subarray(1).indexOf(0)\n\tif (mimeTypeEndIndex === -1) {\n\t\treturn undefined\n\t}\n\tconst mimeType = utf8ArrayToStr(toUint8(frame.data, 1, mimeTypeEndIndex))\n\tconst pictureType = frame.data[2 + mimeTypeEndIndex]\n\tconst descriptionEndIndex = frame.data\n\t\t.subarray(3 + mimeTypeEndIndex)\n\t\t.indexOf(0)\n\tif (descriptionEndIndex === -1) {\n\t\treturn undefined\n\t}\n\tconst description = utf8ArrayToStr(\n\t\ttoUint8(frame.data, 3 + mimeTypeEndIndex, descriptionEndIndex),\n\t)\n\n\tlet data\n\tif (mimeType === '-->') {\n\t\tdata = utf8ArrayToStr(\n\t\t\ttoUint8(frame.data, 4 + mimeTypeEndIndex + descriptionEndIndex),\n\t\t)\n\t}\n\telse {\n\t\tdata = toArrayBuffer(\n\t\t\tframe.data.subarray(4 + mimeTypeEndIndex + descriptionEndIndex),\n\t\t)\n\t}\n\n\tmetadataFrame.mimeType = mimeType\n\tmetadataFrame.pictureType = pictureType\n\tmetadataFrame.description = description\n\tmetadataFrame.data = data\n\n\treturn metadataFrame\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\n/**\n * Decode an ID3 PRIV frame.\n *\n * @param frame - the ID3 PRIV frame\n *\n * @returns The decoded ID3 PRIV frame\n *\n * @internal\n */\nexport function decodeId3PrivFrame(\n\tframe: RawId3Frame,\n): DecodedId3Frame<ArrayBufferLike> | undefined {\n\t/*\n\tFormat: <text string>\\0<binary data>\n\t*/\n\tif (frame.size < 2) {\n\t\treturn undefined\n\t}\n\n\tconst owner = utf8ArrayToStr(frame.data, true)\n\tconst privateData = new Uint8Array(frame.data.subarray(owner.length + 1))\n\n\treturn { key: frame.type, info: owner, data: privateData.buffer }\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\n/**\n * Decodes an ID3 text frame\n *\n * @param frame - the ID3 text frame\n *\n * @returns The decoded ID3 text frame\n *\n * @internal\n */\nexport function decodeId3TextFrame(frame: RawId3Frame): DecodedId3Frame<string> | undefined {\n\tif (frame.size < 2) {\n\t\treturn undefined\n\t}\n\n\tif (frame.type === 'TXXX') {\n\t\t/*\n\t\tFormat:\n\t\t[0] = {Text Encoding}\n\t\t[1-?] = {Description}\\0{Value}\n\t\t*/\n\t\tlet index = 1\n\t\tconst { data } = frame\n\t\tconst description = utf8ArrayToStr(data.subarray(index), true)\n\n\t\tindex += description.length + 1\n\t\tconst value = utf8ArrayToStr(data.subarray(index))\n\n\t\treturn { key: frame.type, info: description, data: value }\n\t}\n\t/*\n\tFormat:\n\t[0] = {Text Encoding}\n\t[1-?] = {Value}\n\t*/\n\tconst text = utf8ArrayToStr(frame.data.subarray(1))\n\treturn { key: frame.type, info: '', data: text }\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { utf8ArrayToStr } from './utf8ArrayToStr.ts'\n\n/**\n * Decode a URL frame\n *\n * @param frame - the ID3 URL frame\n *\n * @returns The decoded ID3 URL frame\n *\n * @internal\n */\nexport function decodeId3UrlFrame(frame: RawId3Frame): DecodedId3Frame<string> | undefined {\n\tif (frame.type === 'WXXX') {\n\t\t/*\n\t\tFormat:\n\t\t[0] = {Text Encoding}\n\t\t[1-?] = {Description}\\0{URL}\n\t\t*/\n\t\tif (frame.size < 2) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tlet index = 1\n\t\tconst description: string = utf8ArrayToStr(\n\t\t\tframe.data.subarray(index),\n\t\t\ttrue,\n\t\t)\n\n\t\tindex += description.length + 1\n\t\tconst value: string = utf8ArrayToStr(frame.data.subarray(index))\n\n\t\treturn { key: frame.type, info: description, data: value }\n\t}\n\t/*\n\tFormat:\n\t[0-?] = {URL}\n\t*/\n\tconst url: string = utf8ArrayToStr(frame.data)\n\treturn { key: frame.type, info: '', data: url }\n}\n","import type { Id3Frame } from '../Id3Frame.ts'\nimport type { RawId3Frame } from './RawId3Frame.ts'\nimport { decodeId3ImageFrame } from './decodeId3ImageFrame.ts'\nimport { decodeId3PrivFrame } from './decodeId3PrivFrame.ts'\nimport { decodeId3TextFrame } from './decodeId3TextFrame.ts'\nimport { decodeId3UrlFrame } from './decodeId3UrlFrame.ts'\n\n/**\n * Decode an ID3 frame.\n *\n * @param frame - the ID3 frame\n *\n * @returns The decoded ID3 frame\n *\n * @internal\n */\nexport function decodeId3Frame(frame: RawId3Frame): Id3Frame | undefined {\n\tif (frame.type === 'PRIV') {\n\t\treturn decodeId3PrivFrame(frame)\n\t}\n\telse if (frame.type[0] === 'W') {\n\t\treturn decodeId3UrlFrame(frame)\n\t}\n\n\telse if (frame.type === 'APIC') {\n\t\treturn decodeId3ImageFrame(frame)\n\t}\n\n\treturn decodeId3TextFrame(frame)\n}\n","import type { RawId3Frame } from './RawId3Frame.ts'\nimport { readId3Size } from './readId3Size.ts'\n\n/**\n * Returns the data of an ID3 frame.\n *\n * @param data - The data to read from\n *\n * @returns The data of the ID3 frame\n *\n * @internal\n */\nexport function getId3FrameData(data: Uint8Array): RawId3Frame {\n\t/*\n\tFrame ID $xx xx xx xx (four characters)\n\tSize $xx xx xx xx\n\tFlags $xx xx\n\t*/\n\tconst type: string = String.fromCharCode(data[0], data[1], data[2], data[3])\n\tconst size: number = readId3Size(data, 4)\n\n\t// skip frame id, size, and flags\n\tconst offset = 10\n\n\treturn { type, size, data: data.subarray(offset, offset + size) }\n}\n","import type { Id3Frame } from './Id3Frame.ts'\nimport type { RawId3Frame } from './util/RawId3Frame.ts'\nimport { decodeId3Frame } from './util/decodeId3Frame.ts'\nimport { getId3FrameData } from './util/getId3FrameData.ts'\nimport { isId3Footer } from './util/isId3Footer.ts'\nimport { isId3Header } from './util/isId3Header.ts'\nimport { readId3Size } from './util/readId3Size.ts'\n\nconst HEADER_FOOTER_SIZE = 10\nconst FRAME_SIZE = 10\n\n/**\n * Returns an array of ID3 frames found in all the ID3 tags in the id3Data\n *\n * @param id3Data - The ID3 data containing one or more ID3 tags\n *\n * @returns Array of ID3 frame objects\n *\n * @public\n */\nexport function getId3Frames(id3Data: Uint8Array): Id3Frame[] {\n\tlet offset = 0\n\tconst frames: Id3Frame[] = []\n\n\twhile (isId3Header(id3Data, offset)) {\n\t\tconst size = readId3Size(id3Data, offset + 6)\n\n\t\tif ((id3Data[offset + 5] >> 6) & 1) {\n\t\t\t// skip extended header\n\t\t\toffset += HEADER_FOOTER_SIZE\n\t\t}\n\t\t// skip past ID3 header\n\t\toffset += HEADER_FOOTER_SIZE\n\t\tconst end = offset + size\n\t\t// loop through frames in the ID3 tag\n\t\twhile (offset + FRAME_SIZE < end) {\n\t\t\tconst frameData: RawId3Frame = getId3FrameData(id3Data.subarray(offset))\n\t\t\tconst frame: Id3Frame | undefined = decodeId3Frame(frameData)\n\t\t\tif (frame) {\n\t\t\t\tframes.push(frame)\n\t\t\t}\n\n\t\t\t// skip frame header and frame data\n\t\t\toffset += frameData.size + HEADER_FOOTER_SIZE\n\t\t}\n\n\t\tif (isId3Footer(id3Data, offset)) {\n\t\t\toffset += HEADER_FOOTER_SIZE\n\t\t}\n\t}\n\n\treturn frames\n}\n","import type { DecodedId3Frame } from './DecodedId3Frame.ts'\nimport type { Id3Frame } from './Id3Frame.ts'\n\n/**\n * Returns true if the ID3 frame is an Elementary Stream timestamp frame\n *\n * @param frame - the ID3 frame\n *\n * @returns `true` if the ID3 frame is an Elementary Stream timestamp frame\n *\n * @internal\n *\n */\nexport function isId3TimestampFrame(frame: Id3Frame): frame is DecodedId3Frame<ArrayBufferLike> {\n\treturn (\n\t\tframe &&\n\t\tframe.key === 'PRIV' &&\n\t\tframe.info === 'com.apple.streaming.transportStreamTimestamp'\n\t)\n}\n","import type { DecodedId3Frame } from '../DecodedId3Frame.ts'\n\n/**\n * Read a 33 bit timestamp from an ID3 frame.\n *\n * @param timeStampFrame - the ID3 frame\n *\n * @returns The timestamp\n *\n * @internal\n */\nexport function readId3Timestamp(\n\ttimeStampFrame: DecodedId3Frame<ArrayBufferLike>,\n): number | undefined {\n\tif (timeStampFrame.data.byteLength === 8) {\n\t\tconst data = new Uint8Array(timeStampFrame.data)\n\t\t// timestamp is 33 bit expressed as a big-endian eight-octet number,\n\t\t// with the upper 31 bits set to zero.\n\t\tconst pts33Bit = data[3] & 0x1\n\t\tlet timestamp =\n\t\t\t(data[4] << 23) + (data[5] << 15) + (data[6] << 7) + data[7]\n\t\ttimestamp /= 45\n\n\t\tif (pts33Bit) {\n\t\t\ttimestamp += 47721858.84\n\t\t} // 2^32 / 90\n\n\t\treturn Math.round(timestamp)\n\t}\n\n\treturn undefined\n}\n","import type { Id3Frame } from './Id3Frame.ts'\nimport { getId3Frames } from './getId3Frames.ts'\nimport { isId3TimestampFrame } from './isId3TimestampFrame.ts'\nimport { readId3Timestamp } from './util/readId3Timestamp.ts'\n\n/**\n * Searches for the Elementary Stream timestamp found in the ID3 data chunk\n *\n * @param data - Block of data containing one or more ID3 tags\n *\n * @returns The timestamp\n *\n * @public\n */\nexport function getId3Timestamp(data: Uint8Array): number | undefined {\n\tconst frames: Id3Frame[] = getId3Frames(data)\n\n\tfor (const frame of frames) {\n\t\tif (isId3TimestampFrame(frame)) {\n\t\t\treturn readId3Timestamp(frame)\n\t\t}\n\t}\n\n\treturn undefined\n}\n","/**\n * The scheme ID URI for ID3 tags.\n *\n * @public\n *\n * @see {@link https://aomediacodec.github.io/id3-emsg/ | Carriage of ID3 Timed Metadata in the Common Media Application Format (CMAF)}\n * @see {@link https://developer.apple.com/documentation/http-live-streaming/about-the-common-media-application-format-with-http-live-streaming-hls#CMAF-Tracks-Segments-Headers-and-Fragments | CMAF Tracks, Segments, Headers, and Fragments}\n */\nexport const ID3_SCHEME_ID_URI = 'https://aomedia.org/emsg/ID3'\n"],"mappings":";;;;;;;;;;;;AAUA,SAAgB,YAAY,MAAkB,QAAyB;CActE,IAAI,SAAS,MAAM,KAAK,QAGtB;MAAA,KAAK,YAAY,MACjB,KAAK,SAAS,OAAO,MACrB,KAAK,SAAS,OAAO,IAGjB;OAAA,KAAK,SAAS,KAAK,OAAQ,KAAK,SAAS,KAAK,KAGhD;QAAA,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,KAEnB,OAAO;GAAA;EACR;CACD;CAGF,OAAO;AACR;;;;;;;;;;;;;ACpCA,SAAgB,YAAY,MAAkB,QAAwB;CACrE,IAAI,OAAO;CACX,QAAQ,KAAK,UAAU,QAAS;CAChC,SAAS,KAAK,SAAS,KAAK,QAAS;CACrC,SAAS,KAAK,SAAS,KAAK,QAAS;CACrC,QAAQ,KAAK,SAAS,KAAK;CAC3B,OAAO;AACR;;;;;;;;;;;;;ACJA,SAAgB,YAAY,MAAkB,QAAyB;CACtE,OACC,YAAY,MAAM,MAAM,KACxB,YAAY,MAAM,SAAS,CAAC,IAAI,MAAM,KAAK,SAAS;AAEtD;;;;;;;;;;;;;ACRA,SAAgB,YAAY,MAAkB,QAAyB;CAItE,IAAI,SAAS,MAAM,KAAK,QAGtB;MAAA,KAAK,YAAY,MACjB,KAAK,SAAS,OAAO,MACrB,KAAK,SAAS,OAAO,IAGjB;OAAA,KAAK,SAAS,KAAK,OAAQ,KAAK,SAAS,KAAK,KAGhD;QAAA,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,OACnB,KAAK,SAAS,KAAK,KAEnB,OAAO;GAAA;EACR;CACD;CAIF,OAAO;AACR;;;;;;;;;;;;;;;ACrBA,SAAgB,WACf,MACA,Q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AAO,KAAK,MAAM,KAAK,KAAK;EAC3D,aAAa;EAEb,IAAI,UACH,aAAa;EAGd,OAAO,KAAK,MAAM,SAAS;CAC5B;AAGD;;;;;;;;;;;;ACjBA,SAAgB,gBAAgB,MAAsC;CACrE,MAAM,SAAqB,aAAa,IAAI;CAE5C,KAAK,MAAM,SAAS,QACnB,IAAI,oBAAoB,KAAK,GAC5B,OAAO,iBAAiB,KAAK;AAKhC;;;;;;;;;;;AChBA,MAAa,oBAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svta/cml-id3",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "ID3 tag parsing functionality",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -50,6 +50,6 @@
50
50
  }
51
51
  },
52
52
  "peerDependencies": {
53
- "@svta/cml-utils": "1.6.1"
53
+ "@svta/cml-utils": "^1.6.2"
54
54
  }
55
55
  }