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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 ScopedJavaLocalRef<jobject> allowedOperations = GetAllowedOperations(); | 449 ScopedJavaLocalRef<jobject> allowedOperations = GetAllowedOperations(); |
450 | 450 |
451 can_pause_ = Java_AllowedOperations_canPause(env, allowedOperations.obj()); | 451 can_pause_ = Java_AllowedOperations_canPause(env, allowedOperations.obj()); |
452 can_seek_forward_ = Java_AllowedOperations_canSeekForward( | 452 can_seek_forward_ = Java_AllowedOperations_canSeekForward( |
453 env, allowedOperations.obj()); | 453 env, allowedOperations.obj()); |
454 can_seek_backward_ = Java_AllowedOperations_canSeekBackward( | 454 can_seek_backward_ = Java_AllowedOperations_canSeekBackward( |
455 env, allowedOperations.obj()); | 455 env, allowedOperations.obj()); |
456 } | 456 } |
457 | 457 |
458 void MediaPlayerBridge::StartInternal() { | 458 void MediaPlayerBridge::StartInternal() { |
| 459 if (!manager()->RequestPlay(player_id())) |
| 460 return; |
| 461 |
459 JNIEnv* env = base::android::AttachCurrentThread(); | 462 JNIEnv* env = base::android::AttachCurrentThread(); |
460 Java_MediaPlayerBridge_start(env, j_media_player_bridge_.obj()); | 463 Java_MediaPlayerBridge_start(env, j_media_player_bridge_.obj()); |
461 if (!time_update_timer_.IsRunning()) { | 464 if (!time_update_timer_.IsRunning()) { |
462 time_update_timer_.Start( | 465 time_update_timer_.Start( |
463 FROM_HERE, | 466 FROM_HERE, |
464 base::TimeDelta::FromMilliseconds(kTimeUpdateInterval), | 467 base::TimeDelta::FromMilliseconds(kTimeUpdateInterval), |
465 this, &MediaPlayerBridge::OnTimeUpdateTimerFired); | 468 this, &MediaPlayerBridge::OnTimeUpdateTimerFired); |
466 } | 469 } |
467 | 470 |
468 SetAudible(volume_ > 0); | 471 SetAudible(volume_ > 0); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 528 |
526 GURL MediaPlayerBridge::GetUrl() { | 529 GURL MediaPlayerBridge::GetUrl() { |
527 return url_; | 530 return url_; |
528 } | 531 } |
529 | 532 |
530 GURL MediaPlayerBridge::GetFirstPartyForCookies() { | 533 GURL MediaPlayerBridge::GetFirstPartyForCookies() { |
531 return first_party_for_cookies_; | 534 return first_party_for_cookies_; |
532 } | 535 } |
533 | 536 |
534 } // namespace media | 537 } // namespace media |
OLD | NEW |