I'm afraid I may have oversimplified, it would appear I have two
different issues that need to be addressed..

as regards the media player, I am mostly interested in maintaining
playback across orientation changes.. losing the mediaplayer state on
release of focus is not a problem (and indeed, i should probably look
into coding that part first, as I think I understand how to do at
least that portion of it).

as for the HttpClient, I'm using it to login and establish a session
with a site that then returns the url for the mediaplayer to load;
ideally I would like to preserve this session across both orientation
changes and app exit/entry events (I'm beginning to understand that
these are effectively the same thing...  I think?).

so, those things being said, I'm afraid I don't yet understand any of
the suggestions made here, and would greatly appreciate any greater
detail (or examples!) that could be provided.

thanks again,

-br

On Dec 8, 7:01 pm, Dave Sparks <davidspa...@android.com> wrote:
> The HTTP session isn't controlled by the Java application, the media
> framework has its own HTTP client.
>
> The Java proxy object for the network session is the MediaPlayer
> object which is owned by VideoView. You could retain a reference to
> the VideoView object across the orientation change, so that it keeps
> its internal MediaPlayer reference. You need to be careful because
> holding on to a MediaPlayer object can have significant implications
> on battery life, so you want to make sure you release it if your
> activity no longer has the focus.
>
> Unfortunately, the current VideoView design doesn't work well for
> restoring state because it starts playing immediately after setVideoURI
> ().
>
> On Dec 7, 12:59 am, ben rosenberg <ben.rosenb...@gmail.com> wrote:
>
> > hey folks,
>
> > to make a long story short, I'm working on an app that plays streaming
> > video content in a VideoView with aMediaController; Im wondering how
> > I can preserve the state of my VideoView across orientation changes,
> > such that opening the keyboard doesn't restart the playback, etc..
>
> > I've been messing around with onSaveInstanceState, but Im fairly
> > certain I'm missing something (possibly Parcelized objects?) ..
> > Ideally i think I'd like to save and restore the state of the
> > MediaPlayer,  as well as an HttpClient (or at least its cookiejar) ...
> > I suspect this will have to be done with Parcelables, but I don't
> > quite have my head around how those work (and the Notepad example
> > hasn't helped)..
>
> > any suggestions, or especially code or pseudocode examples, would be
> > greatly apprectiated
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to