media player and set binary data
Hi.
I have a problem.Please can you help me?
This is runing.
AxWindowsMediaPlayer1.URL="C:\video.avi"
But I want to set binary data for media player.
example,
Dim dArray() as byte=ReadData("C:\video.avi")
AxWindowsMediaPlayer1.URL = dArray
And I can't do. What is the method for read binary data?
Thanks..
Re: media player and set binary data
You can read the contents of a file into a byte array like this:
Code:
Dim byteArray() As Byte = IO.File.ReadAllBytes("C:\video.avi" )
but I fail to see what do you intend to do after this since AxWindowsMediaPlayer1.URL accepts only a string with supposed file location (UNC or local path), not the file itself.
I'm afraid that Windows Media Player control cannot work with byte arrays directly.
Re: media player and set binary data
@cicatrix thank you for your reply. I've done it. Only string value is valid for url method. But I want to send binary data for this component. Or is different other media player control?(to be valid a binary data method)
thanks.
Re: media player and set binary data
You should search specifically for a component or control that supports this feature. It cannot be done with Media Player control unless you write the array into a file and provide a file name to it.
Re: media player and set binary data
@cicatrix thanks again. I'm looking for.