# Google Widevine DRM
Note
ฟีเจอร์นี้ของ ByteArk Player รองรับเฉพาะผู้ใช้ ByteArk Video Cloud for Business หากคุณต้องการใช้งานกรุณาติดต่อ sales@byteark.com
ByteArk Player SDK for Android รองรับการเล่นวิดีโอที่ป้องกันด้วย Google Widevine DRM (opens new window) ในรูปแบบ Online (license ขอแบบ on-demand จาก License server)
# การเปิดใช้งาน
กำหนด License URL ผ่าน withDrmLicenseUrl(...) ของ ByteArkPlayerItem
val playerItem = ByteArkPlayerItemBuilder.Builder()
.withMediaId("VIDEO_ID")
.withTitle("Protected Video")
.withUrl("https://example.com/playlist.m3u8")
.withDrmLicenseUrl("https://license.example.com/widevine")
.build()
mPlayerFragment.openMedia(playerItem)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# ส่ง Custom Header ไปยัง License Server
หาก License server ต้องการ Authorization header หรือ header อื่นๆ สามารถส่งผ่าน withDrmLicenseRequestHeaders(...)
val headers = mapOf(
"Authorization" to "Bearer YOUR_TOKEN",
"X-Custom-Header" to "value"
)
val playerItem = ByteArkPlayerItemBuilder.Builder()
.withMediaId("VIDEO_ID")
.withTitle("Protected Video")
.withUrl("https://example.com/playlist.m3u8")
.withDrmLicenseUrl("https://license.example.com/widevine")
.withDrmLicenseRequestHeaders(headers)
.build()
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# เปิด Secure Surface
เพื่อป้องกันการ Capture หน้าจอ ขณะเล่นเนื้อหาที่ป้องกันด้วย DRM แนะนำให้เปิด Secure Surface ผ่าน ByteArkPlayerBuilder
val playerBuilder = ByteArkPlayerBuilder.Builder()
.withContext(this)
.withControl()
.withSecureSurface()
.build()
1
2
3
4
5
2
3
4
5
| Builder method | Description |
|---|---|
withSecureSurface() | เปิด Secure Surface ของ Android เพื่อป้องกันการ Capture หน้าจอและการบันทึกหน้าจอ |
Note
- การใช้ DRM ต้องใช้งานผ่าน HTTPS เคุณั้น
- บางอุปกรณ์ที่ไม่รองรับ Hardware-backed Widevine จะไม่สามารถเล่นวิดีโอที่ Robustness สูงได้
- หากต้องการข้อมูลเพิ่มเติม หรือเปิดใช้งาน DRM สามารถติดต่อทีมงานได้ทาง support@byteark.com