| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_bridge.h" | 5 #include "media/base/android/media_player_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 base::TimeDelta current = GetCurrentTime(); | 269 base::TimeDelta current = GetCurrentTime(); |
| 270 time_update_cb_.Run(player_id_, current); | 270 time_update_cb_.Run(player_id_, current); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void MediaPlayerBridge::OnMediaError(int error_type) { | 273 void MediaPlayerBridge::OnMediaError(int error_type) { |
| 274 media_error_cb_.Run(player_id_, error_type); | 274 media_error_cb_.Run(player_id_, error_type); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void MediaPlayerBridge::OnVideoSizeChanged(int width, int height) { | 277 void MediaPlayerBridge::OnVideoSizeChanged(int width, int height) { |
| 278 width_ = width; | 278 width_ = width; |
| 279 height_ = height_; | 279 height_ = height; |
| 280 video_size_changed_cb_.Run(player_id_, width, height); | 280 video_size_changed_cb_.Run(player_id_, width, height); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void MediaPlayerBridge::OnBufferingUpdate(int percent) { | 283 void MediaPlayerBridge::OnBufferingUpdate(int percent) { |
| 284 buffering_update_cb_.Run(player_id_, percent); | 284 buffering_update_cb_.Run(player_id_, percent); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void MediaPlayerBridge::OnPlaybackComplete() { | 287 void MediaPlayerBridge::OnPlaybackComplete() { |
| 288 time_update_timer_.Stop(); | 288 time_update_timer_.Stop(); |
| 289 playback_complete_cb_.Run(player_id_); | 289 playback_complete_cb_.Run(player_id_); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 return j_result; | 409 return j_result; |
| 410 } | 410 } |
| 411 | 411 |
| 412 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { | 412 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { |
| 413 bool ret = RegisterNativesImpl(env); | 413 bool ret = RegisterNativesImpl(env); |
| 414 DCHECK(g_MediaPlayerBridge_clazz); | 414 DCHECK(g_MediaPlayerBridge_clazz); |
| 415 return ret; | 415 return ret; |
| 416 } | 416 } |
| 417 | 417 |
| 418 } // namespace media | 418 } // namespace media |
| OLD | NEW |