-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
129 lines (120 loc) · 3.34 KB
/
demo.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MediaElement.js 3.0 - A-B Repeat Plugin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mediaelement/4.2.6/mediaelementplayer.css">
</head>
<body>
<div id="container">
<h1>A-B Repeat Plugin</h1>
<p>This plugin allows you loop a segment of media by right clicking on the time slider rail to set two markers.</p>
<h2>Video Player</h2>
<div class="media-wrapper">
<video id="player1" width="750" height="421" controls preload="none">
<source src="https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/mp4/BigBuckBunny.mp4" type="video/mp4">
</video>
</div>
<h2>API</h2>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>markerColors</td>
<td>string array</td>
<td>['#FF2D00', '#3235FF']</td>
<td>An array of two colors in hexadecimal for the A and B markers, respectively</td>
</tr>
<tr>
<td>markerWidth</td>
<td>number</td>
<td>1</td>
<td>The width of the markers in pixels</td>
</tr>
</tbody>
</table>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mediaelement/4.2.6/mediaelement-and-player.min.js"></script>
<script src="src/ab-repeat/ab-repeat.min.js"></script>
<script>
var mediaElements = document.querySelectorAll('video, audio');
for (var i = 0, total = mediaElements.length; i < total; i++) {
new MediaElementPlayer(mediaElements[i], {
markerColors: ['#FF2D00', '#3235FF'],
markerWidth: 1,
features: ['playpause', 'current', 'progress', 'duration', 'volume', 'fullscreen', 'abrepeat'],
});
}
</script>
<style>
#container {
padding: 0 20px 50px;
max-width: 800px;
}
.footnote {
font-size: 0.7em;
}
table {
border-collapse: collapse;
max-width: 750px;
}
th, td {
border-bottom: 1px solid #ddd;
text-align: center;
width: 120px;
}
th {
background-color: #000;
color: white;
}
a {
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
td:last-child {
width: 400px;
text-align: left;
}
tr:nth-child(even) {
background-color: #f2f2f2
}
pre {
white-space: pre-wrap;
tab-size: 2;
background: black;
color: white;
max-width: 750px;
}
pre[data-lang]::before {
content: attr(data-lang);
display: block;
background-color: #FFA500;
background-image: -webkit-linear-gradient(top, #FFA500, #D67E21);
background-image: linear-gradient(to bottom, #FFA500, #D67E21);
padding: 10px;
}
code {
font-family: "Courier New", Courier, monospace;
padding: 10px 20px;
display: inline-block;
}
</style>
</body>
</html>