# Display Error
ByteArk Player can display custom error messages or images when an error occurs based on HTTP status codes:
- 401 — Unauthorized
- 403 — Forbidden
- 404 — Not Found
- 500 — Internal Server Error
# Options
| Name | Type | Required | Description |
|---|---|---|---|
| errors | Object | No | Error display configuration mapped by HTTP status code |
| errors.[code].image | String | No | Image URL to show when this error occurs |
| errors.[code].message | String | No | Message to show when this error occurs |
# Example
<!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,
errors: {
'401': {
image: '/assets/samples/player/images/error-401.png',
message: 'Unauthorized to play this video',
},
'403': {
image: '/assets/samples/player/images/error-403.png',
message: 'Forbidden to play this video',
},
'404': {
image: '/assets/samples/player/images/error-404.png',
message: 'Video not found',
},
},
sources: [{
title: 'Big Buck Bunny',
src: 'https://byteark-playertzxedwv.stream-playlist.byteark.com/streams/TZyZheqEJUwC/playlist.m3u8',
type: 'application/x-mpegURL'
}]
});
</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
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