1

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.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
user3288047
  • 25
  • 2
  • 7

1 Answers1

0

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.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Hmm maybe there is a way to open a specific file from my Filepath on a certain Type of file? My.Computer.FileSystem.FileExists(Application.StartupPath & "/RANDOMNAME.dll") and then on load makes it load as an mp4? You think that would be possible and if yes could you maybe show me how? – user3288047 May 31 '14 at 10:28
  • WMP does not offer you any options to obfuscate or otherwise protect media source from external access. It's easy to use, but it takes the extension as important part of source content. – Roman R. May 31 '14 at 10:34
  • Hmm I see.. Thank you for bothering to answer my questions. If you have something else in mind tho, which could somehow hide the file somewhere or at least makes it hard to find on any PC then tell me about it any time. I think there's nothing left to discuss then. – user3288047 May 31 '14 at 10:40
  • Hmm one last thing though, how could I display on the exported-created file from my resources (my mp4) the datetime along with it's name.mp4? I should create a Dim d as System.DateTime but then how could I display it with the name.mp4? Could you maybe tweak the code I originally pasted? – user3288047 May 31 '14 at 11:04
  • You cannot, WMP does not offer you overlaying service of this kind. – Roman R. May 31 '14 at 11:09