string resourceName = Assembly.GetExecutingAssembly().GetManifestResourceNames().Single(str => str.EndsWith("random.avi")); // get the resource name. it should be assembly name + "random.avi"
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
// now you got the stream, you can bind into your video play controls.
}
1条答案
按热度按时间9lowa7mx1#
你应该把你的视频嵌入到c#可执行文件中,如下所示:
,然后使用以下代码获取视频流: