custom loops with video player

Hi, I am trying to make custom loops with the ofVideoPlayer. If I set an in frame and an out frame I can loop in one direction quite well with this code

  
if (objectVideo.getCurrentFrame()>=outFrame) {  
                              objectVideo.setPaused(true);  
                              objectVideo.setFrame(inFrame);  
                              objectVideo.setPaused(false);  
                         }  

However I want to have the option to play the video backwards once I get to the outpoint and then forwards again once I get to the inpoint

I have tried this

  
if (!asymetricLoop) {  
                         if (objectVideo.getCurrentFrame()>=outFrame-3) {  
                              objectVideo.setPaused(true);  
                              speed=speed*-1.0;  
                              objectVideo.setSpeed(speed);  
                              objectVideo.setPaused(false);  
                         }  
                         if (objectVideo.getCurrentFrame()<=inFrame) {  
                              objectVideo.setPaused(true);  
                              speed=speed*-1.0;  
                              objectVideo.setSpeed(speed);  
                              objectVideo.setPaused(false);  
                         }  
                    }  

But I miss the outframes and in frames quite a bit and the turn around is quite clunky.

Note I did not have the pause and unpause functions in there at first but it gave me a lot better performance.

Cheers if you have any clues

I solved the problem, here is the way I did it.

  
if (!editIO) {  
                    if (asymetricLoop) {  
                         objectVideo.update();  
                         if (objectVideo.getCurrentFrame()>=outFrame) {  
                              objectVideo.setPaused(true);  
                              objectVideo.setFrame(inFrame);  
                              objectVideo.setPaused(false);  
                         }  
                    }  
                    if (!asymetricLoop) {  
                           
                         if (objectVideo.getCurrentFrame()>outFrame) {  
                              objectVideo.setPaused(true);  
                              if (speed==speed>0) {  
                                   speed=speed*-1.0;  
                              }  
                          
                              objectVideo.setSpeed(speed);  
                              objectVideo.setPaused(false);  
                         }  
                         if (objectVideo.getCurrentFrame()<=inFrame) {  
                              objectVideo.setPaused(true);  
                              if (speed<0) {  
                                   speed=speed*-1.0;  
                              }  
                                
                                
                              objectVideo.setSpeed(speed);  
                              objectVideo.setPaused(false);  
                         }  
                         objectVideo.update();  
                    }