Videos out of sync when trying to play them simultaneously

I am using RealBASIC 2009, and I have two identical videos (the same file) that I am trying to play on two separate screens. They both play simultaneously when I run the program from RealBASIC, but when I build the program and run it from the application, the videos start at two separate times and are out of sync. Is there any way that I can fix this?

Thank you!

I don’t can’t imagine why they’re not in sync when built. Understanding the difference may lead to a better solution but a kludge could be to start a very short period timer when you start the movies. In some way the timer will have to determine when both players have started moving/playing then set one to the position of the other. Then the timer can turn itself off and the movies should stay in sync.

This example only works when starting from the beginning of the movie, and there may be (probably) a stutter…

[code]Action()
player1.Play
player2.Play
syncTimer.Mode = 2
End

Action() //syncTimer

if player1.Position > 0 and player2.Position > 0 then //both are moving

dim pos As double = Min(player1.Position, player2.Position)  //align positions
player1.Position = pos
player2.Position = pos

me.Mode = 0

end

End[/code]

But really, replicating what syncs them in the debugger would be better. Maybe the movies take a while to load and get going and the overhead of the debugger is just enough to allow both to fully set up before Play is called. Are you opening or adding the movies to the players right before calling Play? If so try seperating the Plays to some time later. Also, once you’ve started them both (and out of sync) can you stop, reset position then call Play again and they’ll be in sync? That would indicate some initial resource loading as the problem. Can you post any code?