将嵌入的视频资源作为流播放 [英] Play embedded video resource as stream

查看:32
本文介绍了将嵌入的视频资源作为流播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:我更改了我的问题以更好地阐明问题.如何使用 DirectShow.Net 库从字节数组(取自嵌入式资源)播放视频?>

由于我要阻止用户访问视频文件,所以我需要将视频文件作为资源嵌入并播放.

提前致谢.

解决方案

这有点不标准,但您可以使用 WCF 之类的东西在桌面应用程序中自托管端点.然后将视频输入源设置为您的自托管端点的URL".这适用于 WPF 或 WinForms.不过不确定 Silverlight.

自托管端点可以从您的嵌入式资源中提取媒体并从那里流式传输.

EDIT: I changed my question to better clarify the issue. How is it possible to play a video from a byte array (taken from embedded resource) using DirectShow.Net library?

Since I'm going to prevent users from accessing the video file, I need to embed the video file as resource and play it.

Thanks in advance.

解决方案

It's a bit non-standard, but you could use something like WCF to self-host an endpoint inside your desktop application. Then set the source of the video input to be the "URL" to your self-hosted endpoint. That would work for WPF or WinForms. Not sure about Silverlight though.

The self-hosted endpoint could pull the media from your embedded resources and stream it from there.

这篇关于将嵌入的视频资源作为流播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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