-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathcodec-formats.html
More file actions
120 lines (101 loc) · 3.27 KB
/
Copy pathcodec-formats.html
File metadata and controls
120 lines (101 loc) · 3.27 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Cloudinary Video Player</title>
<link
href="https://res.cloudinary.com/cloudinary-marketing/image/upload/f_auto,q_auto/c_scale,w_32,e_hue:290/creative_staging/cloudinary_internal/Website/Brand%20Updates/Favicon/cloudinary_web_favicon_192x192.png"
rel="icon"
type="image/png"
/>
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/ua-parser-js@0.7.20/src/ua-parser.min.js"></script>
</head>
<body>
<div class="container p-4 col-12 col-md-9 col-xl-6">
<nav class="nav mb-2">
<a href="/index.html"><< Back to examples index</a>
</nav>
<h1>Cloudinary Video Player</h1>
<h2>Codecs & Formats</h2>
<h3 class="mb-4">f_auto</h3>
<video
id="player"
playsinline
controls
muted
autoplay
class="cld-video-player"
width="500"
></video>
<p id="info"></p>
<h3 class="mb-4">mp4/av1</h3>
<video
id="player-av1"
playsinline
controls
muted
autoplay
class="cld-video-player"
width="500"
></video>
<p id="info-mp4-av1"></p>
<h3 class="mb-4">webm/vp9</h3>
<video
id="player-vp9"
playsinline
controls
muted
autoplay
class="cld-video-player"
width="500"
></video>
<p id="info-vp9"></p>
</div>
<script type="module">
import { videoPlayer } from 'cloudinary-video-player';
import 'cloudinary-video-player/player.min.css';
const uap = new UAParser(navigator.userAgent);
// f_auto (default) player
const player = videoPlayer('player', {
cloudName: 'demo',
publicId: 'product-gallery-tutorial_hlk0na',
info: { title: 'f_auto' }
});
// mp4/av1 player
const playerAv1 = videoPlayer('player-av1', {
cloudName: 'demo',
publicId: 'product-gallery-tutorial_hlk0na',
info: { title: 'mp4/av1' },
sourceTypes: ['mp4/av1']
});
// webm/vp9 player
const playerVp9 = videoPlayer('player-vp9', {
cloudName: 'demo',
publicId: 'Image_Performance',
info: { title: 'webm/vp9' },
sourceTypes: ['webm/vp9']
});
player.on('playing', function () {
document.getElementById('info').innerHTML =
uap.getBrowser().name + ' is playing ' + player.videojs.currentSrc();
});
playerAv1.on('playing', function () {
document.getElementById('info-mp4-av1').innerHTML =
uap.getBrowser().name + ' is playing ' + playerAv1.videojs.currentSrc();
});
playerVp9.on('playing', function () {
document.getElementById('info-vp9').innerHTML =
uap.getBrowser().name + ' is playing ' + playerVp9.videojs.currentSrc();
});
</script>
<!-- Bootstrap -->
<link
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
</body>
</html>