-
Notifications
You must be signed in to change notification settings - Fork 22
/
ABRConfiguration.ts
133 lines (122 loc) · 4.47 KB
/
ABRConfiguration.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import { Resolution } from '../resolution/Resolution';
/**
* The adaptive bitrate strategy of the first segment, represented by a value from the following list:
* <br/> - `'performance'`: The player will optimize ABR behavior to focus on the performance of the player. This strategy initiates playback with the lowest quality suitable for the device which means faster start-up time.
* <br/> - `'quality'`: The player will optimize ABR behavior to focus displaying the best visual quality to the end-user. This strategy initiates playback with the highest bit rate suitable for the device.
* <br/> - `'bandwidth'`: The player will optimize the ABR behavior to focus on displaying the most optimal quality based on historic data of available bandwidth and knowledge of the network conditions.
*
* @public
*/
export enum ABRStrategyType {
performance = 'performance',
quality = 'quality',
bandwidth = 'bandwidth',
}
/**
* Describes the metadata of the adaptive bitrate strategy.
*
* @public
*/
export interface ABRMetadata {
/**
* The initial bitrate, in bits per second.
*
* @defaultValue Bitrate available to the browser.
*/
bitrate?: number;
}
/**
* Describes the configuration of the adaptive bitrate strategy.
*
* @public
*/
export interface ABRStrategyConfiguration {
/**
* The strategy for initial playback.
*/
type: ABRStrategyType;
/**
* The metadata for the initial playback strategy.
*
* @defaultValue A {@link ABRMetadata} object with default values.
*/
metadata?: ABRMetadata;
}
/**
* The adaptive bitrate stratey.
*
* @public
*/
export type ABRStrategy = ABRStrategyConfiguration | ABRStrategyType;
/**
* Describes the adaptive bitrate configuration.
*
* @public
*/
export interface ABRConfiguration {
/**
* The adaptive bitrate strategy.
*
* @defaultValue `'bandwidth'`
* @remarks
* <br/> - This property is currently supported on Web and Android platforms only.
*/
strategy?: ABRStrategy;
/**
* The amount which the player should buffer ahead of the current playback position, in seconds.
*
* @remarks
* <br/> - Before v4.3.0: This duration has a maximum of 60 seconds.
* <br/> - After v4.3.0: This duration has no maximum.
* <br/> - The player might reduce or ignore the configured amount because of device or performance constraints.
*
* @defaultValue `20`
*/
targetBuffer?: number;
/**
* The amount of data which the player should keep in its buffer before the current playback position, in seconds.
* This configuration option can be used to reduce the memory footprint on memory restricted devices or on devices
* which don't automatically prune decoder buffers.
*
* Note that the player can decide to keep less data in the decoder buffer in case memory is running low.
* A value of 0 or lower is not accepted and will be treated as default.
*
* @defaultValue `30`
*
* @remarks
* <br/> - This property is currently supported on Web platforms only.
*/
bufferLookbackWindow?: number;
/**
* The maximum length of the player's buffer, in seconds.
*
* The player will initially buffer up to {@link ABRConfiguration.targetBuffer} seconds of media data.
* If the player detects that the decoder is unable to hold so much data,
* it will reduce `maxBufferLength` and restrict `targetBuffer` to be less than
* this maximum.
*
* @remarks
* <br/> - This property is currently supported on Web platforms only.
*/
readonly maxBufferLength?: number;
/**
* The desired limit of network bandwidth consumption for this item.
*
* Set preferredPeakBitRate to non-zero to indicate that the player should attempt to limit item playback to that bit rate, expressed in bits per second.
* If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRate, it will be reduced as much as possible while continuing to play the item.
*
* @remarks
* <br/> - This property is supported on iOS platforms only.
*/
preferredPeakBitRate?: number;
/**
* A preferred upper limit on the resolution of the video to be downloaded (or otherwise transferred) and rendered by the player.
*
* The default value is (0,0), which indicates that the client enforces no limit on video resolution. Other values indicate a preferred maximum video resolution.
* It only applies to HTTP Live Streaming asset.
*
* @remarks
* <br/> - This property is supported on iOS platforms only.
*/
preferredMaximumResolution?: Resolution;
}