Microsoft Producer for Microsoft Office PowerPoint 2003 SDK

This documentation describes the Microsoft® Producer for Microsoft Office PowerPoint® 2003 Software Development Kit (SDK).

The Microsoft Producer SDK is designed to help developers create e-services that simplify the process of publishing content created using Microsoft Producer. E-services consist of custom WebHosts, which allow users to publish to a particular server on the Internet or a company intranet, and profiles, which specify the settings that determine the quality of the output file that Microsoft Producer publishes.

The key features of the Microsoft Producer SDK are:

  • An object model for creating custom WebHosts and working with publishing profiles.
  • A set of registry keys for adding e-services to the Microsoft Producer Publish Wizard user interface.
  • Support for customizing the user interface of the Publish Wizard.

Developers are encouraged to refer to the source code of the samples included with this SDK.

What's New for Producer for PowerPoint 2003

The newest version of Producer has added several new properties and methods, as well as a new feature, the batch asset loading interface.

The following methods and properties have been added since Producer for PowerPoint 2002:

  • Publisher.CalculateBestPublishProfile
  • Publisher.SmartRecompressionProfile
  • Profile.IsSmartRecompressionProfile
  • Profile.IsV7Profile
  • Profile.IsV8Profile
  • Profile.IsV9Profile
  • Profile.IsV9VoiceProfile
  • Profile.IsWebStream
  • Properties.BackupMediaFiles

In addition, Producer 2003 now offers the batch asset loading interface, a method of automating the creation and publishing Producer projects and presentations by using an XML file. For more information, see Producer Batch Asset Loading Interface.

This documentation includes the following sections.

Section | Description
About the Microsoft Producer SDK | Provides an overview of the two main components of the Microsoft Producer SDK.
Producer Object Model | Overview and reference sections of the Producer object model, used for publishing presentations.
Producer Batch Asset Loading Interface | Overview and reference sections for the Producer Batch Asset Loading Interface, used to automate timeline creation.
Glossary | Provides definitions for common terms.

Next

© 2001-2003 Microsoft Corporation. All rights reserved.


About the Microsoft Producer SDK

Microsoft® Producer is a technology that enables users to record audio, video, and still images and use that content to create Microsoft Producer presentations. Presentations may also include imported Microsoft PowerPoint presentations, Microsoft Windows Media® files, Hypertext Markup Language (HTML) files, and synchronized narrations. Using the Publish Wizard, which is available from the Producer user interface, users can publish completed presentations to an Internet server, a corporate intranet site, a server on a corporate network, or a server owned by an e-service provider.

Microsoft Producer 2003 enables developers to customize the presentation publishing process in Microsoft Producer. Producer 2003 offers two automation features to automate tasks using Microsoft Producer, described in the following sections.

  • To automate publishing with the Publish Wizard, Producer exposes a scriptable E-service object programming model. These objects provide a programmable interface that an E-service can use to publish a previously created project. See Overview of the Producer Publishing Object Model for more details.
  • To automate the creation of a project, Producer now accepts a Batch Asset Loading Interface, an XML file that specifies a complete new project in XML format. See Overview of the Producer Batch Asset Loading File Interface for more details.

Note These two processes are not designed to work together. A Batch Asset Loading file can specify that the project it creates be published to a (single) e-service existing on the client's computer; however an e-service cannot access or run a batch file on a client's computer.

See Also

  • Microsoft Producer for Microsoft Office PowerPoint 2003 SDK


Overview of the Producer Publishing Object Model

The Microsoft Producer SDK provides an object model that you can use to create publishing e-services for Microsoft Producer. In Microsoft Producer, an e-service is a service that provides a Web server location and hosting for Producer presentations. The object model documented in this SDK provides functionality to customize (and simplify) the user experience in the Microsoft Producer Publish Wizard, while integrating back-end services. To publish a presentation, users must normally move through a series of wizard pages and individually specify publishing parameters, such as file paths or profile settings. Using the Producer object model, you can specify the Uniform Resource Locator (URL) of an HTML document that functions as a custom user interface in the Publish Wizard, create registry keys that add your e-service to the Microsoft Producer Publish Wizard user interface, and specify profile information associated with your e-service.

This model can be used to pass information to an e-service outside your security zone, such as over the Internet, because you do not need to provide the e-service access to your source files, or to allow the service to run applications on your computer.

An example of an e-service using the publishing object model could be a Web service that hosts presentations for a fee on the Internet. The first time you visit this service using the e-service wizard you might enter information, such as your name, company name, and other registration information. This information would be saved by the e-service inside your project file using the Properties.SetCustomProperty method. The next time you visit the e-service with this project, that information could be retrieved from the project file, and you need not enter it a second time. This e-service can then publish multiple projects on your computer to its Web site during the same session. The object model is used only for publishing.

Only methods and properties that are documented in this SDK are supported.

See Also

  • About the Microsoft Producer SDK


Overview of the Producer Batch Asset Loading File Interface

Microsoft Producer 2003 now offers a tool to completely automate the creation of a timeline, called the Batch Asset Loading Interface. Batch asset loading is a part of the Producer 2003 executable, and it allows Producer to load an XML file on startup that specifies project timeline information. This XML file allows you to create and publish a fully populated project timeline in a scripted fashion. This process can be automated and run by a batch file, allowing you to generate Producer projects at timed intervals. The disadvantages of batch asset loading are that you can publish only one project at a time and you must run Producer on the computer hosting the XML file, or else provide access to the source files on your computer to a remote computer, so you would not want to use this outside a trusted network.

An example scenario for using the Batch Asset Loading File Interface would be a company that regularly videotapes guest lecturers. Such a company might want to automate the creation of browser-accessible versions of the lectures that incorporate presenter slides. This company would create an application that allows a technician to specify the location of the recorded video and any additional source files, such as PowerPoint slides, then click a button to create a timeline that includes all the files in a standard corporate presentation template and publish it to an internal corporate hosting site.

See Also

  • About the Microsoft Producer SDK


Producer Object Model

The Microsoft Producer SDK provides an object model that you can use to create publishing e-services for Microsoft Producer. This section includes the following topics.

Section | Description
Producer Object Model Architecture | Provides a summary of the Producer SDK object model.
Programming Guide | Discusses specific concepts related to developing e-services.
Samples | Provides working sample code for creating e-services.
Object Model Reference | Provides Microsoft JScript® reference information for the properties and methods supported by the Microsoft Producer SDK.

See Also

  • Microsoft Producer for Microsoft Office PowerPoint 2003 SDK


Producer Object Model Architecture

The Microsoft Producer object model uses Microsoft Component Object Model (COM) technology. The functionality for e-services is distilled into a set of programming interfaces; you can write programming code that uses these interfaces by using Microsoft JScript.

The scripting languages use the concept of objects to contain programming functionality. The Producer object model uses several objects to divide the methods, properties, and events into a logical organization that groups semantically related functions together. The primary objects are the core Application object and other objects that can be accessed through its specific properties.

Object | Description
Application Object | Represents the root of the Producer object model.
Error Object | Represents the errors that Producer can generate.
Options Object | Represents the collection of registered e-services.
ProfileManager Object | Represents the collection of all available Profile objects.
Project Object | Represents a Producer project.
Properties Object | Represents the metadata of a project.
Publisher Object | Provides methods to support the publishing process.
Windows Object | Represents a collection of Window objects.

There are additional objects that you may use when creating e-services. You can use these objects as return values from methods or as parameter values that can be passed to a method as an argument.

Object | Description
Profile Object | Represents a publishing profile.
Profiles Object | Represents a collection of Profile objects.
StreamConfig Object | Represents a video or audio stream.
WebHost Object | Represents the e-service.
Window Object | Represents a Producer window.

The following diagram illustrates the organization of the supported objects of the Producer object model.

Producer object model diagram


A Note About Type Library Information

If you use an authoring tool that retrieves information from the Producer object model type library in order to display information about the object model, such as the auto-complete feature of Microsoft Visual InterDev®, the tool may not display specific data type information for parameters that accompany certain methods. Always refer to the Object Model Reference section for specific information about parameter data types.


About the Application Object

This is the root object for the Microsoft Producer object model. All other objects are accessed through this object. To gain access to the Application object, use the following JScript syntax:

var Application = window.external;

This creates an instance of the Application object, which can then be used to retrieve the child objects. For example, the following JScript syntax retrieves an instance of the ProfileManager object:

var ProfileMgr = Application.ProfileManager;


About the Error Object

This object returns error information from the Producer object model. When an error occurs in Producer, the Number and Description properties of the Error object are automatically set. In a JScript try/catch block, the number property of the script error object must be compared to the Number property of the Producer Error object to determine whether the error that occurred is actually a Producer error and not a JScript error. If it is a Producer error, the Error.Description property will contain additional information.


About the Options Object

This object exposes properties and methods that are used primarily to instantiate and manipulate WebHost objects. The Options object also exposes properties that retrieve information about publishing restrictions by security zone.


About the ProfileManager Object

This object is a collection of Profile objects that represents all the available profiles an e-service can use to publish a Producer presentation. The Profile Manager contains six pre-existing profiles, which correspond to the profiles available in Microsoft Producer:

  • LowQualityAudioOnly
  • LowQualityAudioVideo
  • MediumQualityAudioOnly
  • MediumQualityAudioVideo
  • HighQualityAudioOnly
  • HighQualityAudioVideo


About the Project Object

For the purposes of this SDK, one property that provides access to the Properties object, which is a child object of the Project object, is supported. One method is provided to check whether the project timeline contains video content.


About the Properties Object

This object stores information, typically provided by the user, about the Producer presentation project. Some of this data, such as Title or Description, persists as metadata in the header of the Windows Media output file that Microsoft Producer generates. Other data, like PublishWebHost, is specifically for use by the Producer object model. Within the Properties object, there are associated methods you can use to add user-defined properties and subsequently retrieve them by name.


About the Publisher Object

The Publisher object, as the name implies, provides methods related to the final steps of the publishing process.


About the Windows Object

The Windows object is a collection of Producer windows that provides methods to retrieve an object that represents the hosted browser window in Producer. This is useful to allow you to write script code that closes the hosted browser window. For an example of how to close the hosted browser window, see A Simple E-service in the Programming Guide section.


Programming Guide

The Programming Guide is intended to help you learn how to use the Microsoft Producer SDK to build e-services for Microsoft Producer.

The following sections explain how to program the various features and functions of the SDK, and include example code to help get you started.

Section | Description
About the Publishing Process | Provides an overview of the Microsoft Producer Publish Wizard and opportunities to customize the user experience.
Files Published by Producer | Provides details about the files that Producer creates and copies to various publishing server destinations.
How to Create an E-service | Describes the steps you must follow to create Producer e-services.
Adding E-services to Producer | Describes the different ways that e-services can be added to Producer.
Working with Profiles | Provides information about using Profile objects and the Profile Manager in the publishing process.
Working with Security Settings | Provides information about using the security features of the object model.
Changing the Default Learn More Web Page | Explains how to change the address of the default Web page that displays when the user clicks Learn More in the Publish Wizard.

See Also

  • Producer Object Model


About the Publishing Process

Microsoft Producer provides the user with the Publish Wizard. This tool, which is accessible from the program user interface, moves through a series of pages that prompt the user for the information needed to publish the Producer presentation to a remote server or a local hard disk. The first page of the Publish Wizard offers the user three publishing options: My Computer, My Network Places, and Web server. This SDK deals only with functionality related to the Web server option.

Microsoft Producer for PowerPoint 2002 Publish Wizard

When the user clicks the Web server button, two other controls become enabled. One is a command button labeled Learn More. When the user clicks this button, a hosted browser window opens that, by default, displays a Web page from the Microsoft Web site. This page allows the user to choose e-services from third-party Web hosting service providers.

The other control that becomes enabled when the user clicks the Web server button is a drop-down list that contains all the remote servers that have been added to the Windows registry on the user's computer. The default item in the list is Add a New Web server. When the user accepts this default setting and clicks Next, the Publish Wizard proceeds through its default pages for acquiring publishing data. When the process is finished, the user will have created a new Web server that will be available from the Web server drop-down list in future Producer sessions.

Publish Wizard showing Web server list

If the user chooses an e-service from the Web server list, the user interface changes to display a hosted browser window that acts as custom dialog box.

As the e-service author, you must implement a custom user interface. To provide a custom user interface, you specify a value for the HTMLBasedUIURL subkey that is associated with your particular WebHost key in the Windows registry. If no value is present for this subkey, Producer will, by default, show the standard Publish Wizard user interface. The Producer object model contains methods you can use to write values to the registry, or you can create a file with a .reg file name extension that contains script to make changes to the registry. For details about both processes, see the Programming Guide section.

The following is a screen capture example that shows a custom user interface in the Publish Wizard.

Publish Wizard showing custom HTML user interface

When the user chooses your e-service from the Web server list, you can control the user experience and publishing process. Simply use the Producer object model in the script code contained in the Web page specified in the HTMLBasedUIURL registry key. You can use this Web page to collect any information from the user. You can retrieve from the user all of the parameters relevant to the publishing process, you can specify all the values by default in your script code, or you can choose to do anything in between. Finally, once all the necessary values have been specified, the e-service must initiate the publishing process. Producer displays a dialog box with progress bars to advise the user about the time remaining before the file copying is completed.

The following is a screen capture example that shows the progress dialog box.

Publish progress dialog box


Files Published by Producer

The files that are published depend on the content within the presentation. Therefore, the list of files that are published will vary from one presentation to the next.

To generate a list of the specific files that will be created for a presentation, an e-service can call the Publisher.ShowManifest method, which displays a dialog box containing the file list.

The following is a brief listing of the different files that can be created and published as part of a presentation:

  • Presentation templates and the associated image files. The presentation template files are copied to the specified location along with the necessary images to display the presentation in a Web browser. These files will have .gif, .jpg, or .css file name extensions. These files are published to a subfolder that includes the name of the presentation templates used in the presentation.
  • Microsoft PowerPoint slides and associated files. The slides and the associated images or script files for the PowerPoint slides are published to a subfolder of the presentation. This subfolder is given a shortened version of the name of the original PowerPoint presentation.
  • HTML files and associated images. Any HTML files and associated still images are stored in a subfolder of the main presentation folder.
  • Theme.css. A style sheet that contains color information and font sizes for various parts of the presentation. This includes text for the table of contents entries as well as discussions if you have specified a discussion server.
  • Project.js, ProjectA.js, and GoGoProd.js. This group of Microsoft JScript files contains scripting information that controls how the presentation is displayed and played back. Do not change these files.
  • MainFile.htm. The starting page of the presentation. The actual file name is specified in the Publish Wizard.
  • Scan.hta. This Web file displays the list of available Microsoft Producer presentations in a folder and its subfolders or on a CD. This file is automatically generated and lets the viewer click a link to start a presentation.
  • Autorun.inf and Page.ico. Autorun.inf enables a CD to automatically start after it is inserted in a CD-ROM drive (provided that functionality is not disabled in the operating system). Page.ico contains the Microsoft Producer icon that is displayed on the title bar of the page titled Select a Presentation, which provides a list of available presentations.
  • Default.htm and associated .gif images. This page is the introduction page of the presentation. This page displays the information you entered such as the title, presenter, introduction page image, and description. This page displays while your presentation is loading in a Web browser.
  • BasicStyles.css. This style sheet contains information about how the presentation is displayed and played back.
  • Windows Media files. The Windows Media files, which have .wmv, .wma, or .asx file name extensions. The number of WMV or WMA files depends on the number of profiles you selected when publishing the presentation. The Windows Media metafile with an .asx file name extension specifies which Windows Media files will be played back in the presentation.


How to Create an E-service

This section provides information about writing the code that you need to create publishing e-services.

  • Getting Started
  • A Simple E-service


Getting Started

This section shows you how to create the simplest of all possible e-services. This sample is not really a service at all, because it performs no useful function; it only displays the text "Hello World!" in the Producer Publish Wizard. It does, however, demonstrate the minimum work required to make your e-service visible in the Publish Wizard user interface so you can test and debug your code.

The following steps create the Hello World sample:

  1. Open a new text file using a text editor, such as Notepad.exe. Type the following:
    Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\Hello World]

"HTMLBasedUIURL" = "http://yourserver/yourpath/HelloWorld.htm"
"ID" = "C1C8024B-3667-4245-BB8C-0556D61D6166"

    The name of the e-service is the text between the last backslash and the closing square bracket on the line that begins with [HKEY CURRENT USER (in this case, Hello World). This is the name that appears in the Web server list in the Publish Wizard user interface, and also the name of the WebHost key in the registry.

    The value provided for ID is a globally unique identifier (GUID). This must be unique for each WebHost, but feel free to use the one provided for this example. Normally, you will generate a new GUID for each WebHost you create in this manner. (The GUID is generated automatically when you register a WebHost using the Producer Object Model.)

  2. Change the path specified following HTMLBasedUIURL in the preceding text to match a valid URL on your Web server. Be sure to retain the file name HelloWorld.htm.
  3. Save the text file as "HelloWorld.reg". Do not add a .txt file name extension.
  4. If necessary, copy the file HelloWorld.reg to the computer that runs Producer.
  5. Use Explorer to browse to the folder where you saved or copied the HelloWorld.reg file.
  6. Double-click the HelloWorld.reg file. Click Yes and OK when prompted. You've now registered the Hello World WebHost key. This is the registry key that makes the e-service accessible from the Web server list in the Publish Wizard.
  7. Open a new text file in the text editor. Type the following:
    <HTML>
<HEAD></HEAD>
<BODY>
Hello World!
</BODY>
</HTML>
  8. Save the text file as "HelloWorld.htm". This is the Web page that displays in the Producer Publish Wizard when you select the Hello World Web server.
  9. Copy the file HelloWorld.htm to the Web server URL path you specified in step 2.

To display the Hello World page:

  1. Start Producer and open a project.
  2. Click Publish on the toolbar to invoke the Publish Wizard.
  3. Click Web server to enable the drop-down list.
  4. Choose Hello World in the Web server list.
  5. Click Next.

The message displays in the hosted browser window client area.

For the finished samples that accompany this topic, see The Hello World Sample.


A Simple E-service

When your e-service is successfully added to the Windows system registry on the user's computer as a WebHost key, and the user chooses to use your e-service, a hosted browser window in the Publish Wizard loads the Web page you specified in the HTMLBasedUIURL subkey. This page serves as the customized user interface for your e-service. This documentation shall refer to this page as the "custom UI" page. From the custom UI page, you should specify any values related to the current publishing session that you did not specify when you added the e-service to the user's computer or that you wish to change during the Publish Wizard session. Which values you supply in the code and which values you require the user to supply is up to you. The following is a list of properties that you may want to set during the publishing process:

  • Properties.Author
  • Properties.Copyright
  • Properties.Description
  • Properties.DiscussionServerAddress
  • Properties.PublishName (required)
  • Properties.Title
  • WebHost.Password
  • WebHost.PlaybackAddress
  • WebHost.PublishDestination (required)
  • WebHost.Username
  • WebHost.WindowsMediaPlaybackAddress
  • WebHost.WindowsMediaPublishDestination

You must specify at least the Properties.PublishName and WebHost.PublishDestination property values, and you must also specify at least one profile.

You can use virtually any HTML syntax in the custom UI page that you would use in Internet Explorer. This means you can also include HTML controls such as BUTTON elements, TEXT and TEXTAREA elements, SELECT elements, and CHECKBOX elements.

Note You cannot write code that navigates to other Web pages from the custom UI page.

You can, however, imitate the functionality provided by multiple Web pages. The Producer object model exposes two events for this purpose: OnWizardBack and OnWizardNext. To use these events, first associate each event with a function block in your script code:

window.document.OnWizardNext = MyOnWizardNext;
window.document.OnWizardBack = MyOnWizardBack;

Then, create the function blocks that execute when Producer raises each event in response to the user clicking Next or Back in the Publish Wizard:

function MyOnWizardNext(){ }
function MyOnWizardBack(){ }

Once you have created these two event handlers, you can then write code to expose or hide DIV elements in your Web page in order to create a sequence of pages. For an example of how to create a Web page that uses this technique, see the topic Using Properties and Multiple Pages in the Samples section

The following simple example uses a single, static custom UI page.

The custom UI page cannot be resized by the user, but it will display scrollbars if the content exceeds the size of the hosted browser window. The minimum size of the client area in the custom UI page is 460 pixels wide by 340 pixels high. Microsoft recommends that you author your Web page to fit into those dimensions to avoid forcing the user to use scrollbars to access content.

Following are the basic steps to follow to create the custom UI page:

  1. Write the HTML code to guide the user. Note that, as a part of the <BODY> tag, the code specifies the name of a function to execute when the page loads.
    <HTML>
<HEAD></HEAD>
<BODY onload = "OnLoad()">
This page allows the user to publish the presentation.<BR>
All the values are supplied in script, except <BR>
the name of the presentation, which is supplied<BR>
by the user.<BR>
The presentation must contain content on the video timeline<BR>
or an error will result. <BR>
<BR>
<B>Click the <B> Next </B> button to publish the presentation.</B>
<BR>
</BODY>
</HTML>
  2. Create any HTML elements you will need in order to acquire data from the user. The following example creates a TEXT element to retrieve the presentation name.
    Presentation name:
<INPUT TYPE = "TEXT" ID = "presName" NAME = "presName">
  3. Initialize variables to store the values that correspond to the WebHost object properties, which you will set before publishing the presentation. The following example also specifies the publishing destination and playback address values when declaring those variables.
    // Global variables that correspond to WebHost properties.
var Application;
var WebHost;
var ProfileMgr;
var PubDest = "http://MyServer/MyPath";
var PlayBackLoc = "http://MyServer/MyPath";
  4. When the page loads, specify functions to handle events, create an Application object, check the Producer version for compatibility, and initialize any other globally available objects you need to use. The following example code is contained in the OnLoad function that executes when the custom UI page loads in the hosted browser window.
    // Create the function to handle the Next button event
// in the Publish Wizard.
window.document.OnWizardNext = MyOnWizardNext;

// Test whether the Producer version is compatible with this WebHost.
   var AppVersion = Application.Version;
   if (AppVersion.substring(0,3) != "2.0")
      alert ("Warning: Producer version doesn't match.");

// Set the value of the Application object to window.external
// to gain access to the Producer object model.
Application = window.external;

// Retrieve a WebHost object that represents the current e-service.
WebHost = Application.Project.Properties.PublishWebHost;

// Create a Profile Manager object.
ProfileMgr = Application.ProfileManager;

Note Avoid using the OnLoad function to start time consuming processes because this may cause unexpected behavior in the Publish Wizard.

  5. Write script in the MyOnWizardNext function to specify the property values necessary to publish the presentation:
    // Set the profile to one of the Producer built-in profiles.
// Change this profile if necessary for your content.
var myProfile = ProfileMgr.MediumQualityAudioVideo;
WebHost.AddProfile(myProfile);

// Set the presentation name.
Application.Project.Properties.PublishName = presName.value;

// Set the path for the presentation publish destination.
WebHost.PublishDestination = PubDest;

// Set the path of the playback location, if desired.
// This value is used only when the user wants to preview the published presentation.
WebHost.PlaybackAddress = PlayBackLoc;
  6. Write script in the MyOnWizardNext function to test the publishing parameters. If the parameters are determined to be valid, and a presentation doesn't exist with the same name, execute the publishing process.
       // Use try/catch error handling to verify publish validation.
   try{

   // Verify that a presentation doesn't exist with the same name.
   // Validate publishing parameters.
   var bDoesNotExist = Application.Publisher.ValidatePublishPresentation();

   // Test whether ValidatePublishPresentation was successful.
   if (bDoesNotExist == true){
      // Publish the presentation.
      Application.Publisher.PublishPresentation()
   }

   else{
      // Tell the user the there is a problem.
      alert ("Cannot publish because the name exists.")
   }
   }

   catch(e){
      // Show an error message.
      alert ("There were errors. Publish failed.");
   }
  7. Add code to tell the user the process is complete and close the Publish Wizard:
    // Tell the user it is done.
alert("Publish complete.");

// Get a window object that represents the Publish Wizard.
var WizardWin = Application.Windows.FindByName("PublishWizard");

// Close the Publish Wizard.
Application.Windows(WizardWin).Close();

For the complete working sample that accompanies this topic, see A Complete Simple E-service in the Samples section.


Adding E-services to Producer

In order for the user to be able to utilize your e-service, you must first add the details about the service to the registry on the user's computer. You can either modify the registry directly or use the Producer object model. You can also use either technique to add a Web server that uses the default Publish Wizard user interface. Such Web servers function in an identical fashion to Web servers added manually by the user.

The behavior of the Microsoft Producer Publish Wizard depends upon the values of certain keys contained in the Windows system registry. The root key for the Producer e-services is:

HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts

When the user adds a new Web server from the Publish Wizard, or when an e-service is created using the Learn More button, a new key (called a WebHost) is created in the registry below the WebHosts key. Below each WebHost key, the Profiles key is created and may contain subkeys that identify custom publishing profiles for that particular service.

The following subkeys exist within the each WebHost key. Each subkey corresponds to a property of the WebHost object in the Producer object model:

  • (Default)
  • DiscussionServerURL
  • HTMLBasedUIURL
  • HTMLBasedUIURLReserved
  • ID
  • Password
  • PlaybackAddress
  • PublishDestination
  • WindowsMediaPlaybackAddress
  • WindowsMediaPublishDestination
  • Username

The subkey named HTMLBasedUIURLReserved is generated by Producer. Do not change the value of this subkey. Each Profiles key may contain one or more subkeys that represent specific profiles associated with a particular WebHost key. Each profile subkey is given a name that corresponds to a publishing profile ID number and a value that corresponds to the globally unique identifier (GUID) that uniquely identifies the particular profile.

The following is an illustration of the Microsoft Producer registry keys in the regedit.exe tool.

Microsoft Producer registry keys

The following sections provide details about registering WebHosts on the user's computer:

  • Adding E-services Using the Registry
  • Adding E-services Using the Producer Object Model
  • Adding Web Servers Automatically


Adding E-services Using the Registry

You can add or change WebHost keys in the Windows system registry on the user's computer by creating a special script file with a .reg file name extension, which can be executed on the user's computer to make changes to the registry automatically.

Caution Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

A .reg file is a plain text file that you can create using a text editor, such as Microsoft Notepad. You can simply write the script and save the file with the .reg file name extension or change the file name extension from .txt to .reg using Windows Explorer.

Each .reg file must begin with the same line. Use this text exactly as it appears:

Windows Registry Editor Version 5.00

Next, you can include lines of script to specify keys. If a specified key does not exist, one is created automatically, and any subkeys you specify are written to the registry as well. If the key already exists, then any existing subkeys are modified to match the new values specified in the script. To specify a key, enclose the key name in square brackets:

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\MyWebHost]

The previous example specifies a new key in the registry below the WebHosts key and gives it the name MyWebHost.

Following each key, you can specify subkeys and their values. Whether or not you specify subkeys in your script, a subkey with no value set, named (Default), is always added to the new key in the user's registry.

If you choose to modify the registry in this manner, be certain to provide a different GUID for each ID subkey you create. You can generate GUIDs by using a utility such as guidgen.exe, which is included with Microsoft Visual Studio.

The following example is a complete .reg file that adds a new e-service to Microsoft Producer that can be accessed from the Publish Wizard. The service (and therefore the key) is named MyNewWebHost and specifies the HTMLBasedUIURL subkey value as the Microsoft home page. It also adds a key named Profiles below the MyNewWebHost key.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\MyNewWebHost]
"DiscussionServerURL" = ""
"HTMLBasedUIURL" = "http://www.microsoft.com"
"ID" = "13003B9C-83ED-4c95-B950-D163C33B0C15"
"Password" = ""
"PlaybackLocation" = ""
"PublishDestination" = ""
"WindowsMediaPlaybackAddress" = ""
"WindowsMediaPublishDestination" = ""
"Username" = ""

When you specify a URL for the HTMLBasedUIURL subkey, Producer displays that Web page in the Publish Wizard when the user selects your e-service from the Web server list. You can also choose to specify values in the registry as default values for your e-service. For instance, you can specify default publish profiles for your e-service by adding a Profiles subkey below the associated WebHost key. The following example adds two profiles to the .reg file from the previous example by specifying an index (zero-based) and the GUID for each profile:

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\MyNewWebHost\Profiles]

"0" = "0072853c-d773-452c-b858-6de819043b1d"
"1" = "10aab034-119c-47f6-8930-e6e49601be49"

Once these values exist in the registry on the user's computer, your e-service will automatically publish for both profiles, unless the details change when your script code executes in the custom UI page. Similarly, you can specify other default values, such as the PlaybackLocation or PublishDestination.

For more information about profiles, see the Working with Profiles section.

When you add or change a service by directly modifying the registry on the user's computer, the addition or change takes effect for the next Producer session. This may require the user to close the current Producer session and restart the application. When Producer starts, a dialog box appears that informs the user that a change has occurred and allows the user to accept or reject the change.


Adding E-services Using the Producer Object Model

You can write an HTML document that uses the Producer object model in order to add information about your service to the Windows registry on the user's computer. This Web page (or series of Web pages) can display in the browser window that appears when the user clicks Learn More in the Publish Wizard. This documentation shall refer to this Web page as the "add service" page. For an e-service, the add service page should accomplish at least the following three objectives:

  1. Introduce the user to the e-service.
  2. Prompt the user to install the e-service.
  3. Use the Producer object model to register the e-service.

You can use virtually any HTML syntax in the add service page that you would use in Internet Explorer. This means you can also include HTML controls such as BUTTON elements, TEXT and TEXTAREA elements, SELECT elements, and CHECKBOX elements. You can navigate to as many Web pages as you like from the add service page, so you can actually create a series of pages that add a new e-service. The add service page can be resized by the user, and it shows both horizontal and vertical scrollbars if the authored page exceeds the size of the hosted browser window. The default size of the client area of the browser is approximately 570 pixels wide by 400 pixels high.

Following are the basic steps to follow to create the add service page:

  1. Write HTML code to identify the e-service. For example:
    <HTML>
<HEAD></HEAD>
<BODY>
<!-- Create the Web page the displays in Producer. -->
Service: Simple Custom WebHost <BR>
<BR>
Thanks for choosing this e-service. <BR>
Please click the button below to add this service <BR>
to the <B>Microsoft Producer Publish Wizard</B> as a <BR>
new <B>Web server</B>. <BR>
<BR>
</BODY>
</HTML>
  2. Provide a way for the user to install the service. The following example creates an HTML BUTTON element.
    <INPUT TYPE = "BUTTON" ID = "addWebHost" NAME = "addWebHost" VALUE = "Click to add this service!" onClick = "AddWebHost();">
  3. Get an Application object to gain access to the Producer object model.
    var Application = window.external;
  4. Write the function that adds your service details to the Windows system registry. For the case of a service that provides an HTML user interface, you only need to specify the name of the service as you want it to appear in the Publish Wizard (this is also used as the name of the associated registry key) and the Uniform Resource Locator (URL) for the Web page that functions as the customized user interface when the user chooses to utilize the service. The following example code is contained in the AddWebHost function that executes when the user clicks the button created in step 2.
    /* Add a WebHost using the Options.AddWebHost method.
   Be sure to specify the HTMLBasedUIURL parameter to set
   the Web page that displays when the user selects the new
   WebHost from the user interface. */
Application.Options.AddWebHost("Simple Custom WebHost", "http://MyServer/HTMLUI.htm", true);

    If you specify an empty string ("") as the second parameter, the Publish Wizard uses the default user interface when the user selects the e-service from the Web server list. For more information, see the section Adding Web Servers Automatically.

    The value true for the third parameter permits the new WebHost key to overwrite any existing key having the same name.

  5. You should let the user know when the process has been completed successfully and how to use the new e-service.
    alert("Thank you. This service can now be accessed using the Web server list in the Publish Wizard.");
  6. Close the add service page to allow the user to return to the standard Publish Wizard user interface.
    // Use the Windows.FindByName method to get the index
// of the browser window hosted by Producer.
var nWin = Application.Windows.FindByName("EServiceWindow");

// Retrieve the hosted window object.
var pWin = Application.Windows.Item(nWin);

// Test whether the hosted window was successfully retrieved.
if (pWin){
   // Close the window.
   pWin.Close();
}

For the complete sample that accompanies this topic, see Adding an E-service Using a Learn More Page.


Adding Web Servers Automatically

You can add Web servers to Microsoft Producer that use the default Publish Wizard user interface by modifying the registry on the user's computer. Web servers added in this fashion function like those added manually by the user. The Publish Wizard steps through the default sequence of pages, and the user can change or edit any parameters that appear in the user interface.

You can make the modifications to the registry on the user's computer directly or by using the Producer object model. The process in each case is the same as adding an e-service, except:

  • You don't specify a value for the HTMLBasedUIURL subkey (or WebHost.HTMLBasedUIURL).
  • You must specify values for all the necessary publishing parameters when you register the Web server.

For details about registering Producer e-services on the user's computer, see the section Adding E-services to Producer.


Working with Profiles

A profile is a predefined group of settings that match the content type and bit rate with appropriate audio and video codecs. For example, a publishing profile may specify that a Microsoft Producer presentation be published using a video codec designed for streaming content at 56 kilobits per second (Kbps). Producer ships with the following predefined profile names:

  • HighQualityAudioOnly
  • HighQualityAudioVideo
  • MediumQualityAudioOnly
  • MediumQualityAudioVideo
  • LowQualityAudioOnly
  • LowQualityAudioVideo

The intended use of each profile should be evident from its name. The individual profile details, however, will vary. You can write script code to retrieve information about a particular predefined profile. For instance, you can use Profile.Name to retrieve the descriptive name for each profile:

MyText.value = Profile.Name;

The previous example might display the following text in an HTML TEXT element:

For target audience playback at 56 Kbps.

You can use Profile.Description to retrieve a more detailed description of a particular profile.

alert(Profile.Description);

The previous example might display the following text in a system message box:

Use to create a presentation that contains voice, such as a news presentation. Target audience has a dial-up modem connection.

For a sample e-service that displays detailed information about individual profiles, see the topic Displaying Profile Information.

The Profile Manager

The Microsoft Producer object model includes the ProfileManager object. This object exposes the properties and methods you need to work with profiles. Conceptually, the Profile Manager is a collection of the available profiles that Producer can use to publish a presentation. Each profile in the Profile Manager has an index associated with it. Every profile is also uniquely identified by a globally unique identifier (GUID).

With the Profile Manager you can:

  • Count the number of available profiles
  • Determine the profile type
  • Retrieve a particular profile by GUID or index

For detailed information about the properties and methods associated with the ProfileManager object, see the Object Model Reference section.


Checking the Timeline

If you write code that attempts to publish a Producer presentation by using a profile that is incompatible with the content on the Producer timeline, an error will result. For example, Producer cannot publish a presentation using a video profile type if the content on the timeline consists of only audio clips. There must exist at least one video clip on the timeline for a video profile type to be valid.

You can write code to test whether a particular type of content exists on the Producer timeline. To determine if a video clip exists on the timeline, first create and initialize a variable to hold a Boolean value that represents whether content on the Producer timeline contains video:

var bHasVideo = Application.Project.TimelineHasVideo;

Having tested whether at least one video clip exists on the Producer timeline, you can use that information to determine which profiles are valid to use when publishing the presentation content. This process involves iterating through the list of profiles available in the Profile Manager and testing each one to determine its validity. The following code example determines which profiles are valid for the presentation and adds only the valid profile names as options to an HTML SELECT element named selProfiles. The code makes use of the variable bHasVideo from the previous example.

// Store the count of profiles contained in the Profile Manager.
var nCount = ProfileMgr.Count;

// Test whether the Profile Manager contains profiles.
   if (!nCount > 0){
   // No profiles, alert the user and exit the function.
   alert("Error: No profiles available!");
   return false;
}

// Iterate through the profiles in the Profile Manager collection.
for (var i = 0; i < nCount; i++){
   // Retrieve the profile located at index i.
   var Profile = ProfileMgr.Item(i);

   // If the profile is incompatible with the content,
   // don't add it to the selProfile SELECT element list.
   if (!bHasVideo && Profile.IsVideoProfile)
   continue;
   if (bAudioOnly && Profile.IsAudioProfile)
   continue;

   // Always exclude the profiles that are not publish profiles.
   if (!Profile.IsPublishProfile)
   continue;

   // Add the valid profile to the selProfile SELECT element.
   var oOption = document.createElement("OPTION");
   oOption.text = Profile.Name;
   oOption.value = i;
   selProfile.add(oOption);
}

For the complete sample code that accompanies this topic, see the topic Allowing the User to Select Profiles in the Samples section.


Previewing the Presentation

You can write code that allows the user to preview the published presentation after the publishing process has completed. If the presentation has been published using only one profile, launch a browser window to show the Web page generated by Producer. To do this, append to the publishing path (or the path retrieved by WebHost.PlaybackAddress) an additional slash for HTTP addresses, or two backslashes (you must use a backslash as an escape character) for UNC addresses, to separate the path from the file name. Then append the presentation name and the .htm file name extension.

If the presentation has been published using multiple profiles, you can allow the user to view the presentation at a particular bit rate. To do this, append the following text to the URL:

#profile=index

In the preceding text, index represents a number that corresponds to the index of the profile in the e-service WebHost object. This index is the number retrieved by the Profiles.Item property. The following example creates a variable that contains a URL of a presentation, named "MyPresentation", that specifies playback using the second profile added to the WebHost object:

var URL = http://MyServer/MyPath/MyPresentation.htm#profile=1

You can then use JScript to launch a separate browser window to display the presentation:

window.open(URL);

If you store profile GUIDs for your e-service in the registry, and write your e-service to publish to the stored profiles, Producer only publishes the presentation to the profiles that are valid for the content in the presentation. This can create a unique situation where the WebHost.GetProfiles method retrieves a Profiles object that contains more profiles than have been actually published. In this case, you must exclude the unused profiles from the list of options you present to the user. See the section Checking the Timeline for details about how to exclude profiles that are incompatible with the presentation.


Working with Security Settings

When an e-service calls the Publisher.PublishPresentation method, Producer checks the security settings that have been specified on the Security tab of the Options dialog box, which can be reached from the Tools menu. These settings allow a user to indicate the security zones in which an e-service must be hosted in order to publish a presentation to the Internet, to an intranet, or to the local computer. If Producer determines that the settings conflict with the chosen publishing destination and the location of the e-service, an error will be generated.

This error can be generated when an e-service calls either Publisher.PublishPresentation or Publisher.ValidatePublishPresentation. Other kinds of publishing errors can be generated by these two methods as well.

If the publishing destination is on a server that requires login, for example, the e-service must specify values for WebHost.Name and WebHost.Password. This information can be supplied by the user through form fields, if necessary. When the presentation is published, the login information is transmitted to the server in an encrypted form. If the login information is incorrect, an error is generated.

Note Microsoft recommends using the HTTPS protocol to transmit user name and password information across a network or the Internet.

An error is caught using the JScript try/catch syntax, and the Error object is used to isolate the error and display an appropriate message. For more information about error handling, see the Error object in the Object Model Reference.

In the case of security zone restrictions, it is sometimes useful for an e-service to check the security settings itself before an error is generated. This allows an e-service to alert the user in a timely fashion when an invalid publishing destination is chosen. It also allows an e-service to filter a list of possible publishing destinations so that the user is only offered destinations that are compatible with their security settings.

The example below illustrates how an e-service can use Options.EServicePublishLocalRestrictions and Options.EServicePublishRestrictions to determine whether the security settings will allow publishing to the chosen destination.

<HTML>
<HEAD>
<SCRIPT>

// Set up some convenience variables.
var Application = window.external;
var MyWebHost = Application.Project.Properties.PublishWebHost;
var LocalProfile = Application.ProfileManager.HighQualityAudioVideo;
var RemoteProfile = Application.ProfileManager.MediumQualityAudioVideo;

// Set a constant that indicates the location of the e-service.
// 1 = local computer, 2 = intranet, 3 = Internet
ESERVICEZONE = 3;

</SCRIPT>
</HEAD>
<BODY>

Choose a publish destination:
<SELECT id="PublishZone" name="PublishZone">
   <OPTION value="local" selected="yes">Local Computer</OPTION>
   <OPTION value="remote">Remote Computer</OPTION>
</SELECT>
<INPUT type="button" value="Publish" onClick="publish()">

<SCRIPT language="JScript">

function publish() {
   if (PublishZone == "local") {
      // Test whether the publishing restrictions are
      // too restrictive for the e-service's zone.
      if (Application.Options.EServicePublishLocalRestrictions < ESERVICEZONE) {
         alert("This e-service is not authorized to publish presentations on the local computer. Check your security settings.");
         return;
      }
      // Let the user choose the location on the local computer.
      MyWebHost.PublishDestination = Application.Publisher.ChooseDirectory();
      if (MyWebHost.PublishDestination == "") {
         return;  // The user clicked Cancel.
      }
      MyWebHost.AddProfile(LocalProfile);
   } else {  // PublishZone == "remote"
      // Test whether the publishing restrictions are
      // too restrictive for the e-service's zone.
      if (Application.Options.EServicePublishRestrictions < ESERVICEZONE) {
         alert("This e-service is not authorized to publish presentations on remote computers. Check your security settings.");
         return;
      }
      MyWebHost.PublishDestination = "http://remote_hosting_service";
      MyWebHost.AddProfile(RemoteProfile);
   }
   try {
      Application.Publisher.PublishPresentation();
   } catch (e) {
      alert("There were errors. Publish failed.");
   }
}

</SCRIPT>

</BODY>
</HTML>


Changing the Default Learn More Web Page

You can change the Web page that displays by default when the user clicks Learn More in the Publish Wizard. To do this, create a .reg file that changes the value of the PublishEServiceLearnMoreURL subkey. The following is a sample .reg file that changes the default Learn More Web page to the Microsoft Home page:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Producer\Producer Options]
"PublishEServiceLearnMoreURL" = "www.microsoft.com";


Samples

This section contains working sample code that demonstrates how to perform the various functions necessary to create an e-service. Many of the samples are described in detail in the Programming Guide section.

You can use the following samples as a starting point for creating your e-service.

Sample | Description
The Hello World Sample | Illustrates the minimum functionality to show text in the Publish Wizard hosted browser window.
Adding an E-service Using a Learn More Page | Illustrates registering an e-service on the user's computer using the Producer object model.
A Complete Simple E-service | Illustrates creating a Web page that displays a custom user interface in the Publish Wizard. This page publishes the presentation using a default profile.
Allowing the User to Select Profiles | Illustrates creating a Web page that displays a custom user interface in the Publish Wizard. This page presents the user with a drop-down list box to select a publishing profile.
Using Properties and Multiple Pages | Illustrates creating an e-service that lets the user specify values for two properties. Also illustrates the use of DIV elements to imitate multiple Web pages.
A Complete E-service | Illustrates creating a Web page that displays a custom user interface in the Publish Wizard. This page implements the most common properties and methods used in by an e-service.
Displaying Profile Information | Illustrates how to get information about profile details using the Producer object model.

See Also

  • Producer Object Model


The Hello World Sample

The following sample code creates the registry file that adds the Hello World sample to the Publish Wizard. Be sure to change the HTMLBasedUIURL path to match your server address.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts\HelloWorld]

"HTMLBasedUIURL" = "http://MyServer/MyPath/helloworld.htm"
"ID" = "C1C8024B-3667-4245-BB8C-0556D61D6166"

The following sample code creates the Web page that displays in the Publish Wizard for the Hello World topic:

<HTML>
<HEAD></HEAD>
<BODY>
Hello World!
</BODY>
</HTML>

For more information about this sample, see Getting Started.


Adding an E-service Using a Learn More Page

The following sample code creates a Web page that adds a new e-service to the user's computer. This page is displayed when the user chooses an e-service from the Microsoft Web site. When the user selects this service in the Publish Wizard, the wizard provides the customized user interface specified in Options.AddWebHost. Be sure to replace any URLs with your server address.

<HTML>
<!--
***********************************************
**   This is a simple example of how to add  **
**   an e-service to the Microsoft Producer  **
**   Publish Wizard.                         **
**                                           **
**   The code uses the Producer object model **
**   to create an entry in the user's        **
**   registry that specifies a URL for the   **
**   hosted browser window in the Publish    **
**   Wizard user interface.                  **
***********************************************
-->

<BODY>
<SCRIPT language = "JScript">

// Create a global variable to store the Producer application object.
// Initialize as window.external to get access to the object model.
var Application = window.external;

</SCRIPT>

<!-- Create the Web page that is displayed in Producer. -->

Service: Simple Custom WebHost <BR>
<BR>
Thanks for choosing this e-service. <BR>
Please click the following button to add this service <BR>
to the Microsoft Producer Publish Wizard as a <BR>
new Web Server. <BR>

<BR>

<INPUT TYPE = "BUTTON" ID = "addWebHost" NAME = "addWebHost" VALUE = "Click to add this service!" onClick = "AddWebHost();">

<!-- This is the script that executes when the user clicks the button. -->
<SCRIPT language = "JScript">

function AddWebHost(){

/* Add a WebHost using the Options.AddWebHost method.
   Specify the HTMLBasedUIURL parameter to set the Web page that
   displays when the user selects the new WebHost from the user
   interface. The method returns a WebHost object. */

Application.Options.AddWebHost("Simple Custom WebHost","http://yourserver/HTMLUI.htm", true);

// Tell the user what happened.
alert("Thank you. This service can now be accessed using the Web Server list in the Publish Wizard.");

// Call the function that closes the browser window hosted by Producer.
CloseEServiceWindow();
}

// This is the function that closes the hosted browser window.
function CloseEServiceWindow(){

        // Use the Windows.FindByName method to get the index
        // of the browser window hosted by Producer.
        var nWin = Application.Windows.FindByName("EServiceWindow");

        // Retrieve the hosted window object.
        var pWin = Application.Windows.Item(nWin);

        // Test whether the hosted window was successfully retrieved.
        if (pWin){
                // Close the window.
                pWin.Close();
        }
}

</SCRIPT>
</BODY>
</HTML>

For more information about this sample, see Adding E-services to Producer.


A Complete Simple E-service

The following sample code creates a Web page that is displayed in the hosted browser window that is the custom user interface in the Microsoft Producer Publish Wizard. This is the page that is specified in Options.AddWebHost or by changing the HTMLBasedUIURL WebHost subkey in the registry. Be sure to replace any URLs with your server address and path.

<HTML>
<!--
**************************************************
**  This is a sample of a custom user interface **
**  HTML document. This sample requires that    **
**  content exists on the video timeline. If no **
**  content can be encoded as video, an error   **
**  will result. You can change the profile to  **
**  one of the audio-only profile types when    **
**  appropriate.                                **
**************************************************
-->

<BODY onload = "OnLoad()">
This page allows the user to publish the presentation.<BR>
All the values are supplied in script, except <BR>
the name of the presentation, which is supplied<BR>
by the user.<BR>
The presentation must contain content on the video timeline<BR>
or an error will result. <BR>
<BR>

<!-- This is the TEXT INPUT element that retrieves the name
     of the presentation from the user. -->
Presentation name:
<INPUT TYPE = "TEXT" ID = "presName" NAME = "presName">
<BR>
<BR>
<INPUT TYPE = "BUTTON" VALUE = "List Files to be Published"
   onClick = "Application.Publisher.ShowManifest()">
<BR>
<BR>
Click<B> Next </B>to publish the presentation.
<BR>
<BR>

Publish Destination: http://MyServer/MyPath <BR>
Playback Location: http://MyServer/MyPath <BR>
Profile: MediumQualityAudioVideo

<SCRIPT language = "JScript">

// Global variables that correspond to WebHost properties.
var Application;
var WebHost;
var ProfileMgr;
var PublishDestination = "http://MyServer/MyPath";
var PlaybackAddress = "http://MyServer/MyPath";

// This function executes automatically when Producer loads the page.
function OnLoad(){

   // Create the functions to handle the Next and Back button events
   // in the Publish Wizard.
   window.document.OnWizardNext = MyOnWizardNext;
   window.document.OnWizardBack = MyOnWizardBack;

   // Set the value of the Producer object to window.external
   // to gain access to the Producer object model.
   Application = window.external;

   // Test whether the Producer version is compatible with the WebHost.
   var AppVersion = Application.Version;
   if (AppVersion.substring(0,3) != "2.0")
      alert ("Warning: Producer version doesn't match.");

   // Retrieve a WebHost object that represents the current e-service.
   WebHost = Application.Project.Properties.PublishWebHost;

   // Create a Profile Manager object.
   ProfileMgr = Application.ProfileManager;

}

// This function executes when the user clicks Next in the Publish Wizard UI.
function MyOnWizardNext(){

   // Test whether the user has entered a name for the presentation.
   if (presName.value.length <= 0){
      alert("Please enter a presentation name.");
      return true;
   }

   // Set the profile to one of the Producer built-in profiles.
   // Change this profile if necessary for your content.
   var myProfile = ProfileMgr.MediumQualityAudioVideo;
   WebHost.AddProfile(myProfile);

   // Set the presentation name.
   Application.Project.Properties.PublishName = presName.value;

   // Set the presentation publish destination.
   WebHost.PublishDestination = PublishDestination;

   // Set the playback location.
   WebHost.PlaybackAddress = PlaybackAddress;

   // Call the function that begins the publishing process.
   PublishMe();

   return;
}

// This function executes when the user clicks the Back button in the Publish Wizard UI.
function MyOnWizardBack(){

   // Return to the first page of the Publish Wizard.
   return false;

}

// This function starts the publishing process.
function PublishMe(){
   // Use try/catch error handling to verify publish validation.
   try{

      // Verify that a presentation doesn't exist with the same name.
      var bDoesNotExist = Application.Publisher.ValidatePublishPresentation();

      // Test whether ValidatePublishPresentation was successful.
      if (bDoesNotExist == true){
         // Publish the presentation.
         Application.Publisher.PublishPresentation()

         // Tell the user it is done.
         alert("Publish complete.");

         // Close the wizard.
         ClosePubWiz();
      }

      else{
         // Tell the user the there is a problem.
         alert ("Cannot publish because the name exists.")
      }
   }

   catch(e){

      // Show an error message.
      alert ("There were errors. Publish failed.");
   }
}

// This function closes the Publish Wizard.
function ClosePubWiz(){
   // Get a window object that represents the Publish Wizard.
   var WizardWin = Application.Windows.FindByName("PublishWizard");

   // Close the Publish Wizard.
   Application.Windows(WizardWin).Close();
}

</SCRIPT>

</BODY>
</HTML>

For more information about this sample, see the topic in the Programming Guide section.


Allowing the User to Select Profiles

The following sample code creates a Web page that is displayed in the hosted browser window that is the custom user interface in the Microsoft Producer Publish Wizard. This sample illustrates how to enable the user to select a profile from a list of profiles. The code checks the Producer timeline content and determines which profiles are valid. Be sure to replace any URLs with your server address.

<HTML>
<!--
**************************************************
**  This is a sample of a custom user interface **
**  HTML document. This sample creates a list   **
**  of profiles that are valid for the type of  **
**  content on the Producer presentation time-  **
**  line. The user can select one publishing    **
**  profile from the list.                      **
**************************************************
-->

<BODY onload = "OnLoad()">
This page allows the user to publish the presentation.<BR>
All the values are supplied in script, except <BR>
the name of the presentation and the publish profile, <BR>
which are supplied by the user.<BR>

<BR>

<!-- This is the TEXT INPUT element that retrieves the name
     of the presentation from the user. -->
Presentation name:
<INPUT TYPE = "TEXT" ID = "presName" NAME = "presName">
<BR>

<!-- This SELECT element allows the user to choose a profile from
     Producer's Profile Manager. -->
<SELECT id="selProfile" name="selProfile" onChange="" STYLE="WIDTH: 437px">
   <OPTION VALUE = "a" SELECTED> -- Please select a profile from the list below -- </option>
</SELECT>

<BR><BR>

Publish Destination: http://MyServer/MyPath <BR>
Playback Address: http://MyServer/MyPath

<SCRIPT language = "JScript">

// Global variables that correspond to WebHost properties.
var Application;
var WebHost;
var ProfileMgr;
var PublishDestination = "http://MyServer/MyPath";
var PlaybackAddress = "http://MyServer/MyPath";

// This function executes automatically when Producer loads the page.
function OnLoad(){

   // Create two functions to handle the Next and Back button events
   // in the Publish Wizard.
   window.document.OnWizardNext = MyOnWizardNext;
   window.document.OnWizardBack = MyOnWizardBack;

   // Set the value of the Producer object to window.external
   // to gain access to the Producer object model.
   Application = window.external;

   // Check whether the Producer version is compatible with this WebHost.
   var AppVersion = Application.Version;
   if (AppVersion.substring(0,3) != "2.0")
      alert ("Warning: Producer version doesn't match.");

   // Retrieve a WebHost object that represents the current e-service.
   WebHost = Application.Project.Properties.PublishWebHost;

   // Create a Profile Manager object.
   ProfileMgr = Application.ProfileManager;

   // Create a Project object.
   Project = Application.Project;

   // Fill the selProfile SELECT element with a list of valid profiles.
   PopulateListBox();
}

// This function executes when the user clicks Next in the Publish Wizard UI.
function MyOnWizardNext(){

   // Test whether the user has entered a name for the presentation.
   if (presName.value.length <= 0){
      alert("Please enter a presentation name.");
      return true;
   }

   // Test whether the user has selected a profile.
   if (isNaN(parseInt(selProfile.value))){
      alert("Please select a valid publishing profile.");
      return true;
   }

   // Get the profile from Profile Manager that corresponds
   // to the one the user selected.
   var myProfile = ProfileMgr.Item(selProfile.value)

   // Add the profile to the WebHost object.
   WebHost.AddProfile(myProfile);

   // Set the presentation name.
   Application.Project.Properties.PublishName = presName.value;

   // Set the presentation publish destination.
   WebHost.PublishDestination = PublishDestination;

   // Set the playback location.
   WebHost.PlaybackAddress = PlaybackAddress;

   // Call the function that publishes the presentation.
   PublishMe();

return;
}

// This function executes when the user clicks Back in the Publish Wizard UI.
function MyOnWizardBack() {
   // Navigate to the Publish Wizard first page.
   return false;
}

// This function adds only valid profiles to the selProfile SELECT element list.
function PopulateListBox() {
   // Create a variable to hold a Boolean value
   // that represents whether content on the Producer timeline has video.
   var bHasVideo = Project.TimelineHasVideo;

   // Store the count of profiles contained in the Profile Manaager.
   var nCount = ProfileMgr.Count;

   // Test whether the Profile Manager contains profiles.
   if (!nCount > 0){
      // No profiles, alert the user and exit the function.
      alert("Error: No profiles available!");
      return false;
   }

   // Iterate through the profiles in the Profile Manager collection.
   for (var i = 0; i < nCount; i++){
      // Retrieve the profile located at index i.
      var Profile = ProfileMgr.Item(i);

      // If the profile is incompatible with the content,
      // don't add it to the selProfile SELECT element list.
      if (!bHasVideo && Profile.IsVideoProfile)
      continue;

      if (bHasVideo && Profile.IsAudioProfile)
      continue;

      // Always exclude the profiles that are not publish profiles.
      if(!Profile.IsPublishProfile)
      continue;

      // Add the valid profile to the selProfile SELECT element.
      var oOption = document.createElement("OPTION");
      oOption.text = Profile.Name;
      oOption.value = i;
      selProfile.add(oOption);
   }
}

// This function starts the publishing process.
function PublishMe(){
   // Use try/catch error handling to verify publish validation.
   try{

      // Verify that a presentation doesn't exist with the same name.
      var bDoesNotExist = Application.Publisher.ValidatePublishPresentation();

      // Test whether ValidatePublishPresentation was successful.
      if (bDoesNotExist == true){
         // Publish the presentation.
         Application.Publisher.PublishPresentation()

         // Tell the user it is done.
         alert("Publish complete.");

         // Close the wizard.
         ClosePubWiz();
      }

      else{
         // Tell the user that there is a problem.
         alert ("Cannot publish because the name exists.")
      }
   }

   catch(e){
      // Show an error message.
      alert ("There were errors. Publish failed.");
   }
}

// This function closes the Publish Wizard.
function ClosePubWiz(){
   // Get a window object that represents the Publish Wizard.
   var WizardWin = Application.Windows.FindByName("PublishWizard");

   // Close the Publish Wizard.
   Application.Windows(WizardWin).Close();
}
</SCRIPT>

</BODY>
</HTML>

For more information about this sample, see the Working with Profiles section in the Programming Guide.


Using Properties and Multiple Pages

The following sample code creates a Web page that is displayed in the hosted browser window that is the custom user interface in the Microsoft Producer Publish Wizard. This sample illustrates how to create a custom user interface that uses HTML DIV elements to behave like separate pages. The code also specifies and retrieves two property values: one a default property, the other a custom property. Be sure to replace any URLs with your server address.

<HTML>
<!--
**************************************************
**  This is a sample of a custom user interface **
**  HTML document. This sample requires that    **
**  content exists on the video timeline. If no **
**  content can be encoded as video, an error   **
**  will result. You can change the profile to  **
**  one of the audio-only profile types when    **
**  appropriate.                                **
**                                              **
**  This sample demonstrates handling properties**
**  using the Microsoft Producer object model   **
**  and using multiple pages in the custom HTML **
**  user interface.                             **
**************************************************
-->

<BODY onload = "OnLoad()">

<!-- Create a DIV for the first page. -->
<DIV ID = "page0" NAME = "page0">

This page prompts the user for two property values.<BR>
Copyright is a built-in property. Speaker is a custom property.<BR>
<BR>
Please provide copyright info and the speaker's name.<BR>
<BR>

<!-- These two TEXT elements retrieve the property values. -->
Copyright: <INPUT TYPE = "TEXT" ID = "Copyright" NAME = "Copyright">
Speaker: <INPUT TYPE = "TEXT" ID = "Speaker" NAME = "Speaker">

<BR><BR>
Click <B>Next</B> to review the publishing parameters.

</DIV>

<!-- Create a hidden DIV for the second page. -->
<DIV ID = "page1" NAME = "page1" STYLE = "DISPLAY: none">

Please provide a name for the presentation.<BR>
<BR>
The presentation must contain content on the video timeline<BR>
or an error will result. <BR>
<BR>

<!-- This is the TEXT INPUT element that retrieves the name
     of the presentation from the user. -->
Presentation name:
<INPUT TYPE = "TEXT" ID = "presName" NAME = "presName">

<BR><BR>
Click <B>Next</B> to publish the presentation.
<BR>
<BR>
<DIV ID = "Feedback" NAME = "Feedback" STYLE = "BACKGROUND: yellow"></DIV>

</DIV>

<SCRIPT language = "JScript">

// Global variables that correspond to WebHost properties.
var Application;
var WebHost;
var ProfileMgr;
var PublishDestination = "http://MyServer/MyPath";
var PlaybackAddress = "http://MyServer/MyPath";

// This function executes automatically when Producer loads the page.
function OnLoad(){
   // Create the functions to handle the Next and Back button events
   // in the Publish Wizard.
   window.document.OnWizardNext = OnWizardNext;
   window.document.OnWizardBack = OnWizardBack;

   // Set the value of the Producer object to window.external
   // to gain access to the Producer object model.
   Application = window.external;

   // Check whether the Producer version is compatible with this WebHost.
   var AppVersion = Application.Version;
   if (AppVersion.substring(0,3) != "2.0")
      alert ("Warning: Producer version doesn't match.");

   // Create a Profile Manager object.
   ProfileMgr = Application.ProfileManager;

   // Retrieve a Project.Properties object.
   ProjProp = Application.Project.Properties;

   // Retrieve a WebHost object that represents the current e-service.
   WebHost = ProjProp.PublishWebHost;
}

// This function executes when the user clicks Next in the Publish Wizard UI.
function OnWizardNext(){
   // Store the DIV elements in object variables.
   var page0 = document.all.item("page0");
   var page1 = document.all.item("page1");

   //Test whether the DIV is visible.
   if (page0.style.display == ""){

      // Store the property values the user entered.
      PersistPropertyValues();

      // Hide Page 0,.
      page0.style.display = "none";

      // Show Page 1.
      page1.style.display = "";

      // Display the parameter values in the DIV.
      Feedback.innerHTML += "Publish destination = " + PublishDestination + "<BR>";
      Feedback.innerHTML += "Playback location = " + PlaybackAddress + "<BR>";
      Feedback.innerHTML += "Profile = MediumQualityAudioVideo" + "<BR><BR>";

      // Display the property values in the DIV.
      Feedback.innerHTML += "Copyright: " + ProjProp.Copyright + "<BR>";
      Feedback.innerHTML += "Speaker: " + ProjProp.GetCustomProperty("Speaker");

      return;
   }

   else if (page1.style.display == ""){
      // Test whether the user has entered a name for the presentation.
      if (presName.value.length <= 0){
         alert("Please enter a presentation name.");
         return;
      }

      // Call the function that starts the publishing process.
      PublishMe();
   }
   return false;
}

// This function executes when the user clicks Back in the Publish Wizard UI.
function OnWizardBack(){

   // Store the DIV elements in object variables.
   var page0 = document.all.item("page0");
   var page1 = document.all.item("page1");

   // Test whether Page 0 is visible.
   if (page0.style.display == ""){

      // It's the first page; do nothing.
      return;
   }

   // Test whether Page 1 is visible.
   if (page1.style.display == ""){
      // Hide Page 0.
      Feedback.innerHTML = "";
      page1.style.display = "none";

      // Show Page 1.
      page0.style.display = "";

      return true;
   }
   return false;
}

function PersistPropertyValues(){

   // Test whether the user provided copyright information.
   if (Copyright.value){
      // Persist the copyright information the user provided.
      ProjProp.Copyright = Copyright.value;
   }

   // Create or set the custom property for the speaker name.
   ProjProp.SetCustomProperty("Speaker", Speaker.value);

   return;
}

// This function specifies the property values to publish the presentation.
function PublishMe(){

   // Set the profile to one of the Producer built-in profiles.
   // Change this profile if necessary for your content.
   var myProfile = ProfileMgr.MediumQualityAudioVideo;
   WebHost.AddProfile(myProfile);

   // Set the presentation name.
   Application.Project.Properties.PublishName = presName.value;

   // Set the presentation publish destination.
   WebHost.PublishDestination = PublishDestination;

   // Set the playback location.
   WebHost.PlaybackAddress = PlaybackAddress;

   // Use try/catch error handling to verify publish validation.
   try{

      // Verify that a presentation doesn't exist with the same name.
      var bDoesNotExist = Application.Publisher.ValidatePublishPresentation();

      // Test whether ValidatePublishPresentation was successful.
      if (bDoesNotExist == true){
         // Publish the presentation.
         Application.Publisher.PublishPresentation()

         // Tell the user it is finished.
         alert ("Publish complete.");

         // Close the Publish Wizard window.
         ClosePubWiz();
      }

      else{
         // Tell the user the there is a problem.
         alert ("Cannot publish because the name exists.")
      }
   }

   catch(e){

      // Show an error message.
      alert ("There were errors. Publish failed.");

   }

   return;
}

// This function closes the Publish Wizard.
function ClosePubWiz(){
   // Get a window object that represents the Publish Wizard.
   var WizardWin = Application.Windows.FindByName("PublishWizard");

   // Close the Publish Wizard.
   Application.Windows(WizardWin).Close();
}
</SCRIPT>

</BODY>
</HTML>


A Complete E-service

The following sample code creates a complete custom user interface with multiple pages.

<HTML>
<!--
***************************************
* This is a full sample e-service.    *
* Be certain to change publishing and *
* playback address paths to match your*
* server address and path.            *
***************************************
-->

<BODY onload = "OnLoad()">

<!-- Create a DIV for the first page. -->
<DIV ID = "page0" NAME = "page0">

This page prompts the user for two property values.<BR>
Copyright is a built-in property. Speaker is a custom property.<BR>
<BR>
Please provide copyright info and the speaker's name.<BR>
<BR>

<!-- These two TEXT elements retrieve the property values. -->
Copyright: <INPUT TYPE = "TEXT" ID = "Copyright" NAME = "Copyright">
Speaker: <INPUT TYPE = "TEXT" ID = "Speaker" NAME = "Speaker">

<BR><BR>
Click <B>Next</B> to continue.
</DIV>

<!-- Create a hidden DIV for the second page. -->
<DIV ID = "page1" NAME = "page1" STYLE = "DISPLAY: none">

Please provide a name for the presentation.<BR>
<BR>
<BR>

<!-- This is the TEXT INPUT element that retrieves the name
     of the presentation from the user. -->
Presentation name:
<INPUT TYPE = "TEXT" ID = "presName" NAME = "presName">

<BR>
<BR>
<DIV ID = "Feedback" NAME = "Feedback" STYLE = "BACKGROUND: yellow"></DIV>

<BR>
Click <B>Next</B> to select profiles.

</DIV>
<BR>
<DIV ID = "page2" NAME = "page2" STYLE = "DISPLAY: none">
This page allows the user to select publishing profiles. <BR>
The user can select multiple profiles by holding CTRL <BR>
and clicking the profile names. <BR><BR>

<!-- This SELECT element allows the user to choose profiles from
     Producer's Profile Manager. -->
<SELECT id="selProfile" name="selProfile" size = 5 onChange="" MULTIPLE = "true" STYLE="WIDTH: 437px">
</SELECT>
<BR><BR>
Click <B>Next</B> to review publishing parameters.
</DIV>

<DIV ID = "page3" NAME = "page3" STYLE = "DISPLAY: none">
Publishing to: <BR> <BR>

<DIV ID = "Feedback2" NAME = "Feedback2" STYLE = "BACKGROUND: yellow"></DIV>
<BR><BR>
Click <B>Next</B> to publish the presentation.
<BR><BR>

<!-- This BUTTON element shows the file manifest in a dialog box. -->
<INPUT TYPE = "BUTTON" ID = "ShowFiles" VALUE = "List Files To Be Published" OnClick = "Application.Publisher.ShowManifest();
">
</DIV>

<DIV ID = "page4" STYLE = "DISPLAY: none">
You can preview the published presentation.<BR>
Select a profile and click <B>Preview Presentation</B>.<BR>

<SELECT id="selPreview" name="selPreview"  onChange="" STYLE="WIDTH: 437px">
</SELECT>

<INPUT TYPE = "BUTTON" ID = "pPreview" VALUE = "Preview Presentation" OnClick = "PreviewMe();">
<BR><BR><BR><BR><BR><BR><BR>
Click <B>Back</B> to publish again.<BR>
Click <B>Next</B> to finish.
</DIV>

<SCRIPT language = "JScript">

// Global variables that correspond to WebHost properties.
var Application;
var WebHost;
var ProfileMgr;
var PublishDestination = "http://MyServer/MyPath";
var PlaybackAddress = "http://MyServer/MyPath";

// Other global variables.
var bDoesNotExist; // Stores whether a presentation exists with the same name.
var CurrentPage = 0; // Stores currently visible page number.

// Store the DIV elements in object variables.
var page0 = document.all.item("page0");
var page1 = document.all.item("page1");
var page2 = document.all.item("page2");
var page3 = document.all.item("page3");
var page4 = document.all.item("page4");

// This function executes automatically when Producer loads the page.
function OnLoad(){
   // Create the functions to handle the Next and Back button events
   // in the Publish Wizard.
   window.document.OnWizardNext = MyOnWizardNext;
   window.document.OnWizardBack = MyOnWizardBack;

   // Set the value of the Producer object to window.external
   // to gain access to the Producer object model.
   Application = window.external;

   // Check whether the Producer version is compatible with this WebHost.
   var AppVersion = Application.Version;
   if (AppVersion.substring(0,3) != "2.0")
      alert ("Warning: Producer version doesn't match.");

   // Create a Profile Manager object.
   ProfileMgr = Application.ProfileManager;

   // Create a Project object.
   Project = Application.Project;

   // Retrieve a Project.Properties object.
   ProjProp = Project.Properties;

   // Retrieve a WebHost object that represents the current e-service.
   WebHost = ProjProp.PublishWebHost;

   // Fill in the Copyright property value.
   Copyright.value = ProjProp.Copyright;

   // Fill in the Speaker property value, if it exists.
   // Loop through the list of custom properties.
   for (var i = 0; i < ProjProp.GetCustomPropertyCount(); i++){
      // Test whether the custom property is Speaker.
      if (ProjProp.GetCustomPropertyName(i) == "Speaker"){
         // Retrieve the value.
         Speaker.value = ProjProp.GetCustomProperty("Speaker");
         break;
      }
   }

}

// This function executes when the user clicks Next in the Publish Wizard UI.
function MyOnWizardNext(){

   switch (CurrentPage){

      case 0:
         // Store the property values the user entered.
         PersistPropertyValues();

         HidePage(0);
         ShowPage(1);

         // Display the property values in the DIV.
         Feedback.innerHTML = "";
         Feedback.innerHTML += "Properties:<BR>";
         Feedback.innerHTML += "Copyright: " + ProjProp.Copyright + "<BR>";
         Feedback.innerHTML += "Speaker: " + ProjProp.GetCustomProperty("Speaker");

         return;
         break;

      case 1:
         // Test whether the user has entered a name for the presentation.
         if (presName.value.length <= 0){
            alert("Please enter a presentation name.");

            return;
         }

         try{
            // Set the presentation name.
            ProjProp.PublishName = presName.value;
         }

         catch(e){
            alert("Error. Please correct the name.");
            return;
         }

         HidePage(1);
         ShowPage(2);

         // Fill in the profiles list.
         PopulateListBox();

         return;
         break;

      case 2:

         // Call the function that retrieves and stores the user-selected profiles.
         GetSelectedProfiles();

         // Test whether the user selected a profile.
         if (Application.Project.Properties.PublishWebHost.GetProfiles().Count == 0){
            alert("You must select at least one profile.")
            return;
         }

         HidePage(2);
         ShowPage(3);

         // Display the parameter values in the DIV.
         Feedback2.innerHTML = "";
         Feedback2.innerHTML += "Publish destination = " + PublishDestination + "<BR>";
         Feedback2.innerHTML += "Playback location = " + PlaybackAddress + "<BR>";

         return;
         break;

      case 3:
         // Publish it.
         PublishMe();
         return;
         break;

      case 4:
         // Close the window.
         ClosePubWiz();

         return;
         break;

      default:

         break;
   }

}

// This function executes when the user clicks Back in the Publish Wizard UI.
function MyOnWizardBack(){

   switch (CurrentPage){

      case 0:
         // Return to the first page of the Publish Wizard.
         return false;
         break;

      case 1:
         // Clear the Feedback DIV.
         Feedback.innerHTML = "";

         HidePage(1);
         ShowPage(0);
         return true;
         break;

      case 2:
         HidePage(2);
         ShowPage(1);
         return true;
         break;

      case 3:
         HidePage(3);
         ShowPage(2);
         return true;
         break;

      case 4:
         HidePage(4);
         ShowPage(0);
         return true;
         break;

      default:
         break;
   }
}

// This function adds only valid profiles to the selProfile SELECT element list.
function PopulateListBox(){
   // Create a variable to hold a Boolean value
   // that represents whether content on the Producer timeline has video.
   var bHasVideo = Project.TimelineHasVideo;

   // Store the count of profiles contained in the Profile Manager.
   var nCount = ProfileMgr.Count;

   // Test whether the Profile Manager contains profiles.
   if (!nCount > 0){
      // No profiles, alert the user and exit the function.
      alert("Error: No profiles available!");
      return false;
   }

   // Iterate through the profiles in the Profile Manager collection.
   for (var i = 0; i < nCount; i++){
      // Retrieve the profile located at index i.
      var Profile = ProfileMgr.Item(i);

      // If the profile is incompatible with the content,
      // don't add it to the selProfile SELECT element list.
      if (!bHasVideo && Profile.IsVideoProfile)
      continue;

      if (bHasVideo && Profile.IsAudioProfile)
      continue;

      // Always exclude the profiles that are not publish profiles.
      if(!Profile.IsPublishProfile)
      continue;

      // Add the valid profile to the selProfile SELECT element.
      var oOption = document.createElement("OPTION");
      oOption.text = Profile.Name;
      // Store the index that matches the Profile Manager index for later use.
      oOption.value = i;
      selProfile.add(oOption);
   }
}

function PersistPropertyValues(){

   // Persist the copyright information the user provided.
   ProjProp.Copyright = Copyright.value;

   // Create or set custom property for the speaker name.
   // Remember that custom properties persist with the project.
   ProjProp.SetCustomProperty("Speaker", Speaker.value);

return;
}

// This function specifies the property values to publish the presentation.
function PublishMe(){
   // Use try/catch error handling to verify publish validation.
   try{

      // Set the presentation publish destination.
      WebHost.PublishDestination = PublishDestination;

      // Set the playback location.
      WebHost.PlaybackAddress = PlaybackAddress;

      // Verify that a presentation doesn't exist with the same name.
      bDoesNotExist = Application.Publisher.ValidatePublishPresentation();

      // Test whether ValidatePublishPresentation was successful.
      if (bDoesNotExist == false){

         // Prompt the user for permission to overwrite the presentation.
         var answer = window.confirm("Presentation name exists! OK to overwrite; Cancel to change.");

         switch(answer){

            case true:
               // Go ahead and publish.
               break;

            case false:
               // Allow the user to change the presentation name.
               HidePage(3);
               ShowPage(1);
               return;
         }
      }

      // Publish the presentation.
      Application.Publisher.PublishPresentation();

      // Tell the user it is finished.
      alert ("Publish complete.");

      // Fill the profiles preview list box.
      PopulatePreviewList();

      HidePage(3);
      ShowPage(4);
   }

   catch(e){
      // Test whether the error is a Producer error.
      if (e.number == Application.Error.Number){
         // Display the Producer error.
         alert(Application.Error.Description);
      }

      else {
         // Display the JScript error.
         alert(e.description);
      }
   }

   return;
}

// This function retrieves and stores the profiles selected by the user.
function GetSelectedProfiles(){

   // Remove all profiles from the WebHost.
   Application.Project.Properties.PublishWebHost.RemoveAllProfiles();

   // Get the count of options in the select control.
   var selCount = selProfile.options.length;

   // Loop through the options list.
   for (var i = 0; i < selCount; i++){
      // Test whether the option is selected.
      if (selProfile.options[i].selected){
         // Get the profile by index.
         var prof = Application.ProfileManager.Item(selProfile.options[i].value);

         // Add the profile to the WebHost.
         WebHost.AddProfile(prof);
      }
   }

   return;
}

// This function opens a browser window to preview the presentation.
function PreviewMe(){

   // Build the URL of the presentation to preview.
   // Start with the playback address.
   var URL = WebHost.PlaybackAddress;

   // Add the presentation name.
   URL += "/";
   URL += ProjProp.PublishName;

   // Add the file name extension and the #profile parameter name.
   URL += ".htm#profile=";

   // Add the index of the selected profile.
   URL += selPreview.value;

   // Launch the presentation in a separate window.
   window.open(URL);
}

// This function fills the selPreview list box.
function PopulatePreviewList(){
   // Remove existing options from the list.
   for (var i = selPreview.length; i >0 ; i--){
      selPreview.remove(i-1);
   }

   // Get an array of Profile objects from the WebHost.
   var whProfiles = WebHost.GetProfiles();

   // Loop through the array of profiles.
   for (var i=0; i < whProfiles.Count; i++){
      // Add each profile to the selPreview SELECT element.
      var oOption = document.createElement("OPTION");
      oOption.text = whProfiles.item(i).Name;
      // Use the index in the order it exists in the WebHost.
      oOption.value = i;
      selPreview.add(oOption);
   }
}

// This function shows the DIV page passed to the function.
function ShowPage(page){
   // Update the variable that stores the currently visible page number.
   CurrentPage = page;

   switch (page){

      case 0:
         page0.style.display = "";
         break;

      case 1:
         page1.style.display = "";
         break;

       case 2:
         page2.style.display = "";
         break;

      case 3:
         page3.style.display = "";
         break;

      case 4:
         page4.style.display = "";
         break;

      default:
         break;
   }
}

// This function hides the DIV page passed to the function.
function HidePage(page){

   switch (page){

      case 0:
         page0.style.display = "none";
         break;

      case 1:
         page1.style.display = "none";
         break;

      case 2:
         page2.style.display = "none";
         break;

      case 3:
         page3.style.display = "none";
         break;

      case 4:
         page4.style.display = "none";
         break;

      default:
         break;
   }

}

// This function closes the Publish Wizard.
function ClosePubWiz(){
   // Get a window object that represents the Publish Wizard.
   var WizardWin = Application.Windows.FindByName("PublishWizard");

   // Close the Publish Wizard.
   Application.Windows(WizardWin).Close();
}
</SCRIPT>

</BODY>
</HTML>


Displaying Profile Information

The following sample code creates a Web page that is displayed in the hosted browser window that is the custom user interface in the Microsoft Producer Publish Wizard. This sample illustrates how to use the Producer object model to display information about the available publishing profiles.

<!--
**************************************************
**  This is a sample of a custom user interface **
**  HTML document. This sample displays a list  **
**  of all available profiles and their         **
**  properties.                                 **
**************************************************
-->
<HTML>
<BODY>

<SCRIPT language="JScript">
// Get the ProfileManager object.
var ProfileMgr = window.external.ProfileManager;
// Get the number of Profile objects in the ProfileManager.
var ProfileCount = ProfileMgr.Count;
// Create some variables to hold the Profile and StreamConfig indexes.
var ProfileIndex, StreamIndex;

// Iterate through all available Profile objects.
for (ProfileIndex = 0; ProfileIndex < ProfileCount; ProfileIndex++) {
   // Get the next Profile.
   var Profile = ProfileMgr.Item(ProfileIndex);
   // Check to see whether it's a publish profile, and skip it if it isn't.
   if (!Profile.IsPublishProfile) continue;
   // Get the number of StreamConfig objects in this Profile.
   var StreamCount = Profile.Count;
   // Display the properties of this Profile.
   document.write("<H1>" + Profile.Name + "</H1>");
   document.write("<H3>ProfileID (GUID) = " + Profile.ProfileID + "</H3>");
   document.write("<I>" + Profile.Description + "</I><BR><BR>");
   document.write("TotalBitrate = " + Profile.TotalBitrate + "<BR>");
   document.write("AudioStreamCount = " + Profile.AudioStreamCount + "<BR>");
   document.write("VideoStreamCount = " + Profile.VideoStreamCount + "<BR>");
   document.write("Count = " + StreamCount + "<BR>");

   document.write("IsAudioProfile = " + (Profile.IsAudioProfile?"yes":"no") + "<BR>");
   document.write("IsVideoProfile = " + (Profile.IsVideoProfile?"yes":"no") + "<BR>");

   /* The properties that determine quality don't actually determine the
      quality of the profile. These properties test whether the profile is one
      of the Producer standard profiles of the particular quality type. */
   document.write("IsLowQuality = " + (Profile.IsLowQuality?"yes":"no") + "<BR>");
   document.write("IsMediumQuality = " + (Profile.IsMediumQuality?"yes":"no") + "<BR>");
   document.write("IsHighQuality = " + (Profile.IsHighQuality?"yes":"no") + "<BR>");
   // Display a heading for the StreamConfig section, and indent its contents.
   document.write("<BR><H2>StreamConfigs</H2><BLOCKQUOTE>");
   // Iterate through all available StreamConfig objects in this Profile.
   for (StreamIndex = 0; StreamIndex < StreamCount; StreamIndex++) {
      // Get the next StreamConfig.
      var Stream = ProfileMgr.Item(ProfileIndex).Item(StreamIndex);
      // Display the properties of this StreamConfig.
      document.write("<H3>" + Stream.Name + "</H3>");
      document.write("BitRate = " + Stream.BitRate + "<BR>");
      document.write("BitsPerSample = " + Stream.BitsPerSample + "<BR>");
      document.write("BufferWindow = " + Stream.BufferWindow + "<BR>");
      document.write("ChannelCount = " + Stream.ChannelCount + "<BR>");
      document.write("ConnectionName = " + Stream.ConnectionName + "<BR>");
      document.write("FramesPerSecond = " + Stream.FramesPerSecond + "<BR>");
      document.write("MaxKeyFrameSpacing = " + Stream.MaxKeyFrameSpacing + "<BR>");
      document.write("MediaType = " + Stream.MediaType + "<BR>");
      document.write("Number = " + Stream.Number + "<BR>");
      document.write("Quality = " + Stream.Quality + "<BR>");
      document.write("SampleSize = " + Stream.SampleSize + "<BR>");
      document.write("SamplesPerSecond = " + Stream.SamplesPerSecond + "<BR>");
      // Test whether it's a video profile.
      // BitCount, VideoHeight, and VideoWidth are only applicable to video.
      if (Profile.IsVideoProfile) {
         document.write("BitCount = " + Stream.BitCount + "<BR>");
         document.write("VideoHeight = " + Stream.VideoHeight + "<BR>");
         document.write("VideoWidth = " + Stream.VideoWidth + "<BR>");
      }
   }
   // End the indented block.
   document.write("</BLOCKQUOTE>");
}
</SCRIPT>

</BODY>
</HTML>


Object Model Reference

The Microsoft Producer SDK exposes the following objects.

Object | Description
Application | Represents the root of the Microsoft Producer object model.
Error | Represents errors that can occur when using the Producer object model.
Options | Keeps track of WebHost objects and associated properties.
Profile | Represents a collection of StreamConfig objects representing settings for the different tracks of a presentation.
ProfileManager | Represents the collection of all Profile objects available to Producer.
Profiles | Represents a collection of Profile objects.
Project | Represents a Producer project.
Properties | Stores metadata about a project, including various standard properties as well as user-defined properties.
Publisher | Provides methods to support the publishing process.
StreamConfig | Represents an audio or video stream and its associated attributes.
WebHost | Represents an e-service.
Window | Provides a method for closing the browser window that opens when the user clicks the Learn More button in the Publish Wizard.
Windows | Represents a collection of Window objects.

See Also

  • Producer Object Model


Application Object

The Application object represents the root of the Microsoft Producer object model.

The Application object exposes the following properties.

Property | Description
Error | Retrieves the global Error object.
Options | Retrieves the global Options object.
ProfileManager | Retrieves the global ProfileManager object.
Project | Retrieves the global Project object.
Publisher | Retrieves the global Publisher object.
Version | Retrieves the Microsoft Producer version number.
Windows | Retrieves a collection of Window objects.

The Application object is accessed through the following JScript property.

JScript Object | Property
window | external

See Also

  • Object Model Reference


Application.Error

The Error property retrieves the global Error object.

Syntax

Application.Error

Possible Values

This property is a read-only Error object.

See Also

  • Application Object
  • Error Object


Application.Options

The Options property retrieves the global Options object.

Syntax

Application.Options

Possible Values

This property is a read-only Options object.

See Also

  • Application Object
  • Options Object


Application.ProfileManager

The ProfileManager property retrieves the global ProfileManager object.

Syntax

Application.ProfileManager

Possible Values

This property is a read-only ProfileManager object.

See Also

  • Application Object
  • ProfileManager Object


Application.Project

The Project property retrieves the global Project object.

Syntax

Application.Project

Possible Values

This property is a read-only Project object.

See Also

  • Application Object
  • Project Object


Application.Publisher

The Publisher property retrieves the global Publisher object.

Syntax

Application.Publisher

Possible Values

This property is a read-only Publisher object.

See Also

  • Application Object
  • Publisher Object


Application.Version

The Version property retrieves the Microsoft Producer version number.

Syntax

Application.Version

Possible Values

This property is a read-only String in the following format: "2.0.XXXX.0" where XXXX represents the build number.

Remarks

The version number can be tested to confirm that an e-service is being used with the version of Microsoft Producer for which it was designed.

Example

This example illustrates how to check the beginning of the version string to determine whether the e-service might be incompatible with the user's version of Producer:

Version = window.external.Version;
if (Version.substring(0,3) != "2.0") {
  alert ("This e-service has not been tested against Microsoft Producer Version " + Version + ". You may experience problems.");
}

See Also

  • Application Object


Application.Windows

The Windows property retrieves a collection of Window objects.

Syntax

Application.Windows

Possible Values

This property is a read-only Windows object.

See Also

  • Application Object
  • Windows Object


Error Object

The Error object represents errors that can occur when using the Microsoft Producer object model.

The Error object exposes the following properties.

Property | Description
Description | Retrieves a description of the most recent Producer error.
Number | Retrieves the error number of the most recent Producer error.

The Error object is accessed through the following property.

Object | Property
Application | Error

See Also

  • Object Model Reference


Error.Description

The Description property retrieves a description of the most recent Producer error.

Syntax

Application.Error.Description

Possible Values

This property is a read-only String.

Remarks

When an error occurs in Producer, the Number and Description properties of the Error object are automatically set. In a JScript try/catch block, the number property of the script error object must be compared to the Number property of the Producer Error object to determine whether the error that occurred is actually a Producer error and not a JScript error. If it is a Producer error, the Error.Description property will contain additional information.

Example

This example illustrates how to use the Error object:

try {
  // The code that might generate an error goes here.
} catch (e) {
  // Test whether the error is a Producer error.
  if (e.number == Application.Error.Number){
    // Display the Producer error.
    alert(Application.Error.Description);
  } else {
    // Display the JScript error.
    alert(e.description);
  }
}

See Also

  • Error Object


Error.Number

The Number property retrieves the error number of the most recent Producer error.

Syntax

Application.Error.Number

Possible Values

This property is a read-only Number.

Remarks

When an error occurs in Producer, the Number and Description properties of the Error object are automatically set. In a JScript try/catch block, the number property of the script error object must be compared to the Number property of the Producer Error object to determine whether the error that occurred is actually a Producer error and not a JScript error. If it is a Producer error, the Error.Description property will contain additional information.

Example

This example illustrates how to use the Error object:

try {
  // The code that might generate an error goes here.
} catch (e) {
  // Test whether the error is a Producer error.
  if (e.number == Application.Error.Number){
    // Display the Producer error.
    alert(Application.Error.Description);
  } else {
    // Display the JScript error.
    alert(e.description);
  }
}

See Also

  • Error Object


Options Object

The Options object keeps track of WebHost objects and associated properties.

The Options object exposes the following properties.

Property | Description
EServicePublishLocalRestrictions | Retrieves a value indicating the zone or zones in which an e-service must be hosted in order to publish a project to the local computer.
EServicePublishRestrictions | Retrieves a value indicating the zone or zones in which an e-service must be hosted in order to publish a project to the Internet or an intranet.
WebHostByID | Retrieves the WebHost object with the specified ID.

The Options object exposes the following methods.

Method | Description
AddWebHost | Adds a WebHost with the specified name and HTMLBasedUIURL to the registry, and returns a new WebHost object.
RemoveWebHost | Removes the WebHost with the specified name.

The Options object is accessed through the following property.

Object | Property
Application | Options

See Also

  • Object Model Reference


Options.AddWebHost

The AddWebHost method adds a WebHost with the specified name and HTMLBasedUIURL to the registry, and returns a new WebHost object. An existing WebHost with the same name is only overwritten if the overwrite parameter is set to true.

Syntax

Application.Options.AddWebHost(name, HTMLBasedUIURL, overwrite)

Parameters

name

String containing the name of the WebHost to add.

HTMLBasedUIURL

String containing the value used to set the WebHost.HTMLBasedUIURL property. This value can be either a URL indicating the user-interface location, or the empty string (""), which indicates that the default standard user interface will be used.

overwrite

Boolean indicating whether an existing WebHost with the specified name should be overwritten.

Return Values

This method returns a WebHost object.

See Also

  • Options Object
  • WebHost Object
  • WebHost.HTMLBasedUIURL


Options.EServicePublishLocalRestrictions

The EServicePublishLocalRestrictions property retrieves a value indicating the zone or zones in which an e-service must be hosted in order to publish a project to the local computer.

Syntax

Application.Options.EServicePublishLocalRestrictions

Possible Values

This property is a read-only Number.

Value | Description
0 | Local computer only
1 | Intranet or local computer
2 | Internet, intranet, or local computer

Remarks

This property corresponds to a setting on the Security tab of the Options dialog box, which can be accessed from the Tools menu.

Example

The following example illustrates the use of this property:

<HTML>
<HEAD>
<SCRIPT>

// Set up some convenience variables.
var Application = window.external;
var MyWebHost = Application.Project.Properties.PublishWebHost;
var LocalProfile = Application.ProfileManager.HighQualityAudioVideo;
var RemoteProfile = Application.ProfileManager.MediumQualityAudioVideo;

// Set a constant that indicates the location of the e-service.
// 1 = local computer, 2 = intranet, 3 = Internet
ESERVICEZONE = 3;

</SCRIPT>
</HEAD>
<BODY>

Choose a publish destination:
<SELECT id="PublishZone" name="PublishZone">
   <OPTION value="local" selected="yes">Local Computer</OPTION>
   <OPTION value="remote">Remote Computer</OPTION>
</SELECT>
<INPUT type="button" value="Publish" onClick="publish()">

<SCRIPT language="JScript">

function publish() {
   if (PublishZone == "local") {
      // Test whether the publishing restrictions are
      // too restrictive for the e-service's zone.
      if (Application.Options.EServicePublishLocalRestrictions < ESERVICEZONE) {
         alert("This e-service is not authorized to publish presentations on the local computer. Check your security settings.");
         return;
      }
      // Let the user choose the location on the local computer.
      MyWebHost.PublishDestination = Application.Publisher.ChooseDirectory();
      if (MyWebHost.PublishDestination == "") {
         return;  // The user clicked Cancel.
      }
      MyWebHost.AddProfile(LocalProfile);
   } else {  // PublishZone == "remote"
      // Test whether the publishing restrictions are
      // too restrictive for the e-service's zone.
      if (Application.Options.EServicePublishRestrictions < ESERVICEZONE) {
         alert("This e-service is not authorized to publish presentations on remote computers. Check your security settings.");
         return;
      }
      MyWebHost.PublishDestination = "http://remote_hosting_service";
      MyWebHost.AddProfile(RemoteProfile);
   }
   try {
      Application.Publisher.PublishPresentation();
   } catch (e) {
      alert("There were errors. Publish failed.");
   }
}

</SCRIPT>

</BODY>
</HTML>

See Also

  • Options Object


Options.EServicePublishRestrictions

The EServicePublishRestrictions property retrieves a value indicating the zone or zones in which an e-service must be hosted in order to publish a project to the Internet or an intranet.

Syntax

Application.Options.EServicePublishRestrictions

Possible Values

This property is a read-only Number.

Value | Description
0 | Local computer only
1 | Intranet or local computer
2 | Internet, intranet, or local computer

Remarks

This property corresponds to a setting on the Security tab of the Options dialog box, which can be accessed from the Tools menu.

Example

The following example illustrates the use of this property:

<HTML>
<HEAD>
<SCRIPT>

// Set up some convenience variables.
var Application = window.external;
var MyWebHost = Application.Project.Properties.PublishWebHost;
var LocalProfile = Application.ProfileManager.HighQualityAudioVideo;
var RemoteProfile = Application.ProfileManager.MediumQualityAudioVideo;

// Set a constant that indicates the location of the e-service.
// 1 = local computer, 2 = intranet, 3 = Internet
ESERVICEZONE = 3;

</SCRIPT>
</HEAD>
<BODY>

Choose a publish destination:
<SELECT id="PublishZone" name="PublishZone">
   <OPTION value="local" selected="yes">Local Computer</OPTION>
   <OPTION value="remote">Remote Computer</OPTION>
</SELECT>
<INPUT type="button" value="Publish" onClick="publish()">

<SCRIPT language="JScript">

function publish() {
   if (PublishZone == "local") {
      // Test whether the publishing restrictions are
      // too restrictive for the e-service's zone.
      if (Application.Options.EServicePublishLocalRestrictions < ESERVICEZONE) {
         alert("This e-service is not authorized to publish presentations on the local computer. Check your security settings.");
         return;
      }
      // Let the user choose the location on the local computer.
      MyWebHost.PublishDestination = Application.Publisher.ChooseDirectory();
      if (MyWebHost.PublishDestination == "") {
         return;  // The user clicked Cancel.
      }
      MyWebHost.AddProfile(LocalProfile);
   } else {  // PublishZone == "remote"
      // Test whether the publishing restrictions are
      // too restrictive for the e-service's zone.
      if (Application.Options.EServicePublishRestrictions < ESERVICEZONE) {
         alert("This e-service is not authorized to publish presentations on remote computers. Check your security settings.");
         return;
      }
      MyWebHost.PublishDestination = "http://remote_hosting_service";
      MyWebHost.AddProfile(RemoteProfile);
   }
   try {
      Application.Publisher.PublishPresentation();
   } catch (e) {
      alert("There were errors. Publish failed.");
   }
}

</SCRIPT>

</BODY>
</HTML>

See Also

  • Options Object


Options.RemoveWebHost

The RemoveWebHost method removes the WebHost with the specified name.

Syntax

Application.Options.RemoveWebHost(name)

Parameters

name

String containing the name of the WebHost to remove.

Return Values

This method does not return a value.

See Also

  • Options Object
  • WebHost Object


Options.WebHostByID

The PublishEServiceDirectoryURL property retrieves the WebHost object with the specified ID.

Syntax

Application.Options.WebHostByID(ID)

Parameters

ID

String containing the GUID of the WebHost object to retrieve.

Possible Values

This property is a read-only WebHost object.

See Also

  • Options Object
  • WebHost Object


Profile Object

The Profile object represents a collection of StreamConfig objects, which represent settings for different tracks of a presentation. These settings can be used by an e-service to publish a presentation.

The Profile object exposes the following properties.

Property | Description
Application | Retrieves the current Application object.
AudioStreamCount | Retrieves the number of audio streams in this Profile.
Count | Retrieves the total number of streams in this Profile.
Description | Specifies or retrieves the description of this Profile.
IsAudioProfile | Retrieves a value indicating whether this Profile is suitable for publishing or recording projects that contain audio tracks only.
IsHighQuality | Retrieves a value indicating whether this is one of the standard high-quality Profile objects.
IsLowQuality | Retrieves a value indicating whether this is one of the standard low-quality Profile objects.
IsMediumQuality | Retrieves a value indicating whether this is one of the standard medium-quality Profile objects.
IsPublishProfile | Retrieves a value indicating whether this is a publish Profile.
IsVideoProfile | Retrieves a value indicating whether this Profile supports video.
Item | Retrieves the StreamConfig object with the specified index.
Name | Specifies or retrieves the name of this Profile.
ProfileID | Retrieves the GUID of this Profile.
TotalBitrate | Retrieves the sum of the bit rates of all the streams in this Profile.
VideoStreamCount | Retrieves the number of video streams in this Profile.
IsSmartRecompressionProfile | Retrieves a value indicating whether this Profile is the smart recompression Profile.
IsV7Profile | Retrieves a value indicating whether the video codec used in this Profile is the Windows Media Video 7 codec.
IsV8Profile | Retrieves a value indicating whether the video codec used in this Profile is the Windows Media Video 8 codec.
IsV9Profile | Retrieves a value indicating whether the video codec used in this Profile is the Windows Media Video 9 codec.
IsV9VoiceProfile | Retrieves a value indicating whether the audio codec used for this Profile is the Windows Media Audio 9 codec.
IsWebStream | Retrieves a value indicating whether this Profile creates a rich-media streaming presentation.

The Profile object exposes the following methods.

Method | Description
Find | Retrieves the index of the specified StreamConfig object.
GetStreamByNumber | Retrieves the StreamConfig object with the specified user-defined number.

The Profile object is accessed through the following properties and methods.

Object | Property or method
ProfileManager | HighQualityAudioOnly, HighQualityAudioVideo, Item, ItemByID, LowQualityAudioOnly, LowQualityAudioVideo, MediumQualityAudioOnly, and MediumQualityAudioVideo.

See Also

  • Object Model Reference


Profile.Application

The Application property retrieves the current Application object.

Syntax

Application.ProfileManager.Item(profileIndex).Application

Possible Values

This property is a read-only Application object.

See Also

  • Application Object
  • Profile Object


Profile.AudioStreamCount

The AudioStreamCount property retrieves the number of audio streams in this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).AudioStreamCount

Possible Values

This property is a read-only Number (long).

See Also

  • Profile Object


Profile.Count

The Count property retrieves the total number of streams in this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).Count

Possible Values

This property is a read-only Number (long).

See Also

  • Profile Object


Profile.Description

The Description property specifies or retrieves the description of this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).Description

Possible Values

This property is a read/write String.

See Also

  • Profile Object


Profile.Find

The Find method retrieves the index of the specified StreamConfig object.

Syntax

Application.ProfileManager.Item(profileIndex).Find(streamConfig)

Parameters

streamConfig

StreamConfig object whose index is to be retrieved.

Return Values

This method returns a Number (int).

See Also

  • Profile Object
  • StreamConfig Object


Profile.GetStreamByNumber

The GetStreamByNumber method retrieves the StreamConfig object with the specified user-defined number.

Syntax

Application.ProfileManager.Item(profileIndex).GetStreamByNumber(number)

Parameters

number

Number containing the user-defined number of the StreamConfig object to retrieve.

Return Values

This method returns a StreamConfig object.

See Also

  • Profile Object
  • StreamConfig Object


Profile.IsAudioProfile

The IsAudioProfile property retrieves a value indicating whether this Profile is suitable for publishing or recording projects that contain audio tracks only.

Syntax

Application.ProfileManager.Item(profileIndex).IsAudioProfile

Possible Values

This property is a read-only Boolean.

Remarks

When the Profile.IsAudioProfile property is true, the Profile.IsVideoProfile and Profile.IsScreenCaptureProfile properties will be false.

See Also

  • Profile Object


Profile.IsHighQuality

The IsHighQuality property retrieves a value indicating whether this is one of the standard high-quality Profile objects.

Syntax

Application.ProfileManager.Item(profileIndex).IsHighQuality

Possible Values

This property is a read-only Boolean.

Example

This example illustrates how this property can be used to filter the collection of profiles so that only profiles of a particular quality are added to the PublishWebHost object:

var Application = window.external;
var ProfileMgr = Application.ProfileManager;
var bHasVideo = Application.Project.TimelineHasVideo;
for (var i = 0; i < ProfileMgr.Count; i++) {
   var Profile = ProfileMgr.Item(i);
   // Filter out audio profiles for video projects.
   if (bHasVideo && Profile.IsAudioProfile) continue;
   // Filter out video profiles for audio projects.
   if (!bHasVideo && Profile.IsVideoProfile) continue;
   // Add any remaining high-quality publishing profiles to the Web host.
   if (Profile.IsHighQuality && Profile.IsPublishProfile) {
      Application.Project.Properties.PublishWebHost.AddProfile(Profile);
   }
}

See Also

  • Profile Object


Profile.IsLowQuality

The IsLowQuality property retrieves a value indicating whether this is one of the standard low-quality Profile objects.

Syntax

Application.ProfileManager.Item(profileIndex).IsLowQuality

Possible Values

This property is a read-only Boolean.

Example

This example illustrates how this property can be used to filter the collection of profiles so that only profiles of a particular quality are added to the PublishWebHost object:

var Application = window.external;
var ProfileMgr = Application.ProfileManager;
var bHasVideo = Application.Project.TimelineHasVideo;
for (var i = 0; i < ProfileMgr.Count; i++) {
   var Profile = ProfileMgr.Item(i);
   // Filter out audio profiles for video projects.
   if (bHasVideo && Profile.IsAudioProfile) continue;
   // Filter out video profiles for audio projects.
   if (!bHasVideo && Profile.IsVideoProfile) continue;
   // Add any remaining low-quality publishing profiles to the Web host.
   if (Profile.IsLowQuality && Profile.IsPublishProfile) {
      Application.Project.Properties.PublishWebHost.AddProfile(Profile);
   }
}

See Also

  • Profile Object


Profile.IsMediumQuality

The IsMediumQuality property retrieves a value indicating whether this is one of the standard medium-quality Profile objects.

Syntax

Application.ProfileManager.Item(profileIndex).IsMediumQuality

Possible Values

This property is a read-only Boolean.

Example

This example illustrates how this property can be used to filter the collection of profiles so that only profiles of a particular quality are added to the PublishWebHost object:

var Application = window.external;
var ProfileMgr = Application.ProfileManager;
var bHasVideo = Application.Project.TimelineHasVideo;
for (var i = 0; i < ProfileMgr.Count; i++) {
   var Profile = ProfileMgr.Item(i);
   // Filter out audio profiles for video projects.
   if (bHasVideo && Profile.IsAudioProfile) continue;
   // Filter out video profiles for audio projects.
   if (!bHasVideo && Profile.IsVideoProfile) continue;
   // Add any remaining medium-quality publishing profiles to the Web host.
   if (Profile.IsMediumQuality && Profile.IsPublishProfile) {
      Application.Project.Properties.PublishWebHost.AddProfile(Profile);
   }
}

See Also

  • Profile Object


Profile.IsPublishProfile

The IsPublishProfile property retrieves a value indicating whether this is a publish Profile.

Syntax

Application.ProfileManager.Item(profileIndex).IsPublishProfile

Possible Values

This property is a read-only Boolean.

Remarks

When this property is true, the profile will appear in the Publish Wizard's bit-rate selection page.

See Also

  • Profile Object


Profile.IsSmartRecompressionProfile

The IsSmartRecompressionProfile property retrieves a value indicating whether this Profile is the smart recompression Profile.

Syntax

Application.ProfileManager.Item(profileIndex).IsSmartRecompressionProfile

Possible Values

This property is a read-only Boolean.

See Also

  • Publisher.SmartRecompressionProfile
  • Profile Object


Profile.IsV7Profile

The IsV7Profile property retrieves a value indicating whether the video codec used in this Profile is the Windows Media Video 7 codec.

Syntax

Application.ProfileManager.Item(profileIndex).IsV7Profile

Possible Values

This property is a read-only Boolean.

See Also

  • Profile.IsV8Profile
  • Profile.IsV9Profile
  • Profile.IsV9VoiceProfile
  • Profile.IsVideoProfile
  • Profile Object


Profile.IsV8Profile

The IsV8Profile property retrieves a value indicating whether the video codec used in this Profile is the Windows Media Video 8 codec.

Syntax

Application.ProfileManager.Item(profileIndex).IsV8Profile

Possible Values

This property is a read-only Boolean.

See Also

  • Profile.IsV7Profile
  • Profile.IsV9Profile
  • Profile.IsV9VoiceProfile
  • Profile.IsVideoProfile
  • Profile Object


Profile.IsV9Profile

The IsV9Profile property retrieves a value indicating whether the video codec used in this Profile is the Windows Media Video 9 codec.

Syntax

Application.ProfileManager.Item(profileIndex).IsV9Profile

Possible Values

This property is a read-only Boolean.

See Also

  • Profile.IsV7Profile
  • Profile.IsV8Profile
  • Profile.IsV9VoiceProfile
  • Profile.IsVideoProfile
  • Profile Object


Profile.IsV9VoiceProfile

The IsV9VoiceProfile property retrieves a value indicating whether the audio codec used for this Profile is the Windows Media Audio 9 codec.

Syntax

Application.ProfileManager.Item(profileIndex).IsV9VoiceProfile

Possible Values

This property is a read-only Boolean.

See Also

  • Profile.IsV7Profile
  • Profile.IsV8Profile
  • Profile.IsV9Profile
  • Profile.IsVideoProfile
  • Profile Object


Profile.IsVideoProfile

The IsVideoProfile property retrieves a value indicating whether this Profile is suitable for publishing or recording projects that contain video tracks.

Syntax

Application.ProfileManager.Item(profileIndex).IsVideoProfile

Possible Values

This property is a read-only Boolean.

Remarks

When the Profile.IsVideoProfile property is true, the Profile.IsAudioProfile and Profile.IsScreenCaptureProfile properties will be false.

See Also

  • Profile.IsV7Profile
  • Profile.IsV8Profile
  • Profile.IsV9Profile
  • Profile.IsV9VoiceProfile
  • Profile Object


Profile.IsWebStream

The IsWebStream property retrieves a value indicating whether this Profile creates a rich-media streaming presentation.

Syntax

Application.ProfileManager.Item(profileIndex).IsWebStream

Possible Values

This property is a read-only Boolean.

See Also

  • Profile Object


Profile.Item

The Item property retrieves the StreamConfig object with the specified index.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex)

Parameters

streamIndex

Number containing the index of the StreamConfig object to retrieve.

Possible Values

This property is a read-only StreamConfig object.

See Also

  • Profile Object
  • StreamConfig Object


Profile.Name

The Name property specifies or retrieves the name of this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).Name

Possible Values

This property is a read/write String.

See Also

  • Profile Object


Profile.ProfileID

The ProfileID property retrieves the GUID of this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).ProfileID

Possible Values

This property is a read-only String.

See Also

  • Profile Object


Profile.TotalBitrate

The TotalBitrate property retrieves the sum of the bit rates of all the streams in this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).TotalBitrate

Possible Values

This property is a read-only Number (long).

See Also

  • Profile Object


Profile.VideoStreamCount

The VideoStreamCount property retrieves the number of video streams in this Profile.

Syntax

Application.ProfileManager.Item(profileIndex).VideoStreamCount

Possible Values

This property is a read-only Number (long).

See Also

  • Profile Object


ProfileManager Object

The ProfileManager object represents the collection of all Profile objects available to Producer.

The ProfileManager object exposes the following properties.

Property | Description
Application | Retrieves the current Application object.
Count | Retrieves the number of Profile objects in the ProfileManager.
HighQualityAudioOnly | Retrieves the standard Profile object with settings for high-quality audio.
HighQualityAudioVideo | Retrieves the standard Profile object with settings for high-quality audio and video.
Item | Retrieves the Profile with the specified index.
ItemByID | Retrieves the Profile with the specified ID.
LowQualityAudioOnly | Retrieves the standard Profile object with settings for low-quality audio.
LowQualityAudioVideo | Retrieves the standard Profile object with settings for low-quality audio and video.
MediumQualityAudioOnly | Retrieves the standard Profile object with settings for medium-quality audio.
MediumQualityAudioVideo | Retrieves the standard Profile object with settings for medium-quality audio and video.

The ProfileManager object exposes the following method.

Method | Description
Find | Retrieves the index of the specified Profile.

The ProfileManager object is accessed through the following property.

Object | Property
Application | ProfileManager

See Also

  • Object Model Reference


ProfileManager.Application

The Application property retrieves the current Application object.

Syntax

Application.ProfileManager.Application

Possible Values

This property is a read-only Application object.

See Also

  • Application Object
  • ProfileManager Object


ProfileManager.Count

The Count property retrieves the number of Profile objects in the ProfileManager.

Syntax

Application.ProfileManager.Count

Possible Values

This property is a read-only Number.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.Find

The Find method retrieves the index of the specified Profile.

Syntax

Application.ProfileManager.Find(profile)

Parameters

profile

Profile object to find the index of.

Return Values

This method returns a Number.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.HighQualityAudioOnly

The HighQualityAudioOnly property retrieves the standard Profile object with settings for high-quality audio.

Syntax

Application.ProfileManager.HighQualityAudioOnly

Possible Values

This property is a read-only Profile object.

Remarks

This property is a convenience method only. The Profile object which it retrieves may be different in a future release. In order to retrieve a Profile object with particular property values, use the ProfileManager.Count and ProfileManager.Item properties to iterate through the ProfileManager collection, and test for the desired values using the properties of the Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.HighQualityAudioVideo

The HighQualityAudioVideo property retrieves the standard Profile object with settings for high-quality audio and video.

Syntax

Application.ProfileManager.HighQualityAudioVideo

Possible Values

This property is a read-only Profile object.

Remarks

This property is a convenience method only. The Profile object which it retrieves may be different in a future release. In order to retrieve a Profile object with particular property values, use the ProfileManager.Count and ProfileManager.Item properties to iterate through the ProfileManager collection, and test for the desired values using the properties of the Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.Item

The Item property retrieves the Profile with the specified index.

Syntax

Application.ProfileManager.Item(index)

Parameters

index

Number containing the index of the Profile to retrieve.

Possible Values

This property is a read-only Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.ItemByID

The ItemByID property retrieves the Profile with the specified ID.

Syntax

Application.ProfileManager.ItemByID(ID)

Parameters

ID

String containing the GUID of the Profile to retrieve.

Possible Values

This property is a read-only Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.LowQualityAudioOnly

The LowQualityAudioOnly property retrieves the standard Profile object with settings for low-quality audio.

Syntax

Application.ProfileManager.LowQualityAudioOnly

Possible Values

This property is a read-only Profile object.

Remarks

This property is a convenience method only. The Profile object which it retrieves may be different in a future release. In order to retrieve a Profile object with particular property values, use the ProfileManager.Count and ProfileManager.Item properties to iterate through the ProfileManager collection, and test for the desired values using the properties of the Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.LowQualityAudioVideo

The LowQualityAudioVideo property retrieves the standard Profile object with settings for low-quality audio and video.

Syntax

Application.ProfileManager.LowQualityAudioVideo

Possible Values

This property is a read-only Profile object.

Remarks

This property is a convenience method only. The Profile object which it retrieves may be different in a future release. In order to retrieve a Profile object with particular property values, use the ProfileManager.Count and ProfileManager.Item properties to iterate through the ProfileManager collection, and test for the desired values using the properties of the Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.MediumQualityAudioOnly

The MediumQualityAudioOnly property retrieves the standard Profile object with settings for medium-quality audio.

Syntax

Application.ProfileManager.MediumQualityAudioOnly

Possible Values

This property is a read-only Profile object.

Remarks

This property is a convenience method only. The Profile object which it retrieves may be different in a future release. In order to retrieve a Profile object with particular property values, use the ProfileManager.Count and ProfileManager.Item properties to iterate through the ProfileManager collection, and test for the desired values using the properties of the Profile object.

See Also

  • Profile Object
  • ProfileManager Object


ProfileManager.MediumQualityAudioVideo

The MediumQualityAudioVideo property retrieves the standard Profile object with settings for medium-quality audio and video.

Syntax

Application.ProfileManager.MediumQualityAudioVideo

Possible Values

This property is a read-only Profile object.

Remarks

This property is a convenience method only. The Profile object which it retrieves may be different in a future release. In order to retrieve a Profile object with particular property values, use the ProfileManager.Count and ProfileManager.Item properties to iterate through the ProfileManager collection, and test for the desired values using the properties of the Profile object.

See Also

  • Profile Object
  • ProfileManager Object


Profiles Object

The Profiles object represents a collection of Profile objects.

The Profiles object exposes the following properties.

Property | Description
Count | Retrieves the number of Profile objects in the Profiles collection.
Item | Retrieves the Profile object with the specified index.

The Profiles object exposes the following method.

Method | Description
Find | Retrieves the index of the specified Profile object.

The Profiles object is accessed through the following method.

Object | Method
WebHost | GetProfiles

See Also

  • Object Model Reference


Profiles.Count

The Count property retrieves the number of Profile objects in the Profiles collection.

Syntax

Application.Project.Properties.PublishWebHost.GetProfiles().Count

Possible Values

This property is a read-only Number (long).

See Also

  • Profile Object
  • Profiles Object


Profiles.Find

The Find method retrieves the index of the specified Profile object.

Syntax

Application.Project.Properties.PublishWebHost.GetProfiles().Find(profile)

Parameters

profile

Profile object whose index is to be retrieved.

Return Values

This method returns a Number (long).

See Also

  • Profile Object
  • Profiles Object


Profiles.Item

The Item property retrieves the Profile object with the specified index.

Syntax

Application.Project.Properties.PublishWebHost.GetProfiles().Item(index)

Parameters

index

Number containing the index of the Profile object to retrieve.

Possible Values

This property is a read-only Profile object.

See Also

  • Profile Object
  • Profiles Object


Project Object

The Project object represents a Producer project, and exposes the following properties.

Property | Description
Properties | Retrieves the Properties object associated with this Project.
TimelineHasVideo | Retrieves a value indicating whether the presentation timeline includes a video track.

The Project object is accessed through the following property.

Object | Property
Application | Project

See Also

  • Object Model Reference


Project.Properties

The Properties property retrieves the Properties object associated with this Project.

Syntax

Application.Project.Properties

Possible Values

This property is a read-only Properties object.

Remarks

The Properties object stores metadata about a project, including various standard properties as well as user-defined properties. These properties are stored in the project file, and persist between sessions.

See Also

  • Project Object
  • Properties Object


Project.TimelineHasVideo

The TimelineHasVideo property retrieves a value indicating whether the presentation timeline includes a video track.

Syntax

Application.Project.TimelineHasVideo

Possible Values

This property is a read-only Boolean.

Remarks

In order to determine which profiles are valid for publishing a project, you must use this property to determine whether there are any video clips contained in the project. If it contains any video clips, the project cannot be published with an audio profile.

See Also

  • Project Object


Properties Object

The Properties object stores metadata about a project, including various standard properties as well as user-defined properties. These properties are stored in the project file, and persist between sessions.

The Properties object exposes the following properties.

Property | Description
Author | Specifies or retrieves the name of the author of the project.
BackupMediaFiles | Sets or retrieves a value indicating whether to copy files to both WebHost.WindowsMediaPublishDestination and WebHost.PublishDestination.
Copyright | Specifies or retrieves the copyright information for the project.
Description | Specifies or retrieves a description of the project.
DiscussionServerAddress | Specifies or retrieves the address of an optional discussion server.
ImageFilename | Specifies or retrieves the file name of an image to be displayed on the presentation introduction page.
PublishName | Specifies or retrieves the name to publish the project with.
PublishWebHost | Retrieves the WebHost object that represents the current e-service.
Title | Specifies or retrieves the title of the project.

The Properties object exposes the following methods.

Method | Description
GetCustomProperty | Retrieves the custom property with the specified name.
GetCustomPropertyCount | Retrieves the number of custom properties associated with this object.
GetCustomPropertyName | Retrieves the name of the custom property at the specified index.
SetCustomProperty | Specifies the name and value of a custom property.

The Properties object is accessed through the following property.

Object | Property
Project | Properties

See Also

  • Object Model Reference


Properties.Author

The Author property specifies or retrieves the name of the author of the project.

Syntax

Application.Project.Properties.Author

Possible Values

This property is a read/write String.

See Also

  • Properties Object


Properties.BackupMediaFiles

The BackupMediaFiles property sets or retrieves a value indicating whether or not to copy files to both WebHost.WindowsMediaPublishDestination and WebHost.PublishDestination.

Syntax

Application.Project.Properties.BackupMediaFiles

Possible Values

This property is a read/write Boolean. If false, the files are only copied to the destination specified by WebHost.WindowsMediaPublishDestination. If true, files are copied to both locations.

Remarks

This property is true by default in new projects.

See Also

  • WebHost.PublishDestination
  • WebHost.WindowsMediaPublishDestination
  • Properties Object


Properties.Copyright

The Copyright property specifies or retrieves the copyright information for the project.

Syntax

Application.Project.Properties.Copyright

Possible Values

This property is a read/write String.

See Also

  • Properties Object


Properties.Description

The Description property specifies or retrieves a description of the project.

Syntax

Application.Project.Properties.Description

Possible Values

This property is a read/write String.

See Also

  • Properties Object


Properties.DiscussionServerAddress

The DiscussionServerAddress property specifies or retrieves the address of a Web discussion server.

Syntax

Application.Project.Properties.DiscussionServerAddress

Possible Values

This property is a read/write String.

Remarks

If this property is specified, the Web discussion user interface is enabled in the published presentation. This is an ActiveX® control that lets people enter comments or questions about the presentation as it is played back. To use this feature, users must set their Web browser security settings to allow ActiveX controls to be downloaded.

Web discussion servers are available with Microsoft Office Server Extensions or SharePoint™ Portal Server.

See Also

  • Properties Object


Properties.GetCustomProperty

The GetCustomProperty method retrieves the custom property with the specified name.

Syntax

Application.Project.Properties.GetCustomProperty(name)

Parameters

name

String containing the name of the custom property to retrieve.

Return Values

This method returns a value that can have any data type.

Remarks

Custom properties are set using the Properties.SetCustomProperty method, and can have a value of any data type. The return value of Properties.GetCustomProperty has the same data type as the value of the custom property being retrieved.

See Also

  • Properties Object
  • Properties.SetCustomProperty


Properties.GetCustomPropertyCount

The GetCustomPropertyCount method retrieves the number of custom properties associated with this object.

Syntax

Application.Project.Properties.GetCustomPropertyCount()

Parameters

This method takes no parameters.

Return Values

This method returns a Number (double).

See Also

  • Properties Object


Properties.GetCustomPropertyName

The GetCustomPropertyName method retrieves the name of the custom property at the specified index.

Syntax

Application.Project.Properties.GetCustomPropertyName(index)

Parameters

index

Number containing the index of the custom property to be retrieved.

Return Values

This method returns a String.

See Also

  • Properties Object


Properties.ImageFilename

The ImageFilename property specifies or retrieves the file name of an image to be displayed on the presentation introduction page.

Syntax

Application.Project.Properties.ImageFilename

Possible Values

This property is a read/write String.

Remarks

This property is optional. If no value is provided, an image will not be shown on the introduction page.

See Also

  • Properties Object


Properties.PublishName

The PublishName property specifies or retrieves the name to publish the project with.

Syntax

Application.Project.Properties.PublishName

Possible Values

This property is a read/write String.

Remarks

If no value is specified for this property, it will be set to the name of the project file, which is "Untitled" by default if the project has not been saved under a different name.

See Also

  • Properties Object


Properties.PublishWebHost

The PublishWebHost property retrieves the WebHost object that represents the current e-service.

Syntax

Application.Project.Properties.PublishWebHost

Possible Values

This property is a read-only WebHost object.

Remarks

The value of this property is set by the Web Server drop-down list box in the Publish Wizard.

See Also

  • Properties Object
  • WebHost Object


Properties.SetCustomProperty

The SetCustomPropertyName method specifies the name and value of a custom property.

Syntax

Application.Project.Properties.SetCustomProperty(name, value)

Parameters

name

String containing the name of the custom property to be set.

value

The value of the custom property to be set. This value can have any standard data type.

Return Values

This method does not return a value.

Remarks

Once a custom property has been created by calling this method, it cannot be removed.

See Also

  • Properties Object
  • Properties.GetCustomProperty


Properties.Title

The Title property specifies or retrieves the title of the project.

Syntax

Application.Project.Properties.Title

Possible Values

This property is a read/write String.

See Also

  • Properties Object


Publisher Object

The Publisher object provides methods to support the publishing process.

The Publisher object exposes the following methods and property.

Method or Property | Description
CalculateBestPublishProfile | Returns a Profile best suited for this document.
ChooseDirectory | Presents the user with a dialog box to choose a directory on his or her local machine and returns the directory chosen.
PublishPresentation | Publishes the presentation using the profiles contained in the current Web host.
ShowManifest | Displays a window containing a list of the files that will be generated when the presentation is published.
SmartRecompressionProfile | Retrieves the last Profile created by Publisher.CalculateBestPublishProfile.
ValidatePublishPresentation | Determines whether the presentation can be published with the current settings.

The Publisher object is accessed through the following property.

Object | Property
Application | Publisher

See Also

  • Object Model Reference


Publisher.CalculateBestPublishProfile

The CalculateBestPublishProfile method returns a Profile best suited for this document.

Syntax

Application.Publisher.CalculateBestPublishProfile()

Parameters

This method takes no parameters.

Return Values

This method returns a Profile Object with the suggested encoding settings to use.

Remarks

This method scans a timeline to determine if re-encoding is necessary to publish your project. If so, it creates a new Profile and returns it. If not, it may return an existing Profile from the ProfileManager Object. This Profile can be obtained again later without recalculating the information by viewing the Publisher.SmartRecompressionProfile property.

The following criteria are used to determine if the timeline can be republished without recompression:

  • The video track of the timeline consists entirely of Windows Media Video files.
  • Video files all have the same encoding profile, with the exception of screen capture files.
  • Video files do not have any effects or transitions applied to them.
  • Video clips have the same dimensions as the video window in the template in which they play.
  • The audio track two is empty.
  • There are no gaps (blackness) in the video track.
  • Sections of video clips (meaning the entire timeline or a range between screen capture clips) are all from the same file and contiguous.

See Also

  • Profile Object
  • Publisher.SmartRecompressionProfile
  • Publisher Object


Publisher.ChooseDirectory

The ChooseDirectory method presents the user with a dialog box to choose a directory on his or her local machine and returns the directory chosen.

Syntax

Application.Publisher.ChooseDirectory()

Parameters

This method takes no parameters.

Return Values

This method returns a String containing the name of the directory chosen or the empty string ("") if the user clicked Cancel.

See Also

  • Publisher Object


Publisher.PublishPresentation

The PublishPresentation method publishes the presentation using the profiles contained in the current Web host.

Syntax

Application.Publisher.PublishPresentation()

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

Remarks

A call to this method should be placed within a JScript try/catch block. If the presentation cannot be published with the current settings, or if the user clicks Cancel, an error will be generated, and the Error object can be used to display a message indicating the reason the presentation was not published.

If any of the profiles contained in the current Web host are invalid for this presentation, they will be ignored. Only valid profiles will be used for publishing.

See Also

  • Error Object
  • Publisher Object


Publisher.ShowManifest

The ShowManifest method displays a window containing a list of the files that will be generated when the presentation is published.

Syntax

Application.Publisher.ShowManifest()

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

See Also

  • Publisher Object


Publisher.SmartRecompressionProfile

The SmartRecompressionProfile property retrieves the last Profile created by Publisher.CalculateBestPublishProfile.

Syntax

Application.ProfileManager.SmartRecompressionProfile

Possible Values

This property is a read-only Profile Object, or will be null if Publisher.CalculateBestPublishProfile has not yet been run.

See Also

  • Profile Object
  • Publisher Object


Publisher.ValidatePublishPresentation

The ValidatePublishPresentation method determines whether the presentation can be published with the current settings. This method returns a value indicating whether the presentation can be published without overwriting a presentation of the same name that already exists in the chosen publish destination.

Syntax

Application.Publisher.ValidatePublishPresentation()

Parameters

This method takes no parameters.

Return Values

This method returns a Boolean.

Remarks

A call to this method should be placed within a JScript try/catch block. If the presentation cannot be published with the current settings, an error will be generated, and the Error object can be used to display a message indicating the problem.

If the presentation is valid, on the other hand, the method returns a value indicating whether an existing presentation with the same name will be overwritten if the new presentation is published.

See Also

  • Error Object
  • Profile Object
  • Publisher Object
  • WebHost Object


StreamConfig Object

The StreamConfig object represents an audio or video stream and its associated attributes.

The StreamConfig object exposes the following properties.

Property | Description
Application | Retrieves the current Application object.
BitCount | Retrieves the color depth of a video stream.
BitRate | Retrieves the bit rate of the stream, in bits per second.
BitsPerSample | Retrieves the number of bits per sample for the audio stream.
BufferWindow | Retrieves the maximum time in milliseconds between the moment when a stream is received and when it starts playing.
ChannelCount | Retrieves a value indicating whether the audio stream is in mono or stereo.
ConnectionName | Retrieves the input name given to the stream.
FramesPerSecond | Retrieves the average frame rate of the video stream, in frames per second.
MaxKeyFrameSpacing | Retrieves the maximum number of milliseconds between key frames in a video stream.
MediaType | Retrieves a value indicating the type of digital media that this stream contains.
Name | Retrieves the name of the stream.
Number | Retrieves the user-defined number of the stream.
Quality | Retrieves a value indicating the quality of the video image relative to the frame rate.
SampleSize | Retrieves the size, in bytes, of each data packet.
SamplesPerSecond | Retrieves the sample rate, in samples per second (Hertz), at which each channel must be played or recorded.

The StreamConfig object is accessed through the following property and methods.

Object | Property or method
Profile | Item, GetStreamByNumber

See Also

  • Object Model Reference


StreamConfig.Application

The Application property retrieves the current Application object.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).Application

Possible Values

This property is a read-only Application object.

See Also

  • Application Object
  • StreamConfig Object


StreamConfig.BitCount

The BitCount property retrieves the color depth of a video stream.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).BitCount

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

Remarks

This property is valid for video streams only. Common values are 8, 16, 24, and 32.

See Also

  • StreamConfig Object


StreamConfig.BitRate

The BitRate property retrieves the bit rate of the stream, in bits per second.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).BitRate

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


StreamConfig.BitsPerSample

The BitsPerSample property retrieves the number of bits per sample for the audio stream.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).BitsPerSample

Possible Values

This property is a read/write Number (long) with a value of 8 or 16. Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


StreamConfig.BufferWindow

The BufferWindow property retrieves the maximum time in milliseconds between the moment when a stream is received and when it starts playing.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).BufferWindow

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

Remarks

For high bit rate streams (typically, more than one megabit per second), a buffer window of one second is typical; for lower bit rate streams, a latency of approximately three seconds is often used. For video streams, a higher buffer window gives higher quality.

A value of -1 indicates that the buffer window is unknown. In this case, Producer uses whatever buffer window it deems appropriate when publishing a project.

See Also

  • StreamConfig Object


StreamConfig.ChannelCount

The ChannelCount property retrieves a value indicating whether the audio stream is in mono or stereo.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).ChannelCount

Possible Values

This property is a read/write Number (long) containing one of the following values. Specifying this value is not supported in this release.

Value | Description
0 | Mono
1 | Stereo

See Also

  • StreamConfig Object


StreamConfig.ConnectionName

The ConnectionName property retrieves the input name given to the stream.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).ConnectionName

Possible Values

This property is a read/write String. Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


StreamConfig.FramesPerSecond

The FramesPerSecond property retrieves the average frame rate of the video stream, in frames per second.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).FramesPerSecond

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


StreamConfig.MaxKeyFrameSpacing

The MaxKeyFrameSpacing property retrieves the maximum number of milliseconds between key frames in a video stream.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).MaxKeyFrameSpacing

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

Remarks

A key frame is a video frame that is streamed without any information being required from any previous frame. Frames that are dependent on previous frames are called delta frames. Producer can seek to a key frame, but not to a delta frame.

See Also

  • StreamConfig Object


StreamConfig.MediaType

The MediaType property retrieves a value indicating the type of digital media that this stream contains.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).MediaType

Possible Values

This property is a read-only Number containing one of the following values.

Value | Description
0 | Video
1 | Audio
2 | Script
3 | Image

See Also

  • StreamConfig Object


StreamConfig.Name

The Name property retrieves the name of the stream.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).Name

Possible Values

This property is a read/write String. Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


StreamConfig.Number

The Number property retrieves the user-defined number of the stream.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).Number

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


StreamConfig.Quality

The Quality property retrieves a value indicating the quality of the video image relative to the frame rate.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).Quality

Possible Values

This property is a read/write Number (long) ranging from 0 to 100. Specifying this value is not supported in this release.

Remarks

A value of 0 (zero) maximizes the frame rate at the expense of image quality. A value of 100 maximizes image quality at the expense of frame rate.

See Also

  • StreamConfig Object


StreamConfig.SampleSize

The SampleSize property retrieves the size, in bytes, of each data packet.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).SampleSize

Possible Values

This property is a read-only Number (long).

See Also

  • StreamConfig Object


StreamConfig.SamplesPerSecond

The SamplesPerSecond property retrieves the sample rate, in samples per second (Hertz), at which each channel must be played or recorded.

Syntax

Application.ProfileManager.Item(profileIndex).Item(streamIndex).SamplesPerSecond

Possible Values

This property is a read/write Number (long). Specifying this value is not supported in this release.

See Also

  • StreamConfig Object


WebHost Object

The WebHost object represents an e-service, which contains information that is used to publish a presentation. This information is stored in the registry so that it can be reused by Producer on subsequent occasions. The e-services in the registry are used to populate the Web server drop-down list on the first page of the Publish Wizard.

The WebHost object exposes the following properties.

Property | Description
HTMLBasedUIURL | Specifies or retrieves the Uniform Resource Locator (URL) of a Web page to use for a custom page in the Publish Wizard.
ID | Retrieves the GUID of the WebHost.
Name | Specifies or retrieves the name of the WebHost.
Password | Specifies the password for the server if PublishDestination has been set to a URL and login is required.
PlaybackAddress | Specifies or retrieves the address where the presentation can be viewed after it has been published.
PublishDestination | Specifies or retrieves the directory, Universal Naming Convention (UNC), or URL where the published presentation will be stored.
Username | Specifies or retrieves the user name for the server if PublishDestination has been set to a URL and login is required.
WindowsMediaPlaybackAddress | Specifies or retrieves the URL from which audio and video files will be streamed.
WindowsMediaPublishDestination | Specifies or retrieves the directory, UNC, or URL where the presentation audio and video files will be stored for streaming.

The WebHost object exposes the following methods.

Method | Description
AddProfile | Adds the specified Profile to the WebHost.
GetProfiles | Retrieves a Profiles collection object containing all the Profile objects in the WebHost.
RemoveAllProfiles | Removes all Profile objects from the WebHost.
RemoveProfile | Removes the specified Profile from the WebHost.

The WebHost object is accessed through the following properties and methods.

Object | Property or method
Options | AddWebHost, WebHostByID
Properties | PublishWebHost

See Also

  • Object Model Reference


WebHost.AddProfile

The AddProfile method adds the specified Profile to the WebHost.

Syntax

Application.Project.Properties.PublishWebHost.AddProfile(profile)

Parameters

profile

Profile object to be added.

Return Values

This method does not return a value.

Remarks

The Profile to be added can be taken from or created by using the ProfileManager object.

A presentation is published using all profiles within the current Web host that are valid for that presentation. Any profiles that are not valid for the presentation will be skipped.

See Also

  • Profile Object
  • WebHost Object


WebHost.GetProfiles

The GetProfiles method retrieves a Profiles collection object containing copies of all the Profile objects in the WebHost.

Syntax

Application.Project.Properties.PublishWebHost.GetProfiles()

Parameters

This method takes no parameters.

Return Values

This method returns a Profiles object.

Remarks

The collection returned by this method contains only copies of the Profile objects contained in the WebHost. Modifying these copies will have no effect.

See Also

  • Profile Object
  • Profiles Object
  • WebHost Object


WebHost.HTMLBasedUIURL

The HTMLBasedUIURL property specifies or retrieves the URL of a Web page to use for a custom page in the Publish Wizard.

Syntax

Application.Project.Properties.PublishWebHost.HTMLBasedUIURL

Possible Values

This property is a read/write String.

Remarks

If HTMLBasedUIURL is not specified, the Publish Wizard will display the default standard user interface.

When it is specified, the user is presented with a dialog box to confirm the interface change.

See Also

  • WebHost Object


WebHost.ID

The ID property retrieves the GUID of the WebHost.

Syntax

Application.Project.Properties.PublishWebHost.ID

Possible Values

This property is a read-only String.

See Also

  • WebHost Object


WebHost.Name

The Name property specifies or retrieves the name of the WebHost.

Syntax

Application.Project.Properties.PublishWebHost.Name

Possible Values

This property is a read/write String.

See Also

  • WebHost Object


WebHost.Password

The Password property specifies the password for the server if PublishDestination has been set to a URL and login is required.

Syntax

Application.Project.Properties.PublishWebHost.Password

Possible Values

This property is a write-only String.

Remarks

The password is stored in the registry in an encrypted form.

If the user is on a domain, the domain credentials are always tried before the Username and Password specified in this object.

See Also

  • WebHost Object


WebHost.PlaybackAddress

The PlaybackAddress property specifies or retrieves the address where the presentation can be viewed after it has been published.

Syntax

Application.Project.Properties.PublishWebHost.PlaybackAddress

Possible Values

This property is a read/write String.

See Also

  • WebHost Object


WebHost.PublishDestination

The PublishDestination property specifies or retrieves the directory, UNC, or URL where the published presentation will be stored.

Syntax

Application.Project.Properties.PublishWebHost.PublishDestination

Possible Values

This property is a read/write String.

See Also

  • WebHost Object


WebHost.RemoveAllProfiles

The RemoveAllProfiles method removes all Profile objects from the WebHost.

Syntax

Application.Project.Properties.PublishWebHost.RemoveAllProfiles()

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

See Also

  • Profile Object
  • WebHost Object


WebHost.RemoveProfile

The RemoveProfile method removes the specified Profile from the WebHost.

Syntax

Application.Project.Properties.PublishWebHost.RemoveProfile(profile)

Parameters

profile

Profile object to be removed.

Return Values

This method does not return a value.

See Also

  • Profile Object
  • WebHost Object


WebHost.Username

The Username property specifies or retrieves the user name for the server if PublishDestination has been set to a URL and login is required.

Syntax

Application.Project.Properties.PublishWebHost.Username

Possible Values

This property is a read/write String.

Remarks

If the user is on a domain, the domain credentials are always tried before the Username and Password in this object.

See Also

  • WebHost Object
  • WebHost.PublishDestination


WebHost.WindowsMediaPlaybackAddress

The WindowsMediaPlaybackAddress property specifies or retrieves the URL from which audio and video files will be streamed.

Syntax

Application.Project.Properties.PublishWebHost.WindowsMediaPlaybackAddress

Possible Values

This property is a read/write String.

Remarks

The URL must begin with mms://. The supported protocols are HTTP, RTSP, RTSPU, MMS, MMSU, and MMST.

See Also

  • WebHost Object


WebHost.WindowsMediaPublishDestination

The WindowsMediaPublishDestination property specifies or retrieves the directory, UNC, or URL where the presentation audio and video files will be stored for streaming.

Syntax

Application.Project.Properties.PublishWebHost.WindowsMediaPublishDestination

Possible Values

This property is a read/write String.

See Also

  • WebHost Object


Window Object

The Window object provides a method for closing a browser window used by Producer.

The Window object exposes the following method.

Method | Description
Close | Closes the window.

The Window object is accessed through the following method.

Object | Method
Windows | Item

See Also

  • Object Model Reference


Window.Close

The Close method closes the browser window.

Syntax

Application.Windows.Item(windowIndex).Close()

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

See Also

  • Window Object


Windows Object

The Windows object represents a collection of Window objects.

The Windows object exposes the following methods.

Method | Description
FindByName | Retrieves the index of the Window with the specified name.
Item | Retrieves the Window with the specified index.

The Windows object is accessed through the following property.

Object | Property
Application | Windows

See Also

  • Object Model Reference


Windows.FindByName

The FindByName method retrieves the index of the Window with the specified name.

Syntax

Application.Windows.FindByName(name)

Parameters

name

String containing the name of the Window whose index is to be retrieved. Contains one of the following values.

Value | Description
EServiceWindow | Represents the browser window that opens when the user clicks Learn More in the Publish Wizard.
PublishWizard | Represents the Publish Wizard dialog box.

Return Values

This method returns a Number (long).

Remarks

This method retrieves an index that can be used with the Windows.Item method to retrieve a Window object. In order to close the window indicated with the name parameter, the Window.Close method must be called.

See Also

  • Window Object
  • Window.Close
  • Windows Object
  • Windows.Item


Windows.Item

The Item method retrieves the Window with the specified index.

Syntax

Application.Windows.Item(index)

Parameters

index

Number containing the index of the Window to retrieve.

Return Values

This method returns a Number (long).

Remarks

This method is used in conjunction with the Windows.FindByName method to retrieve the Window object representing the browser window that opens when the user clicks the Learn More button in the Publish Wizard. In order to close this window after the user is finished selecting e-services, the Window.Close method must be called. This returns the user to the main Publish Wizard dialog box.

See Also

  • Window Object
  • Window.Close
  • Windows Object
  • Windows.FindByName


Producer Batch Asset Loading Interface

Microsoft Producer offers a new way to automate the creation and publishing of project files, called batch asset loading. Batch asset loading causes Producer to load an XML file on startup that specifies project timeline information, allowing you to create and publish a fully populated project timeline in a scripted fashion. This process can be automated and run by a batch file, allowing you to generate Producer projects at timed intervals.

These documents show you how to create your batch asset file, describe the syntax of the file, and run it to create or publish your Producer project file or presentation.

Batch asset loading will allow you to perform the following tasks:

  • Create a Producer project with a complex timeline of video, audio, HTML pages, and PowerPoint slides.
  • Define table of contents entries manually or have Producer generate table of contents entries from PowerPoint slides automatically.
  • Specify font size, type, and color, as well as background color, and cascading style sheets (CSS) for presentations.
  • Publish a new or a previously created project to a specified location.
  • Specify one or more publish profiles to use to publish a project.

Batch asset loading will not allow you to perform the following tasks:

  • Create a new WebHost Object.
  • Modify slide click presentation timing.
  • Switch tab views.
  • Change options.

This section includes the following topics:

Topic | Description
Creating a Batch Asset Loading File | Describes how to create a new batch asset loading file.
Running a Batch Asset Loading File | Describes how to run the batch asset loading file you have created.
Batch Asset Loading File Syntax | Describes the XML syntax of a batch asset loading file.
Sample Batch Asset Loading File | Provides a complex batch asset loading file for you to try.
Batch Asset Interface Error Codes | Describes the errors that the batch asset loading interface can throw.

See Also

  • Microsoft Producer for Microsoft Office PowerPoint 2003 SDK


Creating a Batch Asset Loading File

A Producer batch asset file is an XML file that follows standard XML conventions. The Producer installation includes an XSD file that defines the available elements. For a list of all the available elements and their attributes, with explanations, see the topic Batch Asset Loading File Syntax. A batch asset loading file can be created in any text editor.

A batch asset loading file must have at least one actions and/or presentation element.

  • The actions block specifies actions that Producer should perform; these actions include building, saving, and publishing. The default action, if the actions block is missing, is build. These actions are processed in the order in which they appear, so be sure to specify them in proper order (for example, don't put the publish action before the load or build action). Note that Producer will not automatically close after processing your actions; you must specify the exit action if you wish to close Producer after processing a batch file.
  • The presentation block is used to specify information about a new project, or a project that you wish to modify. This includes a timeline, presentation font and size, and the WebHost and publish profile you wish to use. You can load an existing project and change project information (such as publish location, title, or author), or you can create a totally new project from source and timeline information contained inside this element.

To create a simple batch asset loading file, open a text editor such as Notepad and paste in the following code:

<?ProducerBatchFile version="2.0"?>
<producer>
    <actions>
        <action command="load">
            <param>G:\Projects\Producer\My presentation.MSProducer</param>
        </action>
    </actions>
</producer>

Save the file with a .MSProducerBF file name extension. This simple batch file loads an existing project called "My presentation" at the path shown inside the param element. Change this to point to an existing project on your own computer and try running it as explained in the topic Running a Batch Asset Loading File. Note that Producer stays open after the project is built. To cause Producer to close, add the following line before the </actions> tag:

<action command="exit"/>

Notice that the exit action takes no parameters, and so can be given as a single-tag element.

If you want to publish this presentation, add a publish destination, as the next code example demonstrates:

<?ProducerBatchFile version="2.0"?>
<producer>
    <actions>
        <action command="logging">
            <param>c:\ProducerBuildLog.log</param>
        <action command="load">
            <param>G:\Projects\Producer\My presentation.MSProducer</param>
        </action>
        <action command="build"/>
        <action command="publish"/>
    </actions>
    <presentation>
        <properties>
            <property name="PublishDestination">C:\temp</property>
            <property name="PublishName">MyPresentation</property>
            <property name="PublishProfile" index="0">PV000.PRX</property>
        </properties>
    </presentation>
</producer>

Note that, if you publish, you must specify both a publish destination and a publish profile (if they are not already defined in an existing file). Also note that you must specify the build action, because you are changing project data, in this case the publish destination, name, and profile. A logging file has been added in this batch asset loading file; logging files are very useful for debugging when building a batch loading file.

Using Producer to generate batch asset loading files automatically:

Producer can generate an XML batch asset loading file for you automatically. To have Producer do this, open an existing project or create a new one from scratch. Then, instead of saving it as a project file, save it as a batch asset loading file with the following steps. Note that this will only save your project data and settings; any actions such as build and save must be inserted manually by using a text editor. A good technique for creating a batch asset file is to create a project using Producer, save it as a batch asset loading file, then modify it to fit your needs. However, be warned that batch asset files can be quite large, and producing them this way can generate an unexpectedly large file.

  1. On the File menu, click Save As.
  2. Select the All Files option.
  3. Type in your file name, and specify .MSProducerBF as the file name extension.
  4. Click Save. The batch file will be created.

Note If you do not explicitly type in the .MSProducerBF file name extension, an Producer project file will be saved with the .MSProducer file name extension by default.

See Also

  • Running a Batch Asset Loading File
  • Batch Asset Loading File Syntax
  • Producer Batch Asset Loading Interface


Running a Batch Asset Loading File

Producer batch asset loading files are ANSI or Unicode text files with a .MSProducerBF file name extension. You can run a batch asset loading file from either a command prompt or the Windows desktop.

To run a batch asset loading file from a command prompt:

  • Type the name (and path, if not local) of the Producer executable, followed by the name and path of your batch file. For example:
    producer.exe "C:\my folder\MyBatchFile.MSProducerBF"

To run a batch asset loading file from the Windows desktop:

  • In Producer, on the File menu, click Open. Select the batch asset loading file you want to run, then click OK,

or

  • In Windows Explorer, right-click the batch asset loading file you want to run, then click Run.

If you include a logging action element in your batch asset loading file, Producer will save a log file that lists all the actions Producer took when processing your file, as well as any errors that occurred. Actions are performed in the order they appear in your XML file, so any errors or actions that occur before the logging action will not appear in the log file.

Producer will also return error codes when run from a command prompt. If no errors occur, Producer returns S_OK. For a complete list of error codes that batch asset loading files can return, see the topic Batch Asset Interface Error Codes.

See Also

  • Creating a Batch Asset Loading File
  • Producer Batch Asset Loading Interface


Sample Batch Asset Loading File

This topic provides a sample Producer batch asset file for you to use. To test creation of this file, you will need to create the following items in the following locations. Alternatively, you can rename the items and locations in the included file to match existing files on your computer.

File or Directory | Description
c:\temp | A folder to hold the build log and the published file.
G:\Projects\Producer\My Video Files\CoverPhoto.gif | An image file holding an image for the presentation introduction page.
G:\Projects\Producer\My Video Files\Marketing Video.wmv | A video clip to include in the presentation. Must be at least 15 seconds long.
G:\Projects\Producer\My Video Files\Sales Video.wmv | A second video clip to include in the presentation. Must be at least 55 seconds long.
G:\Projects\Producer\My Slides\My Slides.ppt | A PowerPoint slide presentation with at least eight slides.
G:\Projects\Producer\My HTML Pages\html1.html G:\Projects\Producer\My HTML Pages\html2.html G:\Projects\Producer\My HTML Pages\html3.html | Three HTML pages to include in the presentation.

Copy and paste this file into a text editor, save it as a file with an .MSProducerBF file name extension as described in the topic Creating a Batch Asset Loading File, and run it as described in the topic Running a Batch Asset Loading File. Producer will stay open after the code in this file finishes processing.

<?ProducerBatchFile version="2.0"?>
<producer>
    <actions>
        <action command="logging">
            <param>c:\temp\ProducerBuildLog.log</param>
        </action>
        <action command="build"/>

         <action command="publish"/>

         <action command="pack">
            <param>C:\packaged producer file</param>
            <param>20</param>
        </action>

    </actions>

    <presentation>
        <properties>
            <property name="Author">Candy Spoon</property>
            <property name="Title"> A Basic Presentation</property>
            <property name="BackgroundColor">#E0E0E0</property>
            <property name="Copyright">Candy Spoon, All Rights Reserved, 2003</property>
            <property name="Description">This is a sample Producer Batch Asset Loading File</property>
            <property name="ImageFilename">G:\Projects\Producer\My Video Files\CoverPhoto.gif</property>

            <property name="TOCFont">Verdana</property>
            <property name="FontColor">Red</property>
            <property name="TOCFontSize">10pt</property>
            <property name="TOCBackgroundColor">Green</property>

            <property name="PublishDestination">C:\temp</property>
            <property name="PublishName">MyPresentation</property>
            <property name="PublishProfile" index="0">PV000.PRX</property>
            <property name="PublishProfile" index="1">PV001.PRX</property>
        </properties >

        <timeline>
            <sequence type="video">
                <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
                <media src ="G:\Projects\Producer\My Video Files\Sales Video.wmv" begintime="10" begintrim="10" endtime="55" transitionindex="41"/>
            </sequence>

            <sequence type="slides">
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="0" begintime="10"/>
                    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="1" begintime="25"/>
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="2" begintime="35"/>
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="7" begintime="45" endtime="55">
                    <tocentryclip title="Slide 7" indent="1"/>
                </media>
            </sequence>

            <sequence type="HTML">
                <media src="G:\Projects\Producer\My HTML Pages\html1.html" endtime="10"/>
                <media src="G:\Projects\Producer\My HTML Pages\html2.html" endtime="25"/>
                <media src="G:\Projects\Producer\My HTML Pages\html3.html" endtime="35"/>
            </sequence>

            <sequence type="Layout">
                <media src="style3videoslideshtml.css" endtime="36"/>
            </sequence>

            <tocentry title="The beginning" begintime="0"/>
            <tocentry title="Slide 1" indent="1" begintime="10"/>
            <tocentry title="Slide 2" indent="1" begintime="25"/>
            <tocentry title="Slide 3" indent="1" begintime="35"/>
        </timeline>

    </presentation>
</producer>


Batch Asset Loading File Syntax

This topic describes the batch asset loading file elements supported by Producer. Producer batch asset loading file elements and attributes are case-sensitive, and must all be lowercase. All attribute values, even numerical values, must be surrounded by quotation marks, as in the following example:

(attribute="value")

This section describes the required and optional elements of the Producer batch asset loading file. In the syntax block, elements are followed by a number in parentheses that indicates how often the element is required, as described in this table. The only irregularity is the actions and presentation elements: you must have one and/or the other.

Symbol | Description
(0+) | The element is required zero or more times.
(0-1) | The element is required zero or one times.
(1+) | The element is required one or more times.
no modifier | The element is required exactly once.

The following syntax block shows the required and optional elements of the Producer PBF file.

<?ProducerBatchFile version="2.0"?>
<producer>
    <actions> (actions and/or presentation required)
        <action> (1+)
            <param> (0+)
            </param>
        </action>
    <presentation> (actions and/or presentation required)
        <properties> (0-1)
            <property> (0+)
            </property>
        </properties>
        <timeline> (0-1)
            <sequence> (0+)
                <media> (0+)
                    <effect> (0+)
                    </effect>
                    <tocentryclip> (0+)
                    </tocentryclip>
                </media>
            </sequence>
            <tocentry> (0+)
            </tocentry>
        </timeline>
    </presentation>
</producer>

Producer supports the following elements in batch asset loading files.

Element | Description
<?ProducerBatchFile version="2.0"?> | Required header for a Producer batch asset loading file. This does not have a matching closing element.
producer | Root element containing all Producer tags.
actions | Contains all action elements.
action | Describes a project-wide action to perform, such as build or load.
param | Contains parameters, if any, for an action element. This is a standard XML element, and is not defined in these documents.
presentation | Root element containing all data for the current project.
properties | Contains all properties for the project.
property | Describes a project property, such as author or publish destination.
timeline | Contains all elements describing the timeline of the project.
sequence | Contains a group of contiguous media files, such as a series of video clips, with any effects or transitions between them.
tocentry | Creates a table of contents entry assigned to a sequence, linked to an absolute time on the timeline.
media | Specifies a particular media element, such as a video clip, audio clip, or slide, on the timeline.
effect | Specifies an effect to apply to a media element.
tocentryclip | Creates a table of contents entry linked to a specific media element on the timeline.

See Also

  • Creating a Batch Asset Loading File
  • Running a Batch Asset Loading File
  • Producer Batch Asset Loading Interface


producer

The producer element is the root element for the Producer batch asset loading file. It takes no attributes.

Syntax

<producer>
</producer>

Example Code

<producer>
    <actions>
        <action command="logging">
            <param>c:\temp\logtest.txt</param>
        </action>
        <action command="build"/>
    </actions>

    <presentation>
        <properties>
                <property name="Author">Candy Spoon</property>
                <property name="Title"> A Basic Presentation</property>
                <property name="BackgroundColor">#E0E0E0</property>
                <property name="Copyright">Candy Spoon, All Rights Reserved, 2003</property>
                <property name="Description">This is a sample Producer Batch Asset Loading File</property>
                <property name="ImageFilename">G:\Projects\Producer\My Video Files\CoverPhoto.gif</property>
        </properties >

        <timeline>
            <sequence type="video">
                <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
                <media src ="G:\Projects\Producer\My Video Files\Sales Video.wmv" begintime="10" transitionindex="41"/>
            </sequence>

            <tocentry title="The beginning" begintime="0"/>
            <tocentry title="Slide 1" indent="1" begintime="10"/>
            <tocentry title="Slide 2" indent="1" begintime="25"/>
            <tocentry title="Slide 3" indent="1" begintime="35"/>

            <sequence type="slides">
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="0" begintime="10"/>
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="1" begintime="25"/>
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="2" begintime="35"/>
                <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="7" begintime="45" endtime="55">
                <tocentryclip title="Slide 7" indent="1"/>
                </media>
            </sequence>

            <sequence type="HTML">
                <media src="G:\Projects\Producer\My HTML Pages\html1.html" endtime="10"/>
                <media src="G:\Projects\Producer\My HTML Pages\html2.html" endtime="25"/>
                <media src="G:\Projects\Producer\My HTML Pages\html3.html" endtime="35"/>
            </sequence>

            <sequence type="Layout">
                <media src="style3videoslideshtml.css" endtime="36"/>
            </sequence>
        </timeline>
    </presentation>
</producer>

Parent/Child Elements

Hierarchy | Elements
Parent | None
Child
  • actions, presentation

See Also

  • Batch Asset Loading File Syntax


actions

The actions element contains a list of one or more action elements that describe Producer actions, such as building or saving. If this element is not included, the project will be built by default.

The actions element takes no attributes.

Syntax

<actions>
</actions>

Example Code

<actions>

    <action command="logging">

        <param>c:\temp\logtest.txt</param>

    </action>

    <action command="build"/>

    <action command="publish"/>

    <action command="save">

        <param>C:\myproducerfile.MSProducer</param>

    </action>

    <action command="pack">

        <param>C:\packaged producer file</param>

        <param>20</param>

    </action>

</actions>

Parent/Child Elements

Hierarchy | Elements
Parent | producer
Child
  • actions

See Also

  • Batch Asset Loading File Syntax


action

The action element lists a single application-level Producer action, such as building or saving. The action is specified by the command attribute.

Syntax

<action
    command="text string">
    <param>parameter value</param>
</action>

Attributes

command (required)

Required value specifying an action to take. Possible values are described in the following table.

Value | Parameters | Description
build | None | Builds a project or modifies project data using all the data in the presentation element, but does not save it. You must use the build value any time you change data in a project (for example, by specifying param elements or new media elements on the timeline), even if you are loading an existing project. To save this project after building, you must specify a save value for the command attribute.
publish | none | Publishes a presentation. Publish location is specified by the PublishDestination property element.
new | None | Creates a new project.
load | Path and file name | Loads an existing Producer project file, and performs additional actions upon it.
save | Path and file name | Saves a project as a Producer project file. Specify the full path and name, with an .MSProducer extension. If the path specified does not exist, this action will fail.
pack | Path and file name | Saves the presentation to an archive file using the path and file name specified. You must specify an .MSProducerZ file name extension. If the specified path does not exist, this action will fail. (See the topic Using the Pack and Go Wizard in Microsoft Producer Help for more information.)
 | Integer value | A second parameter for pack, specifies an integer value indicating the maximum size (in megabytes) of each piece of a multi-file archived project. Do not use, if you want the project saved as a single file.
unpackproject | Path and file name | Unpacks an existing Producer archive file. Include the full path and file name, including the .MSProducerZ extension. (See the topic Using the Pack and Go Wizard in Microsoft Producer Help for more information.)
exit | None | Closes Producer. Without this action, Producer remains open after the batch file is processed (unless an error occurs.
logging | Path and file name | Full path and file name of a text file that lists the actions taken when Producer reads the batch asset loading file. The file extension can be anything you choose, but is typically .txt or .log.

Remarks

When an attribute takes a parameter, such as a save location, the parameters follow the attribute, nested inside a param element. If an attribute value (such as pack) has multiple parameters, use separate param elements for each parameter, as shown in the following code:

<action command="pack">
    <param>C:\my projects\presentation.MSProducerZ</param>
    <param>1</param>
</action>

Example Code

<action command="load">
    <param>c:\my projects\myproj.msproducer</param>
</action>

Parent/Child Elements

Hierarchy | Elements
Parent | actions
Child
  • param (standard XML element not defined in these documents).

See Also

  • Batch Asset Loading File Syntax


presentation

The presentation element is the root element for all the data about a particular project.

This element takes no attributes.

Syntax

<presentation>
</presentation>

Example Code

<presentation>
    <properties>
        <property name="Author">Candy Spoon</property>
    </properties >
    <timeline>
        <sequence type="video">
            <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
            <media src ="G:\Projects\Producer\My Video Files\Sales Video.wmv" begintime="10" transitionindex="41"/>
        </sequence>

        <sequence type="slides">
            <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="0" begintime="10"/>
            <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="1" begintime="25"/>
        </sequence>

        <sequence type="Layout">
            <media src="style3videoslideshtml.css" endtime="36"/>
        </sequence>
    </timeline>
</presentation>

Parent/Child Elements

Hierarchy | Elements
Parent | producer
Child
  • properties, timeline

See Also

  • Batch Asset Loading File Syntax


properties

The properties element holds a number of property elements describing project properties. Many of these properties are the same as those exposed by the Properties Object.

This element takes no attributes.

Syntax

<properties>
</properties>

Example Code

<properties>
    <property name="Author">Candy Spoon</property>
    <property name="Title"> A Basic Presentation</property>
    <property name="BackgroundColor">#E0E0E0</property>
    <property name="Copyright">Candy Spoon, All Rights Reserved, 2003</property>
    <property name="PublishDestination">C:\temp</property>
    <property name="PublishProfile" index="0">PV000.PRX</property>
</properties >

Parent/Child Elements

Hierarchy | Elements
Parent | producer
Child
  • property

See Also

  • Properties Object
  • Batch Asset Loading File Syntax


property

A property element specifies metadata about a project. The property being set is specified by the name attribute. You can specify multiple properties in a project. Most of these properties are the same as those exposed by the Properties Object used in scripting. In array-based attribute values, such as PublishProfile, an additional index attribute specifies a zero-based index into the array.

Syntax

<property
    name="string value"
    index="integer value">
</property>

Attributes

name (required)

Describes a property that you want to set. Possible values are shown in the following table.

Value | Description
Author | Sets the Properties.Author property.
BackgroundColor | Sets the background color surrounding the video in the presentation. This accepts standard HTML string color names (such as Silver or Blue), as well as hexadecimal values in the format "#rrggbb" where rr, gg, and bb represent two-digit red, green, and blue hexadecimal values from 0 to 255.
BackupMediaFiles | Sets the Properties.BackupMediaFiles property.
Copyright | Sets the Properties.Copyright property.
Description | Sets the Properties.Description property.
DiscussionServerAddress | Sets the Properties.DiscussionServerAddress property.
DiscussionServerFriendlyName | Sets a friendly name associated with the discussion server named in DiscussionServerAddress. This is displayed on the pre-roll screen of the presentation.
ImageFilename | Sets the Properties.ImageFilename property.
Password | Sets the password to be used when access to a password-protected location is required for publishing. You may specify a user name (through the UserName value) and password to automate access to this location. This password is stored in the clear, so you should protect a file containing this value, or delete it when you are finished using it. If a password is required to publish in the destination specified by the PublishDestination value and one is not supplied (or the wrong one is supplied), the publish attempt will fail.
PublishDestination | Sets the WebHost.PublishDestination property. When using the publish value for the action element, you must specify the location with this property.
PublishName | Sets the Properties.PublishName property.
PublishProfile | Specifies the Profile Object to use for publishing. The profile to use is specified by profile name (PV000.PRX, for instance). You can find these profiles inside the ...\shared\profiles folder in the Producer installation path. This property takes an optional index attribute used when specifying multiple publish profiles. The index value specifies the display order in the drop-down box of available profiles, with zero being the default value, and higher numbers being farther from the default. (See the topic Setting presentation playback options in Producer Help for more information.) There is no default value for PublishProfile; it must be set in order to publish.
PublishWebHost | Specifies the WebHost Object to use for publishing. The WebHost to use is specified by name. The name for each WebHost can be found in the registry, under HKEY_CURRENT_USER\Software\Microsoft\Producer\WebHosts, or on the first page of Producer's Publish Wizard. This is similar to the Properties.PublishWebHost property.
Title | Sets the Properties.Title property.
TOCBackgroundColor | Sets the background color of the presentation table of contents. This accepts standard HTML string color names (such as Silver or Blue), as well as hexadecimal values in the format "#rrggbb" where rr, gg, and bb represent two-digit red, green, and blue hexadecimal values from 0 to 255.
TOCFont | Specifies the font to use for table of contents entries, for example "Verdana" or "Arial". This acts the same as the FACE attribute of the HTML <FONT> tag.
FontColor | Sets the font color of the presentation table of contents. This acts the same as the COLOR attribute of the HTML <FONT> tag. This accepts standard HTML string color names (such as Silver or Blue), as well as hexadecimal values in the format "#rrggbb" where rr, gg, and bb represent two-digit red, green, and blue hexadecimal values from 0 to 255.
TOCFontSize | Sets the font size of the table of contents. Any valid DHTML font size should work for this value, for instance example 14pt or xx-large.
UserName | Specifies a user name. When access is required to a password-protected location for publishing, you may specify a user name and password to automate access to this location. Specify the password with the Password property. You can place these two values in any order. If a password and user name are required to publish in the destination specified by PublishDestination, and one is not supplied (or the wrong one is supplied), the publish attempt will fail.
WindowsMediaPlaybackAddress | Sets the WebHost.WindowsMediaPlaybackAddress property.
WindowsMediaPublishDestination | Sets the WebHost.WindowsMediaPublishDestination property.

index (optional)

Used only if the property is indexed, such as the PublishProfile value. It is a zero-based integer index value.

Remarks

PublishProfile and PublishDestination must both be set before you can publish a project.

Note If your presentation uses a template that defines font color, size, background color, or other display elements, and you try setting these elements with FontColor, TOCFontSize, or other property values, the template values will override the property values.

Example Code

<properties>
    <property name="Title"> My Presentation </property>
    <property name="TOCBackgroundColor">green</property>
    <property name="TOCFont"> Arial </property>
    <property name="PublishName"> MyPresentation </property>
    <property name="PublishProfile" index=0> PV000.PRX </property>
    <property name="PublishProfile" index=1> CUSTOM.PRX </property>
</properties>

Parent/Child Elements

Hierarchy | Elements
Parent | properties
Child
  • None

See Also

  • Properties Object
  • WebHost Object
  • Batch Asset Loading File Syntax


timeline

The timeline element holds all information about the timeline of a project. This includes the audio and video sequence, as well as effect and transition locations.

This element takes no attributes.

Syntax

<timeline>
</timeline>

Example Code

<timeline>
    <sequence type="video">
        <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
        <media src ="G:\Projects\Producer\My Video Files\Sales Video.wmv" begintime="10" transitionindex="41"/>
    </sequence>

    <sequence type="slides">
        <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="0" begintime="10"/>
        <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="1" begintime="25"/>
        <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="2" begintime="35"/>
        <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="7" begintime="45" endtime="55"/>
     </sequence>

    <tocentry title="The beginning" begintime="0"/>
    <tocentry title="Slide 1" indent="1" begintime="10"/>
    <tocentry title="Slide 2" indent="1" begintime="25"/>
    <tocentry title="Slide 3" indent="1" begintime="35"/>
</timeline>

Parent/Child Elements

Hierarchy | Elements
Parent | presentation
Child
  • sequence, tocentry

See Also

  • Batch Asset Loading File Syntax


sequence

A sequence element holds a sequence of media elements of the same type (audio, video, and so on) on the timeline. So, for example, if you have three video clips in sequence, they can be contained inside a single sequence element. If these video clips are followed by a graphic, however, the graphic must be in a new sequence element following the video sequence element. You can only have one sequence block of each type in the timeline, and the first media element in each sequence starts at time zero unless specified otherwise.

Syntax

<sequence>
    type="string value">
</sequence>

Attributes

type (required)

Describes the type of media elements contained in this sequence. All elements must be of the same type, from the following list of string values. You may only have one sequence of each type in a timeline element, and all sequences begin at time zero, unless otherwise specified in the media element. For a video, HTML, or slide to appear in your presentation, the display template you use must have a display section for that particular media type.

Value | Description
video | A sequence of video elements in the timeline.
audio | A sequence of audio elements for the audio 2 track in the timeline.
HTML | A sequence of HTML pages (either cached or live) for the timeline.
slides | A sequence of PowerPoint slides (individual slides or a whole presentation) for the timeline.
Layout | A sequence of template cascading style sheets for the timeline. Cascading style sheets control the layout of the presentation in the viewer's browser. See the media element for more information on using templates.

Example Code

The following example creates two overlapping video clips with a five-second star wipe transition, accompanied by two slides that change as the videos transition.

<sequence type="video">
    <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
    <media src ="G:\Projects\Producer\My Video Files\Sales Video.wmv" begintime="10" transitionindex="41"/>
</sequence>
<sequence type="slides">
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="1" endtime="12"/>
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="2" begintime="12" endtime="36"/>
</sequence>

Parent/Child Elements

Hierarchy | Elements
Parent | timeline
Child
  • media

See Also

  • Batch Asset Loading File Syntax


media

A media element describes a single, unbroken segment of a single media type in the timeline. This can be an audio or video clip, a single slide from a PowerPoint presentation (using the index attribute) or the entire presentation, or a cascading style sheet. Cascading style sheets specify the layout of the Producer presentation when viewed in a Web browser. An unbroken video or audio segment may be only a piece of a larger file, but it can only be trimmed from the front and/or the back, not spliced segments.

Syntax

<media
    src="string value"
    begintime="floating point value"
    endtime="floating point value"
    begintrim="floating point value"
    endtrim="floating point value"
    index="integer value"
    transitionindex="integer value"
    autotoc="true" | "false"
    live | link="true"
    name="string">
</media>

Attributes

src (required)

Specifies the source file.

begintime (optional)

Specifies the absolute start time for this media element in the timeline. If a begintime attribute is not specified, media elements will be added sequentially in the order that they appear in the file. The first media element in a sequence has a default begintime of zero.

endtime (optional)

Specifies the absolute end time on the timeline for this media element in the timeline. Note that if you do not specify an end time, the media element will stretch out to fill the default time for that media type specified in Producer, overlapping any following media clips with a defined begintime.

begintrim (optional)

Specifies how many seconds to trim from the beginning of the source media clip. This is used to extract a segment of media from an original file to use in your presentation.

endtrim (optional)

Specifies how many seconds to trim from the end of the source media clip. This is used to extract a segment of media from an original file to use in your presentation.

index (optional)

Specifies which slide in a PowerPoint presentation to use, for slide-type media elements (the type is specified in the containing sequence element). This is a zero-based integer index into the presentation. If you omit this value, all slides will be used.

transitionindex (optional)

Specifies a transition to use between two overlapping video segments. The value is a zero-based integer index, specified in the second video segment in an overlapping pair (see Remarks). If this is used in a clip without an overlap, you will receive an error. If this is not specified in an overlapping pair, a simple fade will be used. See the table in Remarks for the list of possible values.

autotoc (optional)

Specifies whether Producer should create a table of contents entry for each slide element, based on the slide's title. If set to "false," or not used, no table of contents entries will be created, and you can then create your own entries if you wish, using the tocentryclip element.

live | link (required by non-locally stored HTML elements)

If this is an HTML media element that is not locally stored, you must specify either live or link, and set the value to "true". Live specifies that the Web page is loaded and displayed from the specified URL when the presentation is viewed; link specifies that a hyperlink with the name specified by name is shown on the presentation window.

name (required and only used by HTML elements with the link attribute)

Specifies a name to display on the HTML timeline, and as the hyperlink text in the presentation. If not specified in a link-type HTML element, no hyperlink will appear.

Remarks

All media elements in the same sequence element must be of the same media type, specified by the sequence element's type attribute.

Each media element allows you to specify its start and end times within the timeline, as a floating integer. If a specified time only contains a portion of a frame (for example, less than 1/30 of a second in an NTSC sample), the fraction will be dropped to include only whole frames.

If a media element is longer than the amount of time specified in the timeline, it will be trimmed from the end to fit into the time slot. For example, imagine that the beach.wmv file in the following code is 60 seconds long.

<media src="c:\my videos\beach.wmv" begintime="0"  endtime="30"
                                    begintrim="10" endtrim="0">

In this example, you specify that 10 seconds should be trimmed from the beginning of beach.wmv. However, the file will still be too long for the timeline space: you specify 30 seconds for it in the timeline (endtime minus begintime), but the file is still 50 seconds (original length minus begintrim). Therefore, an additional 20 seconds will be trimmed automatically from the end of the clip to enable it to fit into the time slot.

Because media elements specify their start and end times within the entire timeline, you could place them in any order in your XML file. However, if you place similar media types in a non-sequential order, this could cause unexpected results.

A video media element can overlap with other video elements. When you overlap two video elements on the timeline, you can specify a transition by index, as specified in the following table (if none is specified, the default transition is a fade). Note that you cannot cross-fade audio elements, or have transitions between any elements except video elements.

Transition Index | Transition Name
0 | Iris
1 | Fade
2 | Checkerboard, Across
3 | Random Dissolve
4 | Random Bars
5 | Pixelate, Fine
6 | Pixelate, Normal
7 | Pixelate, Heavy
8 | Diagonal, Block Wipe
9 | Wipe, Wide Down
10 | Wipe, Normal Down
11 | Wipe, Narrow Down
12 | Wipe, Wide Right
13 | Wipe, Normal Right
14 | Wipe, Narrow Right
15 | Slide, Right
16 | Slide, Down
17 | Inset, Down Right
18 | Inset, Down Left
19 | Inset, Up Left
20 | Inset, Up Right
21 | Inset, In
22 | Split, Vertical
23 | Split, Horizontal
24 | Diagonal, Down Right
25 | Bow Tie, Vertical
26 | Bow Tie, Horizontal
27 | Split, Diagonal Out
28 | Diagonal, Cross Out
29 | Diagonal, Box Out
30 | Filled V, Down
31 | Filled V, Left
32 | Filled V, Up
33 | Filled V, Right
34 | Hollow V, Up
35 | Hollow V, Down
36 | Zig Zag, Vertical
37 | Zig Zag, Horizontal
38 | Rectangle, Out
39 | Diamond, Out
40 | Circle, Out
41 | Star, 5 Points
42 | Waterfall, Right
43 | Wheel, 4 Spokes

You can specify one or more effects for a video clip by using the effect element.

A media element can also specify a cascading style sheet template to control the appearance of your presentation in the viewer's browser. Producer is installed with a number of templates, listed in the tree pane under Presentation Templates. To use one of these, select Presentation Templates in the tree pane, then right-click the template you want in the contents pane. Select Properties on the pop-up menu, and enter only the file name of the template you want. When adding your own custom templates, add them inside the <producer installation path>\1033\Template\ folder, or Producer might not be able to find your templates, particularly when making a project archive. The example in this section uses provided Producer templates.

Example Code

This example creates a timeline with two overlapping video clips, the first ending at 15 seconds, the second beginning at 10 seconds, with a star wipe transition. The first clip is trimmed to 15 seconds, but the second is the full length of the source clip.

<sequence type="video">
    <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
    <media src ="G:\Projects\Producer\My Video Files\Sales Video.wmv" begintime="10" transitionindex="41"/>
</sequence>

<sequence type="html">
    <media src="G:\\Projects\\Producer\\My HTML Pages\\html1.html" begintime="0" endtime="5"/>
    <media src="G:\\Projects\\Producer\\My HTML Pages\\html2.html" begintime="5" endtime="10"/>
    <media src="G:\\Projects\\Producer\\My HTML Pages\\html3.html" begintime="10" endtime="15"/>
    <media src="http://www.microsoft.com" live="true" begintime="15" endtime="25"/>
    <media src="http://www.msn.com" link="true" name="MSN Website" begintime="25" endtime="35"/>
</sequence>

The following example inserts three sequential HTML pages. No begintime is specified, so they are sequential, but the endtime attribute ensures when they will change. If endtime had not been specified, they would have stretched out to the full default slide length specified in Producer.

<sequence type="slides">
<sequence type="HTML">
    <media src="G:\Projects\Producer\My HTML Pages\html1.html" endtime="12"/>
    <media src="G:\Projects\Producer\My HTML Pages\html2.html" endtime="24"/>
    <media src="G:\Projects\Producer\My HTML Pages\html3.html" endtime="36"/>
</sequence>

Parent/Child Elements

Hierarchy | Elements
Parent | sequence
Child
  • effect

See Also

  • effect
  • Batch Asset Loading File Syntax


effect

An effect element specifies a Producer effect to use on a specified piece of media. Producer includes a list of standard effects, such as Ripple or Grayscale, which are referred to by a zero-based index, determined by the index attribute. A media element can have zero or more effect elements. If you apply an effect to an inappropriate media element (such as an HTML media element), the effect will be ignored.

Syntax

<effect index="integer value"/>

Attributes

index (required)

A zero-based index specifying the effect to use. Possible values are shown in the following table.

Value | Effect Name
0 | Fade Out, To Black
1 | Fade In, From Black
2 | Fade Out, To White
3 | Fade In, From White
4 | Brightness, Increase
5 | Brightness, Decrease
6 | Pixelate
7 | Mirror Image
8 | Rotate 90
9 | Rotate 180
10 | Rotate 270
11 | Grayscale
12 | Film Grain
13 | Ripple
14 | Smudge Stick
15 | Graphic Pen
16 | Watercolor

17

Example

The following code adds the "Ripple" effect to a segment of video. This segment appears in the first thirty seconds of the project, and has ten seconds trimmed from the start of the original video.

<media src="c:\my videos\beach.wmv" begintime="0"  endtime="30"
                                    begintrim="10" endtrim="0">
    <effect index="13"/>
</media>

Parent/Child Elements

Hierarchy | Elements
Parent | media
Child
  • None

See Also

  • media
  • Batch Asset Loading File Syntax


tocentry

The tocentry element allows an application to specify a table of contents entry linked to an absolute time on the timeline. The table of contents is a list of hyperlinks in the presentation screen that allow a viewer to jump to specific times in the presentation. A tocentry element immediately follows the sequence element it applies to, and links to the start time of that element on the timeline (with an optional offset, specified by the begintime attribute).

You may stack several of these elements sequentially in the XML, but unless you specify an offset time, they will all point to the same start time, that of the sequence element to which they are attached. Therefore, you may put them in any order in the XML, and they will be compiled correctly because each element should have a unique start time.

You can also attach a table of contents entry to a media element, by using a tocentryclip element. All tocentry and tocentryclip elements in the project are compiled into a single table of contents. You must handle the indentation to indicate subtopics, if you wish.

Syntax

<tocentry
    title="string value"
    indent="integer value"
    begintime="floating point value">
</tocentry>

Attributes

title (required)

Specifies the text that will appear as the table of contents entry.

indent (optional)

Indicates how many levels to indent the entry, from zero to 3, where zero is no indentation and 3 is the most indented.

begintime (optional)

A floating-point value indicating the number of seconds into the timeline from absolute time zero to anchor the link.

Example Code

The following sample code shows a video sequence and four slides. It adds four table of contents entries at zero, 10, 25, and 35 seconds in the timeline.

<sequence type="video">
    <media src="G:\Projects\Producer\My Video Files\Marketing Video.wmv" endtime="15" />
</sequence>

<sequence type="slides">
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="0" begintime="10"/>
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="1" begintime="25"/>
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="2" begintime="35"/>
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" index="7" begintime="45" endtime="55"/>
</sequence>

<tocentry title="The beginning"/>
<tocentry title="Slide 1" indent="1" begintime="10"/>
<tocentry title="Slide 2" indent="1" begintime="25"/>
<tocentry title="Slide 3" indent="1" begintime="35"/>

Parent/Child Elements

Hierarchy | Elements
Parent | sequence
Child | None

See Also

  • sequence
  • tocentryclip
  • Batch Asset Loading File Syntax


tocentryclip

The tocentryclip element is just like the tocentry element, except that it applies to a media element, and the default link time is to the start time of that media element. This element allows an application to specify a table of contents entry in a Producer project specified by a media element, without having to worry about calculating the correct begintime attribute.

The table of contents is a list of hyperlinks in the presentation screen that allow a viewer to jump to specified places in the presentation. A tocentryclip element immediately follows the media element it applies to, and links to the start time of that element on the timeline (with an optional offset, specified by the begintime attribute).

You may stack several of these elements sequentially, but unless you specify an offset time, they will all point to the same start time, that of the media element to which they are attached.

You can also attach a table of contents entry to a sequence element, by using a tocentry element. All tocentry and tocentryclip elements in the project are compiled into a single table of contents. You must handle the indentation to indicate subtopics.

Syntax

<tocentryclip
    title="string value"
    indent="integer value"
    begintime="floating point value">
</tocentryclip>

Attributes

title (required)

Specifies the text that will appear as the table of contents entry.

indent (optional)

Indicates how many levels to indent the entry from zero to 3, where zero is no indentation, and 3 is the most indenting.

begintime (optional)

Indicates the number of seconds into the associated media element (not the absolute time on the timeline) to anchor the link. If not specified, it starts at the same time as the associated media element.

Example Code

The following sample code adds four table of contents entries linked to a video clip. The first entry links to the beginning of the video, by default.

<sequence type="video">
    <media src="G:\Projects\Producer\My Videos\Lecture.wmv">
        <tocentryclip title="The problem" indent="1"/>
        <tocentryclip title="The background" indent="1" begintime="10"/>
        <tocentryclip title="The solution" indent="1" begintime="25"/>
        <tocentryclip title="The cost" indent="1" begintime="35"/>
    </media>
</sequence>

The following sample inserts a PowerPoint presentation with automatically generated table of contents entries.

<sequence type="slides">
    <media src="G:\Projects\Producer\My Slides\My Slides.ppt" autotoc="true"/>
</sequence>

Parent/Child Elements

Hierarchy | Elements
Parent | media
Child
  • None

See Also

  • media
  • tocentry
  • Batch Asset Loading File Syntax


Batch Asset Interface Error Codes

If Producer encounters an error during batch asset loading file processing, it will end and return an error code. The following table lists the error codes that Producer can return when processing a batch asset loading file. Any hosting application that is running Producer can catch these errors and attempt to handle them. If batch processing succeeds, it returns S_OK.

To catch these errors, you must define them in your application.

Error Code | Hexadecimal Value | Description
S_OK | 0x00000000 | The build succeeded.
E_FAIL | 0x80000008 | Unspecified error.
E_INVALIDARG | 0x80070057 | One or more arguments are invalid.
EWMT_FILENOTFOUND | 0xC9470064 | A file to be imported could not be found.
E_PBF_MISSING_TAG | 0xC94700D1 | A required element is missing from the batch asset loading file. The file must contain one producer element, and at least one of either actions or presentation.
E_PBF_ACTION_MISSING_COMMAND | 0xC94700D2 | An action element is missing the command attribute.
E_PBF_COMMAND_MISSING_PARAM | 0xC94700D3 | An action element is missing a required parameter.
E_PBF_COMMAND_FILE_NOT_FOUND | 0xC94700D4 | A file specified for an action element cannot be found, cannot be loaded, or is the wrong type.
E_PBF_EXPECTED_PARAM | 0xC94700D5 | action elements may only have param elements as children.
E_PBF_PROPERTY_MISSING_NAME | 0xC94700D6 | A property element is missing the name attribute.
E_PBF_PROPERTY_UNKNOWN | 0xC94700D7 | An unknown property was specified in the properties section.
E_PBF_SEQUENCE_TYPE_UNKNOWN | 0xC94700D8 | The sequence type is not one of the known types.
E_PBF_MEDIA_WRONG_TRACK | 0xC94700D9 | A media element was added to the wrong sequence type.
E_PBF_SLIDE_INDEX_OUT_RANGE | 0xC94700DA | A PowerPoint file does not have a slide of the specified index.
E_PBF_TRANSITION_INDEX_OUT_RANGE | 0xC94700DB | A transition index is out of range of available transitions.
E_PBF_EFFECT_INDEX_OUT_RANGE | 0xC94700DC | An effect index is out of range of available effects.
E_PBF_MEDIA_DURATION_NEGATIVE | 0xC94700DD | A media element's begintime attribute is greater than its endtime attribute.
E_PBF_COLLECTIONS_MEDIA_NOTFOUND | 0xC94700DE | A file could not be imported or was not found in the collections.
E_PBF_PROFILE_NOT_FOUND | 0xC94700DF | A publish profile file specified by a property element could not be found.
E_PBF_WEBHOST_NOT_FOUND | 0xC94700E0 | The Web host specified by a property element could not be found.
E_PBF_TOCENTRY_MISSING_NAME | 0xC94700E1 | A table of contents entry was specified, using tocentry or tocentryclip, without a title attribute.
E_PBF_MEDIA_MISSING_SRC | 0xC94700E2 | The src attribute is missing from a media element.
E_PBF_NO_CREATE_LOG_FILE` | 0xC94700E3 | The logging action element could not create the specified log file with write access.
E_PBF_FASTPUBLISH_NOT_AVAILABLE | 0xC94700E4 | The timeline requires recompression but does not fulfill all the requirements needed for smart recompression. See Publisher.CalculateBestPublishProfile for a list of requirements for smart recompression. You must change your timeline to fulfill all these criteria before you can publish.

See Also

  • Producer Batch Asset Loading Interface


Glossary

To find a term in the glossary, click the letter of the alphabet that is the first letter in the term you want to look up.

You can also read glossary terms within the text of Help by clicking the underlined glossary term links. After you click a glossary link, the glossary term and definition appear in a pop-up window. To close the window, click anywhere on the screen.

A | B | C | D | E | F | G | H | I | J | K | L | M
N | O | P | Q | R | S | T | U | V | W | X | Y | Z

B

bit rate

The number of bits transferred per second.

Back to Top

C

clip

Small segment of a larger video file.

content

Audio, video, images, text, or any other information that is contained in a digital media file or stream.

Back to Top

E

Extensible Markup Language (XML)

A markup language that provides a format for describing structured data. XML is a World Wide Web Consortium (W3C) specification, and is a subset of Standard Generalized Markup Language (SGML).

Back to Top

F

frame rate

The number of video frames displayed per second. Higher frame rates generally produce smoother movement in the picture.

Back to Top

P

presentation

In Microsoft Producer, the final version of a project that is published. A presentation contains any slides, video, audio, HTML code, still images, presentation templates, or other digital media files that have been added to the timeline.

profile

A group of settings that match content type and bit rate with appropriate audio and video codecs.

project file

The file that contains information about the files that have been imported into or captured in the current project, and how files or clips have been arranged.

Back to Top

S

source

Audio and video content that can be captured and encoded from devices installed on your computer or from a file.

Back to Top

T

timeline

The area of the user interface that shows the timing and arrangement of files or clips that make up a project.

Back to Top

U

Uniform Resource Locator (URL)

The address of a resource on a network. It conforms to the protocol://servername/resource syntax, where protocol is the name of the protocol used (such as http), servername is the name of the server, and resource is the directory path and file name of the resource. If a resource is not specified, a default one is often provided by the server.

URL

See definition for: Uniform Resource Locator (URL)

Back to Top

W

Windows Media file

A file containing audio, video, or script data that is stored in Windows Media Format. Depending on their content and purpose, Windows Media files use a variety of file name extensions, such as: .wma, .wme, .wms, .wmv, .wmx, .wmz, or .wvx.

Back to Top

X

XML

See definition for: Extensible Markup Language (XML)

Back to Top

Previous


Legal Notice

Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, people and events depicted herein are fictitious and no association with any real company, organization, product, person or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2001-2003 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows Media, Windows NT, ActiveSync, ActiveX, Direct3D, DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow, DirectSound, DirectX, FrontPage, HighMAT, JScript, Microsoft Press, MSN, NetShow, Outlook, PowerPoint, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Win32, and Win32s are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

This software is based in part on the work of the Independent JPEG Group.

GIF decompression code, copyright 1990, David Koblas. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.