New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 698514 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 619625



Sign in to add a comment

MediaStream captured from <video/audio> doesn't follow the events of the source HTMLMediaElement

Project Member Reported by mcasas@chromium.org, Mar 4 2017

Issue description

I.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).
 
Blocking: 619625
Project Member

Comment 2 by bugdroid1@chromium.org, 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

**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.
Status: Fixed (was: Started)

Sign in to add a comment