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

Unified Diff: media/base/android/media_player_bridge.cc

Issue 296393007: [Android] Fix the issue of muted attribute in video element does not work. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: update the CL Created 6 years, 7 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
« no previous file with comments | « media/base/android/media_player_bridge.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_player_bridge.cc
diff --git a/media/base/android/media_player_bridge.cc b/media/base/android/media_player_bridge.cc
index b1bb3fec3cfa5ecf8d3b64a105717a5d9083747f..174aaf9cdff77765e8ae20186407697832e64b67 100644
--- a/media/base/android/media_player_bridge.cc
+++ b/media/base/android/media_player_bridge.cc
@@ -50,6 +50,7 @@ MediaPlayerBridge::MediaPlayerBridge(
can_seek_forward_(true),
can_seek_backward_(true),
is_surface_in_use_(false),
+ volume_(-1.0),
weak_factory_(this) {
listener_.reset(new MediaPlayerListener(base::MessageLoopProxy::current(),
weak_factory_.GetWeakPtr()));
@@ -94,6 +95,9 @@ void MediaPlayerBridge::CreateJavaMediaPlayerBridge() {
j_media_player_bridge_.Reset(Java_MediaPlayerBridge_create(
env, reinterpret_cast<intptr_t>(this)));
+ if (volume_ >= 0)
+ SetVolume(volume_);
+
SetMediaPlayerListener();
}
@@ -323,8 +327,10 @@ void MediaPlayerBridge::Release() {
}
void MediaPlayerBridge::SetVolume(double volume) {
- if (j_media_player_bridge_.is_null())
+ if (j_media_player_bridge_.is_null()) {
+ volume_ = volume;
return;
+ }
JNIEnv* env = base::android::AttachCurrentThread();
CHECK(env);
« no previous file with comments | « media/base/android/media_player_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698