0

I have a simple app that uses video. This is route to it:

{ path: 'video', component: VideoComponent }

ngOnInit

  this.video.nativeElement.src = videoSrc;

and a sample url:

/video?project=3

The user can navigate to different routes as well. Such as:

  { path: 'profile', component: ProfileComponent }

My problem is that when the user navigates to routes other then video and comes back, video file is fetched again. I would like to keep it loaded the whole time and prevent subsequent reloads.

What are my options? I've found that you can use RouteReuseStrategy https://angular.io/api/router/RouteReuseStrategy, but it appears to only be valid for activated routes.

sanjihan
  • 5,592
  • 11
  • 54
  • 119

0 Answers0