code: function handleVideo(video) {
  	var
  		xhr = new XMLHttpRequest(),
  		stream;
  
  	// The app has set video.src.
  	if (video.src) {
  		xhr.open('GET', video.src, true);
  		xhr.responseType = 'blob';
  		xhr.onload = function () {
  			if (xhr.status !== 200) {
  				// If this video element was previously handling a MediaStreamRenderer, release it.
  				releaseMediaStreamRenderer(video);
  
  				return;
  			}
  
  			var reader = new FileReader();
  
  			// Some versions of Safari fail to set onloadend property, some others do not react
  			// on 'loadend' event. Try everything here.
  			try {
  				reader.onloadend = onloadend;
  			} catch (error) {
  				reader.addEventListener('loadend', onloadend);
  			}
  			reader.readAsText(xhr.response);
  
  			function onloadend() {
  				var mediaStreamBlobId = reader.result;
  
  				// The retrieved URL does not point to a MediaStream.
  				if (!mediaStreamBlobId || typeof mediaStreamBlobId !== 'string' || !MEDIASTREAM_ID_REGEXP.test(mediaStreamBlobId)) {
  					// If this video element was previously handling a MediaStreamRenderer, release it.
  					releaseMediaStreamRenderer(video);
  
  					return;
  				}
  
  				provideMediaStreamRenderer(video, mediaStreamBlobId);
  			}
  		};
  		xhr.send();
  	}
  
  	// The app has set video.srcObject.
  	else if (video.srcObject) {
  		stream = video.srcObject;
  
  		if (!stream.getBlobId()) {
  			// If this video element was previously handling a MediaStreamRenderer, release it.
  			releaseMediaStreamRenderer(video);
  
  			return;
  		}
  
  		provideMediaStreamRenderer(video, stream.getBlobId());
  	}
  }
docs: Private API.