简体   繁体   中英

Media Element doesnot play at all

I am playing audio mp3 in my windows 8.1 app but media element doesnot playing any thing Here is my code

a.Play();

nothing happens,no errors shown.I am struggling for two days about this problem and I followed this link MediaElement in WinRT / Win8 does not work at all and updated my driver still nothing happens . Please help me my graphics driver is Intel R(Q35) Express Chipset Family(Microsoft Corporation-WDDM 1.0) and processor is Core2Duo 2.666 Need Help?

This is the problem in few versions of Windows 8.1. Update your windows or install windows 7.

This is a sample,

CodeBehind.cs

    MediaElement Sound= new MediaElement();
    Sound.Source = new Uri ("/Assets/Sounds/MySample.mp3",UriKind.Relative);
    Sound.MediaOpened += new RoutedEventHandler(Sound_Opened);
    Sound.Position = TimeSpan.Zero;
    Sound.Volume = 1;
    Sound.AutoPlay = false;
    LayoutRoot.Children.Add(Sound);
    Sound.Play();

    void Sound_Opened(object sender, RoutedEventArgs e)
    {
        MediaElement _Sound = sender as MediaElement;
        _Sound.Play();
    }

After 5 days of struggle finally got the answer to install Media Feature Pack for N and KN versions of Windows 8.1

http://www.microsoft.com/en-pk/download/details.aspx?id=40744

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM