I need set source of mediaElement control in my metro app for Windows 8 !
Here is my code :
string requestUrl = "ms-appx://ArcadiaDJ/Musique/test.mp3");
mediaElement_SoundEffect.Source = new Uri(requestUrl);
mediaElement_SoundEffect.play();
I can set source but the mediaElement work not on play.. No music
i have found this solution but i need set source on loading page dynamically
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.SuggestedStartLocation =Windows.Storage.Pickers.PickerLocationId.MusicLibrary;
openPicker.FileTypeFilter.Add(".mp3");
openPicker.FileTypeFilter.Add(".wav");
file = await openPicker.PickSingleFileAsync();
mediaControl.SetSource(stream, file.ContentType);
Thank you