Re: networkstream and media
You can send file info before transmission starts, this way the client app will be able to determine how to run it when it's done
Code:
byte[] b=new byte[1000];
FileStream fs=File.OpenRead("FilePath");
FileInfo info=new FileInfo("FilePath");
//send info object
//Wait for acceptance, then:-
while(fs.Position<fs.Length)
{
fs.Read(b,fs.Position,1000);
//Send the byte array
}
Re: networkstream and media
well yeh I know how to do that already but the tricky part is when we are recieving data, how to actually construct the data and play it back to the user
Re: networkstream and media
It's not that simple. You cannot automatically assume that the user has the class libraries required to play the media. Your best bet is to save the file to the user's computer and then execute it. If the user has the application to play it, it will play. If he doesn't, then... nothing.
Re: networkstream and media
yeh i know but that is not an option.
Re: networkstream and media
Well you'll need a shedload of bandwidth for a start. Also you have to realise that some media formats require you to have the entire file before you start.
Re: networkstream and media
yeh i realize that however I am not talking about broadcasting it to the internet, i am talking about local network (LAN) inside your house/network.
Re: networkstream and media
Let me elaborate wossy's point.
If it's an ASX for example, it can be streamed. You'd stream it to a windows media player instance on the user's end machine. But as for WMVs, AVIs, MOVs, they play in an application such as a browser by first beginning the download of the file and the plugin or application itself handles the 'streaming'.
If you can access class libraries for the applications for each respective file type and then get them to play it by outputting a stream of audio, then you might have a chance.
So you'll need to find out about all the class libraries for each media type you want to play.