F-IN-BOX Delphi Edition Help >> TFlashPlayerControl / TTransparentFlashPlayerControl >> Events >> Extensions

OnLoadExternalResourceAsync

Syntax

[ Delphi ]
TFlashPlayerControlOnLoadExternalResourceAsync = procedure(ASender: TObject; const Path: WideString; out Stream: TStream) of object;
OnLoadExternalResourceAsync: TFlashPlayerControlOnLoadExternalResourceAsync;

[ Builder C++ ]
typedef Classes::TStream* *PTStream;

typedef void __fastcall (__closure *TFlashPlayerControlOnLoadExternalResourceAsync)
   (System::TObject* ASender, const WideString Path, PTStream pStream);

Description

The event is called only for movies loaded from a TStream. For other cases, please use: SetGlobalOnLoadExternalResourceHandlerAsync The event is called each time when flash loads a FLV using a relative path, e.g. "/all_videos/somevideo.flv". A handler checks passed path (WideString Path) and provides Stream from which flash should load a video. Of course, you can use OnLoadExternalResource or OnLoadExternalResourceEx. But OnLoadExternalResourceAsync is better. When you use OnLoadExternalResource, you should provide the whole video within a handler, if a video is huge the application freezes until you provide all data. When you use OnLoadExternalResourceEx, you can create a thread to provide all data, but flash will save the data to memory. For example, if video's size is 500 Mb, Flash reserves 500 Mb. When you use OnLoadExternalResourceAsync, Flash doesn't reserve memory. It just calls .Seek and .Read of TStream that you've provided in a handler. This is a best way to play big videos from TStream.


More about TFlashPlayerControl
Copyright © Softanics. All rights reserved
F-IN-BOX is a registered trademark of Softanics|Delphi is a trademark of Borland Software Corporation|Macromedia and Shockwave Flash are trademarks of Adobe, Inc.