mat-video icon indicating copy to clipboard operation
mat-video copied to clipboard

GetvideoTag() not working.

Open Shivampio opened this issue 4 years ago • 3 comments

AppComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property '__zone_symbol__addEventListener' of null

Shivampio avatar May 04 '20 12:05 Shivampio

Same error!!! image

Angular CLI: 9.1.4 Node: 12.16.2 OS: win32 x64

Angular: 9.1.4 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.4 @angular-devkit/build-angular 0.901.4 @angular-devkit/build-optimizer 0.901.4 @angular-devkit/build-webpack 0.901.4 @angular-devkit/core 9.1.4 @angular-devkit/schematics 9.1.4 @angular/cdk 9.2.2 @angular/material 9.2.2 @ngtools/webpack 9.1.4 @schematics/angular 9.1.4 @schematics/update 0.901.4 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0

honest-studio avatar May 06 '20 19:05 honest-studio

I had this problem and I solved it using ngAfterViewInit like this :

@ViewChild('lessonVideo')
private matVideo: { getVideoTag: () => HTMLVideoElement };

[...]

ngAfterViewInit(): void {
  this.matVideo.getVideoTag().addEventListener('ended', () => this.store.dispatch(new ReadNextVideo()));
}

I can't import MatVideoComponent 😢 :

import { MatVideoComponent } from 'mat-video'; // <= Module '"node_modules/mat-video/mat-video"' has no exported member 'MatVideoComponent'.

so I describe it's interface :

{ getVideoTag: () => HTMLVideoElement }

And it's work ! 😄

jboz avatar May 08 '20 09:05 jboz

Thanks for your reply, i will try it definitely.

Shivampio avatar May 08 '20 10:05 Shivampio