-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue/45-cmcd-non-finite
Signed-off-by: Casey Occhialini <[email protected]>
- Loading branch information
Showing
115 changed files
with
909 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
indent_style = tab | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { appendCmcdQuery } from '@svta/common-media-library/cmcd/appendCmcdQuery.js'; | ||
|
||
console.log(appendCmcdQuery('https://test.com/?CMCD=bs%2Cot%3Dm%2Csf%3Dh', { mtp: 123 })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<body> | ||
<script type="module" src="dev.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@svta/common-media-library-dev", | ||
"private": true, | ||
"version": "0.5.1", | ||
"license": "Apache-2.0", | ||
"type": "module", | ||
"homepage": "https://github.com/streaming-video-technology-alliance/common-media-library", | ||
"authors": "Casey Occhialini <[email protected]>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/streaming-video-technology-alliance/common-media-library.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/streaming-video-technology-alliance/common-media-library/issues" | ||
}, | ||
"scripts": { | ||
"start": "web-dev-server --node-resolve --open --watch" | ||
}, | ||
"devDependencies": { | ||
"typedoc": "0.25.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* CMCD parameter name. | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export const CMCD_PARAM = 'CMCD'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { CmCustomKey } from '../cta/CmCustomKey.js'; | ||
|
||
/** | ||
* A custom key for CMCD. Custom keys MUST carry a hyphenated prefix | ||
* to ensure that there will not be a namespace collision with future | ||
* revisions to this specification. Clients SHOULD use a reverse-DNS | ||
* A custom key for CMCD. Custom keys MUST carry a hyphenated prefix | ||
* to ensure that there will not be a namespace collision with future | ||
* revisions to this specification. Clients SHOULD use a reverse-DNS | ||
* syntax when defining their own prefix. | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export type CmcdCustomKey = CmCustomKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
import { CmcdFormatter } from './CmcdFormatter.js'; | ||
import { CmcdHeadersMap } from './CmcdHeadersMap.js'; | ||
import { CmcdKey } from './CmcdKey.js'; | ||
import { CmcdValue } from './CmcdValue.js'; | ||
|
||
/** | ||
* Options for encoding CMCD values. | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export interface CmcdEncodeOptions { | ||
/** | ||
* A map of CMCD keys to custom formatters. | ||
*/ | ||
formatters?: Record<CmcdKey, (value: CmcdValue) => number | string>; | ||
/** | ||
* A map of CMCD keys to custom formatters. | ||
*/ | ||
formatters?: Record<CmcdKey, CmcdFormatter>; | ||
|
||
/** | ||
* A map of CMCD header fields to custom CMCD keys. | ||
*/ | ||
customHeaderMap?: CmcdHeadersMap; | ||
/** | ||
* A map of CMCD header fields to custom CMCD keys. | ||
*/ | ||
customHeaderMap?: CmcdHeadersMap; | ||
|
||
/** | ||
* A filter function for CMCD keys. | ||
* | ||
* @param key - The CMCD key to filter. | ||
* | ||
* @returns `true` if the key should be included, `false` otherwise. | ||
*/ | ||
filter?: (key: CmcdKey) => boolean; | ||
/** | ||
* A filter function for CMCD keys. | ||
* | ||
* @param key - The CMCD key to filter. | ||
* | ||
* @returns `true` if the key should be included, `false` otherwise. | ||
*/ | ||
filter?: (key: CmcdKey) => boolean; | ||
|
||
/** | ||
* The base URL to use for relative URLs. | ||
*/ | ||
baseUrl?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
/** | ||
* CMCD encoding types. | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export enum CmcdEncoding { | ||
/** | ||
* JSON | ||
*/ | ||
JSON = 'json', | ||
/** | ||
* JSON | ||
*/ | ||
JSON = 'json', | ||
|
||
/** | ||
* Query string | ||
*/ | ||
QUERY = 'query', | ||
/** | ||
* Query string | ||
*/ | ||
QUERY = 'query', | ||
|
||
/** | ||
* Request headers | ||
*/ | ||
HEADERS = 'headers', | ||
/** | ||
* Request headers | ||
*/ | ||
HEADERS = 'headers', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { CmcdEncodeOptions } from './CmcdEncodeOptions.js'; | ||
import { CmcdValue } from './CmcdValue.js'; | ||
|
||
/** | ||
* A formatter for CMCD values. | ||
* | ||
* | ||
* @param value - The value to format. | ||
* | ||
* | ||
* @returns The formatted value. | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export type CmcdFormatter = (value: CmcdValue) => string; | ||
export type CmcdFormatter = (value: CmcdValue, options?: CmcdEncodeOptions) => string | number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* CMCD header fields. | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export enum CmcdHeaderField { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* Common Media Object Type | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export { CmObjectType as CmcdObjectType } from '../cta/CmObjectType.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* Common Media Streaming Type | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export { CmStreamType as CmcdStreamType } from '../cta/CmStreamType.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* Common Media Streaming Format | ||
* | ||
* | ||
* @group CMCD | ||
* | ||
* | ||
* @beta | ||
*/ | ||
export { CmStreamingFormat as CmcdStreamingFormat } from '../cta/CmStreamingFormat.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.