Shaun McCance
shaunm@gnome.org 2007-2009
Insert an image, video, or other multimedia object.

# Inline Multimedia Objects

    mal_inline_media = element media {
      mal_attr_link ?,
      attribute style { xsd:NMTOKENS } ?,
      attribute type { "image" | "video" | "audio" | "application" } ?,
      attribute mime { text } ?,
      attribute src { text },
      attribute height { text } ?,
      attribute width { text } ?,
      attribute * - (mal:* | local:*) { text } *,

      mal_inline
    }

Use the `media` element to insert an image, video, or other multimedia object into your document. Since not all display tools will be able to display all types of objects, you can provide fallback elements in the contents of a `media` element. See for details on how fallback elements are handled.

# Notas

The `media` element can contain a mixture of text and any general inline elements.

The `media` element can occur in any general inline context, including inside most inline elements, some basic block elements, and certain informational elements.

The `media` element can link to other pages or documents. See for more information.

The `style` attribute takes a space-separated list of style hints. Processing tools should adjust their behavior according to those style hints they understand.

The `mime` attribute takes a valid MIME type for the object that is being inserted.

The `media` element can have attributes from external namespaces. See for more information on external-namespace attributes.

The `media` element may also be used in a block context. See for more information.

# Ejemplos

Use `media` to insert an image into your document:

<p><media type="image" mime="image/png" src="figures/mallard.png"> Drake, the Mallard mascot </media></p>

Drake, the Mallard mascot

# Processing Expectations

When a `media` element occurs in an inline context, it is displayed inline. The exact rendering of a `media` element will depend on the `type` and `mime` attributes. It may be necessary to add controls for audio and video objects.

The `application` type is intended for embedding interactive applications in documents. There are currently no specific recommendations for displaying application objects. Behavior may vary according to the type of application being embedded.

Some display tools will not be able to display all types of objects. For example, a printed document will not be able to display video or play back audio. Even when a display tool can display the type of object, it may not be able to work with the given MIME type for technical or other reasons.

When a display tool cannot display a `media` element, it displays the child elements of the element, as if the `media` element itself were replaced by its children. The child elements may consist of simply another `media` element referencing a different type of content. When processing any child `media` elements, display tools may need to fall back further to their child elements.

In some display media, multimedia objects can have alternate text. This may be displayed when a user hovers over the object, or it may be provided to assistive technologies. When displaying in such a medium, display tools should extract the text value of a `media` element by processing its child elements, and recursively processing any child `media` elements, as if it can not display any types of `media` elements.

# Comparison to Other Formats

The `media` element can be used in place of the DocBook elements `audioobject`, `imageobject`, and `videoobject`. DocBook uses the `inlinemediaobject` element to provide alternative objects. In Mallard, alternative objects are nested, obviating the need for a container element.