more video refinement
This commit is contained in:
@@ -121,6 +121,7 @@
|
|||||||
var player;
|
var player;
|
||||||
var playing = false;
|
var playing = false;
|
||||||
var dataplaying = false;
|
var dataplaying = false;
|
||||||
|
|
||||||
var videotime = 0;
|
var videotime = 0;
|
||||||
var data = JSON.parse('{{ data|safe }}');
|
var data = JSON.parse('{{ data|safe }}');
|
||||||
{% for id, metric in metrics.items %}
|
{% for id, metric in metrics.items %}
|
||||||
@@ -229,6 +230,7 @@
|
|||||||
} else {
|
} else {
|
||||||
if (!dataplaying) {
|
if (!dataplaying) {
|
||||||
output.value = Math.round(datatime)-Math.round(videotime);
|
output.value = Math.round(datatime)-Math.round(videotime);
|
||||||
|
document.getElementById("time").innerHTML = Math.round(videotime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,15 +239,16 @@
|
|||||||
function stopVideo() {
|
function stopVideo() {
|
||||||
player.pauseVideo();
|
player.pauseVideo();
|
||||||
playing = false;
|
playing = false;
|
||||||
dataplay.value = String.fromCharCode(9658);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// call this function when player state changes
|
// call this function when player state changes
|
||||||
function onPlayerStateChange(event) {
|
function onPlayerStateChange(event) {
|
||||||
if (event.data == YT.PlayerState.PLAYING) {
|
if (event.data == YT.PlayerState.PLAYING && lock.checked) {
|
||||||
|
var dataplay = document.getElementById("dataplay").childNodes[0];
|
||||||
} else {
|
dataplay.value = String.fromCharCode(10074,10074);
|
||||||
|
} else if (lock.checked) {
|
||||||
|
var dataplay = document.getElementById("dataplay").childNodes[0];
|
||||||
|
dataplay.value = String.fromCharCode(9658);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -557,7 +560,11 @@ function clock() {
|
|||||||
|
|
||||||
if (lock.checked) {
|
if (lock.checked) {
|
||||||
player.seekTo(c+parseInt(output.value));
|
player.seekTo(c+parseInt(output.value));
|
||||||
|
} else {
|
||||||
|
delay = Math.round(slider.value)-Math.round(player.getCurrentTime());
|
||||||
|
output.value = Math.round(slider.value)-Math.round(player.getCurrentTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == latitude.length) {
|
if (c == latitude.length) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user