Skip to content

Commit

Permalink
Handle both kinds of positions
Browse files Browse the repository at this point in the history
  • Loading branch information
hardiesoft committed Oct 14, 2021
1 parent fa1a6a2 commit c5644b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CptvPlayerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ const getPositions = (
const padding = 5;
if (positions.length > 0 && !Array.isArray(positions[0])) {
return (positions as Region[]).map((position: Region) => [
position.frameNumber,
position.frameNumber ||
(position.frameTime && frameAtTime(position.frameTime - timeOffset)) ||
0,
[
Math.max(0, position.x - padding),
Math.max(0, position.y - padding),
Expand Down Expand Up @@ -185,7 +187,8 @@ export interface Region {
y: number;
width: number;
height: number;
frameNumber: number;
frameNumber?: number;
frameTime?: number;
}
export interface SelectedTrack {
trackId: number;
Expand Down

0 comments on commit c5644b3

Please sign in to comment.