Added video previews when hovering over a file card

This commit is contained in:
Isaac Abadi
2021-08-25 23:36:31 -06:00
parent cca76dd248
commit 6639305771
3 changed files with 49 additions and 2 deletions

View File

@@ -35,6 +35,8 @@ export class UnifiedFileCardComponent implements OnInit {
// optional vars
thumbnailBlobURL = null;
streamURL = null;
// input/output
@Input() loading = true;
@Input() theme = null;
@@ -78,6 +80,8 @@ export class UnifiedFileCardComponent implements OnInit {
const bloburl = URL.createObjectURL(blob);
this.thumbnailBlobURL = this.sanitizer.bypassSecurityTrustUrl(bloburl);*/
}
this.streamURL = this.generateStreamURL();
}
emitDeleteFile(blacklistMode = false) {
@@ -128,6 +132,23 @@ export class UnifiedFileCardComponent implements OnInit {
this.contextMenu.openMenu();
}
generateStreamURL() {
let baseLocation = 'stream/';
let fullLocation = this.baseStreamPath + baseLocation + `?test=test&uid=${this.file_obj['uid']}`;
if (this.jwtString) {
fullLocation += `&jwt=${this.jwtString}`;
}
if (this.file_obj['sub_id']) {
fullLocation += `&sub_id=${this.file_obj['sub_id']}`;
}
fullLocation += '&t=,10';
return fullLocation;
}
}
function fancyTimeFormat(time) {