"captureStreamUntilEnded
" allows us capture "MediaStream
" from a <video>
element; however, remeber, these API are (AFAIK) not fully implemented by any single vendor.
Firefox implemented prefixed version of "mozCaptureStreamUntilEnded
" however their RTCPeerConnection implementation is unable to add/understand stream coming from (i.e. generated by) mozCaptureStreamUntilEnded
because (AFAIK) [currently] "only one" media source i.e. "APM" is permitted both on chrome and firefox.
I tried to stream pre-recorded medias using MediaSource API too; however, it is "not" realtime. Though, you can share chunks generated by MediaSource API as fast as possible using WebRTC SCTP based data channels; however, MediaSource API has itself limited support.
MediaSource API are useful to play chunks (in a <video>
element) instead of waiting for the whole file to be streamed or downloaded.