Page 1 of 1

'FLVPlayer' and 'VideoPlayer' difference

Posted: Thu Aug 06, 2009 10:26 am
by rimasx
Dear Support

What is the difference between
Code:

Code: Select all

rs := TResourceStream.Create(0, 'VideoPlayer', 'FLASH');
  rs := TResourceStream.Create(0, 'FLVPlayer', 'FLASH');



The problem is that when I am using 'VideoPlayer' I can get my encoded video inside of player that contains Play, Stop, Video Progress and Sound options in it. You know, little buttons in the bottom of the VideoPlayer(See the SampleAFLVPlayer). But in this case I cannot play my encoded stream video.
Everything is ok when I use 'FLVPlayer'.. but in this case my video is played in the FlashPlayerControl without Play, Stop, Video Progress and Sound options.. I would like to play my encoded video in 'VideoPlayer'. What I did wrong ?

there is my code

Code: Select all

PROCEDURE Tfrm_player.FormCreate(Sender: TObject);
VAR
  SourceStream, MovieStream: TStream;
  ContentProviderThread: TContentProviderThread;
  Speed: Integer;
  IsSWF: Boolean;
  rs: TStream;
BEGIN

FlashPlayerControl.SetGlobalOnLoadExternalResourceHandlerEx(ContentProvider);
  Speed := 1024 * 1024;
  OpenDialogEncodedFlashFiles.FileName := 'c:\1.eff';// for instance
  SourceStream := TFileStream.Create(OpenDialogEncodedFlashFiles.FileName, fmOpenRead
    OR fmShareDenyWrite);
  SourceStream.Read(IsSWF, sizeof(IsSWF));
  SetGlobalOnLoadExternalResourceHandler(OnGlobalLoadExternalResource);
  FEncodedFLVStream := SourceStream;
  FlashPlayerControl1.FlashVars := 'FLVPath=http://FLV/FlashVideo.flv';
  rs := TResourceStream.Create(0, 'VideoPlayer', 'FLASH');
  FlashPlayerControl1.PutMovieFromStream(rs);
  rs.Free;
END;

 
PROCEDURE Tfrm_player.FlashPlayerControl1LoadExternalResourceAsync(
  ASender: TObject; CONST Path: WideString; OUT Stream: TStream);
BEGIN
  IF Path = 'FlashVideo.flv' THEN
    Stream := TResourceStream.Create(0, 'FlashVideo', 'FLV');
END;



Best Regards

Posted: Thu Aug 06, 2009 1:58 pm
by Softanics
Thank you for your question.

If you would like to have the buttons, you should use Samples\(anything)\SampleA_FLVPlayer\res\VideoPlayer.swf.

But instead of:

Code: Select all

FlashPlayerControl1.FlashVars := 'FLVPath=http://FLV/FlashVideo.flv';


use the following code to load FLV:

Code: Select all

FlashPlayerControl1.FlashVars := 'type_video=flv&url=http://FLV/FlashVideo.flv&auto_play=true';


Thank you.

FLVPlayer functions

Posted: Fri Aug 07, 2009 4:16 am
by rimasx
Great!
Thank you very much

Where can I get the full list of FlashPlayerControl.CallFunction like

pauseVideo
resumeVideo
getDuration
...
...
:?:

May be you could give me the fla source of VideoPlayer.swf :roll:

Best Regards

Posted: Fri Aug 07, 2009 11:10 am
by Softanics
Check your email.

Thank you.