none
[UWP][HTML]Using Windows.Media.Playback.MediaPlayer

    Question

  • H

    I am trying to use the native media player on the xbox one.

    My code is 

           var mediaPlayer = Windows.Media.Playback.MediaPlayer();
           mediaPlayer.source = Windows.Media.Core.MediaSource.createFromUri(Windows.Foundation.Uri(url));
           mediaPlayer.autoPlay = true;

           mediaPlayer.play() //   is undefined

    I get audio but no video. How do i add the video?

    Monday, November 12, 2018 11:42 AM

All replies

  • Hi,

    If you are tying to use native media player, you will need to add a MediaPlayerElement Class in the xaml file to show the video. 

    But as you title mentioned, if you are using HTML, you just need to add a video tag in the html page and set the video source.

    This question has been answered here:[UWP][HTML]Using Windows.Media.Playback.MediaPlayer. You could refer @Elvis's answer as well.

    Best regards,

    Roy


    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.

    Tuesday, November 13, 2018 2:38 AM
    Moderator
  • Hi,

    How is the problem?

    Does my reply solve the problem?

    Best regards,

    Roy


    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.

    Thursday, December 6, 2018 10:04 AM
    Moderator