diff --git a/src/app/components/recent-videos/recent-videos.component.ts b/src/app/components/recent-videos/recent-videos.component.ts index 05deb2b..144f3bd 100644 --- a/src/app/components/recent-videos/recent-videos.component.ts +++ b/src/app/components/recent-videos/recent-videos.component.ts @@ -166,15 +166,14 @@ export class RecentVideosComponent implements OnInit { const sub = this.postsService.getSubscriptionByID(file.sub_id); if (sub.streamingOnly) { // streaming only mode subscriptions - !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}`); + // !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 { // normal subscriptions - !new_tab ? this.router.navigate(['/player', {fileNames: file.id, - 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}`); + !new_tab ? this.router.navigate(['/player', {uid: file.uid, + type: file.isAudio ? 'audio' : 'video', sub_id: sub.id}]) + : window.open(`/#/player;uid=${file.uid};type=${file.isAudio ? 'audio' : 'video'};sub_id=${sub.id}`); } } else { // normal files diff --git a/src/app/player/player.component.ts b/src/app/player/player.component.ts index a554031..c4a0527 100644 --- a/src/app/player/player.component.ts +++ b/src/app/player/player.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, HostListener, EventEmitter, OnDestroy, AfterViewInit, ViewChild } from '@angular/core'; +import { Component, OnInit, HostListener, EventEmitter, OnDestroy, AfterViewInit, ViewChild, ChangeDetectorRef } from '@angular/core'; import { VgApiService } from '@videogular/ngx-videogular/core'; import { PostsService } from 'app/posts.services'; import { ActivatedRoute, Router } from '@angular/router'; @@ -98,6 +98,7 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy { } ngAfterViewInit() { + this.cdr.detectChanges(); this.postsService.sidenav.close(); } @@ -107,7 +108,7 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy { } constructor(public postsService: PostsService, private route: ActivatedRoute, private dialog: MatDialog, private router: Router, - public snackBar: MatSnackBar) { + public snackBar: MatSnackBar, private cdr: ChangeDetectorRef) { } @@ -240,6 +241,7 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy { onPlayerReady(api: VgApiService) { this.api = api; this.api_ready = true; + this.cdr.detectChanges(); // checks if volume has been previously set. if so, use that as default if (localStorage.getItem('player_volume')) {