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