如何从System.Windows.Media.MediaPlayer资源获取音乐?在wpf应用程序中,在线音乐播放器?
我正在做一个wpf音乐播放器,使用system.windows.media命名空间的mediaPlayer控件。在我看来,它可以播放本机上的音乐文件,也可以与其他在线音乐一起在线播放。播放在线音乐时,先下载,然后缓冲一些,播放一些。最后,我觉得这首音乐很好听,想下载。我的问题是,既然已经播放了,那么这个文件是不是已经被下载到本地了呢?如果是这样,我怎样才能得到它?
I was doing a wpf music player, use the system.windows.media namespace mediaPlayer control. In my opinion, it can play music files on the machine can also play online with other online music. When it is playing online music, download it first and then buffer some, play some. Finally, I think this music sounds good, want to download. My question is, since it has been played, then this file is not already been downloaded to the local out? If so, how can I get to it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为由于数字版权管理问题,这一点不受支持。拥有用户正在播放的内容的人可能只希望它被流式传输。但在内部,MediaPlayer 很可能保留一个缓冲区用于搜索内容,但它可能不会保存到磁盘。
也就是说,如果您有一个 uri,您可以使用它在本地下载内容然后播放它,但我不确定这如何与流媒体一起使用(开始下载内容,同时要求媒体播放器将 uri 播放到该本地文件)
I dont think this is supported because of digital right management concerns. Its possible that who ever is owning the content the user is playing only wants it to be streamed. Internally though, MediaPlayer most likely keeps a buffer for seeking through content, but its probbly not saved to disk.
That said, if you have an uri, you could use that to download the content localy and then play it, but im unsure how that would work with streaming (starting to download content, and meanwhile asking mediaplayer to play the uri to that local file)