Index: remoting/client/plugin/chromoting_instance.cc |
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc |
index db90e9afefcca360aa06340e3119e81e3ab17ce9..362b11c644b692703ce1e301eae8bc4f6385bc8e 100644 |
--- a/remoting/client/plugin/chromoting_instance.cc |
+++ b/remoting/client/plugin/chromoting_instance.cc |
@@ -126,7 +126,7 @@ logging::LogMessageHandlerFunction g_logging_old_handler = NULL; |
// String sent in the "hello" message to the plugin to describe features. |
const char ChromotingInstance::kApiFeatures[] = |
"highQualityScaling injectKeyEvent sendClipboardItem remapKey trapKey " |
- "notifyClientDimensions pauseVideo"; |
+ "notifyClientDimensions pauseVideo pauseAudio"; |
bool ChromotingInstance::ParseAuthMethods(const std::string& auth_methods_str, |
ClientConfig* config) { |
@@ -345,6 +345,13 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) { |
return; |
} |
PauseVideo(pause); |
+ } else if (method == "pauseAudio") { |
+ bool pause = false; |
+ if (!data->GetBoolean("pause", &pause)) { |
+ LOG(ERROR) << "Invalid pauseAudio."; |
+ return; |
+ } |
+ PauseAudio(pause); |
} |
} |
@@ -580,6 +587,15 @@ void ChromotingInstance::PauseVideo(bool pause) { |
host_connection_->host_stub()->ControlVideo(video_control); |
} |
+void ChromotingInstance::PauseAudio(bool pause) { |
+ if (!IsConnected()) { |
+ return; |
+ } |
+ protocol::AudioControl audio_control; |
+ audio_control.set_enable(!pause); |
+ host_connection_->host_stub()->ControlAudio(audio_control); |
+} |
+ |
ChromotingStats* ChromotingInstance::GetStats() { |
if (!client_.get()) |
return NULL; |