Skip to content

Commit d00d602

Browse files
committed
Add video orientation demo
1 parent 32e6268 commit d00d602

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

demos/video-orientation-demo.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<html>
2+
3+
<head>
4+
<style>
5+
body {
6+
margin: 0;
7+
padding: 20px;
8+
font-family: Arial, sans-serif;
9+
max-width: 100vw;
10+
box-sizing: border-box;
11+
}
12+
13+
h1 {
14+
font-size: clamp(1.5rem, 4vw, 2.5rem);
15+
margin-bottom: 1rem;
16+
word-wrap: break-word;
17+
}
18+
19+
p {
20+
font-size: clamp(1rem, 2.5vw, 1.2rem);
21+
margin-bottom: 2rem;
22+
word-wrap: break-word;
23+
}
24+
25+
video {
26+
width: 100%;
27+
max-width: 100%;
28+
height: auto;
29+
display: block;
30+
}
31+
</style>
32+
</head>
33+
34+
<body>
35+
36+
<h1>Auto-cropped videos for different orientations</h1>
37+
<p>Resize your browser and refresh to see the different videos displayed based on the width of the viewport.</p>
38+
39+
<video controls>
40+
<!-- Landscape orientation -->
41+
<source src="https://res.cloudinary.com/demo/video/upload/ar_16:9,c_fill,g_auto,w_800/dog_orig_qflwce.mp4"
42+
media="(orientation: landscape) and (min-width: 800px)"/>
43+
44+
<!-- Portrait orientation -->
45+
<source src="https://res.cloudinary.com/demo/video/upload/ar_9:16,c_fill,g_auto,w_300/dog_orig_qflwce.mp4"
46+
media="(orientation: portrait) and (min-width: 300px)"/>
47+
48+
<!-- Fallback -->
49+
<source src="https://res.cloudinary.com/demo/video/upload/c_scale,w_600/dog_orig_qflwce.mp4"/>
50+
</video>
51+
52+
</body>
53+
54+
</html>

0 commit comments

Comments
 (0)