The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
[UWP] How to determinate what video MediaPlayerElement can play RRS feed

  • Question

  • I have video with different format in folder.

    How I can determinate programmatically which of them

    MediaPlayerElement can play.

    For example

    mp4,

    wmv,

    flv

    and other ?


    • Edited by Barry Wang Friday, December 23, 2016 9:28 AM title tags
    Thursday, December 22, 2016 5:37 PM

Answers

  • Hello SmartWhy,

    The support video and codecs are listed on this page , however we don't have a way to specify which video is supported and which video is not supported by API, this kind of method does not exist, see MediaPlayerElement

    So I think you can try the following:

    1. Maybe you will need to ask your customer to choose videos so that you can load it into your MediaPlayerElement. If so you can specify the FileOpenPicker and use FileTypeFilter  to filter the supported videos instead of using all files.

    2. If you can loop your files, you may try to filter those files' extensions.

    Personally I'd like you to use the first method since it's easy and reasonable.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by SmartWhy Friday, December 23, 2016 10:36 AM
    Friday, December 23, 2016 9:28 AM

All replies

  • Hello SmartWhy,

    The support video and codecs are listed on this page , however we don't have a way to specify which video is supported and which video is not supported by API, this kind of method does not exist, see MediaPlayerElement

    So I think you can try the following:

    1. Maybe you will need to ask your customer to choose videos so that you can load it into your MediaPlayerElement. If so you can specify the FileOpenPicker and use FileTypeFilter  to filter the supported videos instead of using all files.

    2. If you can loop your files, you may try to filter those files' extensions.

    Personally I'd like you to use the first method since it's easy and reasonable.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by SmartWhy Friday, December 23, 2016 10:36 AM
    Friday, December 23, 2016 9:28 AM
  • I used this method. But i hoped that there is best solution.

    Very sad. Will limit only by extensions.

    Friday, December 23, 2016 10:36 AM