Page 1 of 1

Loop not working for flv files

Posted: Mon Nov 17, 2008 11:17 am
by 1x2x1x2x
Hi, any idea wat's wrong with my code below?
I can play .flv file without any problem by following samples given. However, I couldn't make it AutoReplay even I set Loop = true.

Any suggestion would be appreciated


------------------------- Code ---------------------------
// Create the interop host control.
WindowsFormsHost host = new WindowsFormsHost();

// Create the ActiveX control.
f_in_box__control player = new f_in_box__control();

player.FlashMethod_SetVariable("repeat", "always");
player.FlashProperty_Loop = true;
//player.FlashProperty_Scale = "ShowAll";
//player.FlashProperty_ScaleMode = 0;

// Assign the ActiveX control as the host control's child.
host.Child = player;
host.Background = Brushes.Pink;
Grid.SetColumn(host, 0);
Grid.SetRow(host, 0);

// Add the interop host control to the Grid
// control's collection of child controls.
this.Root.Children.Add(host);



player.FlashProperty_FlashVars = "FLVPath=" + HttpUtility.HtmlEncode("file://" + @"D:\Chan\Code\WPFSandbox\WPFSandbox\flv\20051210-w50s.flv");
player.PutMovieFromStream(this.GetType().Assembly.GetManifestResourceStream("WPFSandbox.flv.FLVPlayer.swf"));

player.FlashMethod_Play();
------------------------------------------------------------------

Posted: Mon Nov 17, 2008 2:45 pm
by Softanics
Thank you for your question.

Yes, actually FLVPlayer.swf doesn't support loop.

I can suggest the following workaround. Create a timer. Check periodically f_in_box__control1.FlashMethod_GetVariable("FLVPosition"), when it doesn't change more, set f_in_box__control1.FlashMethod_SetVariable("FLVPosition", 0)

I hope it's suitable.

Thank you.