# Options

ByteArk Player is configured through ByteArkPlayerConfig for player-wide settings and ByteArkPlayerItem for the video to be played. Each item holds one or more ByteArkPlayerSources, and DRM is configured per source.

WARNING

This page reflects the v2.0.0 README on pub.dev (opens new window). Item-level metadata placement, the exact aspectRatio value format, and per-platform source selection were inferred from the README examples — verify against the installed SDK if in doubt.

# ByteArkPlayerConfig

final config = ByteArkPlayerConfig(
  licenseKey: ByteArkPlayerLicenseKey(
    android: "<ANDROID_LICENSE_KEY>",
    iOS: "<IOS_LICENSE_KEY>",
  ),
  playerItem: playerItem,
  aspectRatio: '16:9',
  autoPlay: true,
  control: true,
);
1
2
3
4
5
6
7
8
9
10
Property Type Default Description
licenseKey ByteArkPlayerLicenseKey required License keys for Android and iOS
playerItem ByteArkPlayerItem required The video to play
aspectRatio String? - Aspect ratio as 'width:height' (e.g. '16:9'); primarily controls sizing on Web
autoPlay bool? true Start playback automatically
control bool? true Show the control bar
seekButtons bool? true Show seek-forward/backward buttons
seekTime int? 30 Seek step (seconds)
fullScreenButton bool? true Show the full-screen button
settingButton bool? true Show the settings button
secureSurface bool? false Enable secure surface for DRM content
subtitleSize ByteArkPlayerSubtitleSize? medium Subtitle font size as a percentage of video height: minimum (1%), extraTiny (2%), tiny (3%), extraSmall (4%), small (5%), medium (6%), large (7%), extraLarge (8%), maximum (9%)
subtitleBackgroundEnabled bool? true Show subtitle background
subtitlePaddingBottomPercentage int? 10 Subtitle padding from bottom (%)
adsSettings ByteArkAdsSettings? - Advertisement settings (see Advertisement)
lighthouseSetting ByteArkLighthouseSetting? - Lighthouse settings (see ByteArk Lighthouse)

# ByteArkPlayerLicenseKey

final licenseKey = ByteArkPlayerLicenseKey(
  android: "<ANDROID_LICENSE_KEY>",
  iOS: "<IOS_LICENSE_KEY>",
);
1
2
3
4
Property Type Description
android String License key for Android
iOS String License key for iOS

# ByteArkPlayerItem

final playerItem = ByteArkPlayerItem(
  sources: [
    ByteArkPlayerSource(url: "<MEDIA_URL>"),
  ],
  title: "Big Buck Bunny",
);
1
2
3
4
5
6
Property Type Required Description
sources List<ByteArkPlayerSource> Yes One or more playable sources (must be non-empty). Provide multiple sources to offer per-platform / per-DRM variants
mediaId String? No Video ID (required when using Lighthouse)
title String? No Video title
subtitle String? No Episode / short description
posterImage String? No Poster image URL
shareUrl String? No URL used for sharing
lighthouseMetaData ByteArkPlayerLighthouseMetaData? No Lighthouse metadata

# ByteArkPlayerSource

A single playable source. Use the default constructor for plain content, or the ByteArkPlayerSource.drm factory to attach DRM.

// Plain source
final source = ByteArkPlayerSource(url: "<MEDIA_URL>");
// DRM-protected source
final drmSource = ByteArkPlayerSource.drm(
  url: "<MEDIA_URL>",
  drm: WidevineDrm(licenseUrl: "<WIDEVINE_LICENSE_URL>"),
);
1
2
3
4
5
6
7
8
Property Type Required Description
url String Yes Source URL (HLS .m3u8 or DASH .mpd)
drm ByteArkDrm No DRM configuration, set via the ByteArkPlayerSource.drm factory (see DRM)

# ByteArkAdsSettings

final adsSettings = ByteArkAdsSettings(
  adTagUrl: "<VAST_TAG_URL>",
);
1
2
3
Property Type Description
adTagUrl String? VAST/VMAP ad tag URL
enableDefaultCompanionSlot bool? Enable default Companion Ad slot
defaultCompanionSize Pair<int, int>? Companion Ad size (width, height)

# ByteArkLighthouseSetting

final lighthouseSetting = ByteArkLighthouseSetting(
  projectId: "<PROJECT_ID>",
  debug: false,
);
1
2
3
4
Property Type Description
projectId String? Lighthouse Project ID
debug bool? Enable debug mode

# DRM

DRM is attached per source through the ByteArkPlayerSource.drm factory. ByteArkDrm is a sealed type with two implementations: WidevineDrm (Android) and FairPlayDrm (iOS). Provide one source per platform's DRM; the player selects the compatible source at runtime.

final playerItem = ByteArkPlayerItem(
  sources: [
    ByteArkPlayerSource.drm(
      url: "<HLS_URL>",   // .m3u8 for FairPlay (iOS)
      drm: FairPlayDrm(
        licenseUrl: "<FAIRPLAY_LICENSE_URL>",
        certificateUrl: "<FAIRPLAY_CERTIFICATE_URL>",
      ),
    ),
    ByteArkPlayerSource.drm(
      url: "<DASH_URL>",  // .mpd for Widevine (Android)
      drm: WidevineDrm(
        licenseUrl: "<WIDEVINE_LICENSE_URL>",
      ),
    ),
  ],
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

See Google Widevine and Apple FairPlay for each type's full properties.