Skip to content

Commit

Permalink
change default value for onVideoTracksNotPlayable and onAudioTracksNo…
Browse files Browse the repository at this point in the history
…tPlayable to "error"
  • Loading branch information
Florent-Bouisset committed Jan 9, 2025
1 parent 2a66760 commit ef25c83
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions doc/api/Loading_a_Content.md
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ Those are the possible values for that option:

_type_: `string|undefined`

_defaults_: `"continue"`
_defaults_: `"error"`

Specifies the behavior when all audio tracks are not playable.

Expand All @@ -729,7 +729,7 @@ If neither the audio nor the video tracks are playable, an error will be thrown

_type_: `string|undefined`

_defaults_: `"continue"`
_defaults_: `"error"`

Specifies the behavior when all video tracks are not playable.

Expand Down
4 changes: 2 additions & 2 deletions src/default_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const DEFAULT_CONFIG = {
*
* Note: If neither the audio nor the video tracks are playable, an error will be thrown regardless of this setting.
*/
DEFAULT_AUDIO_TRACKS_NOT_PLAYABLE_BEHAVIOR: "continue" as "continue" | "error",
DEFAULT_AUDIO_TRACKS_NOT_PLAYABLE_BEHAVIOR: "error" as "continue" | "error",

/**
* Specifies the behavior when all video tracks are not playable.
Expand All @@ -115,7 +115,7 @@ const DEFAULT_CONFIG = {
*
* Note: If neither the audio nor the video tracks are playable, an error will be thrown regardless of this setting.
*/
DEFAULT_VIDEO_TRACKS_NOT_PLAYABLE_BEHAVIOR: "continue" as "continue" | "error",
DEFAULT_VIDEO_TRACKS_NOT_PLAYABLE_BEHAVIOR: "error" as "continue" | "error",

/**
* If set to true, video through loadVideo will auto play by default
Expand Down
4 changes: 2 additions & 2 deletions src/main_thread/api/__tests__/option_utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ describe("API - parseLoadVideoOptions", () => {
minimumManifestUpdateInterval: 0,
mode: "auto",
onCodecSwitch: "continue",
onAudioTracksNotPlayable: "continue",
onVideoTracksNotPlayable: "continue",
onAudioTracksNotPlayable: "error",
onVideoTracksNotPlayable: "error",
requestConfig: {},
referenceDateTime: undefined,
representationFilter: undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/manifest/classes/__tests__/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import type IManifest from "../manifest";
import type IPeriod from "../period";

const defaultManifestOptions = {
onAudioTracksNotPlayable: "continue" as const,
onVideoTracksNotPlayable: "continue" as const,
onAudioTracksNotPlayable: "error" as const,
onVideoTracksNotPlayable: "error" as const,
};

function generateParsedPeriod(
Expand Down
4 changes: 2 additions & 2 deletions src/manifest/classes/__tests__/period.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import CodecSupportCache from "../codec_support_cache";
import type IPeriod from "../period";

const defaultPeriodOptions = {
onAudioTracksNotPlayable: "continue" as const,
onVideoTracksNotPlayable: "continue" as const,
onAudioTracksNotPlayable: "error" as const,
onVideoTracksNotPlayable: "error" as const,
};

describe("Manifest - Period", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest/classes/__tests__/update_periods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FakePeriod implements IPeriodMetadata {
this.duration = end === undefined ? undefined : end - (start ?? 0);
this.streamEvents = [];
this.adaptations = {};
this.onAudioTracksNotPlayable = "continue";
this.onAudioTracksNotPlayable = "error";
this.onVideoTracksNotPlayable = "error";
}
createAdaptationsObject() {
Expand Down

0 comments on commit ef25c83

Please sign in to comment.