Fix js loading/playback issues
This commit is contained in:
parent
5f626b5b3c
commit
d04ccd3c5b
1 changed files with 8 additions and 3 deletions
|
@ -311,7 +311,9 @@ class Annotator extends EventTarget {
|
||||||
fetch(metadata_req)
|
fetch(metadata_req)
|
||||||
.then(response => response.ok ? response.json() : null)
|
.then(response => response.ok ? response.json() : null)
|
||||||
.then(metadata => {
|
.then(metadata => {
|
||||||
metadata.annotations = metadata.annotations.map((a) => new Annotation(a.tag, a.t_in, a.t_out))
|
if (metadata !== null) {
|
||||||
|
metadata.annotations = metadata.annotations.map((a) => new Annotation(a.tag, a.t_in, a.t_out))
|
||||||
|
}
|
||||||
this.loadStrokes(data, metadata)
|
this.loadStrokes(data, metadata)
|
||||||
})
|
})
|
||||||
.catch(e => console.log(e));
|
.catch(e => console.log(e));
|
||||||
|
@ -754,7 +756,9 @@ class Annotator extends EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
// when an outpoint is set, stop playing there
|
// when an outpoint is set, stop playing there
|
||||||
if (this.outPointPosition && (next_path > this.outPointPosition[0] || next_point > this.outPointPosition[1])) {
|
if (this.outPointPosition && (next_path > this.outPointPosition[0] ||
|
||||||
|
(next_path == this.outPointPosition[0] && next_point > this.outPointPosition[1]))) {
|
||||||
|
console.log('> out point', this.outPointPosition)
|
||||||
return [null, null];
|
return [null, null];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -945,7 +949,8 @@ class Annotator extends EventTarget {
|
||||||
|
|
||||||
getEndTimeMs() {
|
getEndTimeMs() {
|
||||||
const videoDuration = this.getFinalFrameTime();
|
const videoDuration = this.getFinalFrameTime();
|
||||||
const audioDuration = (this.audioEl) ? this.audioEl.duration + this.audioOffset : 0;
|
const audioDuration = (this.audioEl && this.audioEl.src) ? this.audioEl.duration + this.audioOffset : 0;
|
||||||
|
|
||||||
return Math.max(videoDuration, audioDuration * 1000);
|
return Math.max(videoDuration, audioDuration * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue