# Options
ByteArk Player is configured through two classes: ByteArkPlayerConfig for player-wide settings and ByteArkPlayerItem for the video to be played.
# ByteArkPlayerConfig
final config = ByteArkPlayerConfig(
licenseKey: ByteArkPlayerLicenseKey(
android: "<ANDROID_LICENSE_KEY>",
iOS: "<IOS_LICENSE_KEY>",
),
playerItem: playerItem,
autoPlay: true,
control: true,
);
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
| Property | Type | Default | Description |
|---|---|---|---|
licenseKey | ByteArkPlayerLicenseKey | required | License keys for Android and iOS |
playerItem | ByteArkPlayerItem | required | The video to play |
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 (small/medium/large) |
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
2
3
4
| Property | Type | Description |
|---|---|---|
android | String | License key for Android |
iOS | String | License key for iOS |
# ByteArkPlayerItem
final playerItem = ByteArkPlayerItem(
url: "<MEDIA_URL>",
title: "Big Buck Bunny",
);
1
2
3
4
2
3
4
| Property | Type | Required | Description |
|---|---|---|---|
url | String? | Yes | Video URL (HLS .m3u8) |
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 |
drm | ByteArkDrm? | No | DRM configuration (Widevine/FairPlay) |
lighthouseMetaData | ByteArkPlayerLighthouseMetaData? | No | Lighthouse metadata |
# ByteArkAdsSettings
final adsSettings = ByteArkAdsSettings(
adTagUrl: "<VAST_TAG_URL>",
);
1
2
3
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
2
3
4
| Property | Type | Description |
|---|---|---|
projectId | String? | Lighthouse Project ID |
debug | bool? | Enable debug mode |
# ByteArkDrm
final drm = ByteArkDrm(
widevineDrm: WidevineDrm(
licenseUrl: "<WIDEVINE_LICENSE_URL>",
),
fairPlayDrm: FairPlayDrm(
licenseUrl: "<FAIRPLAY_LICENSE_URL>",
certificateUrl: "<FAIRPLAY_CERTIFICATE_URL>",
),
);
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
| Property | Type | Description |
|---|---|---|
widevineDrm | WidevineDrm? | Widevine configuration for Android (see Google Widevine) |
fairPlayDrm | FairPlayDrm? | FairPlay configuration for iOS (see Apple FairPlay) |