Windows Phone音乐示例代码

时间:2013-04-19 09:21:30

标签: windows-phone

我下载了这个

http://code.msdn.microsoft.com/wpapps/Music-Videos-Hub-Sample-8ef80aab

没有错误地部署,但我听不到声音。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

试试这个,这是在WP 7/8上播放媒体文件的最简单方法:

MediaPlayerLauncher objMediaPlayerLauncher = new MediaPlayerLauncher();
            objMediaPlayerLauncher.Media = new Uri("SongName.mp3", UriKind.Relative);
            objMediaPlayerLauncher.Location = MediaLocationType.Install;
            objMediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop | MediaPlaybackControls.All;
            objMediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
            objMediaPlayerLauncher.Show();