Embedded Object (Multimedia) Support

EditLive! for XML supports the embedding of multimedia content in XHTML sections through the use of <object> tags. This section provides information on how the multimedia support of EditLive! for XML functions and how to configure multimedia support within EditLive! for XML.

Multimedia Overview

Multimedia support within EditLive! for XML is achieved by embedding content via <object> tags and their associated <param> tags. EditLive! for XML supports the embedding of any form of multimedia content via the <object> tag provided that the relevant configuration information has been provided for the format. Multimedia objects can be inserted either using local files or files within a WebDAV repository. If a local file is used then this file will be uploaded when the content from EditLive! for XML is submitted.

Multimedia objects embedded within EditLive! for XML are presented to the user as icon within a resizable area. The icon can be seen below:

Figure 10.1. Icon use to represent multimedia objects

Icon use to represent multimedia objects

While most of the parameters and properties for the multimedia type are configured, to some extent, via the EditLive! for XML configuration file the height, width and data attributes of the <object> tag must be specified by the user. The height and width are used to provided the dimensions, if any, for the object while the data attribute contains the URL for the location of the object source file.

Configuration

Configuration information of multimedia content is provided via the <multimedia> element within the configuration file. For each multimedia file type to be used with EditLive! for XML a separate <type> configuration element must be provided. Types are differentiated by their unique name attribute.

The <type> element serves a dual purpose. Some of the settings within the <type> element are used to configure the Insert Object and Object Properties dialogs while others are used to configure the attributes of the <object> tag to be inserted into EditLive! for XML. The section below provides definitions of the behaviors of each attribute:

Interface Configuration Attributes

name

The name is presented to the user within the Insert Object dialog's File Type drop down.

Figure 10.2. List of Available Types

List of Available Types
extension

The file extension associated with this object type. When EditLive! for XML detects an object that has a source file that has the specified extension the Object Properties dialog will be displayed accordingly when displayed.

urlParam

This attribute specifies which <param> element is to contain the URL for the source file for the object if required. EditLive! for XML will automatically assign the URL for the source file to be the value for the <param> tag with the name specified via this attribute.

Note

The URL for the source file will be stored in the data attribute of the <object> tag irrespective of this setting.

allowCustomParams

This attribute indicates whether users can add custom parameters to the list of available parameters for the object. When set to false users are restricted to providing values for the parameters specified by the EditLive! for XML configuration file.

<object> Tag Configuration Attributes

type

This attribute maps directly to the <object> tag's type attribute. While the meaning of this attribute is browser dependant it is often used to specify the MIME type of object.

codebase

This attribute maps directly to the <object> tag's codebase attribute. While the meaning of this attribute is browser dependant it is often used to specify the download URL for the program or plug-in used to render this object type in the browser.

classid

This attribute maps directly to the <object> tag's classid attribute. The meaning of this attribute is browser dependant.

<param> Tag Configuration

A list of possible <param> tags to be used with the <object> can be configured via the <param> elements associated with the <type> element within the EditLive! for XML. Each <param> element allows a name attribute to be specified for the parameter. The user will then be able to choose a parameter with this name in the Object Properties dialog in EditLive! for XML and provide an associated value. This can be seen in the following figure:

Figure 10.3. Parameter listing in the Object Properties Dialog

Parameter listing in the Object Properties Dialog

The dialog options shown above could be generated by the following XML configuration settings:

<editLive>
  ...
  <mediaSettings>
    ...
    <multimedia>
      <types>
        ...
        <type 
          name="Macromedia Flash" 
          type="application/x-shockwave-flash" 
          extension="swf" 
          allowCustomParams="true" 
          urlParam="movie"
        >
          <param name="movie" />
          <param name="quality" />
          <param name="bgcolor" />
        </type>
        ...
      </types>
    </multimedia>
  </mediaSettings>
  ...
</editLive>

The name-value pairs specified in the Parameters tab of the Object Properties dialog are inserted into EditLive! for XML as <param> tags associated with the relevant <object> tag.

Example

This example demonstrates how to configure EditLive! for XML in the following way:

The following multimedia types will be available for inserting with the listed configuration:

Macromedia Flash

Associated with the extension .swf, the MIME type application/x-shockwave-flash and the parameter with the name movie will be used to specify the source URL for the object in addition to the data attribute.

MP3

Associated with the extension .mp3, the MIME type application/x-mplayer2 and as no parameter is specified for the urlParam only the data attribute will be used to store the location of the object source file.

AVI

Associated with the extension .avi, the MIME type application/x-mplayer2 and as no parameter is specified for the urlParam only the data attribute will be used to store the location of the object source file.

WAV

Associated with the extension .wav, the MIME type application/x-mplayer2 and as no parameter is specified for the urlParam only the data attribute will be used to store the location of the object source file.

The Macromedia Flash type will have the following parameters available and will not permit users to enter custom parameters:

  • movie

  • quality

  • bgcolor

The three other types will not have any predefined parameters, but users may specify any custom parameters.

The configuration used to achieve these settings is as follows:

...
<types>
    <type 
        name="Macromedia Flash" 
        type="application/x-shockwave-flash" 
        extension="swf" 
        allowCustomParams="false" 
        urlParam="movie"
     >
        <param name="movie" />
        <param name="quality" />
        <param name="bgcolor" />
    </type>
    <type 
        name="MP3 Audio" 
        type="application/x-mplayer2" 
        extension="mp3" 
        allowCustomParams="true" 
    />
    <type 
        name="AVI" 
        type="application/x-mplayer2" 
        extension="avi" 
        allowCustomParams="true" 
    />
    <type 
        name="WAV Audio" 
        type="application/x-mplayer2" 
        extension="wav" 
        allowCustomParams="true" 
    />
</types>
...

The Object Properties dialog would appear as follows for these settings:

Figure 10.4. Object Example - Multimedia Types

Object Example - Multimedia Types

Figure 10.5. Object Example - Macromedia Flash Parameters

Object Example - Macromedia Flash Parameters

Object File Sources

Objects can be inserted either from the file system of the client machine or from a WebDAV repository.

Inserting Local Files

In order for local files to be inserted as multimedia objects in EditLive! for XML the file upload properties of EditLive! for XML must be correctly configured. For more information on this please see the article on Using HTTP for Image and Object Upload in Ephox EditLive! for XML.

Inserting from a WebDAV Repository

EditLive! for XML can be configured to enable multimedia files to be inserted from a WebDAV repository. This is achieved by configuring the <webdav> child element of the <multimedia> element. For more information on how to configure WebDAV support for EditLive! for XML see the chapter on Using WebDAV with EditLive! for XML.

See Also