title: How to reduce the length of a video using JavaScript?
body: <p>I am trying to trim the length of a video within the browser, from either the beginning or the end. What I currently have is a MediaStream which is being recorded using the MediaRecorder API, which I use to produce a Blob at the end of the recording with type set to 'video/mp4'. This works great and I am able to play the video back, however I would like a way to trim the video either at the start or end. </p>
  
  <p>Upon further investigation of the MediaStream API I came across the <a href="https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer" rel="noreferrer">SourceBuffer</a> object, that you can obtain from a MediaStreamTrack and use it to remove a time slice, which is exactly what I want. However I am unsure of how to obtain the MediaStreamTrack from the video (blob) since video.srcObject property returns null.</p>