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(); }
private void player_MediaEnded(object sender, RoutedEventArgs e) { //设置一下视频进度,确保从头开始播放 MediaPlay.Position = TimeSpan.Zero; MediaPlay.Play(); }
private void back_Click(object sender, RoutedEventArgs e) { MediaPlay.DefaultPlaybackRate = -2.0; MediaPlay.Play(); }
private void play_Click(object sender, RoutedEventArgs e) { MediaPlay.Play(); }