-
Notifications
You must be signed in to change notification settings - Fork 3
/
video-js.html
72 lines (58 loc) · 1.82 KB
/
video-js.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
<link rel="import" href="../polymer/polymer.html">
<script src="../videojs/dist/video-js/video.js"></script>
<!--
Element providing a wrapper around the Video.js HTML5 video library
##### Example
<video-js controls preload="auto" width="640" height="264" poster="oceans-clip.png">
<source src="oceans-clip.mp4" type='video/mp4' />
<source src="oceans-clip.webm" type='video/webm' />
<source src="oceans-clip.ogv" type='video/ogg' />
</video-js>
@element video-js
@blurb Element providing a wrapper around the Video.js HTML5 video library
@status alpha
@homepage http://github.com/addyosmani/video-js
-->
<polymer-element name="video-js" attributes="width height preload poster">
<template>
<link rel="stylesheet" href="../videojs/dist/video-js/video-js.css">
<video class="video-js vjs-default-skin" id="myvideo" controls width="{{width}}" height="{{height}}" preload="{{preload}}" poster="{{poster}}">
<content></content>
</video>
</template>
<script>
Polymer({
/**
* The `width` attribute specifies the width of a video player, in pixels
*
* @attribute width
* @type integer
*/
width: 640,
/**
* The `height` attribute specifies the height of a video player, in pixels
*
* @attribute height
* @type integer
*/
height: 264,
/**
* The `preload` attribute specifies if/how the video should be loaded
*
* @attribute preload
* @type string
*/
preload: 'auto',
/**
* The `poster` attribute specifies an image shown while downloading
*
* @attribute poster
* @type string
*/
poster: '',
ready: function() {
videojs(this.$.myvideo);
}
});
</script>
</polymer-element>