VB.NET从My.Resources播放视频自动在文件路径中创建.mp4文件 [英] VB.NET Playing Video From My.Resources Automatically Creates The .mp4 File In Filepath

查看:81
本文介绍了VB.NET从My.Resources播放视频自动在文件路径中创建.mp4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是在尝试使用我的资源在Axwindowsmediaplayer上播放视频,因此可以从我的其他计算机上观看(只是从我的资源中获取).我想到了这个.

I'm basically trying to play a video on Axwindowsmediaplayer from my resources, so it could be seen from other computers besides mine (just taking it from my Resources). And I came up with this.

 Dim b As Byte() = My.Resources.My_Video
 Dim TheFIlePath As String = "My Video.mp4"
 Dim TempFile As System.IO.FileStream = IO.File.Create(TheFIlePath)
 TempFile.Write(b, 0, b.Length)
 TempFile.Close()
 Me.AxWindowsMediaPlayer1.URL = (TheFIlePath)

总有办法避免创建-在我的Filepath上生成我的视频吗?或至少掩盖它?好像它显示为DLL或SRT文件,但除了 .MP4 之外,还有其他内容吗?即使隐藏它,dunno也不会让它作为简单的 .MP4 躺在那里.

Is there anyway to avoid creating - spawning my video on my Filepath? Or at least mask it? Like it appears as a DLL or SRT file but anything besides the .MP4? Even hiding it, dunno just don't let it lie there as a simple .MP4.

推荐答案

使用较低级别的API可能会发生这种情况,但是Windows Media Player(尤其是其ActiveX尺寸)需要真正的文件系统文件和扩展名来标识格式.

This is possible with lower level APIs, however Windows Media Player (and its ActiveX form factor in particular) needs both real file system file and extension identifying the format.

这篇关于VB.NET从My.Resources播放视频自动在文件路径中创建.mp4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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