freealise commited on
Commit
fef9e6c
·
verified ·
1 Parent(s): 22acfae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -780,12 +780,16 @@ async(c, o, p, d, n, m, s)=>{
780
  });
781
 
782
  videoDome.videoTexture.video.oncanplaythrough = function () {
 
 
 
 
783
  play();
784
  videoDome.videoTexture.video.oncanplaythrough = null;
785
  video.oncanplaythrough = null;
786
  };
787
 
788
- var debugLayer = BABYLON.Engine.LastCreatedScene.debugLayer.show();
789
 
790
 
791
  if (document.getElementById("model")) {
@@ -956,13 +960,13 @@ function seek(t) {
956
  videoDome.videoTexture.video.pause();
957
  video.pause();
958
 
959
- videoDome.videoTexture.video.currentTime += t;
960
  if (videoDome.videoTexture.video.currentTime > videoDome.videoTexture.video.duration) {
961
  videoDome.videoTexture.video.currentTime = videoDome.videoTexture.video.duration;
962
  } else if (videoDome.videoTexture.video.currentTime < 0) {
963
  videoDome.videoTexture.video.currentTime = 0;
964
  }
965
- video.currentTime += t;
966
  if (video.currentTime > video.duration) {
967
  video.currentTime = video.duration;
968
  } else if (video.currentTime < 0) {
@@ -1310,8 +1314,7 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
1310
  <a href='#' onclick='snapshot();'>Screenshot</a>
1311
  <a href='#' onclick='record_video();'>Record</a>
1312
  <a href='#' onclick='stop_recording();'>Stop rec.</a>
1313
- <a href='#' onclick='seek(-1);'>Back</a> <a href='#' onclick='seek(1);'>Fwd</a>
1314
- <a href='#' onclick='play();'>Play</a><br/>
1315
  <img src='' id='img_out' onload='var ctxt = document.getElementById(\"cnv_out\").getContext(\"2d\");ctxt.drawImage(this, 0, 0);'/><br/>
1316
  <canvas id='cnv_out'></canvas>
1317
  <div id='compass_box'><div id='compass'><a id='fullscreen' onclick='
 
780
  });
781
 
782
  videoDome.videoTexture.video.oncanplaythrough = function () {
783
+ document.getElementById('seek').innerHTML = '';
784
+ for (var i=0; i<videoDome.videoTexture.video.duration; i++) {
785
+ document.getElementById('seek').innerHTML += '<a href="#" onclick="seek('+i+');">'+i+'</a> ';
786
+ }
787
  play();
788
  videoDome.videoTexture.video.oncanplaythrough = null;
789
  video.oncanplaythrough = null;
790
  };
791
 
792
+ var debugLayer = BABYLON.Engine.LastCreatedScene.debugLayer.show();
793
 
794
 
795
  if (document.getElementById("model")) {
 
960
  videoDome.videoTexture.video.pause();
961
  video.pause();
962
 
963
+ videoDome.videoTexture.video.currentTime = t;
964
  if (videoDome.videoTexture.video.currentTime > videoDome.videoTexture.video.duration) {
965
  videoDome.videoTexture.video.currentTime = videoDome.videoTexture.video.duration;
966
  } else if (videoDome.videoTexture.video.currentTime < 0) {
967
  videoDome.videoTexture.video.currentTime = 0;
968
  }
969
+ video.currentTime = t;
970
  if (video.currentTime > video.duration) {
971
  video.currentTime = video.duration;
972
  } else if (video.currentTime < 0) {
 
1314
  <a href='#' onclick='snapshot();'>Screenshot</a>
1315
  <a href='#' onclick='record_video();'>Record</a>
1316
  <a href='#' onclick='stop_recording();'>Stop rec.</a>
1317
+ <span id='seek'></span> <a href='#' onclick='play();'>Play</a><br/>
 
1318
  <img src='' id='img_out' onload='var ctxt = document.getElementById(\"cnv_out\").getContext(\"2d\");ctxt.drawImage(this, 0, 0);'/><br/>
1319
  <canvas id='cnv_out'></canvas>
1320
  <div id='compass_box'><div id='compass'><a id='fullscreen' onclick='