To Daniel

Thanks again
Okay that seems to be working

Just to clarify
the 0 , 200  implies  start immediately  and re-occur every 200 milliseconds ?

the 100 , 200 implies start in 100 milliseconds and re-occur every 200 
milliseconds ?

Thus there is two cycles going 100 milliseconds apart  causing it to play for 
100 milliseconds and then pause for 100 milliseconds
so it plays (for 100 ms)  pauses for (100 ms)  

am I right ?

thanks again





On Jun 29, 2011, at 9:46 AM, Daniel Drozdzewski wrote:

> On Wed, Jun 29, 2011 at 1:37 PM, New Developer <[email protected]> wrote:
>> To Daniel
>> I have tried pause no success
>> can you let me know more what you were thinking  perhaps I have implemented 
>> it incorrectly ??
>> 
>> Thanks again
> 
> Sure, I was thinking following (I have not implemented this myself mind):
> 
> <code>
> MediaPlayer player;
> Timer timer = new Timer();
> //initialisation of the player
> 
> timer.schedule( new TimerTask() {
>  run() {
>     player.start();
>  }
> }, 0, 200);
> 
> timer.schedule( new TimerTask() {
>  run() {
>     player.pause();
>  }
> }, 100, 200);
> 
> </code>
> 
> You schedule 2 recurring tasks on a Timer: one to resume/start the
> video every 200 milliseconds, and the second to pause it also every
> 200 milliseconds, with 100 millisecond offset. This should slow the
> playback by the factor of 2. You can adjust the numbers to get
> different ratios and I would not play or pause for longer than say 500
> milliseconds, as it will look jerky.
> 
> It is possible that both timers will diverge (no real-time promise),
> in which case you will have to do something a bit more clever than
> arbitrary numbers, as the paused_time / play_time ratio will shift.
> 
> You will probably need to monitor actual track progress by using
> MediaPlayer.getCurrentPosition(), rather than the inaccurate wall
> clock.
> 
> Daniel
> 
> 
>> 
>> 
>> On Jun 12, 2011, at 3:52 AM, Daniel Drozdzewski wrote:
> ^^^^^^^^^^^^^^^----- Internet got very slow or The Matrix is
> overloaded (could not resist)
> 
> -- 
> 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