| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/android/media_player_android.h" | 5 #include "media/base/android/media_player_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/thread_task_runner_handle.h" | |
| 11 #include "media/base/android/media_drm_bridge.h" | 10 #include "media/base/android/media_drm_bridge.h" |
| 12 #include "media/base/android/media_player_manager.h" | 11 #include "media/base/android/media_player_manager.h" |
| 13 | 12 |
| 14 namespace media { | 13 namespace media { |
| 15 | 14 |
| 16 MediaPlayerAndroid::MediaPlayerAndroid( | 15 MediaPlayerAndroid::MediaPlayerAndroid( |
| 17 int player_id, | 16 int player_id, |
| 18 MediaPlayerManager* manager, | 17 MediaPlayerManager* manager, |
| 19 const RequestMediaResourcesCB& request_media_resources_cb, | 18 const RequestMediaResourcesCB& request_media_resources_cb, |
| 20 const GURL& frame_url) | 19 const GURL& frame_url) |
| 21 : request_media_resources_cb_(request_media_resources_cb), | 20 : request_media_resources_cb_(request_media_resources_cb), |
| 22 player_id_(player_id), | 21 player_id_(player_id), |
| 23 manager_(manager), | 22 manager_(manager), |
| 24 frame_url_(frame_url), | 23 frame_url_(frame_url), |
| 25 is_audible_(false), | 24 is_audible_(false), |
| 26 weak_factory_(this) { | 25 weak_factory_(this) { |
| 27 listener_.reset(new MediaPlayerListener(base::ThreadTaskRunnerHandle::Get(), | 26 listener_.reset(new MediaPlayerListener(base::MessageLoopProxy::current(), |
| 28 weak_factory_.GetWeakPtr())); | 27 weak_factory_.GetWeakPtr())); |
| 29 } | 28 } |
| 30 | 29 |
| 31 MediaPlayerAndroid::~MediaPlayerAndroid() {} | 30 MediaPlayerAndroid::~MediaPlayerAndroid() {} |
| 32 | 31 |
| 33 GURL MediaPlayerAndroid::GetUrl() { | 32 GURL MediaPlayerAndroid::GetUrl() { |
| 34 return GURL(); | 33 return GURL(); |
| 35 } | 34 } |
| 36 | 35 |
| 37 GURL MediaPlayerAndroid::GetFirstPartyForCookies() { | 36 GURL MediaPlayerAndroid::GetFirstPartyForCookies() { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 81 } |
| 83 | 82 |
| 84 void MediaPlayerAndroid::SetAudible(bool is_audible) { | 83 void MediaPlayerAndroid::SetAudible(bool is_audible) { |
| 85 if (is_audible_ != is_audible) { | 84 if (is_audible_ != is_audible) { |
| 86 is_audible_ = is_audible; | 85 is_audible_ = is_audible; |
| 87 manager_->OnAudibleStateChanged(player_id(), is_audible_); | 86 manager_->OnAudibleStateChanged(player_id(), is_audible_); |
| 88 } | 87 } |
| 89 } | 88 } |
| 90 | 89 |
| 91 } // namespace media | 90 } // namespace media |
| OLD | NEW |