tags:

views:

18

answers:

1

if i have two media players in form1 and form2 respectively....how can i control the media player in form2 with media player in form1....so that if i pause media player in form1...the media player in form2 should get passed and if i scrub the seek bar in player1 the seek bar in player in form2 should move along with it...how can i do that.......means how to play single video in both players at once...

+1  A: 

It depends heavily on the media player control that you are using, but as a generic approach you can remove the build in control of the player and place them outside the control.

Then in each action, you should call a Sync function, to keep both in sync.
Something like this:

Sub Button_Pause_Pressed()
  Player1.Pause
  Sync( Player1, Player2 )
end sub

Sub Sync( SourcePlayer, DestinationPlayer )
  if SourcePlayer.isPaused then 
      DestinationPlayer.Pause  
  end if
  '' // etc.
end sub

If you can use WPF, is much easier, because you can bind the controls of both player to the same ViewModel object and keep both in sync.

Eduardo Molteni