-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
executable file
·107 lines (97 loc) · 2.63 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Video</title>
<link rel="stylesheet" href="css/html5video.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="css/index.css" type="text/css" media="screen" charset="utf-8">
<script src="js/jquery-1.8.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/underscore.js" type="text/javascript"></script>
<script src="js/dy-video-html5.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
var v = new DYVideo({
el: '#dy-player',
videoSrc: 'http://192.168.1.205/~lvjian/video/death.mp4'
});
v.render();
v.setTrimIn(1000);
v.setTrimOut(1500);
v.trimin(function(e, data) {
console.log('get trimin');
console.log(data);
});
v.trimout(function(e, data) {
console.log('get trimout');
console.log(data);
});
$('#play-list>li>a').click(function(e) {
e.preventDefault();
var videoSrc = this.href;
if(videoSrc != v.getCurrentSrc()) {
v.clearTrims();
}
v.play(videoSrc);
$('#play-list').find('li>a').removeClass('actived');
$(this).addClass('actived');
});
$('#play-list').outerHeight($('#dy-player').outerHeight());
});
</script>
</head>
<body>
<div id="main">
<div id="dy-player"></div>
<ul id="play-list">
<li>
<a href="http://192.168.1.205/~lvjian/video/death.mp4">
Old Lady & Death.mp4
</a>
</li>
<li>
<a href="http://192.168.1.205/~lvjian/video/sl.mp4">
Shou Lu Video from BTV
</a>
</ul>
<div class='clear'></div>
</div>
<script type="text/template" id="dy-video-tmpl">
<div class="video-wrapper">
<video width="720" height="400"
src="<%= videoSrc%>"
onfocus="this.blur();"
controls
<%= autoplay ? "autoplay" : "" %>
<%= posterSrc == undefined ? "" :
"poster=" + posterSrc %>
>
</video>
<div class="video-controls">
<a href="#" onfocus="this.blur();" class="button btn-trim-in">
</a>
<a href="#" onfocus="this.blur();" class='button btn-trim-out'>
</a>
</div>
</div>
<div class="canvas-wrapper" >
<canvas width="710" height="100"></canvas>
<div class="trim-times">
<table border="0" cellpadding='0' cellspacing='0'>
<tbody>
<tr>
<td>
<div class="trim-time-in" trimTime='none'>
</div>
</td>
<td>
<div class="trim-time-out" trimTime='none'>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</script>
</body>
</html>