| Index: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp
|
| diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp
|
| index b6da23929cd3921e44e542ffcb43a041f68eca61..58e16b2d2a87ad6560230e0559dd12a9a65ce729 100644
|
| --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp
|
| +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp
|
| @@ -64,7 +64,7 @@ MediaStreamTrack* MediaStreamTrack::Create(ExecutionContext* context,
|
| MediaStreamTrack::MediaStreamTrack(ExecutionContext* context,
|
| MediaStreamComponent* component)
|
| : ContextLifecycleObserver(context),
|
| - ready_state_(MediaStreamSource::kReadyStateLive),
|
| + ready_state_(component->Source()->GetReadyState()),
|
| is_iterating_registered_media_streams_(false),
|
| stopped_(false),
|
| component_(component),
|
| @@ -72,6 +72,10 @@ MediaStreamTrack::MediaStreamTrack(ExecutionContext* context,
|
| constraints_() {
|
| component_->Source()->AddObserver(this);
|
|
|
| + // If the source is already non-live at this point, the observer won't have
|
| + // been called. Update the muted state manually.
|
| + component_->SetMuted(ready_state_ == MediaStreamSource::kReadyStateMuted);
|
| +
|
| if (component_->Source() &&
|
| component_->Source()->GetType() == MediaStreamSource::kTypeVideo) {
|
| // ImageCapture::create() only throws if |this| track is not of video type.
|
| @@ -183,11 +187,12 @@ String MediaStreamTrack::readyState() const {
|
| if (Ended())
|
| return "ended";
|
|
|
| + // Although muted is tracked as a ReadyState, only "live" and "ended" are
|
| + // visible externally.
|
| switch (ready_state_) {
|
| case MediaStreamSource::kReadyStateLive:
|
| - return "live";
|
| case MediaStreamSource::kReadyStateMuted:
|
| - return "muted";
|
| + return "live";
|
| case MediaStreamSource::kReadyStateEnded:
|
| return "ended";
|
| }
|
|
|