-
Notifications
You must be signed in to change notification settings - Fork 3
/
demo.html
executable file
·37 lines (26 loc) · 1 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
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>vimeo-player Demo</title>
<script src="../platform/platform.js"></script>
<link rel="import" href="vimeo-player.html">
</head>
<body unresolved>
<p>An example of using <code><vimeo-player></code></p>
<vimeo-player id="my-demo" videoid="5730550" responsive="1" caption="the greatest video ever uploaded to vimeo"></vimeo-player>
<script>
window.addEventListener('polymer-ready', function (e) {
var demo = document.querySelector('#my-demo');
demo.addEventListener('vimeo-player-response', function(event){
var data = event.detail.data
, duration = data.duration;
duration = (duration > 60)
? Math.floor(duration / 60) + 'm' + (duration % 60) + 's'
: duration + 's';
demo.caption = data.title + ' - ' + duration;
})
});
</script>
</body>
</html>