Skip to content

Commit 4dd9dc8

Browse files
author
Teng-Hui Zhu
committed
Keep the controller when video ended.
Use the media controller as a reminder to the user when the video ended. We don't quit the video here b/c user may want to replay the video. bug:5340224 Change-Id: I6d5fdb54bb614277b75e1a18ebe0a7dadd47017e
1 parent f4c77df commit 4dd9dc8

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

core/java/android/webkit/HTML5VideoFullScreen.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public void onPrepared(MediaPlayer mp) {
198198
// after reading the MetaData
199199
if (mMediaController != null) {
200200
mMediaController.setEnabled(true);
201+
mMediaController.show();
201202
}
202203

203204
if (mProgressView != null) {
@@ -320,6 +321,11 @@ public int getBufferPercentage() {
320321
return 0;
321322
}
322323

324+
@Override
325+
public void showControllerInFullScreen() {
326+
mMediaController.show(0);
327+
}
328+
323329
// Other listeners functions:
324330
private MediaPlayer.OnBufferingUpdateListener mBufferingUpdateListener =
325331
new MediaPlayer.OnBufferingUpdateListener() {

core/java/android/webkit/HTML5VideoView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,7 @@ public boolean getStartWhenPrepared() {
342342
return m_startWhenPrepared;
343343
}
344344

345+
public void showControllerInFullScreen() {
346+
}
347+
345348
}

core/java/android/webkit/HTML5VideoViewProxy.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ public static void onPrepared() {
273273
}
274274

275275
public static void end() {
276+
mHTML5VideoView.showControllerInFullScreen();
276277
if (mCurrentProxy != null) {
277278
if (isVideoSelfEnded)
278279
mCurrentProxy.dispatchOnEnded();

0 commit comments

Comments
 (0)