videogular2 icon indicating copy to clipboard operation
videogular2 copied to clipboard

VgMedia.ngOnDestroy causes error when routing

Open seyfert opened this issue 9 years ago • 4 comments

Description

Videogular errors when navigating away from route with video.

Expected Behavior

Should be able to change routes without causing an error.

Actual Behavior

Error: TypeError: this.subscriptions.mutation.unsubscribe is not a function at VgMedia.ngOnDestroy

Steps to Reproduce

  1. Clone videogular2-starter
  2. Copy AppComponent videogular ts/html to new component (e.g. HomeComponent)
  3. Create new component (e.g. Page2Component)
  4. In app.module.ts, import RouterModule from @angular/router, the two new components, and define routes:
    imports: [
...
        RouterModule.forRoot([{ path: '', component: HomeComponent }, { path: 'page2', component: Page2Component }])
    ],
  1. Change app.component.html to use routes.
<p>
    <a href="" routerLink="">Home</a> |
    <a href="" routerLink="page2">Page 2</a>
</p>
<router-outlet></router-outlet>
  1. Launch app. When you try to navigate to route2 the app with error.

seyfert avatar Dec 18 '16 06:12 seyfert

Please, update to 3.0.0 and check breaking changes here: https://github.com/videogular/videogular2/releases

All docs and demos has been updated too so for further documentation please check:

  • Documentation: https://github.com/videogular/videogular2/tree/master/docs
  • Showroom: https://github.com/videogular/videogular2-showroom

Elecash avatar Dec 18 '16 10:12 Elecash

I am having this exact issue when routing out of the view where is videogular installed and I am using version 5.6.2, do you have a solution for this issue?

apcano1978 avatar Oct 28 '17 19:10 apcano1978

Same problem over here. In my case I'm routing out of the view using: this.router.navigateByUrl('/login');

And the error is: Cannot read property 'bufferDetected' of undefined. And the same goes for the properties 'play' and 'elem'. Hope that helps to solve the issue.

mora260 avatar Nov 02 '17 07:11 mora260

For a similar type of issue as what the OP describes, I was getting mention of MutationObserver in my error for IE10 specifically, and resolved it by installing https://github.com/megawac/MutationObserver.js into my polyfills file.

jessemorton avatar Jan 12 '18 21:01 jessemorton