VB.NET Playing Video From My.Resources Automatical

2019-09-18 05:34发布

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条回答
爷、活的狠高调
2楼-- · 2019-09-18 06:06

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.

查看更多
登录 后发表回答