AlmediaLink · static class
The single entry point for host code. All methods and events are static; the SDK is a process-wide singleton in practice.
static string Version { get; }
The current SDK semantic version, e.g. "1.0.1".
static AlmediaStatus CurrentStatus { get; }
The SDK’s current lifecycle status. Reads AlmediaStatus.NotInitialized until the native bridge reports its first terminal status, then tracks every transition.
Read this from components that mount after Initialize has already completed - by then the first OnStatusChanged may have already fired, and CurrentStatus is the way to recover the latest value before subscribing for further transitions.
static AlmediaNotAvailableReason? NotAvailableReason { get; }
Why the SDK is unavailable for this player. Non-null exactly while CurrentStatus is NotAvailable, and null in every other status. When the SDK reports NotAvailable, read this value to answer why.
A NotAvailable status whose reason the backend did not send, or sent as a value this SDK version does not recognize, reads as AlmediaNotAvailableReason.Unknown rather than null. Treat Unknown as “not available, cause unspecified”, not as an error.
Updated before OnStatusChanged fires, so a handler can read it directly:
NotAvailable regardless of reason. The reason exists for analytics, diagnostics, and messaging.
static AlmediaScreenAvailability ScreenAvailability { get; }
Which SDK screens can be presented right now - see AlmediaScreenAvailability. Reads all-false until the SDK is ready.
Updated with every SDK status update, and it can change while the status itself stays the same: a linked player can gain or lose a screen at any time. Check it before showing your own entry point, and subscribe to OnScreenAvailabilityChanged to keep it current.
static AlmediaProgress Progress { get; }
The latest progress snapshot, or null when the SDK has none. See AlmediaProgress. It is null before the first snapshot arrives, after the native SDK clears the snapshot with its message stream token (an account change, or a token the server refused), and after Initialize with a different configuration. The SDK keeps it in memory only.
The SDK updates it before OnProgressUpdated fires. A scene that loads after the event can read the accessor, then subscribe for updates: