using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace clock { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { MediaTimeline mediaTimeline = new MediaTimeline(new Uri("c:\\mytemp\\kaamos2010.avi", UriKind.Absolute)); // mediaTimeline.BeginTime = new TimeSpan(0, 1, 32); ei toimi kuten voisi olettaa // mediaElementVideo.Position säätää aloituspaikan mediaTimeline.Duration = new Duration(new TimeSpan(0, 0, 5)); mediaElementVideo.Clock = mediaTimeline.CreateClock(); mediaElementVideo.Clock.Controller.Begin(); } private void mediaElementVideo_MediaOpened(object sender, RoutedEventArgs e) { // MessageBox.Show("media on avattu"); } private void mediaElementVideo_MediaFailed(object sender, ExceptionRoutedEventArgs e) { // MessageBox.Show("media failed"); } } }