简体   繁体   English

C#-如果不支持Windows Media Player,则会发生错误

[英]C# - Error if Windows Media Player is not supported

i´m using the windows media player (Interop.WMPLib.dll & AxInterop.WMPLib.dll) in my c#-project to stream a mp3 from a server. 我在c#项目中使用Windows Media Player(Interop.WMPLib.dll和AxInterop.WMPLib.dll)从服务器流式传输mp3。 The only problem is, if the windows media player is somehow not supported on a pc (not installed or something), my application just gives an error (no exception, just a "windows-error") and won´t start. 唯一的问题是,如果PC不支持Windows Media Player(未安装或未安装),我的应用程序将给出一个错误(无例外,只是一个“ Windows错误”)而无法启动。

So, is it possible to check, if the windows media player is supported? 因此,是否可以检查Windows Media Player是否受支持? Just checking if the OS is supported will probably not help. 仅检查操作系统是否受支持将可能无济于事。

Are there maybe some better ways to stream mp3s than with the WMP ? 是否有比WMP更好的流mp3的方法?

Thanks in advance. 提前致谢。

Look at the IsInstalled value under key HKLM\\Software\\Microsoft\\Active Setup\\Installed Components\\{22d6f312-b0f6-11d0-94ab-0080c74c7e95} OR HKLM\\Software\\Microsoft\\MediaPlayer\\ . 在键HKLM\\Software\\Microsoft\\Active Setup\\Installed Components\\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}HKLM\\Software\\Microsoft\\MediaPlayer\\下,查看IsInstalled值。 It is 1 if installed . 如果已安装,则为1。

OR Try a thirdparty player if you dont want to rely on WMP . 或者如果您不想依靠WMP,请尝试使用第三方播放器。 VLC also has support for so many codecs . VLC还支持许多编解码器。

http://wiki.videolan.org/.Net_Interface_to_VLC http://wiki.videolan.org/.Net_Interface_to_VLC
http://vlcdotnet.codeplex.com/ http://vlcdotnet.codeplex.com/
http://www.codeproject.com/Articles/109639/nVLC http://www.codeproject.com/Articles/109639/nVLC
http://sourceforge.net/projects/libvlcnet/ http://sourceforge.net/projects/libvlcnet/

I would like to extend this question one leve higher and solve absence of media player programatically because its unnecessary part of my solution. 我想进一步扩大这个问题,并以编程方式解决媒体播放器的缺席问题,因为这是我解决方案中不必要的部分。 If interested please check https://stackoverflow.com/questions/17103532/optional-use-of-embed-wmp-on-windows-server 如果有兴趣,请检查https://stackoverflow.com/questions/17103532/optional-use-of-embed-wmp-on-windows-server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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