VB.NET Playing Video From My.Resources Automatically Creates The .mp4 File In Filepath

余生长醉 提交于 2019-12-12 01:46:23

问题


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)

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.


回答1:


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.



来源:https://stackoverflow.com/questions/23968387/vb-net-playing-video-from-my-resources-automatically-creates-the-mp4-file-in-fi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!