Microsoft Producer for PowerPoint 2003 SDK banner art
PreviousNext

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

See Also

PreviousNext


© 2001-2003 Microsoft Corporation. All rights reserved.