@svta/cml-dash 1.0.0 → 1.0.2
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 +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param frameRate - The frame rate string to parse.
|
|
6
6
|
* @returns The frame rate as a number.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* {@includeCode ../test/parseFrameRate.test.ts#example}
|
|
@@ -25,7 +25,7 @@ declare function parseFrameRate(frameRate: string): number;
|
|
|
25
25
|
*
|
|
26
26
|
* @returns Processed URI template.
|
|
27
27
|
*
|
|
28
|
-
* @
|
|
28
|
+
* @public
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* {@includeCode ../test/processUriTemplate.test.ts#example}
|
|
@@ -36,8 +36,7 @@ declare function processUriTemplate(uriTemplate: string, representationId: strin
|
|
|
36
36
|
/**
|
|
37
37
|
* The scheme ID URI for thumbnail tiles in DASH.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
* @beta
|
|
39
|
+
* @public
|
|
41
40
|
*/
|
|
42
41
|
declare const THUMBNAIL_TILE_SCHEME_ID_URI = "http://dashif.org/guidelines/thumbnail_tile";
|
|
43
42
|
//#endregion
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/parseFrameRate.ts","../src/processUriTemplate.ts","../src/THUMBNAIL_TILE_SCHEME_ID_URI.ts"],"sourcesContent":[],"mappings":";;AAWA;;;;ACQA;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/parseFrameRate.ts","../src/processUriTemplate.ts","../src/THUMBNAIL_TILE_SCHEME_ID_URI.ts"],"sourcesContent":[],"mappings":";;AAWA;;;;ACQA;;;;ACdA;;iBFMgB,cAAA;;;;AAAhB;;;;ACQA;;;;ACdA;;;;;;;;iBDcgB,kBAAA;;;;ADRhB;;;;ACQgB,cCdH,4BAAA,GDcG,6CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param frameRate - The frame rate string to parse.
|
|
6
6
|
* @returns The frame rate as a number.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* {@includeCode ../test/parseFrameRate.test.ts#example}
|
|
@@ -32,7 +32,7 @@ const TOKENS = /\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]
|
|
|
32
32
|
*
|
|
33
33
|
* @returns Processed URI template.
|
|
34
34
|
*
|
|
35
|
-
* @
|
|
35
|
+
* @public
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* {@includeCode ../test/processUriTemplate.test.ts#example}
|
|
@@ -92,8 +92,7 @@ function processUriTemplate(uriTemplate, representationId, number, subNumber, ba
|
|
|
92
92
|
/**
|
|
93
93
|
* The scheme ID URI for thumbnail tiles in DASH.
|
|
94
94
|
*
|
|
95
|
-
*
|
|
96
|
-
* @beta
|
|
95
|
+
* @public
|
|
97
96
|
*/
|
|
98
97
|
const THUMBNAIL_TILE_SCHEME_ID_URI = "http://dashif.org/guidelines/thumbnail_tile";
|
|
99
98
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["value: string | number | null | undefined","valueString: string"],"sources":["../src/parseFrameRate.ts","../src/processUriTemplate.ts","../src/THUMBNAIL_TILE_SCHEME_ID_URI.ts"],"sourcesContent":["/**\n * Parses a DASH framerate string into a number.\n *\n * @param frameRate - The frame rate string to parse.\n * @returns The frame rate as a number.\n *\n * @
|
|
1
|
+
{"version":3,"file":"index.js","names":["value: string | number | null | undefined","valueString: string"],"sources":["../src/parseFrameRate.ts","../src/processUriTemplate.ts","../src/THUMBNAIL_TILE_SCHEME_ID_URI.ts"],"sourcesContent":["/**\n * Parses a DASH framerate string into a number.\n *\n * @param frameRate - The frame rate string to parse.\n * @returns The frame rate as a number.\n *\n * @public\n *\n * @example\n * {@includeCode ../test/parseFrameRate.test.ts#example}\n */\nexport function parseFrameRate(frameRate: string): number {\n\tconst [numerator, denominator] = frameRate.split('/').map(value => parseInt(value, 10))\n\n\tif (denominator === undefined) {\n\t\treturn numerator\n\t}\n\n\tif (isNaN(numerator) || isNaN(denominator) || denominator === 0) {\n\t\treturn NaN\n\t}\n\n\treturn numerator / denominator\n}\n","const TOKENS = /\\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\\$/g\n\n/**\n * Process a URI template used in `SegmentTemplate` nodes.\n *\n * @param uriTemplate - URI template to process.\n * @param representationId - Representation ID.\n * @param number - Number.\n * @param subNumber - Sub-number.\n * @param bandwidth - Bandwidth.\n * @param time - Time. Should be passed as a number unless the value is larger than `MAX_SAFE_INTEGER`, then it should be provided as a string. If the value is a string all format tags will be ignored.\n *\n * @returns Processed URI template.\n *\n * @public\n *\n * @example\n * {@includeCode ../test/processUriTemplate.test.ts#example}\n */\nexport function processUriTemplate(\n\turiTemplate: string,\n\trepresentationId: string | null | undefined,\n\tnumber: number | null | undefined,\n\tsubNumber: number | null | undefined,\n\tbandwidth: number | null | undefined,\n\ttime: string | number | null | undefined,\n): string {\n\tconst uri = uriTemplate.replace(TOKENS, (match, name, widthStr, format) => {\n\t\tlet value: string | number | null | undefined\n\n\t\tswitch (name) {\n\t\t\tcase undefined: // $$ case\n\t\t\t\treturn '$'\n\n\t\t\tcase 'RepresentationID':\n\t\t\t\tvalue = representationId\n\t\t\t\tbreak\n\n\t\t\tcase 'Number':\n\t\t\t\tvalue = number\n\t\t\t\tbreak\n\n\t\t\tcase 'SubNumber':\n\t\t\t\tvalue = subNumber\n\t\t\t\tbreak\n\n\t\t\tcase 'Bandwidth':\n\t\t\t\tvalue = bandwidth\n\t\t\t\tbreak\n\n\t\t\tcase 'Time':\n\t\t\t\tif (typeof time === 'string') {\n\t\t\t\t\treturn time\n\t\t\t\t}\n\n\t\t\t\tvalue = time ? Math.round(time) : time\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tvalue = null\n\t\t}\n\n\t\tif (value == null) {\n\t\t\treturn match\n\t\t}\n\n\t\tlet valueString: string\n\n\t\tswitch (format) {\n\t\t\tcase undefined: // Happens if there is no format specifier.\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\tvalueString = value.toString()\n\t\t\t\tbreak\n\n\t\t\tcase 'o':\n\t\t\t\tvalueString = value.toString(8)\n\t\t\t\tbreak\n\n\t\t\tcase 'x':\n\t\t\t\tvalueString = value.toString(16)\n\t\t\t\tbreak\n\n\t\t\tcase 'X':\n\t\t\t\tvalueString = value.toString(16).toUpperCase()\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tvalueString = value.toString()\n\t\t\t\tbreak\n\t\t}\n\n\t\tconst width = parseInt(widthStr, 10) || 1\n\t\treturn valueString.padStart(width, '0')\n\t})\n\n\treturn uri\n}\n","/**\n * The scheme ID URI for thumbnail tiles in DASH.\n *\n * @public\n */\nexport const THUMBNAIL_TILE_SCHEME_ID_URI = 'http://dashif.org/guidelines/thumbnail_tile'\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,eAAe,WAA2B;CACzD,MAAM,CAAC,WAAW,eAAe,UAAU,MAAM,IAAI,CAAC,KAAI,UAAS,SAAS,OAAO,GAAG,CAAC;AAEvF,KAAI,gBAAgB,OACnB,QAAO;AAGR,KAAI,MAAM,UAAU,IAAI,MAAM,YAAY,IAAI,gBAAgB,EAC7D,QAAO;AAGR,QAAO,YAAY;;;;;ACtBpB,MAAM,SAAS;;;;;;;;;;;;;;;;;;AAmBf,SAAgB,mBACf,aACA,kBACA,QACA,WACA,WACA,MACS;AAuET,QAtEY,YAAY,QAAQ,SAAS,OAAO,MAAM,UAAU,WAAW;EAC1E,IAAIA;AAEJ,UAAQ,MAAR;GACC,KAAK,OACJ,QAAO;GAER,KAAK;AACJ,YAAQ;AACR;GAED,KAAK;AACJ,YAAQ;AACR;GAED,KAAK;AACJ,YAAQ;AACR;GAED,KAAK;AACJ,YAAQ;AACR;GAED,KAAK;AACJ,QAAI,OAAO,SAAS,SACnB,QAAO;AAGR,YAAQ,OAAO,KAAK,MAAM,KAAK,GAAG;AAClC;GAED,QACC,SAAQ;;AAGV,MAAI,SAAS,KACZ,QAAO;EAGR,IAAIC;AAEJ,UAAQ,QAAR;GACC,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;AACJ,kBAAc,MAAM,UAAU;AAC9B;GAED,KAAK;AACJ,kBAAc,MAAM,SAAS,EAAE;AAC/B;GAED,KAAK;AACJ,kBAAc,MAAM,SAAS,GAAG;AAChC;GAED,KAAK;AACJ,kBAAc,MAAM,SAAS,GAAG,CAAC,aAAa;AAC9C;GAED;AACC,kBAAc,MAAM,UAAU;AAC9B;;EAGF,MAAM,QAAQ,SAAS,UAAU,GAAG,IAAI;AACxC,SAAO,YAAY,SAAS,OAAO,IAAI;GACtC;;;;;;;;;;AC1FH,MAAa,+BAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svta/cml-dash",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "DASH manifest parsing functionality",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@svta/cml-utils": "
|
|
54
|
+
"@svta/cml-utils": "1.1.0"
|
|
55
55
|
}
|
|
56
56
|
}
|