Guest User

Untitled

a guest
Apr 17th, 2012
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Sync multiple MediaItems
  2. private void slider1_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
  3. {
  4.  
  5. videos[0].Position = TimeSpan.FromSeconds(slider1.Value);
  6.  
  7. foreach (MediaElement elem in videos)
  8. {
  9. elem.Position = videos[0].Position;
  10. elem.Play();
  11. }
  12.  
  13. private void slider1_DragCompleted(object sender,
  14. System.Windows.Controls.Primitives.DragCompletedEventArgs e)
  15. {
  16. var realPosition = TimeSpan.FromSeconds(slider1.Value);
  17.  
  18. foreach (var elem in videos)
  19. {
  20. elem.Position = realPosition;
  21. }
  22.  
  23. foreach (var elem in videos)
  24. {
  25. elem.Play();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment