Inserting Media
To insert a media component:
-
In the Design Structure Window of the desired file, locate the node in
which you wish to insert a media component.
-
In the Component Palette, select Simple Components
from the dropdown list, and then drag and drop the media
component to the parent node of your choice.
The media node is inserted and
highlighted under the expanded parent node.
-
In the Property Inspector, set the following attributes for the media
component:
-
source - Enter the URI that specifies the location of the
media resource. This is required. If no contentType is specified,
the contentType will be inferred from the extension of the source
attribute.
-
standbyText - Enter the message to display in the media
player while the media resource is loading.
-
autoStart - Select true to load and play the media resource
automatically without user initiation. Default is false.
-
contentType - Enter the MIME type of the media content
returned by the source URI. Use this attribute as a hint when
determining which player to pick, how the controls of the player
are to be configured, and the default size of the media player. If
contentType isn't specified, the contentType will be inferred from
the extension of the source URI.
-
controls - Select the set of controls to be made available
to the user for controlling the media playback. The actual set of
controls displayed for the same value may differ between players.
Likewise, the amount of space occupied by the controls will differ
from media player to media player. This can cause problems if the
size of the media control has been specified by the "width" and
"height" attributes rather than "innerWidth" and "innerHeight"
attributes. Supported values are:
-
none
- Don't show any controls for the media
player and don't allow control access through alternate means
such as context menus. This value is typically only used in
kiosk-type applications where no user control over the playing
of the media is allowed. It is typically used in conjunction
with setting the "autostart" attribute to "true", and the
"playCount" attribute to "0" to cause the media to play
immediately and then loop.
-
noneVisible
- Don't show any controls for the
media player but allow control access through alternate means
such as context menus. This value is typically only used in
applications where user control over the playing of the media
is allowed, but not encouraged. It is typically used in
conjunction with setting the "autostart" attribute to "true",
and the "playCount" attribute to "0" to cause the media to
play immediately and then loop.
-
minimal
- Show a minimal set of controls for
playing media on the media player. This value gives users
control over the most important media playing controls, while
occupying the least amount of additional space on the user
agent.
-
typical
- Default. Show the typical set of
controls for playing media on the media player. This value
gives users control over the most common media playing
controls, without occupying an inordinate amount of extra
space on the user agent.
-
all
- Show all available controls for playing
media on the media player. Using this setting can cause a
large amount of additional space to be required, depending on
the media player used.
-
height - Enter the height in pixels to reserve for the
media player plus its content. As the extra height needed for the
media player controls can vary from media player to media player
and depend on the controls displayed in the media player, it is
recommended that the "innerHeight" attribute be used in preference
to this attribute. If both the "height" and "innerHeight"
attributes are specified, the "height" attribute will be used. If
no height is specified, the height of the media control is
determined by calculating the "innerHeight" and adding any extra
height necessary to display the media player controls.
-
inlineStyle - Enter the inline CSS style for the standby
text of this element. In the right column, click the
icon to open a dialog, then click New to enter the
CSS property values. The property element defines a single
name/value pair. The name is defined by the Name attribute, and
the Value by the plain-text contents of the element. For example,
you can enter 'color' for Name, and 'red' for Value. In the
Advanced tab, you can enter an EL syntax data binding expression or use
the Bind to Data dialog to select a data source for this complex
attribute.
-
innerHeight - Enter the height in pixels to reserve for the
media player content. This will typically be set to the pixel
height of the media resource to display. If no "innerHeight" is
specified, the "innerHeight" will be defaulted based on the
content type of the media resource to play. If both the "height"
and "innerHeight" attributes are specified, the "height" attribute
will be used.
-
innerWidth - Enter the width in pixels to reserve for the
media player content. This will typically be set to the pixel
width of the media resource to display. If no "innerWidth" is
specified, the "innerWidth" will be defaulted based on the content
type of the media resource to play. If both the "width" and
"innerWidth" attributes are specified, the "width" attribute will
be used.
-
playCount - Enter the number of times the media resource
will play. If set to "0", the resource will loop until the user
stops the playing.
-
player - Select the media player to use to play the media
resource. If possible, the media control will accomodate this
request. However, if the requested player is not available on the
user agent, or does not support playing the media resource, an
alternate player will be used instead. In all cases, the "link"
player is used if no other player is available, or if the
requested player fails for some reason. Supported values are:
-
link
- Use a link in the user agent page to
launch the playing of the media resource. This player setting
uses the least amount of space on the page and uses the user
agent's built-in content type mapping to determine how to
display the media resource.
-
quicktime
- Use the Apple QuickTime player.
-
w
indows
- Use the Windows Media Player.
-
real
- Use the RealPlayer.
-
width - Enter the width in pixels to reserve for the media
player plus its content. As the extra width needed for the media
player controls can vary from media player to media player and
depend on the controls displayed in the media player, it is
recommended that the "innerWidth" attribute be used in preference
to this attribute. If both the "width" and "innerWidth" attributes
are specified, the "width" attribute will be used. If no width is
specified, the width of the media control is determined by
calculating the "innerWidth" and adding any extra width necessary
to display the media player controls.
Note: To use data binding, see
Data Binding a Component Attribute.
Examples (UIX XML)
...
<media source="house.wma" />
...
<media source="house.wma"
controls="minimal"
shortDesc="Bad House Music"
standyText="I wish I wasn't loading this..."/>
...
<media source="seattle.wmv"
innerWidth="160"
innerHeight="112"
autostart="true"
controls="all" />
...
Related topics
About Media
Working with Simple and
Miscellaneous Components
Copyright © 1997, 2004, Oracle.
All rights reserved.