mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-25 07:42:11 +00:00
chore(PlayerConfig): Add default value to some fields
This commit is contained in:
@@ -401,18 +401,18 @@ export function parseResponse<T extends IParsedResponse = IParsedResponse>(data:
|
||||
if (data.playerConfig) {
|
||||
const player_config = {
|
||||
audio_config: {
|
||||
loudness_db: data.playerConfig.audioConfig.loudnessDb,
|
||||
perceptual_loudness_db: data.playerConfig.audioConfig.perceptualLoudnessDb,
|
||||
enable_per_format_loudness: data.playerConfig.audioConfig.enablePerFormatLoudness
|
||||
loudness_db: data.playerConfig.audioConfig?.loudnessDb,
|
||||
perceptual_loudness_db: data.playerConfig.audioConfig?.perceptualLoudnessDb,
|
||||
enable_per_format_loudness: data.playerConfig.audioConfig?.enablePerFormatLoudness
|
||||
},
|
||||
stream_selection_config: {
|
||||
max_bitrate: data.playerConfig.streamSelectionConfig.maxBitrate
|
||||
max_bitrate: data.playerConfig.streamSelectionConfig?.maxBitrate || '0'
|
||||
},
|
||||
media_common_config: {
|
||||
dynamic_readahead_config: {
|
||||
max_read_ahead_media_time_ms: data.playerConfig.mediaCommonConfig.dynamicReadaheadConfig.maxReadAheadMediaTimeMs,
|
||||
min_read_ahead_media_time_ms: data.playerConfig.mediaCommonConfig.dynamicReadaheadConfig.minReadAheadMediaTimeMs,
|
||||
read_ahead_growth_rate_ms: data.playerConfig.mediaCommonConfig.dynamicReadaheadConfig.readAheadGrowthRateMs
|
||||
max_read_ahead_media_time_ms: data.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.maxReadAheadMediaTimeMs || 0,
|
||||
min_read_ahead_media_time_ms: data.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.minReadAheadMediaTimeMs || 0,
|
||||
read_ahead_growth_rate_ms: data.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.readAheadGrowthRateMs || 0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -74,8 +74,8 @@ export interface IParsedResponse {
|
||||
|
||||
export interface IPlayerConfig {
|
||||
audio_config: {
|
||||
loudness_db: number;
|
||||
perceptual_loudness_db: number;
|
||||
loudness_db?: number;
|
||||
perceptual_loudness_db?: number;
|
||||
enable_per_format_loudness: boolean;
|
||||
};
|
||||
stream_selection_config: {
|
||||
|
||||
@@ -3,8 +3,8 @@ export type RawData = RawNode | RawNode[];
|
||||
|
||||
export interface IRawPlayerConfig {
|
||||
audioConfig: {
|
||||
loudnessDb: number;
|
||||
perceptualLoudnessDb: number;
|
||||
loudnessDb?: number;
|
||||
perceptualLoudnessDb?: number;
|
||||
enablePerFormatLoudness: boolean;
|
||||
};
|
||||
streamSelectionConfig: {
|
||||
|
||||
Reference in New Issue
Block a user