Turn video into Blob object?

Asked

Viewed 168 times

2

I found this code in a tutorial that to turn videos into objects and be treated as if it were a url blob, with the first video with comes on the page the function works perfectly, but when I call another video through the Ajax the same does not reproduce, the only purpose of this code is to help protect the original path of videos to avoid direct access, which may be wrong?

function mascara()
{
    var ms = new MediaSource();

    var video = document.querySelector('source');
    video.src = window.URL.createObjectURL(ms);

    ms.addEventListener('sourceopen', function(e) {

      var sourceBuffer = ms.addSourceBuffer('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
      sourceBuffer.appendBuffer(oneVideoWebMChunk);

    }, false);
};
  • my tip does not use videos in the database , puts in a folder that nobody has access and makes a file give an include on it, mno db while the video does not finish d be loaded it from a lock table other people will not be able to access at the same time.

  • The videos are already in folders, what is received by Ajax is just the way this new video that the user clicked, having return to success I call this function to mask the url of the video, but it does not play :/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.