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_android.h" | 10 #include "content/browser/android/media_player_manager_android.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 void ContentVideoView::SetSurface(JNIEnv* env, jobject obj, | 134 void ContentVideoView::SetSurface(JNIEnv* env, jobject obj, |
135 jobject surface) { | 135 jobject surface) { |
136 manager_->SetVideoSurface(surface); | 136 manager_->SetVideoSurface(surface); |
137 ReleaseSurface(surface); | 137 ReleaseSurface(surface); |
138 } | 138 } |
139 | 139 |
140 void ContentVideoView::UpdateMediaMetadata(JNIEnv* env, jobject obj) { | 140 void ContentVideoView::UpdateMediaMetadata(JNIEnv* env, jobject obj) { |
141 media::MediaPlayerBridge* player = manager_->GetFullscreenPlayer(); | 141 media::MediaPlayerBridge* player = manager_->GetFullscreenPlayer(); |
142 if (player) | 142 if (player && player->prepared()) |
143 Java_ContentVideoView_updateMediaMetadata( | 143 Java_ContentVideoView_updateMediaMetadata( |
144 env, obj, player->GetVideoWidth(), player->GetVideoHeight(), | 144 env, obj, player->GetVideoWidth(), player->GetVideoHeight(), |
145 player->GetDuration().InMilliseconds(), player->can_pause(), | 145 player->GetDuration().InMilliseconds(), player->can_pause(), |
146 player->can_seek_forward(), player->can_seek_backward()); | 146 player->can_seek_forward(), player->can_seek_backward()); |
147 } | 147 } |
148 | 148 |
149 } // namespace content | 149 } // namespace content |
OLD | NEW |