play .ts file on chrome with Angular

224 Views Asked by At

I am trying to play a .ts file on chrome, but getting the error:

Uncaught (in promise) DOMException: Failed to load because no supported source was found.

Here's my function and this works for me when the extension is mp4. How can i get fix this to play .ts extensions?

  var vid;
  function play_video(video, width, height) {
    if (vid == null) {
      vid = document.createElement("video");
      document.body.appendChild(vid);
    }
    vid.source = { src: video, type: "video/ts" };
    vid.width = width;
    vid.height = height;
    vid.loop = true;
    vid.muted = true;
    vid.src = video;
    vid.type = "video/ts";
    vid.play();
  }
0

There are 0 best solutions below