summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/HTML5VideoViewProxy.java
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2012-06-15 11:22:23 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2012-06-15 11:27:34 -0700
commit6a9586bc57b162a2d68dd3e417f0fd43d8932fd0 (patch)
tree2c07b65044bd5e021dd4df0902f16baf0a2c5c4a /core/java/android/webkit/HTML5VideoViewProxy.java
parenta7e3a1e0e7d308e7e78a1992038a34485d04ab29 (diff)
Notify Java side to start when transition into full screen mode without a reload.
When video start in inline mode, and then transition into full screen mode, the video is still playing, so we need to notify the player, such that the controller can get the state correctly. bug:6675847 Change-Id: Ib5f712ca91fe1c374dcc20de996dac6ff7b9e983
Diffstat (limited to 'core/java/android/webkit/HTML5VideoViewProxy.java')
-rw-r--r--core/java/android/webkit/HTML5VideoViewProxy.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index 90db308c3edf..ab884dfbdd8c 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -147,6 +147,7 @@ class HTML5VideoViewProxy extends Handler
// Save the inline video info and inherit it in the full screen
int savePosition = 0;
boolean canSkipPrepare = false;
+ boolean forceStart = false;
if (mHTML5VideoView != null) {
// We don't allow enter full screen mode while the previous
// full screen video hasn't finished yet.
@@ -154,11 +155,11 @@ class HTML5VideoViewProxy extends Handler
Log.w(LOGTAG, "Try to reenter the full screen mode");
return;
}
+ int playerState = mHTML5VideoView.getCurrentState();
// If we are playing the same video, then it is better to
// save the current position.
if (layerId == mHTML5VideoView.getVideoLayerId()) {
savePosition = mHTML5VideoView.getCurrentPosition();
- int playerState = mHTML5VideoView.getCurrentState();
canSkipPrepare = (playerState == HTML5VideoView.STATE_PREPARING
|| playerState == HTML5VideoView.STATE_PREPARED
|| playerState == HTML5VideoView.STATE_PLAYING)
@@ -166,10 +167,14 @@ class HTML5VideoViewProxy extends Handler
}
if (!canSkipPrepare) {
mHTML5VideoView.reset();
+ } else {
+ forceStart = playerState == HTML5VideoView.STATE_PREPARING
+ || playerState == HTML5VideoView.STATE_PLAYING;
}
}
mHTML5VideoView = new HTML5VideoFullScreen(proxy.getContext(),
layerId, savePosition, canSkipPrepare);
+ mHTML5VideoView.setStartWhenPrepared(forceStart);
mCurrentProxy = proxy;
mHTML5VideoView.setVideoURI(url, mCurrentProxy);
mHTML5VideoView.enterFullScreenVideoState(layerId, proxy, webView);