mirror of
https://github.com/LuanRT/googlevideo.git
synced 2026-06-30 09:55:15 +00:00
feat!: rework library (#27)
This commit is contained in:
13
docs/api/exports/utils/namespaces/FormatKeyUtils/README.md
Normal file
13
docs/api/exports/utils/namespaces/FormatKeyUtils/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
[googlevideo](../../../../README.md) / [exports/utils](../../README.md) / FormatKeyUtils
|
||||
|
||||
# FormatKeyUtils
|
||||
|
||||
## Functions
|
||||
|
||||
- [createKey](functions/createKey.md)
|
||||
- [createSegmentCacheKey](functions/createSegmentCacheKey.md)
|
||||
- [createSegmentCacheKeyFromMetadata](functions/createSegmentCacheKeyFromMetadata.md)
|
||||
- [fromFormat](functions/fromFormat.md)
|
||||
- [fromFormatInitializationMetadata](functions/fromFormatInitializationMetadata.md)
|
||||
- [fromMediaHeader](functions/fromMediaHeader.md)
|
||||
- [getUniqueFormatId](functions/getUniqueFormatId.md)
|
||||
@@ -0,0 +1,25 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / createKey
|
||||
|
||||
# Function: createKey()
|
||||
|
||||
> **createKey**(`itag`, `xtags`): `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:10](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L10)
|
||||
|
||||
Creates a format key based on itag and xtags.
|
||||
|
||||
## Parameters
|
||||
|
||||
### itag
|
||||
|
||||
`undefined` | `number`
|
||||
|
||||
### xtags
|
||||
|
||||
`undefined` | `string`
|
||||
|
||||
## Returns
|
||||
|
||||
`string`
|
||||
|
||||
A string format key.
|
||||
@@ -0,0 +1,29 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / createSegmentCacheKey
|
||||
|
||||
# Function: createSegmentCacheKey()
|
||||
|
||||
> **createSegmentCacheKey**(`mediaHeader`, `format?`): `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:47](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L47)
|
||||
|
||||
Creates a segment cache key.
|
||||
|
||||
## Parameters
|
||||
|
||||
### mediaHeader
|
||||
|
||||
[`MediaHeader`](../../../../protos/interfaces/MediaHeader.md)
|
||||
|
||||
The MediaHeader object.
|
||||
|
||||
### format?
|
||||
|
||||
[`SabrFormat`](../../../../../types/shared/interfaces/SabrFormat.md)
|
||||
|
||||
Format object (needed for init segments.)
|
||||
|
||||
## Returns
|
||||
|
||||
`string`
|
||||
|
||||
A string key for caching segments.
|
||||
@@ -0,0 +1,21 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / createSegmentCacheKeyFromMetadata
|
||||
|
||||
# Function: createSegmentCacheKeyFromMetadata()
|
||||
|
||||
> **createSegmentCacheKeyFromMetadata**(`requestMetadata`): `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:61](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L61)
|
||||
|
||||
Creates a cache key from request metadata.
|
||||
|
||||
## Parameters
|
||||
|
||||
### requestMetadata
|
||||
|
||||
[`SabrRequestMetadata`](../../../../sabr-streaming-adapter/interfaces/SabrRequestMetadata.md)
|
||||
|
||||
## Returns
|
||||
|
||||
`string`
|
||||
|
||||
A string key for caching segments.
|
||||
@@ -0,0 +1,27 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / fromFormat
|
||||
|
||||
# Function: fromFormat()
|
||||
|
||||
> **fromFormat**(`format?`): `undefined` \| `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:18](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L18)
|
||||
|
||||
Creates a format key from a SabrFormat object.
|
||||
|
||||
## Parameters
|
||||
|
||||
### format?
|
||||
|
||||
#### itag?
|
||||
|
||||
`number`
|
||||
|
||||
#### xtags?
|
||||
|
||||
`string`
|
||||
|
||||
## Returns
|
||||
|
||||
`undefined` \| `string`
|
||||
|
||||
A string format key or undefined if format is undefined.
|
||||
@@ -0,0 +1,21 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / fromFormatInitializationMetadata
|
||||
|
||||
# Function: fromFormatInitializationMetadata()
|
||||
|
||||
> **fromFormatInitializationMetadata**(`formatInitMetadata`): `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:35](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L35)
|
||||
|
||||
Creates a format key from FormatInitializationMetadata.
|
||||
|
||||
## Parameters
|
||||
|
||||
### formatInitMetadata
|
||||
|
||||
[`FormatInitializationMetadata`](../../../../protos/interfaces/FormatInitializationMetadata.md)
|
||||
|
||||
## Returns
|
||||
|
||||
`string`
|
||||
|
||||
A string format key or undefined if formatId is undefined.
|
||||
@@ -0,0 +1,21 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / fromMediaHeader
|
||||
|
||||
# Function: fromMediaHeader()
|
||||
|
||||
> **fromMediaHeader**(`mediaHeader`): `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:27](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L27)
|
||||
|
||||
Creates a format key from a MediaHeader object.
|
||||
|
||||
## Parameters
|
||||
|
||||
### mediaHeader
|
||||
|
||||
[`MediaHeader`](../../../../protos/interfaces/MediaHeader.md)
|
||||
|
||||
## Returns
|
||||
|
||||
`string`
|
||||
|
||||
A string format key.
|
||||
@@ -0,0 +1,23 @@
|
||||
[googlevideo](../../../../../README.md) / [exports/utils](../../../README.md) / [FormatKeyUtils](../README.md) / getUniqueFormatId
|
||||
|
||||
# Function: getUniqueFormatId()
|
||||
|
||||
> **getUniqueFormatId**(`format`): `string`
|
||||
|
||||
Defined in: [src/utils/formatKeyUtils.ts:85](https://github.com/LuanRT/googlevideo/blob/cc730b4dbadc5ae882d6aa28d716e442943577fa/src/utils/formatKeyUtils.ts#L85)
|
||||
|
||||
Generates a unique format ID based on the SabrFormat properties.
|
||||
|
||||
## Parameters
|
||||
|
||||
### format
|
||||
|
||||
[`SabrFormat`](../../../../../types/shared/interfaces/SabrFormat.md)
|
||||
|
||||
The SabrFormat object.
|
||||
|
||||
## Returns
|
||||
|
||||
`string`
|
||||
|
||||
A unique string identifier for the format.
|
||||
Reference in New Issue
Block a user