Skip to content

Commit

Permalink
Reduce default cacheThreshold for video
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Feb 14, 2025
1 parent 56711da commit 960b5cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/core/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ import Events from './events/Events.js';
* lastBitrateCachingInfo: { enabled: true, ttl: 360000 },
* lastMediaSettingsCachingInfo: { enabled: true, ttl: 360000 },
* saveLastMediaSettingsForCurrentStreamingSession: true,
* cacheLoadThresholds: { video: 50, audio: 5 },
* cacheLoadThresholds: { video: 10, audio: 5 },
* trackSwitchMode: {
* audio: Constants.TRACK_SWITCH_MODE_ALWAYS_REPLACE,
* video: Constants.TRACK_SWITCH_MODE_NEVER_REPLACE
Expand Down Expand Up @@ -982,7 +982,7 @@ import Events from './events/Events.js';
* The default expiration is one hour, defined in milliseconds.
* @property {boolean} [saveLastMediaSettingsForCurrentStreamingSession=true]
* Set to true if dash.js should save media settings from last selected track for incoming track selection during current streaming session.
* @property {module:Settings~AudioVideoSettings} [cacheLoadThresholds={video: 50, audio: 5}]
* @property {module:Settings~AudioVideoSettings} [cacheLoadThresholds={video: 10, audio: 5}]
* For a given media type, the threshold which defines if the response to a fragment request is coming from browser cache or not.
* @property {module:Settings~AudioVideoSettings} [trackSwitchMode={video: "neverReplace", audio: "alwaysReplace"}]
* For a given media type defines if existing segments in the buffer should be overwritten once the track is switched. For instance if the user switches the audio language the existing segments in the audio buffer will be replaced when setting this value to "alwaysReplace".
Expand Down Expand Up @@ -1219,7 +1219,7 @@ function Settings() {
},
saveLastMediaSettingsForCurrentStreamingSession: true,
cacheLoadThresholds: {
video: 50,
video: 10,
audio: 5
},
trackSwitchMode: {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test/streaming/streaming.MediaPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ describe('MediaPlayer', function () {

it('should configure cacheLoadThresholds', function () {
let cacheLoadThresholdForVideo = player.getSettings().streaming.cacheLoadThresholds[Constants.VIDEO];
expect(cacheLoadThresholdForVideo).to.equal(50);
expect(cacheLoadThresholdForVideo).to.equal(10);

player.updateSettings({ 'streaming': { 'cacheLoadThresholds': { 'video': 10 } } });

Expand Down

0 comments on commit 960b5cd

Please sign in to comment.