forked from carmineolivo/jquery.brightcove-video
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEXAMPLE.html
43 lines (38 loc) · 1.2 KB
/
EXAMPLE.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
<!DOCTYPE HTML>
<html>
<head lang="en">
<title>jQuery Brightcove Video Plugin - EXAMPLE</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="jquery.brightcove-video.js"></script>
</head>
<body>
<div class="player" style="height:240px; width:320px;"></div>
<script>
$( function() {
// Initialize the jQuery Brightcove Video plugin
$( ".player" ).brightcoveVideo({
"playerID": "1925363807001",
"@videoPlayer": "1754276221001",
"templateReadyHandler": onTemplateReady
});
// On TEMPLATE_READY (The player is ready for interaction through API)
function onTemplateReady( event ) {
var $player = $( this );
// On PLAY (The player has begun or resumed playback)
$player.brightcoveVideo( "onMediaEvent", "PLAY", function(event) {
alert( "Play" );
// Pause after 3 seconds
setTimeout( function() {
$player.brightcoveVideo( "pause" );
alert( "Pause after 3 seconds" );
}, 3000 );
});
// Append an image on top of the player, fading out on click
$player.brightcoveVideo( "overlay", "<img src='http://goo.gl/hR0kK'>" )
.on( "click", function() { $(this).fadeOut() } );
}
} );
</script>
</body>
</html>