-
Notifications
You must be signed in to change notification settings - Fork 6
/
flow_player.html
102 lines (79 loc) · 2.48 KB
/
flow_player.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Demo Video 1</title>
<!-- optimize mobile versions -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- The "functional" skin, "functional.css", "minimalist.css" and "playful.css" are available -->
<link rel="stylesheet" href="//releases.flowplayer.org/6.0.3/skin/functional.css">
<!-- Minimal styling for this standalone page (can be removed) -->
<style>
body {
font-family: "myriad pro", tahoma, verdana, arial, sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
}
#content {
margin: 50px auto;
max-width: 982px;
}
.flowplayer.custom-subtitles {
display:none;
}
.flowplayer.custom-subtitles .fp-subtitle {
display:none;
}
</style>
<!-- CSS for this demo -->
<!--link rel="stylesheet" href="//flowplayer.org/media/css/demos/basics/subtitles.css"-->
<!-- Flowplayer depends on jquery for video tag based setups -->
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<!-- Flowplayer-->
<script src="//releases.flowplayer.org/6.0.3/flowplayer.min.js"></script>
</head>
<body>
<div id="content">
<div id="with-subtitles" class="flowplayer" data-ratio="0.5625" data-embed="true">
<video>
<source type="video/mp4"
src="foo.mp4">
<source type="video/flash"
src="mp4:functional">
<!--track kind="subtitles" default srclang="en" label="English"
src="/standalone/basics/subtitles-en.vtt"-->
<track kind="subtitles" srclang="de" label="Deutsch"
src="foo.vtt"></video>
</div>
</div><!--/end content -->
</body>
<script>
jQuery["postJSON"] = function( url, data, callback ) {
return jQuery.ajax({
url: url,
type: "POST",
contentType:"application/json; charset=utf-8",
data: data,
success: callback
});
};
$(function() {
flowplayer().on("cuepoint", function (e, api, cuepoint) {
if (cuepoint.subtitle) {
console.log(cuepoint.subtitle);
$.postJSON('/addSubtitle', JSON.stringify(cuepoint.subtitle), function() {});
}
// end of a subtitle
if (cuepoint.subtitleEnd) {
}
//if (cuepoint.time == 0.5) api.speed( .75 );
//$("#cue").text(cuepoint.time);
});
});
///var player = flowplayer();
//player.on("cuepoint", function(e, api, cuepoint) {
// // start of a subtitle
//});
</script>
</html>