how to do online streaming using SWF files?

.NET Edition of the F-IN-BOX
zainy
Posts: 12
Joined: Thu Mar 20, 2008 6:02 am

how to do online streaming using SWF files?

Postby zainy » Thu Mar 27, 2008 1:12 pm

The code i am currently using for playing FLV files is as follows...


Code: Select all

ContentProviderFromURL ContentProvider =
                                            new ContentProviderFromURL(f_in_box__control1.AxCode, File_Name_Path_URL);
                                    f_in_box__control1.FlashProperty_FlashVars = "autoplay=1&way=http://FLV/FlashVideo.flv";
                                    f_in_box__control1.FlashMethod_SetVariable("FLVPlay", "any_value_here");
                                    f_in_box__control1.PutMovieFromStream(this.GetType().Assembly.GetManifestResourceStream("wclFlashPlayerControl.res.uflvplayer_500x375.swf"));


Can we play swf file using same method? Please provide with the details..

Regards,
Muhammad Abdullah Malik
Assistant Software Engineer

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Re: how to do online streaming using SWF files?

Postby Softanics » Thu Mar 27, 2008 6:47 pm

Thank you for your question.

zainy wrote:Can we play swf file using same method? Please provide with the details..


Do you mean, how to load swf from a stream?

For example:

Code: Select all

Stream stream = f_in_box__control1.PutMovieUsingStream();


After that you can either write the whole movie's content at once:

Code: Select all

stream.Write( ... );
stream.Close();


or create a separate thread and write the data buffer-by-buffer:

Code: Select all

while ( ... )
{
   stream.Write( ... );
}

stream.Close();
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

zainy
Posts: 12
Joined: Thu Mar 20, 2008 6:02 am

Postby zainy » Mon Mar 31, 2008 12:37 pm

Thanks for the response,
Can u please send a sample code for this bcause i've tried to do it as per your instructions but its not working.
I want to play the swf file same way as flv file plays in f-in-box control by streaming like i pass the URL to contentproviderfromurl class:
ContentProviderFromURL ContentProvider =
new ContentProviderFromURL(f_in_box__control1.AxCode, FormURL.URL);
Muhammad Abdullah Malik

Assistant Software Engineer

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon Mar 31, 2008 3:30 pm

Please download it here:
http://f-in-box.com/TEMP/A0A6C127-318F- ... eaming.zip

See this part:

Code: Select all

Stream FromStream = this.GetType().Assembly.GetManifestResourceStream("Sample02_SWF_FLV_Embedding.Embedded_Movies.movie.swf");
Stream ToStream = f_in_box__control1.PutMovieUsingStream();

new FromStreamToStreamWriter(FromStream, ToStream);


Click to "play embedded swf" to see how it works.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon Mar 31, 2008 3:34 pm

BTW if you just need to load a movie from URL, use:

Code: Select all

f_in_box__control1.FlashProperty_Movie = "http://movie.com/...../movie.swf";
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

zainy
Posts: 12
Joined: Thu Mar 20, 2008 6:02 am

Postby zainy » Tue Apr 01, 2008 4:54 am

I want to play buffer by buffer. Because of security reasons we cannot download the movie. This method will download movie in temporary files.
Muhammad Abdullah Malik

Assistant Software Engineer

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Apr 01, 2008 5:09 am

zainy wrote:I want to play buffer by buffer. Because of security reasons we cannot download the movie. This method will download movie in temporary files.


OK, this example plays a movie buffer by buffer:
http://f-in-box.com/TEMP/A0A6C127-318F- ... eaming.zip
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

zainy
Posts: 12
Joined: Thu Mar 20, 2008 6:02 am

Postby zainy » Tue Apr 01, 2008 5:28 am

Man i guess i am not been able to deliver what i want, let me try it again.

I want to play "swf" movie from URL, It should not store on hard drive any way. Also want to play it as it is downloading.

Currently i am downloading swf into stream and on completion, i am playing it.

Thanks for response.

Regards,
Muhammad Abdullah Malik

Assistant Software Engineer

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Apr 01, 2008 2:43 pm

zainy wrote:I want to play "swf" movie from URL, It should not store on hard drive any way. Also want to play it as it is downloading.

Currently i am downloading swf into stream and on completion, i am playing it.


So what's the problem?... Create new System.Net.WebRequest, get a stream and start a writer thread, the things are almost the same as in the example:

Code: Select all

using System.Net;

WebRequest request = WebRequest.Create("http://blablabla");

HttpWebResponse response = (HttpWebResponse)request.GetResponse ();

Stream FromStream = response.GetResponseStream();

Stream ToStream = f_in_box__control1.PutMovieUsingStream();

new FromStreamToStreamWriter(FromStream, ToStream);
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

zainy
Posts: 12
Joined: Thu Mar 20, 2008 6:02 am

Postby zainy » Wed Apr 02, 2008 5:40 am

Thanks a lot mate, it worked :D
Muhammad Abdullah Malik

Assistant Software Engineer


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 12 guests

cron