O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Trimming

To trim a file, you use TrimStartTime and TrimStopTime properties exposed by MediaTranscoder. The following code demonstrates:

async Task TrimUserSelectedFile(){  // Get a source MP4 file from the user  FileOpenPicker openPicker = new FileOpenPicker();  openPicker.FileTypeFilter.Add(".mp4");  StorageFile sourceFile = await openPicker.PickSingleFileAsync();  if (sourceFile != null)  {    // Get a target MP4 file from the user    FileSavePicker savePicker = new FileSavePicker();    savePicker.FileTypeChoices.Add("MP4 file", new string[] { ".mp4" });    StorageFile targetFile = await savePicker.PickSaveFileAsync();    if (targetFile != null)    {      // Just use the source format       MediaEncodingProfile ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required