0

I have given video tag to play the video. Below code is working properly.For Sample code:

<div class="video">
    <video controls (click)="toggleVideo()" #videoPlayer>
        <source src="https://vjs.zencdn.net/v/oceans.mp4" type="video/mp4" />
        Browser not supported
    </video>
</div>

Component.ts:

   @ViewChild("videoPlayer", { static: false }) videoplayer: ElementRef;
    isPlay: boolean = false;

 toggleVideo() {
    this.videoplayer.nativeElement.play();
  }

But if I can change the src into .mpd file, Its not playing the video. Below code is not playing any video. Is it because of mpd file? Can you please help me?

<div class="video">
    <video controls (click)="toggleVideo()" #videoPlayer>
      <source src="http://ec2-3-6-94-231.ap-south-1.compute.amazonaws.com/ga_test/dash/test.mpd" type="video/mpd" />
      Browser not supported
    </video>
  </div>

charu
  • 77
  • 9
  • Basically, you can't use HTML5 video to play that specific format out of the box :( https://stackoverflow.com/questions/43632886/can-html5-play-a-mpd-manifest-file-through-its-video-tag However, you can use Dash.js https://reference.dashif.org/dash.js/latest/samples/index.html – WSD Oct 08 '20 at 09:22
  • Ok, thanks,, Is there any way to play this video in vlc player using angular? Could you please share any docs related about this?? – charu Oct 08 '20 at 09:50
  • Don't think so. But have a look to https://reference.dashif.org/dash.js/latest/samples/getting-started/auto-load-single-video-src.html they are using Dash.js and seems easy to integrate in your Angular project. – WSD Oct 08 '20 at 10:44
  • Also, it seems that someone build a webcomponent to deal with this (based on Dash.js) https://www.npmjs.com/package/dash-video-element Or even better https://www.npmjs.com/package/angular-dashjs-player – WSD Oct 08 '20 at 10:45

0 Answers0