-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·160 lines (123 loc) · 4.97 KB
/
index.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
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
155
156
157
158
159
160
<!DOCTYPE html><!-- PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd" -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<head>
<style type="text/css">
body {
text-align: center;
padding: 2em;
font-family: Helvetica, Arial, sans-serif;
}
pre, p {
text-align: left;
}
#container {
width: 480px;
margin: auto;
}
h1 {
color: darkgrey;
}
#infobutton {
opacity: 0.3;
visibility: hidden;
-moz-transition: opacity 0.2s linear;
}
#infobutton:hover {
opacity: 1;
-moz-transition: opacity 0.2s linear;
}
.video:hover #infobutton {
visibility: visible;
}
</style>
<script src="js/libs/jquery-1.3.min.js"></script>
<script type="text/javascript" src="js/libs/jquery.json/jquery.json-1.3.min.js"></script>
<script type="text/javascript" src="js/libs/jquery.uri.js"></script>
<script type="text/javascript" src="js/libs/jquery.xmlns.js"></script>
<script type="text/javascript" src="js/libs/jquery.curie.js"></script>
<script type="text/javascript" src="js/libs/jquery.datatype.js"></script>
<script type="text/javascript" src="js/libs/jquery.rdf.js"></script>
<script type="text/javascript" src="js/libs/jquery.rdfa.js"></script>
<script type="text/javascript" src="js/libs/jquery.rules.js"></script>
<script type="text/javascript">
var infoVisible = false;
$(document).ready(function(){
$("video").each(function (index, video) {
var $video = $(video);
var rdf = $video.rdf()
.prefix('dc', 'http://purl.org/dc/elements/1.1/');
rdf.where('?video dc:title ?title')
.optional('?video dc:creator ?creator')
.optional('?video dc:date ?date')
.optional('?video dc:rights ?rights')
.each(function() {
video.title = this.title.value,
video.creator = this.creator.value,
video.date = this.date.value,
video.rights = this.rights.value;
});
});
var myVideo = document.getElementById('myVideo');
var title = myVideo.title;
var author = myVideo.creator;
var license = myVideo.rights;
var date = myVideo.date;
var lowerThird = document.createElement('div');
lowerThird.id = "infopanel";
lowerThird.innerHTML = '<span style="text-align:left;font-size:18px;padding-left: 10px;padding-top: 10px; display: block">'+title+'</span><span style="text-align:left;font-size:12px;padding-left: 11px;padding-top: 3px; display: block">'+author+'</span><span style="text-align:left;font-size:12px;padding-left: 11px;padding-top: 3px; display: block">'+date+'</span><span style="text-align:left;font-size:12px;padding-left: 11px;padding-top: 3px; display: block">'+license+'</span>';
myVideo.parentNode.appendChild(lowerThird);
var top = myVideo.top;
var left = myVideo.left;
var position = $('#myVideo').position();
var lowerThirdPos = Math.floor(myVideo.height / 3)*2;
var infoBoxHeight = myVideo.height - lowerThirdPos;
lowerThirdStyle = 'background-color:rgba(0, 0, 0, 0.5); margin-top:'+lowerThirdPos+'px;position:absolute;top:'+position.top+'px;left:'+position.left+'px;color:white;font-family:Helvetica, Arial, sans-serif;text-shadow:black 2px 2px 6px;width:'+(myVideo.width)+'px;height:'+infoBoxHeight+'px';
lowerThird.setAttribute('style', lowerThirdStyle);
lowerThird.style.display = "none";
lowerThird.style.zindex = "1";
});
function showhideInfo() {
var panel = document.getElementById('infopanel');
if (!infoVisible) {
panel.style.display = 'block';
infoVisible = true;
} else {
panel.style.display = 'none';
infoVisible = false;
}
}
</script>
</head>
<body>
<div id="container">
<img src="drumbeat_logo.png" id="logo" />
<div class="video" style="width:480px; height: 270px; position: relative">
<img id="infobutton" src="info_white.png" style="z-index: 2;position: absolute; right :15px; bottom:15px;" onclick="showhideInfo()" />
<!-- TODO: this video needs to get moved to video.mozilla.org. Be gentle with this current host... -->
<video id="myVideo" src="http://audioscene.org/scene-files/humph/drumbeat/metadata/barcelonavid.ogg" width="480" height="270" autoplay>
<meta property="dc:title" content="Barcelona Participant Introductions">
<meta property="dc:creator" content="Brett Gaylor">
<meta property="dc:date" content="2010-11-04">
<meta property="dc:rights" content="CC-BY-SA">
</video>
</div>
<h1>Video Lab Metadata Demo</h1>
<p>
This web page contains machine readable metadata about the video (see below). We have added javascript to expose and display this information to the user.
</p>
<p>
<pre>
<video src="barcelonavid.ogg" width="480" height="270" autoplay>
<meta property="dc:title"
content="Barcelona Participant Introductions">
<meta property="dc:creator" content="Brett Gaylor">
<meta property="dc:date" content="2010-11-04">
<meta property="dc:rights" content="CC-BY-SA">
</video>
</pre>
</p>
</div>
</body>
</html>