mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-18 01:21:29 +03:00
Control-clicking file cards will now open the player in a new tab
This commit is contained in:
@@ -138,28 +138,36 @@ export class RecentVideosComponent implements OnInit {
|
|||||||
|
|
||||||
// navigation
|
// navigation
|
||||||
|
|
||||||
goToFile(file) {
|
goToFile(info_obj) {
|
||||||
|
const file = info_obj['file'];
|
||||||
|
const event = info_obj['event'];
|
||||||
if (this.postsService.config['Extra']['download_only_mode']) {
|
if (this.postsService.config['Extra']['download_only_mode']) {
|
||||||
this.downloadFile(file);
|
this.downloadFile(file);
|
||||||
} else {
|
} else {
|
||||||
this.navigateToFile(file);
|
this.navigateToFile(file, event.ctrlKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToFile(file) {
|
navigateToFile(file, new_tab) {
|
||||||
localStorage.setItem('player_navigator', this.router.url);
|
localStorage.setItem('player_navigator', this.router.url);
|
||||||
if (file.sub_id) {
|
if (file.sub_id) {
|
||||||
const sub = this.postsService.getSubscriptionByID(file.sub_id);
|
const sub = this.postsService.getSubscriptionByID(file.sub_id);
|
||||||
if (sub.streamingOnly) {
|
if (sub.streamingOnly) {
|
||||||
this.router.navigate(['/player', {name: file.id,
|
// streaming only mode subscriptions
|
||||||
url: file.requested_formats ? file.requested_formats[0].url : file.url}]);
|
!new_tab ? this.router.navigate(['/player', {name: file.id,
|
||||||
|
url: file.requested_formats ? file.requested_formats[0].url : file.url}])
|
||||||
|
: window.open(`/#/player;name=${file.id};url=${file.requested_formats ? file.requested_formats[0].url : file.url}`);
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/player', {fileNames: file.id,
|
// normal subscriptions
|
||||||
type: file.isAudio ? 'audio' : 'video', subscriptionName: sub.name,
|
!new_tab ? this.router.navigate(['/player', {fileNames: file.id,
|
||||||
subPlaylist: sub.isPlaylist}]);
|
type: file.isAudio ? 'audio' : 'video', subscriptionName: sub.name,
|
||||||
|
subPlaylist: sub.isPlaylist}])
|
||||||
|
: window.open(`/#/player;fileNames=${file.id};type=${file.isAudio ? 'audio' : 'video'};subscriptionName=${sub.name};subPlaylist=${sub.isPlaylist}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/player', {type: file.isAudio ? 'audio' : 'video', uid: file.uid}]);
|
// normal files
|
||||||
|
!new_tab ? this.router.navigate(['/player', {type: file.isAudio ? 'audio' : 'video', uid: file.uid}])
|
||||||
|
: window.open(`/#/player;type=${file.isAudio ? 'audio' : 'video'};uid=${file.uid}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<button mat-menu-item>Placeholder</button>
|
<button mat-menu-item>Placeholder</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
<mat-card [matTooltip]="null" (click)="navigateToFile()" matRipple class="file-mat-card" [ngClass]="{'small-mat-card': card_size === 'small', 'file-mat-card': card_size === 'medium', 'large-mat-card': card_size === 'large', 'mat-elevation-z4': !elevated, 'mat-elevation-z8': elevated}">
|
<mat-card [matTooltip]="null" (click)="navigateToFile($event)" matRipple class="file-mat-card" [ngClass]="{'small-mat-card': card_size === 'small', 'file-mat-card': card_size === 'medium', 'large-mat-card': card_size === 'large', 'mat-elevation-z4': !elevated, 'mat-elevation-z8': elevated}">
|
||||||
<div style="padding:5px">
|
<div style="padding:5px">
|
||||||
<div *ngIf="!loading && file_obj.thumbnailURL" class="img-div">
|
<div *ngIf="!loading && file_obj.thumbnailURL" class="img-div">
|
||||||
<div style="position: relative">
|
<div style="position: relative">
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ export class UnifiedFileCardComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToFile() {
|
navigateToFile(event) {
|
||||||
this.goToFile.emit(this.file_obj);
|
this.goToFile.emit({file: this.file_obj, event: event});
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToSubscription() {
|
navigateToSubscription() {
|
||||||
|
|||||||
Reference in New Issue
Block a user