Aray Karjauv commited on
Commit
407695b
1 Parent(s): 45f2b9f

timeline fix, player cors

Browse files
Files changed (2) hide show
  1. backend.py +1 -1
  2. player.html +1 -2
backend.py CHANGED
@@ -194,5 +194,5 @@ def calc_speaker_percentage(timeline, duration):
194
  for start in sorted(timeline.keys()):
195
  end = timeline[start]['end']
196
  speaker = timeline[start]['speaker']
197
- percentages.append([speaker, (end-start)/duration])
198
  return percentages
 
194
  for start in sorted(timeline.keys()):
195
  end = timeline[start]['end']
196
  speaker = timeline[start]['speaker']
197
+ percentages.append([speaker, 100*(end-start)/duration])
198
  return percentages
player.html CHANGED
@@ -61,7 +61,7 @@
61
  </head>
62
  <body>
63
  <div class="video-container" style="width: 100%">
64
- <video controls class="video" id="video" preload="metadata" style="width: 100%">
65
  <source src="$url" type="video/mp4"></source>
66
  <track src="$vtt" kind="subtitles" srclang="en" label="English" default></track>
67
  </video>
@@ -79,7 +79,6 @@
79
  const percentages = $percentages;
80
 
81
  async function main(){
82
- console.log('main ==========================================')
83
  let divs = ''
84
  let last_time = 0
85
  for(let p of percentages){
 
61
  </head>
62
  <body>
63
  <div class="video-container" style="width: 100%">
64
+ <video controls class="video" id="video" preload="metadata" style="width: 100%" crossorigin="use-credentials">
65
  <source src="$url" type="video/mp4"></source>
66
  <track src="$vtt" kind="subtitles" srclang="en" label="English" default></track>
67
  </video>
 
79
  const percentages = $percentages;
80
 
81
  async function main(){
 
82
  let divs = ''
83
  let last_time = 0
84
  for(let p of percentages){