diff options
| author | Andreas Huber <andih@google.com> | 2010-01-28 11:19:57 -0800 |
|---|---|---|
| committer | Andreas Huber <andih@google.com> | 2010-01-28 11:52:43 -0800 |
| commit | 256430093679e1d62b54fb0c852126e54d162f6f (patch) | |
| tree | 028c49d18e0e77bc69f8967dda61619ee324f7a2 /core/java/android/webkit/HTML5VideoViewProxy.java | |
| parent | 75d76bcf52587e4bfe00b7377d100510a3489674 (diff) | |
API Extension: Support for optionally specifying a map of extra request headers when specifying the uri of media data to be played.
related-to-bug: 2393577
Original change by Andrei Popescu <andreip@google.com>
Diffstat (limited to 'core/java/android/webkit/HTML5VideoViewProxy.java')
| -rw-r--r-- | core/java/android/webkit/HTML5VideoViewProxy.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java index 429b3353e66f..85f1d5cb4dd4 100644 --- a/core/java/android/webkit/HTML5VideoViewProxy.java +++ b/core/java/android/webkit/HTML5VideoViewProxy.java @@ -73,6 +73,8 @@ class HTML5VideoViewProxy extends Handler private static final int ENDED = 201; private static final int POSTER_FETCHED = 202; + private static final String COOKIE = "Cookie"; + // Timer thread -> UI thread private static final int TIMEUPDATE = 300; @@ -165,7 +167,15 @@ class HTML5VideoViewProxy extends Handler mVideoView = new VideoView(proxy.getContext()); mVideoView.setWillNotDraw(false); mVideoView.setMediaController(new MediaController(proxy.getContext())); - mVideoView.setVideoURI(Uri.parse(url)); + + String cookieValue = CookieManager.getInstance().getCookie(url); + Map<String, String> headers = null; + if (cookieValue != null) { + headers = new HashMap<String, String>(); + headers.put(COOKIE, cookieValue); + } + + mVideoView.setVideoURI(Uri.parse(url), headers); mVideoView.setOnCompletionListener(proxy); mVideoView.setOnPreparedListener(proxy); mVideoView.setOnErrorListener(proxy); |
