Player configuration ******************** High-value "PlayerConfiguration" options are documented on their own pages: Analytics, Advertising, and Thumbnails. This page covers streaming/buffering, retry behavior, and autoplay. Basics (source, format, start time, volume) are covered in Player basics; language preferences in Tracks and languages. Code samples: * Player configuration (https://raw.githubusercontent.com/castlabs/prestoplay-web-code-samples/refs/heads/main/examples/player/configuration.js): autoplay and the browser autoplay policy, start time, volume, muted state, buffering goals, and retries. Streaming configuration ======================= "StreamingConfiguration", passed under the "streaming" key, controls buffering and segment download behavior. player.open({ source: 'https://example.com/manifest.mpd', streaming: { bufferingGoal: 20, // seconds to buffer ahead of the playhead (default: 10) rebufferingGoal: 5, // minimum seconds to resume after a stall; must be <= bufferingGoal (default: 2) bufferBehind: 30, // seconds of content kept behind the playhead (default: 30) }, }); Retry configuration =================== The player retries failed network requests automatically. Control retry behavior through "AttemptParameters": * "streaming.attemptParameters" controls retries for segment requests. * "manifest.attemptParameters" controls retries for manifest requests. player.open({ source: 'https://example.com/manifest.mpd', streaming: { attemptParameters: { maxAttempts: 5, // maximum number of attempts (including the first) baseDelay: 1000, // delay before the first retry, in milliseconds backoffFactor: 2, // multiplier applied to the delay on each retry fuzzFactor: 0.5, // randomization factor to spread retry timing timeout: 30000, // per-request timeout in milliseconds; 0 = unlimited }, }, manifest: { attemptParameters: { maxAttempts: 3, baseDelay: 500, backoffFactor: 2, fuzzFactor: 0.5, timeout: 15000, }, }, }); Low latency =========== For low latency streaming configuration, see Low latency. Autoplay ======== "autoplay" controls whether playback starts when "Player.open" (https://players.castlabs.com/web/latest/docs/api/clpp.Player.md#open) resolves. Default: "false" (loaded and buffered, paused). await player.open({ source: '//example.com/manifest1.mpd', autoplay: false, // default }); // Content is ready but paused — start playback after the button is clicked playButton.addEventListener('click', () => player.play()); With "autoplay: true", the player starts playing as soon as the content is ready, with no additional call: await player.open({ source: '//example.com/manifest1.mpd', autoplay: true, }); // Playback starts automatically when open() resolves Use the "autoplay" configuration option rather than the HTML "