Platform SDK: Broadcast Architecture

Packaging Files

In order for an enhancement file to display properly, it must arrive intact with all its dependency files, such as images, scripts and so on. Otherwise, the page will appear broken when it is displayed to the user. To ensure that the enhancement displays as intended, enhancement files are compressed with their dependencies into a package. A package is a gzip-compressed, MIME-encoded archive as specified in the ATVEF foundation specification 1.1. Transmitting the files in a compressed format has the additional benefit of saving bandwidth.

Your application can call the IATVEFPackage interface in order to package one or more enhancement files together. Your application first calls IATVEFPackage::Initialize to create a new package. Then it calls IATVEFPackage::AddFile repeatedly to add files to the package, and finally, it calls IATVEFPackage::Close to close the package. Once a package has been closed, it cannot be reopened or edited. To send the package, call IATVEFSend::SendPackage.

Because compressing files into a package can be time-consuming, it is recommended that your authoring tool perform this step prior to transmitting the files. You also have the option not to compress any or all files in a package.

If an enhancement needs to transmit more than one package, your authoring tool should create multiple CATVEFPackage objects to store those packages. This is more efficient that reusing a single CATVEFPackage object because it enables your application to compress the files into packages before transmission begins.

For more information and sample code, see Creating Packages.

The IP address and port used to transmit packages is set using methods of the IATVEFAnnouncement interface. For more information, see Configuring Announcements.