在.net中播放流媒体 [英] Playing media from stream in .net

查看:360
本文介绍了在.net中播放流媒体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发以字节形式接收媒体内容(.mp3 / .mp4 / .avi)的应用程序。

但是,由于WPF不支持从流媒体播放媒体,所以我开始使用WMP.dll。

我正在创建类库,以字节和媒体格式接收媒体并相应地播放媒体。

参考以编程方式创建WMP ,但是,我找不到传递字节的方法流。


所以我的问题是如何使用wmp.dll从字节中播放媒体?



(我正在使用' WMP.dll'通过COM并位于'C:\ WINDOWS \system32 \ wmp.dll')

I am developing application that receives media content(.mp3/.mp4/.avi) in form of bytes.
However, as WPF doesn't support playing media from stream, So I started with WMP.dll.
I am creating class library that receives media in form of bytes and media format and play media accordingly.
Referring Creating the WMP Programmatically, however, I didn't find method to pass bytes stream.

So my question is how do I play media from bytes using wmp.dll?

(I am using 'WMP.dll' through COM and located at 'C:\WINDOWS\system32\wmp.dll')

推荐答案

您无法将字节流传递给MediaPlayer期待它的运作。 MediaPlayer不支持它。



您必须使用其他播放器。我不知道我的头脑。



另一种方法是使用DirectShow,但这并不容易。
You cannot pass a byte stream to MediaPlayer and expect it to work. MediaPlayer doesn't support it.

You will have to use a different player that does. I don't know of one off the top of my head.

An alternate method would be to use DirectShow, but that's not exactly easy.


这篇关于在.net中播放流媒体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆