AudioRecoveryPolicy class
Configures the automatic audio-stream error recovery loop (retry attempts, backoff, and stall detection) shared by the iOS/Android/web audio navigators.
Plugin-owned flat config (not a Readium-owned model) — serialized as a
flat Map, not json.encode. Set once via
FlutterReadium().setAudioRecoveryPolicy(...) before opening a publication.
Existing audio navigators keep the policy captured at construction time.
Explicit player errors recover automatically by default. Resource-loading timeouts only report loading unless the application opts into rebuilding.
- Annotations
Constructors
- AudioRecoveryPolicy({int maxAttempts = 3, double backoffBaseSeconds = 1.0, double stallTimeoutSeconds = 20.0, double connectionTimeoutSeconds = 10.0, bool recoverOnResourceLoadingTimeout = false})
-
const
-
AudioRecoveryPolicy.fromJson(Map<
String, dynamic> json) -
factory
Properties
- backoffBaseSeconds → double
-
Base delay, in seconds, for the exponential backoff between recovery
attempts (
backoffBaseSeconds * 2^(attempt-1), i.e. 1s/2s/4s with the default). Defaults to1.0.final - connectionTimeoutSeconds → double
-
How long, in seconds, a single recovery attempt may spend rebuilding the
player / (re)connecting before that attempt is abandoned and the loop
moves on (to the next attempt, or to terminal failure). Bounds a stalled
connect so a dead network can't hang recovery indefinitely. Defaults to
10.0.final - hashCode → int
-
The hash code for this object.
no setterinherited
- maxAttempts → int
-
Maximum number of automatic recovery attempts before entering a
terminal failure state. Defaults to
3.final -
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- recoverOnResourceLoadingTimeout → bool
-
Whether a resource-loading timeout starts automatic recovery.
When false, the timeout only reports a loading state. Defaults to
false.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stallTimeoutSeconds → double
-
How long, in seconds, a resource-loading attempt may wait for its first
forward playback progress before reporting a loading stall.
Defaults to
20.0.final - stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
copyWith(
{Object? maxAttempts = unset, Object? backoffBaseSeconds = unset, Object? stallTimeoutSeconds = unset, Object? connectionTimeoutSeconds = unset, Object? recoverOnResourceLoadingTimeout = unset}) → AudioRecoveryPolicy -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited