testing library

Framework-agnostic v2 implementation conformance utilities.

Classes

YlAndroidContentSource
YlBufferStrategy
Built-in strategies are optimization goals. bounded requires exact managed-media duration and byte admission limits, not a process RSS bound. Platforms unable to enforce the required budget must reject it. Durations are whole nonnegative signed32 milliseconds; bytes are positive signed32.
YlConformanceFailure
YlConformancePolicyCase
One known source/policy expectation. Include at least one supported case (defaults/preferences are allowed), plus strict success and unsupported cases applicable to the adapter. Managed-route support is verified by native suites.
YlDvrWindow
Immutable DvrWindow value; validate at publication boundaries.
YlFailure
A transportable playback failure with safe public metadata.
YlFailureCodes
YlFileSource
YlFirstFrameEvent
YlHttpRequest
Request metadata with explicitly scoped credentials.
YlLimitationId
Extensible, validated wire identifier; diagnostics never echo its value.
YlLoadOptions
Immutable choices for one source load.
YlMediaSource
Closed source family. Source identities and request metadata are sensitive.
YlMediaTrack
Immutable MediaTrack value; validate at publication boundaries.
YlNetworkPolicy
Source-specific transport guarantees. Unsupported requirements must fail. Policy durations must be whole signed32 milliseconds; timeouts are positive, retry delays are nonnegative, and counts are nonnegative signed32 integers.
YlNetworkSource
YlPixelSize
Pixel dimensions are validated at native decode and state acceptance.
YlPlatformConformance
Runs isolated, bounded cases without a test-framework dependency.
YlPlatformConformanceFixture
An implementation-owned deterministic harness. source must be supported with default load options, committing initially in buffering without Ready or First Frame until the explicit hooks below inject them. Each created player is isolated. Hook futures complete after their input is processed and its observable state/events are published, including ignored/duplicate inputs. Private transport reply ordering and controller milestone futures belong in adapter/controller suites, not this SPI-only harness.
YlPlatformImplementationInfo
Runtime implementation identity used by the controller's SPI handshake.
YlPlatformLoadResult
A committed session whose matching authoritative full state is already accepted by the adapter. The load barrier requires both native commit success and that state, in either arrival order, but never Ready or First Frame. Invalidated candidates fail instead of returning stale handles. Implementors bound transport waits and clean up failed loads; state remains authoritative.
YlPlatformPlayer
Handwritten v2 SPI. Session commands reject replaced/stopped identities; volume is player-scoped. State revisions increase across session changes. State/event streams are authoritative and dispose is idempotent.
YlPlaybackEngineChangedEvent
YlPlaybackFailedEvent
YlPlaybackMetrics
Immutable PlaybackMetrics value; validate at publication boundaries.
YlPlaybackSessionId
Opaque identity for one playback session.
YlPlayerCapabilities
Immutable PlayerCapabilities value; validate at publication boundaries.
YlPlayerEvent
A discrete session event, timed from an implementation-local monotonic epoch.
YlPlayerOptions
Immutable player-wide choices captured at creation. The update interval must be a positive whole number of signed32 milliseconds.
YlPlayerPlatform
Registration point for v2 implementations. The controller verifies each created player's implementation SPI major before exposing it to callers.
YlPlayerState
Immutable PlayerState value; validate at publication boundaries.
YlRequirementId
Extensible, validated wire identifier; diagnostics never echo its value.
YlRetryScheduledEvent
YlSafeDiagnostics
Centralized sanitization for public playback diagnostics.
YlSourceAssessment
Immutable SourceAssessment value; validate at publication boundaries.
YlTimeline
Immutable Timeline value; validate at publication boundaries.
YlVideoConstraints
Optional positive signed32 adaptive-video limits; null is unconstrained.
YlVideoGeometry
Immutable VideoGeometry value; validate at publication boundaries.

Constants

ylPlayerSpiMajor → const int
The Dart platform contract major; independent of native transport versions.

Functions

validateYlDvrWindow(YlDvrWindow window) → void
validateYlLoadOptions(YlLoadOptions options) → void
Validates load choices before issuing a platform load command.
validateYlMediaTrack(YlMediaTrack track) → void
validateYlPixelSize(YlPixelSize size) → void
Validate before native-to-domain decoding and before controller publication. Constructors remain const, so correctness never depends on Dart assertions.
validateYlPlaybackMetrics(YlPlaybackMetrics metrics) → void
validateYlPlaybackSessionId(YlPlaybackSessionId sessionId) → void
Enforces playback-session identity invariants at runtime boundaries.
validateYlPlaybackSpeed(double speed) → void
validateYlPlayerCapabilities(YlPlayerCapabilities capabilities) → void
validateYlPlayerEvent(YlPlayerEvent event) → void
Durations use an implementation-local monotonic epoch, never wall time. Adapters must check native time scalars before Duration construction to avoid overflowing its microsecond storage; validation cannot recover wrapped input.
validateYlPlayerOptions(YlPlayerOptions options) → void
Validates creation options before a platform player is allocated.
validateYlPlayerState(YlPlayerState state) → void
Validates a complete snapshot at the controller/native acceptance boundary. Ordering against previous revisions and callback sessions belongs to the controller, since a single immutable snapshot cannot establish chronology.
validateYlSeekPosition(Duration position) → void
Media time uses nonnegative signed64 transport milliseconds, never the signed32 policy limit. Dart Duration stores microseconds, so all nonnegative native Dart durations already fit the transport millisecond upper bound.
validateYlSource(YlMediaSource source) → void
Validates a source before any platform call. Errors never include identities or request metadata, including in ArgumentError.invalidValue.
validateYlSourceAssessment(YlSourceAssessment assessment) → void
validateYlTimeline(YlTimeline timeline) → void
Raw native negative live offsets must be clamped to zero by the adapter before constructing these domain values. Other negative times are invalid.
validateYlTrackId(String trackId) → void
validateYlVideoConstraints(YlVideoConstraints constraints) → void
Used for both initial load and runtime adaptive-video constraint commands.
validateYlVideoGeometry(YlVideoGeometry geometry) → void
validateYlVolume(double volume) → void

Exceptions / Errors

YlPlayerException
Exception wrapper for a transportable playback failure.