MediaStream captured from <video/audio> doesn't follow the events of the source HTMLMediaElement |
||
Issue descriptionI.e. - when the source tag ends, the captured Stream should end as well (by stop()ping every track, flipping the active bits, firing the appropriate events). - when the source tag has no 'source' (hasn't fired onloadedmetadata, oncanplay etc), the captured MStream has no tracks; it should wait until the source tag has something (signalled by e.g. onloadedmetadata event fired) then add Tracks to the MS appropriately. Currently it doesn't wait at all. This track addition should make the capture MS fire an onaddtrack event since this is a browser-initiated track addition. (cc dutton@ since he found issues like this in the past).
,
Mar 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d80e6732a30c9f8b5c725fc98b013577799022cd commit d80e6732a30c9f8b5c725fc98b013577799022cd Author: mcasas <mcasas@chromium.org> Date: Mon Mar 06 21:35:20 2017 HTMLMediaElement capture: teach the captured MStream to follow up source events wip This CL adds support for the MediaStream created by calling captureStream() on a <video/audio> to follow the events of the source <video/audio>, namely: - if the source tag ends, the captured MediaStreamTracks are ended and the captured MediaStream is ended (which wasn't the case before). - if the source tag hits an onloadedmetadata, MediaStreamTracks are added to the captured MediaStream as fit. -- this also allows for a MediaStream-with-no-tracks to be created out of a source tag with no content. Added/beefed up LayoutTests for this. MediaStream::{add,remove}RemoteTrack are renamed to {add,remove}TrackByComponent. The reason for the original name is that only internal add/removal of tracks should fire an on{add/remove}track [1], and until this CL this was only possible for remote tracks. [1] https://developer.mozilla.org/en-US/docs/Web/Events/addtrack BUG= 698514 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2727583007 Cr-Commit-Position: refs/heads/master@{#454964} [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/content/renderer/media_capture_from_element/html_video_element_capturer_source.cc [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-creation.html [add] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-ended.html [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/Source/modules/mediastream/MediaStream.h [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/Source/platform/mediastream/MediaStreamDescriptor.cpp [modify] https://crrev.com/d80e6732a30c9f8b5c725fc98b013577799022cd/third_party/WebKit/Source/platform/mediastream/MediaStreamDescriptor.h
,
Mar 6 2017
**NOTE** that a <video> tag to which a MediaStream is plugged will _not_ follow changes in the latter's Track set: https://crbug.com/409562.
,
Mar 6 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by mcasas@chromium.org
, Mar 6 2017