none
WPF MediaElement not playing h.264 videos on XP without CODEC

    Question

  • I loved the flexibility of using MediaElement control with Windows Media Player to play h.264 (mp4) videos in my WPF application.  The problem is that the codec for h.264 is included in Windows 7, but not in XP.  So, my users that have are on the XP operating system cannot use my player.  The player is just a small part of my overall app. 

    I need to find a solution to allow my users to view mp4 files without having to install a CODEC on their machines.  Is Microsoft planning on ever updating Media Player 11 on XP with a CODEC for h.264?  It seems that they have really missed the boat here.

    Anyway, I was able to get a 3rd party video player "FlowPlayer" to work by embedding a WebBrowser inside of one of my windows in WPF and launching the FlowPlayer html inside of that WebBrowser.  The problem is that once the video starts playing from inside the web browser, I don't have any hooks into the FlowPlayer control to detect where the video position is (how long into the video they have been playing) or to send it commands to resume playback at a certain point, or skip forward or backwards by some amount of seconds.

    My main limitation here is that I am not a web developer, so I don't know how to implement the hooks I need to communicate with the FlowPlayer instance that is living inside my WebBrowser WPF control.

    Does anybody know a way I can get the WPF Media Element to just play h.264 files under XP without having to install a CODEC?

    Or, does anybody know of a WPF control that comes with an API and plays h.264 videos with its own codec?

    I would appreciate any help you could provide in this matter.

    One of the requirements for my app is to NOT require our users to be admin on their machine.  With this limitation it means that we cannot install any CODEC or program on their machine.  We are able to copy our executable and necessary .dlls to the %appdata% folder on the users machine without needing admin priveleges.

    Thanks in advance for your help !!


    Thursday, March 24, 2011 3:56 AM

Answers

  • Hi Curtis Harrison,

    As we know, WPF MediaElement wraps the MediaPlayer ActiveX, and it play the medias which Windows Media Player can play. So we have to install the h.264 codec for Windows Media Player, then WPF MediaElement can play. Such as K-Lite Code Pack or CCCP.

    However, you are finding one control or solution that can contain the codec to play the h.264 media file on XP. Please try the following project on Codeplex: http://wpfmediakit.codeplex.com/

    On the other hand, if you could find one ActiveX control which supports the H.264, then you could host it in WPF follow as this article: http://msdn.microsoft.com/en-us/library/ms742735.aspx.

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    -------------------------------------------------------------

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Friday, March 25, 2011 3:54 AM
    Moderator
  • So to summarize the answer:

    1.  Microsoft will not support h.264 in XP natively

    2.  If I want to have an h.264 player that works in xp, I need to install 3rd party CODECs or find a 3rd party player that supports it, because Microsoft will not support h.264 in XP natively

    If that is the answer, I can accept it.  It just seems that with the endless 'security updates' that microsoft has me download weekly, they might consider patching MediaPlayer with an h.264 codec...

    Thanks,
    Curtis

    Thursday, March 31, 2011 8:11 PM

All replies

  • Hi Curtis Harrison,

    As we know, WPF MediaElement wraps the MediaPlayer ActiveX, and it play the medias which Windows Media Player can play. So we have to install the h.264 codec for Windows Media Player, then WPF MediaElement can play. Such as K-Lite Code Pack or CCCP.

    However, you are finding one control or solution that can contain the codec to play the h.264 media file on XP. Please try the following project on Codeplex: http://wpfmediakit.codeplex.com/

    On the other hand, if you could find one ActiveX control which supports the H.264, then you could host it in WPF follow as this article: http://msdn.microsoft.com/en-us/library/ms742735.aspx.

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    -------------------------------------------------------------

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Friday, March 25, 2011 3:54 AM
    Moderator
  • So to summarize the answer:

    1.  Microsoft will not support h.264 in XP natively

    2.  If I want to have an h.264 player that works in xp, I need to install 3rd party CODECs or find a 3rd party player that supports it, because Microsoft will not support h.264 in XP natively

    If that is the answer, I can accept it.  It just seems that with the endless 'security updates' that microsoft has me download weekly, they might consider patching MediaPlayer with an h.264 codec...

    Thanks,
    Curtis

    Thursday, March 31, 2011 8:11 PM