Update: dont see anything old:wrong URL when playing FLV

.NET Edition of the F-IN-BOX
froggie
Posts: 3
Joined: Thu Sep 23, 2010 9:07 am

Update: dont see anything old:wrong URL when playing FLV

Postby froggie » Fri Mar 18, 2011 2:28 pm

UPDATE:
Somehow the event is raised correctly now. the URL has the correct value.
BUT:
The desired flv is nor played. All I see is a white surface.
Can anyone help?

Original:
I'm trying to play a flv file from stream. I used this HowTo: http://www.f-in-box.com/dotnet/help/ind ... tream.html

But whenn the event get fired it has the wrong URL.
The URL ist the Aplliction.StartupPath (\\?\C:\Visual Studio 2008\Projects\FLVPlayer\FLVPlayer\bin\Debug\FLVPlayer.vshost.exe).

What I'm doing wrong?

Here is my created flash movie (ActionScript2):
http://remixshare.com/dl/sd4ysu62ul/FLV2.fla

Here is my Code in C#:

Code: Select all

// The variable flash = new f_in_box__lib.f_in_box__control();
// FLV2.swf is the embeded movie from the HowTo
namespace FLVPlayer
{
    public partial class Form1 : Form
    {
        private f_in_box__lib.AxCode axCode;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // Loads flash.ocx from resource
            Stream streamWithFlashOCXCode = Assembly.GetExecutingAssembly().GetManifestResourceStream("FLVPlayer.Resources.Flash10n.ocx");

            if (streamWithFlashOCXCode == null)
            {
                MessageBox.Show("Resource 'Flash10n.ocx' not found");
                return;
            }

            axCode = new f_in_box__lib.AxCode(streamWithFlashOCXCode);
            flash.AxCode.OnLoadExternalResourceByFullPath += new f_in_box__lib.AxCode.OnLoadExternalResourceByFullPathEventHandler(AxCode_OnLoadExternalResourceByFullPath);

            flash.PutMovieFromStream(this.GetType().Assembly.GetManifestResourceStream("FLVPlayer.Resources.FLV2.swf"));
            flash.FlashMethod_Play();
        }

        private void AxCode_OnLoadExternalResourceByFullPath(object sender, string URL, Stream Stream, ref bool Handled)
        {
            if (URL == "http://FLV/FlashVideo.flv")
            {
                Stream flvStream = this.GetType().Assembly.GetManifestResourceStream("FLVPlayer.Resources.Chapter1_de.flv.flv");

                const int size = 64 * 1024;
                byte[] buffer = new byte[size];
                int eeadBytes;

                while ((eeadBytes = flvStream.Read(buffer, 0, size)) > 0)
                {
                    try
                    {
                        Stream.Write(buffer, 0, size);
                    }
                    catch (IOException e)
                    {
                        // Loading is interrupted 
                        break;
                    }
                }

                Stream.Close();

                Handled = true;
            }
        }
    }

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

Re: Update: dont see anything old:wrong URL when playing FLV

Postby Softanics » Mon Mar 21, 2011 9:30 am

Hello,

The first question is: does the similar sample from the f-in-box demo work well?

Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

froggie
Posts: 3
Joined: Thu Sep 23, 2010 9:07 am

Postby froggie » Thu Mar 24, 2011 11:34 am

Ok, now I'm using the FLVPlayer.swf from the samples and it works.

Next question:
My FLV-file has dimensions of 650x366 and my control in which the f-in-box control ist shown (Dockstyle.Fill) has dimensions of 1024x768.

How can I center (scaled) the FLV-Video?
I played around with Scalemode but the video is not centered.

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

Postby Softanics » Thu Mar 31, 2011 11:22 am

froggie wrote:Ok, now I'm using the FLVPlayer.swf from the samples and it works.

Next question:
My FLV-file has dimensions of 650x366 and my control in which the f-in-box control ist shown (Dockstyle.Fill) has dimensions of 1024x768.

How can I center (scaled) the FLV-Video?
I played around with Scalemode but the video is not centered.


Not sure that it's possible. What if just to resize the f-in-box control?
Best regards, Artem A. Razin,

F-IN-BOX support

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


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 14 guests

cron