ByteArkPlayerSource class

One playable way to deliver the same media — a URL paired with an optional ByteArkDrm scheme and an optional MIME type hint.

A ByteArkPlayerItem carries one or more ByteArkPlayerSources. Each platform plays the first Source whose DRM matches its capabilities:

  • iOS plays the first source with drm == null or drm is FairPlayDrm.
  • Android plays the first source with drm == null or drm is WidevineDrm.
  • Web reorders the list Widevine-first (see lib/web/web_sources_mapper.dart) then hands it to the ByteArk Web SDK; the browser's key-system support drops incompatible sources during playback (Widevine on Chromium / Edge / Android browsers, FairPlay on Safari).

Construction:

  • Use ByteArkPlayerSource.new (the primary constructor) for a non-DRM source — Source(url: …, type?: …).
  • Use ByteArkPlayerSource.drm for a DRM-protected source — the drm argument is required and non-null. MIME type defaults from the DRM scheme (FairPlay → application/x-mpegURL, Widevine → application/dash+xml); pass an explicit type to override.

See ADR-0004 for the design rationale.

Constructors

ByteArkPlayerSource({required String url, String? type})
Creates a non-DRM ByteArkPlayerSource.
ByteArkPlayerSource.drm({required String url, required ByteArkDrm drm, String? type})
Creates a DRM-protected ByteArkPlayerSource. The drm argument is required; the MIME type defaults from the DRM scheme when omitted (HLS for FairPlay, DASH for Widevine).

Properties

drm ByteArkDrm?
The DRM scheme + credentials, or null for a non-DRM source. Sealed: exactly one of WidevineDrm or FairPlayDrm when non-null.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String?
Optional MIME type hint for the SDK. Defaults to a sensible value when constructed via ByteArkPlayerSource.drm (HLS for FairPlay, DASH for Widevine); null for the non-DRM primary constructor unless the host passes it.
final
url String
The media URL — typically an HLS .m3u8 (FairPlay) or DASH .mpd (Widevine) manifest.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Serialises this Source for transport across the platform channel.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited