Skip to main content
confusticate
Participant
January 13, 2011
Question

Video player seek() problems

  • January 13, 2011
  • 1 reply
  • 1085 views

I'm trying to build a video player in AIR for Android. Specifically, I'm trying to rewind the video by getting it to seek back to the beginning when it reaches the end.

I have built some non-mobile video players in the past and I normally rewind the video as follows:

// on NetStream.Play.Stop

netstream.pause();

netstream.seek(0);

This doesn't seem to work on the mobile - my guess was that it's because mobile memory is more constrained, so the video is no longer in memory. This video is 1:45 minutes (11MB). When it got about 1 minute in, I tried seeking by dragging the seek slider and it seemed like anything between 0:00 - 0:30 was not able to be seeked to.

On tracing out NetStatusEvents, I noticed it starts NetStream.Buffer.Flush-ing like crazy at 1:35 (ie, before the video has even finished).

a) Is there any way to prevent the flushing? (and is this even going to be a solution?) OR

b) Is there some kind of alternative? eg, when I package the FLV into the .apk, this seek() problem obviously isn't a problem anymore, but an 11MB .apk is not exactly feasible. Is there some way I could download and save the video file onto the user's phone, perhaps?

I am really stuck and grasping at straws. I can't be the only person who's had to build a custom AIR for Android video player! Any help would be very much appreciated!

This topic has been closed for replies.

1 reply

Participating Frequently
January 14, 2011

Unfortunately I don't know enough about the video APIs to answer your main question. But here is some information from our docs: http://help.adobe.com/en_US/as3/mobile/WS4f388c71a1d4fd05-3e2e5588124a6ccb96c-8000.html

As for alternatives, you can download data/files to the SDCard on the phone. Use URLLoader to download and FileStream to write to the card.