title: Image/Video Preview In Angular
body: <p>I'm trying to upload image or video in Angular. I wanted to display its preview. 
  I have no problem in previewing the image, my problem is how can i preview the video?
  Please see this stackblitz link: </p>
  
  <p><a href="https://stackblitz.com/edit/angular-video-or-image-upload-preview" rel="nofollow noreferrer"><strong>CLICK HERE</strong></a></p>
  
  <p><br /></p>
  
  <blockquote>
    <p>CODE</p>
  </blockquote>
  
  <pre><code> onSelectFile(event) {
      if (event.target.files &amp;&amp; event.target.files[0]) {
        var reader = new FileReader();
  
        reader.readAsDataURL(event.target.files[0]);
  
        reader.onload = (event) =&gt; {
          this.url = event.target.result;
        }
      }
    }
  </code></pre>