-1

I have an angularjs app and a url for a MS Stream video. How can I embed this video into my page? The user should paste this link into the page and embed the video. This is my js code:

  let video = document.createElement("video");
        video.src = videoUrl;
        video.load();
        video.addEventListener('loadeddata', function() {
          scope.myContent._videoConfig = {
            sources: [{
              src: $sce.trustAsResourceUrl(videoUrl),
              type: "video/mp4"
            }]
          };
          scope.$apply();
          scope.myContent.url = videoUrl;
        });

I does not throw an error but I reckon the load() statement does not work.

bier hier
  • 20,970
  • 42
  • 97
  • 166
  • Possible duplicate of [How do I redirect to another webpage?](https://stackoverflow.com/questions/503093/how-do-i-redirect-to-another-webpage) – bier hier May 15 '18 at 01:47

1 Answers1

0

If it’s an mp4 just set src on the video tag. If it’s not an mp4, you need use a player like video.js.

szatmary
  • 29,969
  • 8
  • 44
  • 57