player improvements
This commit is contained in:
@@ -198,7 +198,12 @@ def get_video_data(w,groups=['basic'],mode='water'):
|
|||||||
if dict(rowingmetrics)[c]['numtype'] == 'integer':
|
if dict(rowingmetrics)[c]['numtype'] == 'integer':
|
||||||
data[c] = df2[c].astype(int).tolist()
|
data[c] = df2[c].astype(int).tolist()
|
||||||
else:
|
else:
|
||||||
data[c] = df2[c].values.tolist()
|
sigfigs = dict(rowingmetrics)[c]['sigfigs']
|
||||||
|
if (c != 'pace'):
|
||||||
|
da = ((10**sigfigs)*df2[c]).astype(int)/(10**sigfigs)
|
||||||
|
else:
|
||||||
|
da = df2[c]
|
||||||
|
data[c] = da.values.tolist()
|
||||||
metrics[c] = {
|
metrics[c] = {
|
||||||
'name': dict(rowingmetrics)[c]['verbose_name'],
|
'name': dict(rowingmetrics)[c]['verbose_name'],
|
||||||
'metric': c,
|
'metric': c,
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ rowingmetrics = (
|
|||||||
'ax_max': 1e5,
|
'ax_max': 1e5,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'basic'}),
|
'group':'basic',
|
||||||
|
'sigfigs': -1}),
|
||||||
|
|
||||||
('hr',{
|
('hr',{
|
||||||
'numtype':'integer',
|
'numtype':'integer',
|
||||||
@@ -66,7 +67,8 @@ rowingmetrics = (
|
|||||||
'ax_max': 200,
|
'ax_max': 200,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'athlete'}),
|
'group':'athlete',
|
||||||
|
'sigfigs':0,}),
|
||||||
|
|
||||||
('pace',{
|
('pace',{
|
||||||
'numtype':'float',
|
'numtype':'float',
|
||||||
@@ -76,6 +78,7 @@ rowingmetrics = (
|
|||||||
'ax_max': 1.0e3*75,
|
'ax_max': 1.0e3*75,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
|
'sigfigs': 1,
|
||||||
'group': 'basic'}),
|
'group': 'basic'}),
|
||||||
|
|
||||||
('velo',{
|
('velo',{
|
||||||
@@ -86,6 +89,7 @@ rowingmetrics = (
|
|||||||
'ax_max': 8,
|
'ax_max': 8,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
|
'sigfigs': 1,
|
||||||
'type':'pro',
|
'type':'pro',
|
||||||
'group': 'basic'}),
|
'group': 'basic'}),
|
||||||
|
|
||||||
@@ -106,6 +110,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 15,
|
'ax_min': 15,
|
||||||
'ax_max': 45,
|
'ax_max': 45,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
|
'sigfigs': 1,
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'basic'}),
|
'group':'basic'}),
|
||||||
|
|
||||||
@@ -116,6 +121,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 1000,
|
'ax_max': 1000,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
|
'sigfigs': 0,
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'forcepower'}),
|
'group':'forcepower'}),
|
||||||
|
|
||||||
@@ -126,6 +132,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 600,
|
'ax_max': 600,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
|
'sigfigs': 0,
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'forcepower'}),
|
'group':'forcepower'}),
|
||||||
|
|
||||||
@@ -136,6 +143,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 1200,
|
'ax_max': 1200,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
|
'sigfigs': 0,
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'forcepower'}),
|
'group':'forcepower'}),
|
||||||
|
|
||||||
@@ -145,6 +153,7 @@ rowingmetrics = (
|
|||||||
'verbose_name': 'Peak Drive Force (N)',
|
'verbose_name': 'Peak Drive Force (N)',
|
||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 1500,
|
'ax_max': 1500,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'forcepower'}),
|
'group':'forcepower'}),
|
||||||
@@ -156,6 +165,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 2.5,
|
'ax_max': 2.5,
|
||||||
'mode':'rower',
|
'mode':'rower',
|
||||||
|
'sigfigs': 2,
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'stroke'}),
|
'group':'stroke'}),
|
||||||
|
|
||||||
@@ -165,6 +175,7 @@ rowingmetrics = (
|
|||||||
'verbose_name': 'Average/Peak Force Ratio',
|
'verbose_name': 'Average/Peak Force Ratio',
|
||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 1,
|
'ax_max': 1,
|
||||||
|
'sigfigs': 2,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'forcepower'}),
|
'group': 'forcepower'}),
|
||||||
@@ -175,6 +186,7 @@ rowingmetrics = (
|
|||||||
'verbose_name': 'Interval Distance (m)',
|
'verbose_name': 'Interval Distance (m)',
|
||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 1e5,
|
'ax_max': 1e5,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'basic'}),
|
'group':'basic'}),
|
||||||
@@ -186,6 +198,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 1e5,
|
'ax_max': 1e5,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
|
'sigfigs': 0,
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'basic'}),
|
'group':'basic'}),
|
||||||
|
|
||||||
@@ -196,10 +209,12 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 4,
|
'ax_max': 4,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 2,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'stroke'}),
|
'group': 'stroke'}),
|
||||||
|
|
||||||
|
|
||||||
('catch',{
|
('catch',{
|
||||||
'numtype':'float',
|
'numtype':'float',
|
||||||
'null':True,
|
'null':True,
|
||||||
@@ -207,6 +222,7 @@ rowingmetrics = (
|
|||||||
'ax_min': -40,
|
'ax_min': -40,
|
||||||
'ax_max': -75,
|
'ax_max': -75,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'stroke'}),
|
'group': 'stroke'}),
|
||||||
@@ -218,6 +234,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 20,
|
'ax_max': 20,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 1,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'stroke'}),
|
'group': 'stroke'}),
|
||||||
@@ -229,6 +246,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 20,
|
'ax_min': 20,
|
||||||
'ax_max': 55,
|
'ax_max': 55,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'stroke'}),
|
'group': 'stroke'}),
|
||||||
@@ -240,6 +258,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 30,
|
'ax_max': 30,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group': 'stroke'}),
|
'group': 'stroke'}),
|
||||||
@@ -251,6 +270,7 @@ rowingmetrics = (
|
|||||||
'ax_min': -50,
|
'ax_min': -50,
|
||||||
'ax_max': 50,
|
'ax_max': 50,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'stroke'}),
|
'group':'stroke'}),
|
||||||
@@ -263,6 +283,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 40,
|
'ax_min': 40,
|
||||||
'ax_max': 140,
|
'ax_max': 140,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'stroke'}),
|
'group':'stroke'}),
|
||||||
@@ -275,6 +296,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 40,
|
'ax_min': 40,
|
||||||
'ax_max': 140,
|
'ax_max': 140,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'stroke'}),
|
'group':'stroke'}),
|
||||||
@@ -286,6 +308,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 20,
|
'ax_min': 20,
|
||||||
'ax_max': 55,
|
'ax_max': 55,
|
||||||
'default': 1.0,
|
'default': 1.0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'erg',
|
'mode':'erg',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'stroke'}),
|
'group':'stroke'}),
|
||||||
@@ -297,6 +320,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 110,
|
'ax_max': 110,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 0,
|
||||||
'mode':'water',
|
'mode':'water',
|
||||||
'type': 'pro',
|
'type': 'pro',
|
||||||
'group':'forcepower'}),
|
'group':'forcepower'}),
|
||||||
@@ -308,6 +332,7 @@ rowingmetrics = (
|
|||||||
'ax_min': 0,
|
'ax_min': 0,
|
||||||
'ax_max': 15,
|
'ax_max': 15,
|
||||||
'default': 0,
|
'default': 0,
|
||||||
|
'sigfigs': 1,
|
||||||
'mode':'both',
|
'mode':'both',
|
||||||
'type': 'basic',
|
'type': 'basic',
|
||||||
'group':'basic'}),
|
'group':'basic'}),
|
||||||
|
|||||||
@@ -314,15 +314,43 @@
|
|||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
|
// cookie reader
|
||||||
|
function createCookie(name,value,days) {
|
||||||
|
if (days) {
|
||||||
|
var date = new Date();
|
||||||
|
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||||
|
var expires = "; expires="+date.toGMTString();
|
||||||
|
}
|
||||||
|
else var expires = "";
|
||||||
|
document.cookie = name+"="+value+expires+"; path=/";
|
||||||
|
}
|
||||||
|
function readCookie(name) {
|
||||||
|
var nameEQ = name + "=";
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
for(var i=0;i < ca.length;i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||||
|
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
// lock
|
// lock
|
||||||
var lock = document.getElementById("lock");
|
var lock = document.getElementById("lock");
|
||||||
// lock.onchange nog doen
|
|
||||||
var output = document.getElementById("id_delay");
|
var output = document.getElementById("id_delay");
|
||||||
|
var cookie = readCookie("lock");
|
||||||
|
var delay = output.value;
|
||||||
|
if (cookie=="true") {
|
||||||
|
lock.checked = true;
|
||||||
|
output.disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// lock.onchange nog doen
|
||||||
|
|
||||||
{% if locked %}
|
{% if locked %}
|
||||||
lock.checked = true;
|
lock.checked = true;
|
||||||
output.disabled = true;
|
output.disabled = true;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
var delay = output.value;
|
|
||||||
|
|
||||||
// slider
|
// slider
|
||||||
var slider = document.getElementById("myRange");
|
var slider = document.getElementById("myRange");
|
||||||
@@ -407,20 +435,18 @@
|
|||||||
slider.value = this.value+Math.round(player.getCurrentTime());
|
slider.value = this.value+Math.round(player.getCurrentTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
// lock delay form field if checkbox checked
|
|
||||||
lock.oninput = function() {
|
|
||||||
if (this.checked) {
|
|
||||||
output.disabled = true;
|
|
||||||
} else {
|
|
||||||
output.disabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Update the current slider value (each time the slider is changed)
|
// Update the current slider value (each time the slider is changed)
|
||||||
slider.onchange = function() {
|
slider.onchange = function() {
|
||||||
clearInterval(timeupdater)
|
clearInterval(timeupdater)
|
||||||
if (lock.checked) {
|
if (lock.checked) {
|
||||||
if (this.value-output.value > 0) {
|
if (this.value-output.value > 0) {
|
||||||
player.seekTo(this.value-output.value);
|
player.seekTo(this.value-output.value);
|
||||||
|
if (playing) {
|
||||||
|
player.playVideo();
|
||||||
|
} else {
|
||||||
|
player.pauseVideo();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (playing) {
|
if (playing) {
|
||||||
player.seekTo(0);
|
player.seekTo(0);
|
||||||
@@ -482,8 +508,10 @@
|
|||||||
lock.oninput = function() {
|
lock.oninput = function() {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
output.disabled = true;
|
output.disabled = true;
|
||||||
|
createCookie("lock","true",0);
|
||||||
} else {
|
} else {
|
||||||
output.disabled = false;
|
output.disabled = false;
|
||||||
|
createCookie("lock","false",0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Slider start stop
|
// Slider start stop
|
||||||
|
|||||||
Reference in New Issue
Block a user