Results 1 to 8 of 8

Thread: networkstream and media

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    networkstream and media

    this is a toughy

    I want to know if I can open up a file (say, abc.avi), read until EOF, and transmit bytes[] until EOF over networkstream?

    now, the tricky part is this

    on the recieving end, how can I then view the data recieved, so if the transmitted data was an audio/video - it would display this (play it) to the screen.

    can it be done? how? I guess I need to decode the data and show the data recieved to the user but no idea how exactly.

    anyone?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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
    }
    Last edited by ComputerJy; Jun 17th, 2006 at 10:10 AM. Reason: reformatting code
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    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

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: networkstream and media

    yeh i know but that is not an option.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.
    I don't live here any more.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    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.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width