-
Notifications
You must be signed in to change notification settings - Fork 241
Expand file tree
/
Copy pathmeta2.html
More file actions
154 lines (144 loc) · 4.31 KB
/
Copy pathmeta2.html
File metadata and controls
154 lines (144 loc) · 4.31 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
153
154
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Video player with Metadata track (type = selector) | Able Player Demos</title>
<link rel="stylesheet" href="demos.css" type="text/css">
<!-- Dependencies -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Able Player CSS -->
<link rel="stylesheet" href="../build/ableplayer.min.css" type="text/css"/>
<!-- Able Player JavaScript -->
<script src="../build/ableplayer.js"></script>
<!-- CSS for hidden blocks on content in this example -->
<style>
div#video-and-meta-wrapper {
position: relative;
}
div.meta {
position: absolute;
z-index: 10000;
display: none;
}
div#info,
div#instructions {
background-color: #ffc;
border: 3px solid #412C84;
color: #000;
font-size: 1.2em;
line-height: 1.25em;
padding: 0.5em;
}
div#info {
top: 40px;
left: 20px;
width: 200px;
height: auto;
}
div#instructions {
top: 240px;
left: 90px;
width: 200px;
height: auto;
}
div#instructions:focus,
div#terrill:focus,
div#terrill:hover {
border: 3px solid #C00;
}
div#terrill {
top: 40px;
left: 136px;
width: 120px;
height: 140px;
background-color: #FFF;
border: 3px solid #412C84;
opacity: 0.3;
}
div#terrill:focus {
border: 3px solid yellow;
}
div#response {
top: 40px;
right: 80px;
width: 150px;
height: 90px;
background-image: url('cartoon-bubble.png');
background-position: top left;
background-repeat: no-repeat;
font-weight: bold;
font-size: 1.2em;
padding-top: 20px;
text-align: center;
}
</style>
<!-- Example script: handle user's click on Terrill button -->
<script>
$(document).ready(function() {
$('#instructions').on('focus',function() {
$('#terrill').attr('tabindex','0');
})
$('#terrill').on('click',function() {
toggleResponse();
});
$('#terrill').on('keypress',function(e) {
if (e.which === 13 || e.which === 32) {
toggleResponse();
}
});
});
function toggleResponse() {
if ($('#response').is(':visible')) {
$('#response').hide();
}
else {
// response is an interactive element not included in metadata file
// therefore it doesn't disappear automatically
$('#response').show().delay(5000).fadeOut();
}
}
</script>
</head>
<body>
<header>
<div class="title">Able Player Demos</div>
</header>
<nav>
<ul>
<li><a href="index.html">More demos</a></li>
<li><a href="https://ableplayer.github.io/ableplayer">Able Player Home</a></li>
</ul>
</nav>
<main>
<h1>Video player with Metadata track (type = selector)</h1>
<p>Time-synced metadata is provided in a WebVTT file with kind="metadata".
A <strong>data-meta-type</strong> attribute has value "selector",
which is one of two types of supported metadata tracks
(the other is "text"). With "selector" as the metadata type,
the contents of the WebVTT file is used to identify
blocks of existing hidden content that are shown at the designated times during playback.
The keyword <strong>PAUSE</strong> on a single line within the WebVTT file causes the player to pause
at the designated times.
</p>
<p>
There are metadata events embedded in this demo at 0:23 and 0:39 seconds.
</p>
<div id="video-and-meta-wrapper">
<video id="video1" preload="auto" width="480" height="360" poster="../media/wwa.jpg" data-able-player data-meta-type="selector" playsinline>
<source type="video/mp4" src="../media/wwa.mp4" data-desc-src="../media/wwa_described.mp4"/>
<source type="video/webm" src="../media/wwa.webm" data-desc-src="../media/wwa_described.webm"/>
<track kind="captions" src="../media/wwa_captions_en.vtt" srclang="en" label="English"/>
<track kind="metadata" src="../media/wwa_meta.vtt" srclang="en"/>
</video>
<!-- metadata content -->
<div class="meta" id="info" role="alert">Supplemental content displayed briefly during a break in the audio</div>
<div class="meta" id="instructions" role="alert" tabindex="-1">What happens if you click Terrill's face?</div>
<div class="meta" id="terrill" role="button" aria-label="Terrill's face" tabindex="-1"></div>
<div class="meta" id="response" role="alert">Ouch!</div>
</div>
<ul id="debug"></ul>
</main>
</body>
</html>