| 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 10c2e52354652c43602fb7dd5f62b5aeb090598b..db9de010c0f7ff74bdf1c9d6cca90551f54a2df1 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,11 @@ 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. Check the muted state manually.
|
| + if (ready_state_ == MediaStreamSource::kReadyStateMuted)
|
| + component_->SetMuted(true);
|
| +
|
| if (component_->Source() &&
|
| component_->Source()->GetType() == MediaStreamSource::kTypeVideo) {
|
| // ImageCapture::create() only throws if |this| track is not of video type.
|
| @@ -183,11 +188,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";
|
| }
|
|
|