Added backend and database support for video streaming

Added UI support for video streaming. branch is now feature-complete
This commit is contained in:
Isaac Grynsztein
2020-04-09 23:33:58 -04:00
parent a61606b69f
commit e15141c5e0
7 changed files with 60 additions and 16 deletions

View File

@@ -29,8 +29,10 @@
</mat-option>
</mat-select>
</div>
<div>
<mat-checkbox [(ngModel)]="streamingOnlyMode">Streaming-only mode</mat-checkbox>
<div class="col-12">
<div>
<mat-checkbox [(ngModel)]="streamingOnlyMode">Streaming-only mode</mat-checkbox>
</div>
</div>
</div>
</div>

View File

@@ -49,8 +49,7 @@ export class SubscribeDialogComponent implements OnInit {
if (!this.download_all) {
timerange = 'now-' + this.timerange_amount.toString() + this.timerange_unit;
}
this.postsService.createSubscription(this.url, this.name, timerange).subscribe(res => {
this.postsService.createSubscription(this.url, this.name, timerange, this.streamingOnlyMode).subscribe(res => {
this.subscribing = false;
if (res['new_sub']) {
this.dialogRef.close(res['new_sub']);

View File

@@ -184,8 +184,8 @@ export class PostsService {
return this.http.post(this.path + 'deletePlaylist', {playlistID: playlistID, type: type});
}
createSubscription(url, name, timerange = null) {
return this.http.post(this.path + 'subscribe', {url: url, name: name, timerange: timerange})
createSubscription(url, name, timerange = null, streamingOnly = false) {
return this.http.post(this.path + 'subscribe', {url: url, name: name, timerange: timerange, streamingOnly: streamingOnly});
}
unsubscribe(sub, deleteMode = false) {

View File

@@ -54,7 +54,11 @@ export class SubscriptionFileCardComponent implements OnInit {
}
goToFile() {
this.goToFileEmit.emit(this.file.id);
const emit_obj = {
name: this.file.id,
url: this.file.requested_formats ? this.file.requested_formats[0].url : this.file.url
}
this.goToFileEmit.emit(emit_obj);
}
openSubscriptionInfoDialog() {

View File

@@ -84,10 +84,16 @@ export class SubscriptionComponent implements OnInit {
});
}
goToFile(name) {
goToFile(emit_obj) {
const name = emit_obj['name'];
const url = emit_obj['url'];
localStorage.setItem('player_navigator', this.router.url);
this.router.navigate(['/player', {fileNames: name, type: 'subscription', subscriptionName: this.subscription.name,
subPlaylist: this.subscription.isPlaylist}]);
if (this.subscription.streamingOnly) {
this.router.navigate(['/player', {name: name, url: url}]);
} else {
this.router.navigate(['/player', {fileNames: name, type: 'subscription', subscriptionName: this.subscription.name,
subPlaylist: this.subscription.isPlaylist}]);
}
}
onSearchInputChanged(newvalue) {