-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
152 lines (142 loc) · 7.62 KB
/
example.html
File metadata and controls
152 lines (142 loc) · 7.62 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Video Player - Example</title>
<link rel="stylesheet" href="assets/simple-video-player.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="assets/simple-video-player.js"></script>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1, h2 {
color: #333;
}
.example {
margin: 30px 0;
padding: 20px;
border: 1px solid #ddd;
border-radius: 4px;
background: #fafafa;
}
.example h3 {
margin-top: 0;
color: #666;
}
.code {
background: #f4f4f4;
padding: 10px;
border-radius: 4px;
font-family: monospace;
margin: 10px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Simple Video Player - Examples</h1>
<p>This page demonstrates the Simple Video Player plugin functionality. In a real WordPress installation, you would use the shortcode syntax shown in each example.</p>
<div class="example">
<h3>Example 1: Basic MP4 Video</h3>
<div class="code">[simple_video mp4="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4"]</div>
<!-- Simulated shortcode output -->
<div class="simple-video-player-container" style="width: 100%;">
<div class="simple-video-player-wrapper">
<video id="simple-video-1" class="simple-video-player" controls preload="metadata">
<source src="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4" type="video/mp4">
<p>Your browser does not support the video tag. Please upgrade your browser or try a different one.</p>
</video>
<div class="simple-video-play-button" data-video-id="simple-video-1">
<svg class="play-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5.14v14.72c0 .6.66.96 1.14.6l11.4-7.36c.43-.28.43-.92 0-1.2L9.14 4.54c-.48-.36-1.14 0-1.14.6z"/>
</svg>
</div>
</div>
</div>
</div>
<div class="example">
<h3>Example 2: Video with Custom Width</h3>
<div class="code">[simple_video mp4="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4" width="60%"]</div>
<!-- Simulated shortcode output -->
<div class="simple-video-player-container" style="width: 60%;">
<div class="simple-video-player-wrapper">
<video id="simple-video-2" class="simple-video-player" controls preload="metadata">
<source src="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4" type="video/mp4">
<p>Your browser does not support the video tag. Please upgrade your browser or try a different one.</p>
</video>
<div class="simple-video-play-button" data-video-id="simple-video-2">
<svg class="play-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5.14v14.72c0 .6.66.96 1.14.6l11.4-7.36c.43-.28.43-.92 0-1.2L9.14 4.54c-.48-.36-1.14 0-1.14.6z"/>
</svg>
</div>
</div>
</div>
</div>
<div class="example">
<h3>Example 3: Autoplay Muted Video (Background Style)</h3>
<div class="code">[simple_video mp4="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4" autoplay="true" muted="true" loop="true" controls="false"]</div>
<!-- Simulated shortcode output -->
<div class="simple-video-player-container" style="width: 100%;">
<div class="simple-video-player-wrapper">
<video id="simple-video-3" class="simple-video-player" autoplay muted loop preload="metadata">
<source src="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4" type="video/mp4">
<p>Your browser does not support the video tag. Please upgrade your browser or try a different one.</p>
</video>
<div class="simple-video-play-button" data-video-id="simple-video-3">
<svg class="play-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5.14v14.72c0 .6.66.96 1.14.6l11.4-7.36c.43-.28.43-.92 0-1.2L9.14 4.54c-.48-.36-1.14 0-1.14.6z"/>
</svg>
</div>
</div>
</div>
</div>
<div class="example">
<h3>Example 4: Multiple Format Support (WebM + MP4)</h3>
<div class="code">[simple_video webm="https://sample-videos.com/zip/10/webm/SampleVideo_1280x720_1mb.webm" mp4="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4"]</div>
<!-- Simulated shortcode output -->
<div class="simple-video-player-container" style="width: 100%;">
<div class="simple-video-player-wrapper">
<video id="simple-video-4" class="simple-video-player" controls preload="metadata">
<source src="https://sample-videos.com/zip/10/webm/SampleVideo_1280x720_1mb.webm" type="video/webm">
<source src="https://sample-videos.com/zip/10/mp4/SampleVideo_1280x720_1mb.mp4" type="video/mp4">
<p>Your browser does not support the video tag. Please upgrade your browser or try a different one.</p>
</video>
<div class="simple-video-play-button" data-video-id="simple-video-4">
<svg class="play-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5.14v14.72c0 .6.66.96 1.14.6l11.4-7.36c.43-.28.43-.92 0-1.2L9.14 4.54c-.48-.36-1.14 0-1.14.6z"/>
</svg>
</div>
</div>
</div>
</div>
<h2>Features Demonstrated</h2>
<ul>
<li><strong>Custom Play Button:</strong> Click the play button to start videos</li>
<li><strong>Hover Effects:</strong> Hover over the play button to see smooth transitions</li>
<li><strong>Responsive Design:</strong> Resize your browser to see responsive behavior</li>
<li><strong>Format Fallback:</strong> WebM is tried first, falls back to MP4</li>
<li><strong>Accessibility:</strong> Use Tab to focus the play button, Enter/Space to activate</li>
<li><strong>Multiple Instances:</strong> Multiple players work independently</li>
</ul>
<h2>WordPress Usage</h2>
<p>In WordPress, simply use the shortcode in your posts or pages:</p>
<div class="code">
[simple_video mp4="https://yoursite.com/video.mp4"]<br>
[simple_video webm="https://yoursite.com/video.webm" mp4="https://yoursite.com/video.mp4" controls="true" width="80%"]
</div>
</div>
</body>
</html>