Differences

This shows you the differences between two versions of the page.

Link to this comparison view

media [2014/09/16 14:26] (current)
Line 1: Line 1:
 +===== The <media> Element =====
 +==== Definition and Usage ====
 +
 +The [[media|<media>]] element defines a media object containing: perceptual media
 +content; imperative code content; declarative code content; UTC content; or
 +global variables for the application. The object type is defined by the
 +//type// attribute or is inferred by the file extension used in the
 +//src// attribute.
 +
 +Four special types are defined:
 +
 +  * The "application/x-ncl-NCL" (or "application/x-ginga-NCL") type is
 +    applied to [[media|<media>]] elements with NCL code content (note thus that
 +    an NCL application can embedded another NCL application).
 +
 +  * The "application/x-ncl-NCLua" (or "application/x-ginga-NCLua") type is
 +    applied to [[media|<media>]] elements with Lua imperative code content.
 +
 +  * The "application/x-ncl-settings" (or "application/x-ginga-settings") is
 +    applied to a special [[media|<media>]] element (there may be only one in an
 +    NCL document, but it may be reused as child element of other
 +    [[context|<context>]] elements) whose properties are global variables
 +    (properties defined by the document author or reserved environment
 +    properties managed by the system) that may be manipulated by the NCL
 +    document processor. The media object of "application/x-ncl-settings" type
 +    does not have content to be exhibited. Once an NCL application is
 +    started, the properties of this media object are available for rule
 +    evaluations defined by [[rule|<rule>]] elements. In order to use these
 +    properties in [[link|<link>]] element definitions, they must be explicitly
 +    declared.
 +
 +  * The application/x-ncl-time (or application/x-ginga-time) type shall be
 +    applied to a special [[media|<media>]] element (there may be only one in an
 +    NCL document, but it may be reused as child element of other
 +    [[context|<context>]] elements), whose content is the UTC. When it is started,
 +    the UTC content is not exhibited; however, it can be used to define
 +    content anchors by using [[area|<area>]] elements. Note that any continuous
 +    [[media|<media>]] element with no source specified can be used to define a
 +    clock relative to the [[media|<media>]] element start time.
 +
 +=== Reuse of media objects ===
 +
 +Excepting [[media|<media>]] elements of "application/x-ncl-NCL" and
 +"application/x-ncl-NCLua" types, a [[media|<media>]] element may refer to another
 +[[media|<media>]] element of the same document or to an imported [[media|<media>]]
 +element. All attributes and child elements defined by the referred element
 +are inherited by the referring element, except the //focusIndex//
 +attribute. All attributes and child elements defined by the referring
 +element must be ignored by the NCL player, except the following attributes
 +and child elements:
 +
 +  * //id// attribute, which shall be defined.
 +
 +  * //instance// attribute, which may be defined, otherwise has "new" as
 +    its default string value;
 +
 +  * Child [[area|<area>]] elements may be added. If the new added [[area|<area>]]
 +    element has the same //id// attribute of an already existent
 +    [[area|<area>]] element (defined in the reused [[media|<media>]] element), the
 +    new added [[area|<area>]] is ignored by the NCL player.
 +
 +  * Child [[property|<property>]] elements may be added. If the new added
 +    [[property|<property>]] element has the same name attribute of an already
 +    existing [[property|<property>]] element (defined in the reused [[media|<media>]]
 +    element), the new added [[property|<property>]]is ignored by the NCL player.
 +
 +The referred element and the element that refers to it shall be considered
 +the same, regarding its data specification. They shall also be considered
 +the same regarding their presentation, if the instance attribute receives
 +the "instSame" or "gradSame" values.
 +
 +The following semantics must be respected when reusing a [[media|<media>]]
 +element. Assume the set of [[media|<media>]] elements composed of the referred
 +[[media|<media>]] element and all the referring [[media|<media>]] elements.
 +
 +  * If any element of the subset formed by the referred [[media|<media>]] element
 +    and all other [[media|<media>]] elements having the instance attribute equal
 +    to "instSame" or "gradSame" is scheduled to be presented, all other
 +    elements in this subset, which are not descendants of a [[switch|<switch>]]
 +    element, are also assumed as scheduled for presenting, and more than
 +    that, when they are being presented, they are represented by the same
 +    presentation instance. Descendant elements of a [[switch|<switch>]] element
 +    have the same behavior if the rules needed to present them are
 +    satisfied, otherwise they are not scheduled for presenting.
 +    * If the instance attribute is equal to "instSame", all scheduled nodes
 +      of the subset are immediately presented through a unique instance
 +      (start instruction applied on all of them) if a start instruction is
 +      applied in any of them.
 +    * If the instance attribute is equal to "gradSame", all scheduled nodes
 +      of the subset are presented through a unique instance, but now
 +      gradually, as soon as start instructions are applied on them, coming
 +      from a link, etc.
 +    * As each [[media|<media>]] element starts its presentation,the  common
 +      instance in presentation must notify the events associated with
 +      its [[area|<area>]] and [[property|<property>]] elements.
 +
 +  * The [[media|<media>]] elements in the set that have instance attribute values
 +    equal to "new" are not scheduled for presenting if any other element in
 +    the set is scheduled to be presented. When they are individually
 +    scheduled for presenting, no other element in the set is
 +    affected. Moreover, new independent presentation instances shall be
 +    created at each individual presentation starting.
 +
 +==== Syntax ====
 +^ Element ^ Attributes ^ Content ^ Parent ^
 +| [[media|<media>]] | __//id//__, //src//, //type//, //refer//, //instance//, //descriptor// | ([[area|<area>]] <nowiki>|</nowiki> [[property|<property>]])* | [[body|<body>]] or [[context|<context>]] or [[switch|<switch>]] |
 +==== Attributes ====
 +
 +^ Name ^ Value ^ Description ^
 +| //id// | It may receive any string value that begins with a letter or an underscore and that only contains letters, digits, <".">, and <"_">. | The //id// attribute uniquely identifies the element within a document. |
 +| //src// | <html><p></html>The following are valid values:<html></p></html><html><ul></html><html><li class="level1"><div class="li"></html><"<nowiki>file:///file_path/#fragment_identifier</nowiki>"> -- for local files,<html></div></li></html><html><li class="level1"><div class="li"></html><"<nowiki>http://server_identifier/file_path/#fragment_identifier</nowiki>"> -- for remote files downloaded using the HTTP protocol,<html></div></li></html><html><li class="level1"><div class="li"></html><"<nowiki>https://server_identifier/file_path/#fragment_identifier</nowiki>"> -- for remote files downloaded using the HTTPS protocol,<html></div></li></html><html><li class="level1"><div class="li"></html><"<nowiki>rtsp://server_identifier/file_path/#fragment_identifier</nowiki>"> -- for streams downloaded using the RTSP protocol,<html></div></li></html><html><li class="level1"><div class="li"></html><"<nowiki>rtp://server_identifier/file_path/#fragment_identifier</nowiki>"> -- for streams downloaded using the RTP protocol,<html></div></li></html><html><li class="level1"><div class="li"></html><"<nowiki>ncl-mirror://media_element_identifier</nowiki>"> -- for a content flow identical to the one in presentation by another [[media|<media>]] element,<html></div></li></html><html><li class="level1"><div class="li"></html><"<nowiki>sbtvd-ts:</nowiki>"> or <"<nowiki>isdb-ts:</nowiki>"> or <"<nowiki>ts://program_number.component_tag</nowiki>"> -- for elementary streams received from the transport stream.<html></div></li></html><html></ul></html><html><p></html>For //src// attribute whose value identifies the <"sbtvd-ts">, <"isdb-ts">, or <"ts"> scheme, the "program_number.component_tag", can be substituted by the following reserved words:<html></p></html><html><ul></html><html><li class="level1"><div class="li"></html>"video" -- corresponding to the primary video ES being presented on the video plan,<html></div></li></html><html><li class="level1"><div class="li"></html>"audio" -- corresponding to the primary audio ES,<html></div></li></html><html><li class="level1"><div class="li"></html>"text" -- corresponding to the primary text ES,<html></div></li></html><html><li class="level1"><div class="li"></html>"video(i)" -- corresponding to the //i//-th smaller video ES "component_tag" listed in the PMT of the tuned services,<html></div></li></html><html><li class="level1"><div class="li"></html>"audio(i)" -- corresponding to the //i//-th smaller audio ES "component_tag" listed in the PMT of the tuned services, or<html></div></li></html><html><li class="level1"><div class="li"></html>"text(i)" -- corresponding to the //i//-th smaller text ES "component_tag" listed in the PMT of the tuned services.<html></div></li></html><html></ul></html> | The //src// attribute is the locator for the media object content.  |
 +| //type// | <html><p></html>String.<html></p></html><html><p></html>It shall follow MIME Media Types format.  Four special types are defined: "application/x-ncl-NCL" (or "application/x-ginga-NCL"), "application/x-ncl-NCLua" (or "application/x-ginga-NCLua"), "application/x-ncl-settings" (or "application/x-ginga-settings"), and "application/x-ncl-time" (or "application/x-ginga-time").<html></p></html> | The //type// attribute shall follow MIME Media Types format (or, more simply, mimetypes). A mimetype is a string that defines the class of media (audio, video, image, text, application) and a media encoding type (such as jpeg, mpeg, etc.). Mimetypes may be registered or informal. Registered mimetypes are controlled by the IANA. Informal mimetypes are not registered with IANA, but are defined by common agreement; they usually have an "x-" before the media type name. |
 +| //refer// | IDREF or the string "alias#id" where "id" is an IDREF value. | <html><p></html>The //refer// attribute refers to a [[media|<media>]] element //id// that will be reused. An element that refers to another element cannot be reused; that is, its //id// cannot be the value of any //refer// attribute. The referred element must be a [[media|<media>]] element.<html></p></html><html><p></html>The referred element and the element that refers to it is considered the same regarding their data specification.<html></p></html><html><p></html>If the referred media object is defined within an imported document D, the refer attribute value must have the format "alias#id", where "alias" is the value of the alias attribute associated with the imported D document.<html></p></html> |
 +| //instance// | "new", "instSame", or "gradSame". | Specifies the reuse type.  The "new" value defines a new presentation instance but inheriting the specification of the referred [[media|<media>]] element.  The "instSame" value defines a same presentation instance that is immediately started as soon as the referred [[media|<media>]] element or any other [[media|<media>]] elements referring to it with instance attribute equal to "instSame" is started, or if a start instruction is applied on it.  The "gradSame" value defines a same presentation instance that is started as soon an start instruction is applied on it, coming from a link, etc. |
 +| //descriptor// | IDREF. | The //descriptor// attribute refers to a [[descriptor|<descriptor>]] element. |
 +
 +
 +
 +
  
Back to top