Platform SDK: Broadcast Architecture |
Preparing packages of files to be sent to broadcast clients involves three steps: creating a new package, adding files to it, and then closing the package. The following simplified example illustrates these steps. For more information on how to obtain the pIPackage interface pointer or using multiple packages, see Co-creating a Package Class Instance. See Creating An Announcement for an example of how to create a DATE variable.
HRESULT hr; DATE PackageExpires; //...create an expiration date for the entire package or set to zero hr = pIPackage->Initialize(PackageExpires); DATE FileExpires; //...create an expiration date for the individual file or set to zero hr = pIPackage->AddFile( L"page1.htm", //file name L"lid://unique123@xyz.com", //MIME content location L"text/html", //MIME content type &DateExpires, //MIME Content Expiration Date 0x406, //MIMEContentLanguageId TRUE //compress the file );
The second parameter specifies a local ID URL that tells the client to look for this file in its local "unique123@xyz.com" namespace. Triggers will reference the same "lid://" URL and namespace when they are sent to trigger the display of this particular file. For more information about namespaces, see Creating Triggers.
After you have added all the files for this package, call pIPackage->Close()
. The package is now ready to be sent using the IATVEFSend::SendPackage method. The IATVEFSend interface is implemented in the CSendATVEFInserter and CSendATVEFMulticast classes.