Hi,

I'm using the reset() now. There's a little bump in the playback every
time it reaches the end of the content that existed in the file when
it was initially loaded which I don't like but I'm using prepareAsync
so I think this hiccup is as small as I can make it with a single
VideoView.

Thanks for your help.
-jm


On Mon, Jan 30, 2012 at 11:16 AM, Daniel Drozdzewski
<[email protected]> wrote:
> John-Marc,
>
> I have not done this myself, but here is tutorial on how to do it:
> http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/
>
> They actually create new MediaPlayer object upon every update to the
> buffer file and point this new MediaPlayer to the updated buffer every
> single time.
>
> I would test calling MediaPlayer.reset() first instead of creating new
> player object every time, to see whether time and memory consumed by
> such solution is a bit better.
>
> HTH,
>
> Daniel
>
>
>
>
>
> On 30 January 2012 15:49, John-Marc Desmarais <[email protected]> wrote:
>> Hi,
>>
>> I am currently writing a video file to the SDCard while playing it
>> with VideoView.
>>
>> My problem is that, if I buffer 1MB of video and begin the Video
>> playback, the video stops after 1MB has been played, even though by
>> this time, 5MBs of file has now been written to the sdcard.
>>
>> I have been trying various things in onCompletion handler.. such as:
>>                int curLoc = mp.getCurrentPosition();
>>                Log.e(LogName.onCompletion, LogName.onCompletion + 
>> "CurrentLocation:
>> " + mp.getCurrentPosition());
>>                Log.e(LogName.onCompletion, LogName.onCompletion + "Duration: 
>> " +
>> mp.getDuration());
>>                mp.pause();
>>                mp.prepareAsync();
>>                mp.start();
>>                mp.seekTo(curLoc);
>>
>> In this case I get a "Cannot play video" message.
>>
>> Or:
>>                int curLoc = mp.getCurrentPosition();
>>                Log.e(LogName.onCompletion, LogName.onCompletion + 
>> "CurrentLocation:
>> " + mp.getCurrentPosition());
>>                Log.e(LogName.onCompletion, LogName.onCompletion + "Duration: 
>> " +
>> mp.getDuration());
>>                mp.prepareAsync();
>>                mp.start();
>>                mp.seekTo(curLoc);
>>
>> This crashes with "prepare Async in State 128".
>>
>> Has anyone solved the problem of re-queuing file in the videoView so
>> that it plays everything that has been written to the sdcard even
>> though it starts with a smaller file?
>>
>> Regards,
>> -jm
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Daniel Drozdzewski
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to