'FLVPlayer' and 'VideoPlayer' difference

F-IN-BOX for Delphi / Builder C++ / VCL
rimasx
Posts: 7
Joined: Tue Jul 21, 2009 5:00 am
Location: USA

'FLVPlayer' and 'VideoPlayer' difference

Postby rimasx » Thu Aug 06, 2009 10:26 am

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

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

Postby Softanics » Thu Aug 06, 2009 1:58 pm

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.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

rimasx
Posts: 7
Joined: Tue Jul 21, 2009 5:00 am
Location: USA

FLVPlayer functions

Postby rimasx » Fri Aug 07, 2009 4:16 am

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

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

Postby Softanics » Fri Aug 07, 2009 11:10 am

Check your email.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

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


Return to “Delphi / Builder / VCL Edition”

Who is online

Users browsing this forum: No registered users and 8 guests

cron