Starting WMP Control from System.IO.Stream
-
I have a unique situation. I need to selectively play some mpeg videos in different sequences depending on the state of my main App. I have been able to add WMP to my form and play videos by setting URL = @"C:\path\filename.mpg". However, in the release version I cannot store the videos on the customers drive, so they must be embedded in the resources of the app. That's not the problem though. I would like to be able to create a MemoryStream and dynamically build the "file" which will reside in memory. However, there is no way to tell the WMP control to play my System.IO.MemoryStream. I would have to save to disk and set URL = the new temporary file, and that isn't allowed. Is there a way to point the URL at a resource in an assembly ? If not, can I tell WMP to play a System.IO.Stream ?
-
I have a unique situation. I need to selectively play some mpeg videos in different sequences depending on the state of my main App. I have been able to add WMP to my form and play videos by setting URL = @"C:\path\filename.mpg". However, in the release version I cannot store the videos on the customers drive, so they must be embedded in the resources of the app. That's not the problem though. I would like to be able to create a MemoryStream and dynamically build the "file" which will reside in memory. However, there is no way to tell the WMP control to play my System.IO.MemoryStream. I would have to save to disk and set URL = the new temporary file, and that isn't allowed. Is there a way to point the URL at a resource in an assembly ? If not, can I tell WMP to play a System.IO.Stream ?
Both are possible, I'm quite sure. But telling WMP to play a Stream would involve writing a shell extension that pretends your stream is a file. An easier option might be the embedded resource route. Does this article[^] help you?
Tech, life, family, faith: Give me a visit. I'm currently blogging about: Check out this cutie The apostle Paul, modernly speaking: Epistles of Paul Judah Himango