Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bctcvai committed Nov 22, 2024
1 parent 0c50af3 commit 0c2b39d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 14 additions & 10 deletions ui/src/js/annotation/annotation-multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ export class AnnotationMulti extends TatorElement {
this._primaryVideoIndex = this._longest_idx;
max_frames = Math.round(max_time * this._maxFps);
this._timeStore.setLengthAndFps(max_frames, this._maxFps);

const searchParams = new URLSearchParams(window.location.search);
this._totalTime.textContent =
"/ " + frameToTime(max_frames, this._maxFps);
Expand All @@ -1491,7 +1491,6 @@ export class AnnotationMulti extends TatorElement {
this._videos[idx].style.zIndex = "unset";
}


let frameInit = 0;
if (searchParams.has("frame")) {
frameInit = Number(searchParams.get("frame"));
Expand Down Expand Up @@ -1584,12 +1583,15 @@ export class AnnotationMulti extends TatorElement {
}

shiftGlobalFrame(amount) {
const minFrameIncrement = this._maxFps / this._videos[this._primaryVideoIndex]._mediaInfo.fps;
amount *= Math.max(1,minFrameIncrement);
const minFrameIncrement =
this._maxFps / this._videos[this._primaryVideoIndex]._mediaInfo.fps;
amount *= Math.max(1, minFrameIncrement);
const prime_frame = this._videos[this._primaryVideoIndex].currentFrame();
const global_frame = prime_frame * (this._maxFps / this._videos[this._primaryVideoIndex]._mediaInfo.fps);
const global_frame =
prime_frame *
(this._maxFps / this._videos[this._primaryVideoIndex]._mediaInfo.fps);
this.goToFrame(global_frame + amount);
};
}

setMultiviewUrl(multiviewType, vid_id) {
let get_pos = () => {
Expand Down Expand Up @@ -2327,8 +2329,11 @@ export class AnnotationMulti extends TatorElement {
let failSafeFunction = () => {
clearTimeout(this._failSafeTimer);
this._videoStatus = "paused";
const primeToGlobal = this._maxFps / this._videos[this._primaryVideoIndex]._mediaInfo.fps;
this.goToFrame(this._videos[this._primaryVideoIndex].currentFrame()*primeToGlobal);
const primeToGlobal =
this._maxFps / this._videos[this._primaryVideoIndex]._mediaInfo.fps;
this.goToFrame(
this._videos[this._primaryVideoIndex].currentFrame() * primeToGlobal
);
};
clearTimeout(this._failSafeTimer);
if (paused == false) {
Expand Down Expand Up @@ -2614,8 +2619,7 @@ export class AnnotationMulti extends TatorElement {
}

_timeToFrame(minutes, seconds) {
var frame =
minutes * 60 * this._maxFps + seconds * this._maxFps + 1;
var frame = minutes * 60 * this._maxFps + seconds * this._maxFps + 1;
return frame;
}

Expand Down
1 change: 0 additions & 1 deletion ui/src/js/annotation/time-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export class TimeStore {
this._lastGlobalFrame = length - 1;
}


/**
* @param {Tator.Media} media - Media to add to the internal map when retrieving time info
* @param {integer} channelIndex - Associated channel index
Expand Down

0 comments on commit 0c2b39d

Please sign in to comment.