Add support for new ribbon timeline.

This commit is contained in:
Dermot Duffy
2023-04-14 16:44:39 -07:00
parent 86a8fcd7c1
commit e854187666
13 changed files with 154 additions and 71 deletions
+6 -3
View File
@@ -1,8 +1,8 @@
export type ViewMediaType = 'clip' | 'snapshot' | 'recording';
export enum VideoContentType {
MP4 = "mp4",
HLS = "hls",
MP4 = 'mp4',
HLS = 'hls',
}
export class ViewMedia {
@@ -34,6 +34,9 @@ export class ViewMedia {
public getEndTime(): Date | null {
return null;
}
public getUsableEndTime(): Date | null {
return this.getEndTime() ?? (this.inProgress() ? new Date() : this.getStartTime());
}
public inProgress(): boolean | null {
return null;
}
@@ -51,7 +54,7 @@ export class ViewMedia {
}
public includesTime(seek: Date): boolean {
const startTime = this.getStartTime();
const endTime = this.getEndTime() ?? startTime;
const endTime = this.getUsableEndTime();
return !!startTime && !!endTime && seek >= startTime && seek <= endTime;
}