Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: content/renderer/media/media_stream_source.cc

Issue 2922733002: Propagate muted state from MediaStreamAudioSource into JS. (Closed)
Patch Set: Updated WebKit MediaStreamTrack layout test to not expect readyState=muted Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_source.cc
diff --git a/content/renderer/media/media_stream_source.cc b/content/renderer/media/media_stream_source.cc
index 3334bfd57120d66fa4bbd13cac1a12a50d968479..97b34d8340b39df103fc558cfc74d61e3734890f 100644
--- a/content/renderer/media/media_stream_source.cc
+++ b/content/renderer/media/media_stream_source.cc
@@ -26,6 +26,14 @@ void MediaStreamSource::StopSource() {
Owner().SetReadyState(blink::WebMediaStreamSource::kReadyStateEnded);
}
+void MediaStreamSource::SetSourceMuted(bool is_muted) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ // TODO(ossu): Check that we only go between Muted and Live, not from Ended.
Guido Urdaneta 2017/06/08 14:15:06 nit: Add a crbug.com reference?
ossu-chromium 2017/06/08 14:52:08 Naah, I think I should just fix it before submitti
+ Owner().SetReadyState(is_muted
+ ? blink::WebMediaStreamSource::kReadyStateMuted
+ : blink::WebMediaStreamSource::kReadyStateLive);
+}
+
void MediaStreamSource::SetDeviceInfo(const StreamDeviceInfo& device_info) {
DCHECK(thread_checker_.CalledOnValidThread());
device_info_ = device_info;

Powered by Google App Engine
This is Rietveld 408576698