# Google Widevine
Note
ฟีเจอร์นี้ของ ByteArk Player รองรับเฉพาะผู้ใช้ ByteArk Video Cloud for Business หากคุณต้องการใช้งานกรุณาติดต่อ sales@byteark.com
ByteArk Player รองรับการเล่นวิดีโอที่ป้องกันด้วย Google Widevine (opens new window) ซึ่งใช้ได้กับเบราว์เซอร์ตระกูล Chromium ทั้งบนเดสก์ท็อปและ Android
# DRM Source Object ของ Widevine
| Name | Type | Required | Description |
|---|---|---|---|
| url | String | Yes | URL ของ Widevine license server |
| serverCertificateUrl | String | No | URL ของ Widevine service certificate |
| videoRobustness | String | No | ระดับความปลอดภัยของวิดีโอ: SW_SECURE_CRYPTO, SW_SECURE_DECODE, HW_SECURE_CRYPTO, HW_SECURE_DECODE, HW_SECURE_ALL |
| audioRobustness | String | No | ระดับความปลอดภัยของออดิโอ: SW_SECURE_CRYPTO, SW_SECURE_DECODE, HW_SECURE_CRYPTO, HW_SECURE_DECODE, HW_SECURE_ALL |
| licenseRequestHeaders | Array<{name: String; value: String}> | No | Custom header ที่ส่งไปยัง license server |
หมายเหตุ: การตั้งค่า videoRobustness และ audioRobustness เป็น Hardware (prefix HW_) ทำให้การเล่นวิดีโอ/ออดิโอต้องใช้ Hardware ในการถอดรหัส (decrypt) ซึ่งอาจทำให้ไม่สามารถเล่นวิดีโอได้ในบางอุปกรณ์ ขึ้นอยู่กับ policy ของเจ้าของ Content
# ตัวอย่างการตั้งค่า
{
src: 'https://byteark-playertzxedwv.stream-playlist.byteark.com/streams/TZyZheqEJUwC/playlist.m3u8',
type: 'application/x-mpegURL',
drm: {
widevine: {
url: '<URL_TO_WIDEVINE_LICENSE_SERVER>'
}
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# ตัวอย่างการตั้งค่าเพื่อส่ง Authorization Header
{
src: 'https://byteark-playertzxedwv.stream-playlist.byteark.com/streams/TZyZheqEJUwC/playlist.m3u8',
type: 'application/x-mpegURL',
drm: {
widevine: {
url: '<URL_TO_WIDEVINE_LICENSE_SERVER>',
licenseRequestHeaders: [
{
name: 'Authorization',
value: '<YOUR_AUTHORIZATION_HEADER>'
}
]
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# ตัวอย่าง
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="video-player"></div>
<script src="https://byteark-sdk.cdn.byteark.com/player/v2/byteark-player.min.js"></script>
<script>
var player = bytearkPlayer('video-player', {
fluid: true,
poster: '/assets/samples/player/images/poster-big-buck-bunny.jpg',
sources: [
{
title: 'Widevine Source',
src: 'https://byteark-playertzxedwv.stream-playlist.byteark.com/streams/TZyZheqEJUwC/playlist.m3u8',
type: 'application/x-mpegURL',
drm: {
widevine: {
url: '<URL_TO_WIDEVINE_LICENSE_SERVER>',
licenseRequestHeaders: [
{
name: 'Authorization',
value: '<YOUR_AUTHORIZATION_HEADER>'
}
]
}
}
}
],
plugins: {
bytearkShaka: {}
}
});
window.player = player;
</script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39