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 "content/browser/android/content_video_view.h" | 5 #include "content/browser/android/content_video_view.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/browser/android/media_player_manager_impl.h" | 10 #include "content/browser/android/media_player_manager_impl.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 void ContentVideoView::DestroyContentVideoView() { | 45 void ContentVideoView::DestroyContentVideoView() { |
46 if (!j_content_video_view_.is_null()) { | 46 if (!j_content_video_view_.is_null()) { |
47 Java_ContentVideoView_destroyContentVideoView(AttachCurrentThread()); | 47 Java_ContentVideoView_destroyContentVideoView(AttachCurrentThread()); |
48 j_content_video_view_.Reset(); | 48 j_content_video_view_.Reset(); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
| 52 // static |
| 53 void ContentVideoView::KeepScreenOn(bool screen_on) { |
| 54 Java_ContentVideoView_keepScreenOnContentVideoView(AttachCurrentThread(), |
| 55 screen_on); |
| 56 } |
| 57 |
52 void ContentVideoView::OnMediaPlayerError(int error_type) { | 58 void ContentVideoView::OnMediaPlayerError(int error_type) { |
53 if (!j_content_video_view_.is_null()) { | 59 if (!j_content_video_view_.is_null()) { |
54 Java_ContentVideoView_onMediaPlayerError(AttachCurrentThread(), | 60 Java_ContentVideoView_onMediaPlayerError(AttachCurrentThread(), |
55 j_content_video_view_.obj(), | 61 j_content_video_view_.obj(), |
56 error_type); | 62 error_type); |
57 } | 63 } |
58 } | 64 } |
59 | 65 |
60 void ContentVideoView::OnVideoSizeChanged(int width, int height) { | 66 void ContentVideoView::OnVideoSizeChanged(int width, int height) { |
61 if (!j_content_video_view_.is_null()) { | 67 if (!j_content_video_view_.is_null()) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 void ContentVideoView::UpdateMediaMetadata(JNIEnv* env, jobject obj) { | 143 void ContentVideoView::UpdateMediaMetadata(JNIEnv* env, jobject obj) { |
138 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer(); | 144 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer(); |
139 if (player && player->IsPlayerReady()) | 145 if (player && player->IsPlayerReady()) |
140 Java_ContentVideoView_updateMediaMetadata( | 146 Java_ContentVideoView_updateMediaMetadata( |
141 env, obj, player->GetVideoWidth(), player->GetVideoHeight(), | 147 env, obj, player->GetVideoWidth(), player->GetVideoHeight(), |
142 player->GetDuration().InMilliseconds(), player->CanPause(), | 148 player->GetDuration().InMilliseconds(), player->CanPause(), |
143 player->CanSeekForward(), player->CanSeekBackward()); | 149 player->CanSeekForward(), player->CanSeekBackward()); |
144 } | 150 } |
145 | 151 |
146 } // namespace content | 152 } // namespace content |
OLD | NEW |