# Apple FairPlay
Note
ฟีเจอร์นี้ของ ByteArk Player รองรับเฉพาะผู้ใช้ ByteArk Video Cloud for Business หากคุณต้องการใช้งานกรุณาติดต่อ sales@byteark.com
ByteArk Player SDK for Flutter รองรับการเล่นวิดีโอที่ป้องกันด้วย Apple FairPlay Streaming (FPS) (opens new window) บน iOS โดย Flutter SDK จะส่ง DRM configuration ผ่านไปยัง AVPlayer ของ iOS SDK เพื่อจัดการ License และ Decryption
# การใช้งาน
กำหนด FairPlayDrm ผ่าน ByteArkDrm ของ ByteArkPlayerItem
final playerItem = ByteArkPlayerItem(
url: "<MEDIA_URL>",
drm: ByteArkDrm(
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 | Required | Description |
|---|---|---|---|
licenseUrl | String? | Yes | URL ของ FairPlay License server (สำหรับขอ CKC) |
certificateUrl | String? | Yes | URL ของ FairPlay Application Certificate |
licenseRequestHeaders | Map<String, String>? | No | Custom header ที่ส่งไปยัง License server |
# ส่ง Custom Header ไปยัง License Server
final playerItem = ByteArkPlayerItem(
url: "<MEDIA_URL>",
drm: ByteArkDrm(
fairPlayDrm: FairPlayDrm(
licenseUrl: "<FAIRPLAY_LICENSE_URL>",
certificateUrl: "<FAIRPLAY_CERTIFICATE_URL>",
licenseRequestHeaders: {
"Authorization": "Bearer <YOUR_TOKEN>",
},
),
),
);
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
ข้อควรระวัง
- การใช้งาน DRM ต้องใช้งานผ่าน HTTPS เท่านั้น
- FairPlay decryption ทำงานได้บนอุปกรณ์จริงเท่านั้น ไม่สามารถใช้งานบน iOS Simulator ได้