예제 #1
0
        private async void Image_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            FileOpenPicker fopvideo = new FileOpenPicker();

            fopvideo.SuggestedStartLocation = PickerLocationId.Desktop;
            fopvideo.FileTypeFilter.Add(".mp4");
            fopvideo.FileTypeFilter.Add(".ogg");
            fopvideo.FileTypeFilter.Add(".wmv");
            StorageFile file = await fopvideo.PickSingleFileAsync();

            IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);

            MediaPlay.SetSource(stream, file.ContentType);
            MediaPlay.Play();
        }
예제 #2
0
 private void player_MediaEnded(object sender, RoutedEventArgs e)
 {
     //设置一下视频进度,确保从头开始播放
     MediaPlay.Position = TimeSpan.Zero;
     MediaPlay.Play();
 }
예제 #3
0
 private void back_Click(object sender, RoutedEventArgs e)
 {
     MediaPlay.DefaultPlaybackRate = -2.0;
     MediaPlay.Play();
 }
예제 #4
0
 private void play_Click(object sender, RoutedEventArgs e)
 {
     MediaPlay.Play();
 }