0

在 ngx-embeded-video 的帮助下,我的 angular8 应用程序中有视频播放器,我需要禁用默认播放器选项,如暂停、最大窗口、音量、播放选项。此外,该视频需要在该弹出窗口上播放所有需要启用的播放器选项的角度材质模式弹出窗口。视频播放如下所示在此处输入图像描述 当用户单击此视频时,角度材料模态需要打开并播放相同的视频,我已尝试打开模型但无法正常工作,我需要这方面的帮助。html:

ts:
  import { EmbedVideoService } from 'ngx-embed-video';
  import { CarPopupModalComponent } from '../car/car-popup-modal/car-popup-modal.component'

  export class CarComponent implements OnInit {
  videos: any;
  vimeoUrl = 'https://vimeo.com/197933516';
  constructor(private embedService: EmbedVideoService){
    this.videos = this.embedService.embed(this.vimeoUrl);
    }
    openCarDialog(): void {
    console.log('inside the modal');
    this.dialog.open(CarPopupModalComponent, {
      width: '250px',
      data: {}
    })
  }
  }
4

1 回答 1

0

我是通过以下角度支持包“ https://www.npmjs.com/package/mat-video ”实现的

 npm install --save mat-video 

 import to module,

 import { MatVideoModule } from 'mat-video';

@NgModule({
  imports: [
    BrowserAnimationsModule,
    MatVideoModule
  ],
})
export class AppModule { }

html:
<mat-video title="{{'Advertisement Video' | translate}}" [autoplay]="false" [preload]="false" [fullscreen]="false" [download]="false"
      spinner="spin" (click)="openCarDialog()">
      <source matVideoSource src="../../../assets/videos/fourkvideo.mp4" type="video/mp4">

ts:
Vidoe can play angular madal pop by
openCarDialog(): void {
    console.log('inside the modal');
    this.dialog.open(CarPopupModalComponent, {
      width: '720px',
      height: '500px',
      data: {}
    })
  }
于 2019-07-02T12:54:56.980 回答