From ff19d19e016f67edf0a4e8eea374d144dc5129ef Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Mon, 17 Jan 2011 18:08:56 +0000 Subject: Maintain the seek position in HTML5 video Receive the current seek position from native when we start playing a video. That way is we are returning from pause we correctly continue where we left off. Requires and external/webkit change. (I6001f45a362f491e9040c8b52260d0a08fb8504f) Bug:3303721 Change-Id: I6b92289d4ef36bba1e0429327917533a4101655d --- core/java/android/webkit/HTML5VideoViewProxy.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/java/android/webkit/HTML5VideoViewProxy.java') diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java index 85bff4f01fe5..d8f34e05d2fe 100644 --- a/core/java/android/webkit/HTML5VideoViewProxy.java +++ b/core/java/android/webkit/HTML5VideoViewProxy.java @@ -495,6 +495,7 @@ class HTML5VideoViewProxy extends Handler break; } case ENDED: + mSeekPosition = 0; nativeOnEnded(mNativePointer); break; case PAUSED: @@ -538,10 +539,15 @@ class HTML5VideoViewProxy extends Handler * Play a video stream. * @param url is the URL of the video stream. */ - public void play(String url) { + public void play(String url, int position) { if (url == null) { return; } + + if (position > 0) { + seek(position); + } + Message message = obtainMessage(PLAY); message.obj = url; sendMessage(message); -- cgit v1.2.3