openct-tasks/_common/modules/pemFioi/taskVideo/test.html

68 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Youtube API test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="../../ext/jquery/2.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="player.css" />
<script src="player.js"></script>
<style>
html, body {
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<div id="video1"></div>
<br><hr><br>
<div>
<button id="btn1_get_data">Get state</button>
<button id="btn1_destroy">Destroy</button>
</div>
<pre id="state1"></pre>
<script>
$(document).ready(function() {
$("#video1").taskVideo({
video_id: "XN5NXT0g1lg",
width: '500px',
introduction: 'Introduction text',
conclusion: 'Conclusion text',
sections: [
{
title: 'Section 1',
description: 'Description text 1',
parts: 2,
start: 0,
end: 7.5
},
{
title: 'Section 2',
description: 'Description text 2',
start: 7.5,
end: 15
}
],
//sections: 2,
show_viewed: true,
youtube: {
rel: 0,
autoplay: 0,
//start: 2,
//end: 10
//hl:
}
})
$('#btn1_get_data').click(function() {
var state = $("#test").taskVideo.state();
$('#state1').html(JSON.stringify(state, null, 2));
})
$('#btn1_destroy').click(function() {
$("#test").taskVideo.destroy();
})
})
</script>
</body>
</html>