SlideShare a Scribd company logo
5   Defining Structure, Metadata and Layout Building the Outline
5.1 About a SMIL File Can be read by humans! Create with any text editor Depends on the language  implementation Host Language provides self-contained file Basic structure is similar to HTML Filename extension is  .smil Using  .smi  can cause problems with MIME types Integration Set embeds SMIL timing and synchronisation within HTML Basic structure is HTML SMIL integration ignored by non-supporting browsers Filename extension is . htm .html
5.2 Design Guidelines Always observe copyright law No rights to media under  Copyright Licensing Agency   agreements for UK HEI For audio check with  Mechanical Copyright Protection Society Copyright violation can be  very costly Create images, video and audio Consult with Audio Visual Services (AVS) Do initial design on paper or in drawing package Assemble assets in an organised file system Note down ideas seen on TV and in other media Remember to backup work frequently!
5.3 SMIL Authoring Rules & Guidelines Comment and indent  to aid readability <!-- use HTML comments --> SMIL is an XML based language so case matters Elements and attributes use lower or camel case ( camelCase ) <layout> <fadeColor> Exceptions such as  <root-layout> Attribute values are enclosed in “double quotes” dur=“25s” Binary elements have a closing element <par></par> Unary elements must close with a forward slash <region id=“”… /> Some elements can be both binary or unary <t:img> … </t:img>  or  <t:img …/> Observe case in filepath names <audio src=“edlectures/SEAMUS.rm”>  not the same as  <audio src=“edlectures/seamus.rm”>
5.4 Structure of a SMIL file  xmlns  attribute defines the XML namespace Not required for SMIL 1.0 applications URL used as a unique identifier it is not accessed by the client <head>  section is optional – usually included <meta>  tags used to provide metainformation for clients <body>  lists content and order of its presentation <smil  xmlns =&quot;http://www.w3.org/2001/SMIL20/Language&quot;> <head>   <!-- Metadata definitions go here --> <meta … /> <layout> <!– Layout of presentation is defined here --> </layout> </head> <body> <!– Timing and content of presentation defined here --> </body> </smil>
5.5 QuickTime SMIL Extensions Must declare if presentation uses QT SMIL extensions QuickTime SMIL Extensions are documented at http://www.apple.com/quicktime/authoring/qtsmil2.html Complete QuickTime and SMIL documentation at http://developer.apple.com/documentation/QuickTime/IQ_InteractiveMovies/quicktimeandsmil/chapter_10_section_1.html URL used as a unique identifier Identifier is not accessed by the client Some attributes set for the  <smil>  element autoplay ,  next Other attributes are set for media elements:  <video>,   <img>  and  <audio> chapter ,  immediate-instantiation <smil xmlns:qt= http:// www.apple.com/quicktime/resources/smilextensions ”  qt:autoplay=“true” qt:next=“part6.smil”> ... </smil>
5.6 RealNetwork SMIL Extensions RealNetworks provides an extensive list of extensions to SMIL 2 Used in addition to standard namespace declaration for SMIL2 Must declare namespace(s) if SMIL code uses RN extensions Declaration does not require that namespace is used Prefix relates attribute to a specific namespace rn : calls extensions for effects cv : calls extensions for checking the version of the player Can be used to: Switch between SMIL1 and SMIL2 content based on client version or screen resolution Manipulate image transparency Referenced as prefix:attribute=“value”  e.g.  rn:mediaOpacity=“50%” Can use an alternative prefix to “rn” for calling extensions Extensions are documented in RealNetworks Production Guide (on CD) Not documented in a single reference <smil xmlns=&quot;http://www.w3.org/2001/SMIL20/Language&quot; xmlns:rn=“ http://features.real.com/2001/SMIL20/Extensions ” xmlns:cv=“ http:// features.real.com/systemComponent ”> ... </smil>
5.7 Metainformation Similar to <meta> element in HTML Used by SMIL clients to display information about presentation RealONE: title, author, copyright  QuickTime: author and content SMIL 1  defines a minimum set  of attributes SMIL 2 uses <metadata> element to include W3C’s RDF statements No presently supported in SMIL clients RDF metadata can be  several times larger  than the SMIL Overrides metadata encoded in the media clip Consumed by search engine robots and used in displaying search results <head> <meta name=&quot;author&quot; content=&quot;John A. Smith&quot; /> <meta name=&quot;title&quot; content=&quot;South West Coastal Path&quot;/> <meta name=&quot;copyright&quot; content=&quot;(c) 2000 John A. Smith&quot; /> <meta name=&quot;abstract&quot; content=&quot;A presentation using images video and  audio to illustrate the beauty of the South West Coastal Path&quot; /> </head>
5.8 Layout Single  <root-layout>  for presentation Provide id to allow manipulation and animation Sizes are defined in pixels Defines the size of the client playback window Smallest computer screen is 640x80 (VGA) Others are 800x600, 1024x768 and 1280x1024 Set a background colour: “red”, #FF0000, rgb(255,0,0) SMIL 1 background-color (QuickTime) SMIL 2 backgroundColor Examples Real ONE QuickTime <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;# nnnnn &quot; width=&quot;640&quot; height=&quot;480&quot; /> </layout>
5.8.1 Layout (continued) <topLayout>  defines secondary top-level windows Sizes are defined in pixels Only implemented in RealONE player No control over window placement on display surface Audio continues to play after window is closed Open second window at start of presentation (default) Use whenActive and whenNotActive attributes Can contain any number of defined regions Examples RealONE  default behaviour RealONE  whenActive behaviour <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;#nnnnn&quot; width=&quot;640&quot; height=&quot;480&quot; /> <topLayout id=“vidpanel” width=“320” height=“240” backgroundColor=“white”> <region id=“subtitles” … /> </topLayout> … </layout>
5.8.2 Switching Layouts <switch>  can be used to swap layouts depending on client characteristics Possible uses Language preference settings Adapt presentation to network condition of client Show subtitles to accompany video clip Show text version of audio clip Examples Real ONE  switch on  systemLanguage  attribute value <switch> <!-- Layout for English-UK clients --> <layout  systemLanguage =“en”> … </layout> <!-- Layout for French-France clients --> <layout systemLanguage=“fr”> … </layout> </switch>
5.9 Regions and Positioning Default backgroundColor is “transparent” backgroundColor=“inherit”  uses the  <root-layout>  colour Position of region defined relative to parent using: top ,  bottom ,  left  and  right  attributes Can be pixel or % (percentage) values Volume of an audio region can be set 0% is silent, 100% is full volume and 200% is twice full volume Audio level is relative to volume setting of the playback device <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;#FF0000&quot; width=&quot;640&quot; height=&quot;480&quot; /> <region id=&quot;video&quot; width=&quot;320&quot; height=&quot;240&quot; top=&quot;120&quot; left=&quot;50&quot; /> <region id=&quot;title&quot; width=&quot;150&quot; height=&quot;40&quot; top=&quot;300“ left=&quot;50“backgroundColor=&quot;teal&quot; /> <region id=&quot;audio&quot; soundLevel=&quot;50%&quot; /> </layout>
5.9.1 Registration Points Purpose is to support precise positioning of content Can be use in two ways: Define  regPoint  in the clip source tag Define  regPoint  as part of the layout and assign to the clip (Recommended) regPoint  defines a precise location within a region Set of typical values: topLeft, topMid, topRight, midLeft, center, midRight, bottomLeft, bottomMid  and  bottomRight regpoint values can also be given as x,y coordinates from top-left corner regAlign  positions the content in relation to the regPoint Uses same values as regPoint Interaction of  regPoint ,  regAlign  and  fit  attributes is complex See W3C standard for  explanation Use  RealNetworks  examples <layout> <!-- Define registration points --> <regPoint id=&quot;centre&quot; left=&quot;50%&quot; top=&quot;50%&quot; regAlign=&quot;center&quot; /> </layout> … <textstream id=&quot;intro1&quot;  systemLanguage=&quot;en&quot; src=&quot;text/intro.rt&quot; region=&quot;screen&quot; regPoint=&quot;center&quot; regAlign=“center” begin=&quot;panel4.begin+3s&quot; />
5.10 Layering and Fitting Exactly the same as the  z-index  in the CSS2 specification Root window has a default value of “0” (zero) z-index  attribute defines the layering of overlapping regions Values can be positive or negative numbers z-index=“5”  or  z-index=“-4” Use contiguous values e.g. 10, 20, 30, 40 etc. Higher values display over lower values fit  attributes defines how visual media is “fitted” into a region Possible values are:  fill hidden meet scroll slice <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;#nnnnn&quot; width=&quot;640&quot; height=&quot;480&quot; /> <region id=&quot;video&quot; width=&quot;320&quot; height=&quot;240&quot; top=&quot;120&quot; left=&quot;50&quot;  z-index=&quot;1“ fit=&quot;&quot;/> <region id=&quot;title&quot; width=&quot;150&quot; height=&quot;40&quot; top=&quot;300&quot; left=&quot;50“  backgroundColor=&quot;teal&quot; z-index=&quot;2&quot;/> <region id=&quot;audio&quot; soundLevel=&quot;50%&quot; /> </layout>
5.11 z-index and regions Defines root region  Image region with z-index of “0” (zero) Video region with z-index of “1” Image region acts as a backdrop Video is layered over the backdrop Example <layout> <root-layout width=&quot;280&quot; height=&quot;220&quot;/> <region id=&quot;image&quot; top=&quot;10&quot; left=&quot;10&quot; width=&quot;260&quot; height=&quot;200&quot; z-index=&quot;0&quot;/> <region id=&quot;video&quot; top=&quot;20&quot; left=&quot;20&quot; width=&quot;240&quot; height=&quot;180&quot; z-index=&quot;1&quot;/> </layout>
5.12  fit  attribute values fill Scale the object's height and width independently so that the content just touches all edges of the box.  hidden If the intrinsic height (width) of the media object element is smaller than the height (width) defined in the  region  element, render the object starting from the top (left) edge and fill up the remaining height (width) with the background color.  If the intrinsic height (width) of the media object element is greater than the height (width) defined in the  region  element, render the object starting from the top (left) edge until the height (width) defined in the  region  element is reached, and clip the parts of the object below (right of) the height (width).  meet Scale the visual media object while preserving its aspect ratio until its height or width is equal to the value specified by the height or width attributes, while none of the content is clipped. The object's left top corner is positioned at the top-left coordinates of the box, and empty space at the right or bottom is filled up with the background color.  slice Scale the visual media object while preserving its aspect ratio so that its height or width are equal to the value specified by the height and width attributes while some of the content may get clipped. Depending on the exact situation, either a horizontal or a vertical slice of the visual media object is displayed. Overflow width is clipped from the right of the media object. Overflow height is clipped from the bottom of the media object.  scroll A scrolling mechanism should be invoked when the element's rendered contents exceed its bounds.  Example
5.13 Embedded SMIL: Structure XHTML+TIME brings SMIL2 behaviours to HTML in IE5.5 and IE6 Declares the XML Namespace “t” (for time) URN provides a unique and persistent identifier for it Declare a CSS attribute for HTML elements to use “time2” behaviour Import the time2 behaviours into the namespace Recipe to include in the HEAD of the HTML document Could be included dynamically using SSI, PHP, ASP etc. Keep a local HTML+TIME template handy <html  xmlns:t =&quot;urn:schemas-microsoft-com:time“  > <head> <style> .time {behavior: url(#default#time2);} </style> <?import namespace=t urn=&quot;urn:schemas-microsoft-com:time“ implementation=&quot;#default#time2&quot; /> </head> <body> <!--Content goes here --> </body> </html>
5.14 Metainformation Use HTML  <meta>  tags as in any other web pages Check the organisation’s metadata standards Greater range of metadata supported than in dedicated SMIL aware  media players Consumed by search engine robots and used in the display of search results Include automatically as part of a dynamically generated web page  <head> <meta name=&quot;author&quot; content=&quot;John Smith&quot;> <meta name=&quot;description&quot; content=&quot;A SMIL presentation of the SWCP&quot;> <meta name=&quot;keywords&quot; content=&quot;SMIL, smil, walking, coastal, path&quot;> </head>
5.15 Layout and Positioning Layout is controlled using Cascading Style Sheets (CSS2) CSS cannot define the size of a browser window Call  a javascript function for window.open  <div>  is used to declare discreet division in the HTML page class  attribute is used call time behaviours Use the  style  attribute to define position position:absolute position:relative Use top and left for most positioning right, bottom, width and height can be used Position with pixel values for consistency Other values can be used –  em pt in mm Provide an  id  to permit reference to the div Example <body> . . . <div class=&quot;time&quot; id=&quot;intro&quot; style=&quot;position:absolute; left:50px; top:50px&quot;> <p>South West Coastal Path: Summer 2000</p> </div> . . . </body>
5.15.1 Using Cascading Style Sheet Example .txtPanel  /* Define style for text panel */ {  /* This can be called from class attribute */  position:absolute;  top:90px; /* Use pixel values */  left:420px;  width:200px;  height:260px;  background-color:#silver;  /* Background is white */ z-index:2 /* Set z-index for this style */ } #rootContainer  /* Define style for root window */ { /* Applied to element with corresponding id attribute value */ position:absolute;  top:0px;  left:0px;  width:640px;  height:480px;  background-color:#99ccff;  z-index:0 /* Set z-index for this style */ }
5.16 Layering and Fitting z-index  value defines the layering of overlapping  <div>  elements Value is a point on a z-axis extending towards and away from the viewer Higher values are displayed over lower values Values can be positive or negative numbers: “5” or “-4” Progression using sequential ordering 1,2,3 or 10, 20, 30 etc. is suggested Exactly the same as the  z-index  in the CSS2 specification fit  attribute is not available Use CSS2 elements and attributes supported in IEv6 overflow overflowx  and  overflowy Values are:  visible scroll hidden auto See  MSDN Library  for further details Examples <body> <t:img class=&quot;time&quot; id=&quot;swcpimg1&quot; begin=&quot;2&quot; dur=&quot;7&quot;  z-index=&quot;2&quot;  src=&quot;images/img2045.jpeg“ style=&quot;position:absolute; top:120px; left:140px&quot;/> </body>

More Related Content

PPS
SMIL Containers
PPS
Timing and Synchronisation
PPTX
Secrets of a Blazor Component Artisan (v2)
PPTX
Html 5.0
PPTX
Writing java script for Csharp's Blazor
PDF
Getting Ignited with EE2
PPT
Dan Holevoet, Google
PPTX
ColdFusion Builder Extensions
SMIL Containers
Timing and Synchronisation
Secrets of a Blazor Component Artisan (v2)
Html 5.0
Writing java script for Csharp's Blazor
Getting Ignited with EE2
Dan Holevoet, Google
ColdFusion Builder Extensions

Similar to Defining Structure Metadata and Layout (20)

PPT
Introduction to Web Design
PPT
Keep SMILing
PPT
Flex For Flash Developers Ff 2006 Final
PPT
Intro to html
PPT
Intro to html
PPT
Web design
PPT
Silver Light By Nyros Developer
PPT
PPT
How the web works june 2010
PPT
Html5 Overview
PPT
PPT
Cleveland Silverlight Firestarter - XAML Basics
PPT
PPT
Expanding a tree node
PPT
KMUTNB - Internet Programming 3/7
PPT
Creating Yahoo Mobile Widgets
PPT
Xhtml Part1
PPT
HTML5 Fundamentals
PPT
XHTML and CSS
PPT
Html Intro2
Introduction to Web Design
Keep SMILing
Flex For Flash Developers Ff 2006 Final
Intro to html
Intro to html
Web design
Silver Light By Nyros Developer
How the web works june 2010
Html5 Overview
Cleveland Silverlight Firestarter - XAML Basics
Expanding a tree node
KMUTNB - Internet Programming 3/7
Creating Yahoo Mobile Widgets
Xhtml Part1
HTML5 Fundamentals
XHTML and CSS
Html Intro2
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Cloud computing and distributed systems.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectroscopy.pptx food analysis technology
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Programs and apps: productivity, graphics, security and other tools
Cloud computing and distributed systems.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Network Security Unit 5.pdf for BCA BBA.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Ad

Defining Structure Metadata and Layout

  • 1. 5 Defining Structure, Metadata and Layout Building the Outline
  • 2. 5.1 About a SMIL File Can be read by humans! Create with any text editor Depends on the language implementation Host Language provides self-contained file Basic structure is similar to HTML Filename extension is .smil Using .smi can cause problems with MIME types Integration Set embeds SMIL timing and synchronisation within HTML Basic structure is HTML SMIL integration ignored by non-supporting browsers Filename extension is . htm .html
  • 3. 5.2 Design Guidelines Always observe copyright law No rights to media under Copyright Licensing Agency agreements for UK HEI For audio check with Mechanical Copyright Protection Society Copyright violation can be very costly Create images, video and audio Consult with Audio Visual Services (AVS) Do initial design on paper or in drawing package Assemble assets in an organised file system Note down ideas seen on TV and in other media Remember to backup work frequently!
  • 4. 5.3 SMIL Authoring Rules & Guidelines Comment and indent to aid readability <!-- use HTML comments --> SMIL is an XML based language so case matters Elements and attributes use lower or camel case ( camelCase ) <layout> <fadeColor> Exceptions such as <root-layout> Attribute values are enclosed in “double quotes” dur=“25s” Binary elements have a closing element <par></par> Unary elements must close with a forward slash <region id=“”… /> Some elements can be both binary or unary <t:img> … </t:img> or <t:img …/> Observe case in filepath names <audio src=“edlectures/SEAMUS.rm”> not the same as <audio src=“edlectures/seamus.rm”>
  • 5. 5.4 Structure of a SMIL file xmlns attribute defines the XML namespace Not required for SMIL 1.0 applications URL used as a unique identifier it is not accessed by the client <head> section is optional – usually included <meta> tags used to provide metainformation for clients <body> lists content and order of its presentation <smil xmlns =&quot;http://www.w3.org/2001/SMIL20/Language&quot;> <head> <!-- Metadata definitions go here --> <meta … /> <layout> <!– Layout of presentation is defined here --> </layout> </head> <body> <!– Timing and content of presentation defined here --> </body> </smil>
  • 6. 5.5 QuickTime SMIL Extensions Must declare if presentation uses QT SMIL extensions QuickTime SMIL Extensions are documented at http://www.apple.com/quicktime/authoring/qtsmil2.html Complete QuickTime and SMIL documentation at http://developer.apple.com/documentation/QuickTime/IQ_InteractiveMovies/quicktimeandsmil/chapter_10_section_1.html URL used as a unique identifier Identifier is not accessed by the client Some attributes set for the <smil> element autoplay , next Other attributes are set for media elements: <video>, <img> and <audio> chapter , immediate-instantiation <smil xmlns:qt= http:// www.apple.com/quicktime/resources/smilextensions ” qt:autoplay=“true” qt:next=“part6.smil”> ... </smil>
  • 7. 5.6 RealNetwork SMIL Extensions RealNetworks provides an extensive list of extensions to SMIL 2 Used in addition to standard namespace declaration for SMIL2 Must declare namespace(s) if SMIL code uses RN extensions Declaration does not require that namespace is used Prefix relates attribute to a specific namespace rn : calls extensions for effects cv : calls extensions for checking the version of the player Can be used to: Switch between SMIL1 and SMIL2 content based on client version or screen resolution Manipulate image transparency Referenced as prefix:attribute=“value” e.g. rn:mediaOpacity=“50%” Can use an alternative prefix to “rn” for calling extensions Extensions are documented in RealNetworks Production Guide (on CD) Not documented in a single reference <smil xmlns=&quot;http://www.w3.org/2001/SMIL20/Language&quot; xmlns:rn=“ http://features.real.com/2001/SMIL20/Extensions ” xmlns:cv=“ http:// features.real.com/systemComponent ”> ... </smil>
  • 8. 5.7 Metainformation Similar to <meta> element in HTML Used by SMIL clients to display information about presentation RealONE: title, author, copyright QuickTime: author and content SMIL 1 defines a minimum set of attributes SMIL 2 uses <metadata> element to include W3C’s RDF statements No presently supported in SMIL clients RDF metadata can be several times larger than the SMIL Overrides metadata encoded in the media clip Consumed by search engine robots and used in displaying search results <head> <meta name=&quot;author&quot; content=&quot;John A. Smith&quot; /> <meta name=&quot;title&quot; content=&quot;South West Coastal Path&quot;/> <meta name=&quot;copyright&quot; content=&quot;(c) 2000 John A. Smith&quot; /> <meta name=&quot;abstract&quot; content=&quot;A presentation using images video and audio to illustrate the beauty of the South West Coastal Path&quot; /> </head>
  • 9. 5.8 Layout Single <root-layout> for presentation Provide id to allow manipulation and animation Sizes are defined in pixels Defines the size of the client playback window Smallest computer screen is 640x80 (VGA) Others are 800x600, 1024x768 and 1280x1024 Set a background colour: “red”, #FF0000, rgb(255,0,0) SMIL 1 background-color (QuickTime) SMIL 2 backgroundColor Examples Real ONE QuickTime <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;# nnnnn &quot; width=&quot;640&quot; height=&quot;480&quot; /> </layout>
  • 10. 5.8.1 Layout (continued) <topLayout> defines secondary top-level windows Sizes are defined in pixels Only implemented in RealONE player No control over window placement on display surface Audio continues to play after window is closed Open second window at start of presentation (default) Use whenActive and whenNotActive attributes Can contain any number of defined regions Examples RealONE default behaviour RealONE whenActive behaviour <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;#nnnnn&quot; width=&quot;640&quot; height=&quot;480&quot; /> <topLayout id=“vidpanel” width=“320” height=“240” backgroundColor=“white”> <region id=“subtitles” … /> </topLayout> … </layout>
  • 11. 5.8.2 Switching Layouts <switch> can be used to swap layouts depending on client characteristics Possible uses Language preference settings Adapt presentation to network condition of client Show subtitles to accompany video clip Show text version of audio clip Examples Real ONE switch on systemLanguage attribute value <switch> <!-- Layout for English-UK clients --> <layout systemLanguage =“en”> … </layout> <!-- Layout for French-France clients --> <layout systemLanguage=“fr”> … </layout> </switch>
  • 12. 5.9 Regions and Positioning Default backgroundColor is “transparent” backgroundColor=“inherit” uses the <root-layout> colour Position of region defined relative to parent using: top , bottom , left and right attributes Can be pixel or % (percentage) values Volume of an audio region can be set 0% is silent, 100% is full volume and 200% is twice full volume Audio level is relative to volume setting of the playback device <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;#FF0000&quot; width=&quot;640&quot; height=&quot;480&quot; /> <region id=&quot;video&quot; width=&quot;320&quot; height=&quot;240&quot; top=&quot;120&quot; left=&quot;50&quot; /> <region id=&quot;title&quot; width=&quot;150&quot; height=&quot;40&quot; top=&quot;300“ left=&quot;50“backgroundColor=&quot;teal&quot; /> <region id=&quot;audio&quot; soundLevel=&quot;50%&quot; /> </layout>
  • 13. 5.9.1 Registration Points Purpose is to support precise positioning of content Can be use in two ways: Define regPoint in the clip source tag Define regPoint as part of the layout and assign to the clip (Recommended) regPoint defines a precise location within a region Set of typical values: topLeft, topMid, topRight, midLeft, center, midRight, bottomLeft, bottomMid and bottomRight regpoint values can also be given as x,y coordinates from top-left corner regAlign positions the content in relation to the regPoint Uses same values as regPoint Interaction of regPoint , regAlign and fit attributes is complex See W3C standard for explanation Use RealNetworks examples <layout> <!-- Define registration points --> <regPoint id=&quot;centre&quot; left=&quot;50%&quot; top=&quot;50%&quot; regAlign=&quot;center&quot; /> </layout> … <textstream id=&quot;intro1&quot; systemLanguage=&quot;en&quot; src=&quot;text/intro.rt&quot; region=&quot;screen&quot; regPoint=&quot;center&quot; regAlign=“center” begin=&quot;panel4.begin+3s&quot; />
  • 14. 5.10 Layering and Fitting Exactly the same as the z-index in the CSS2 specification Root window has a default value of “0” (zero) z-index attribute defines the layering of overlapping regions Values can be positive or negative numbers z-index=“5” or z-index=“-4” Use contiguous values e.g. 10, 20, 30, 40 etc. Higher values display over lower values fit attributes defines how visual media is “fitted” into a region Possible values are: fill hidden meet scroll slice <layout> <root-layout id=&quot;main&quot; backgroundColor=&quot;#nnnnn&quot; width=&quot;640&quot; height=&quot;480&quot; /> <region id=&quot;video&quot; width=&quot;320&quot; height=&quot;240&quot; top=&quot;120&quot; left=&quot;50&quot; z-index=&quot;1“ fit=&quot;&quot;/> <region id=&quot;title&quot; width=&quot;150&quot; height=&quot;40&quot; top=&quot;300&quot; left=&quot;50“ backgroundColor=&quot;teal&quot; z-index=&quot;2&quot;/> <region id=&quot;audio&quot; soundLevel=&quot;50%&quot; /> </layout>
  • 15. 5.11 z-index and regions Defines root region Image region with z-index of “0” (zero) Video region with z-index of “1” Image region acts as a backdrop Video is layered over the backdrop Example <layout> <root-layout width=&quot;280&quot; height=&quot;220&quot;/> <region id=&quot;image&quot; top=&quot;10&quot; left=&quot;10&quot; width=&quot;260&quot; height=&quot;200&quot; z-index=&quot;0&quot;/> <region id=&quot;video&quot; top=&quot;20&quot; left=&quot;20&quot; width=&quot;240&quot; height=&quot;180&quot; z-index=&quot;1&quot;/> </layout>
  • 16. 5.12 fit attribute values fill Scale the object's height and width independently so that the content just touches all edges of the box. hidden If the intrinsic height (width) of the media object element is smaller than the height (width) defined in the region element, render the object starting from the top (left) edge and fill up the remaining height (width) with the background color. If the intrinsic height (width) of the media object element is greater than the height (width) defined in the region element, render the object starting from the top (left) edge until the height (width) defined in the region element is reached, and clip the parts of the object below (right of) the height (width). meet Scale the visual media object while preserving its aspect ratio until its height or width is equal to the value specified by the height or width attributes, while none of the content is clipped. The object's left top corner is positioned at the top-left coordinates of the box, and empty space at the right or bottom is filled up with the background color. slice Scale the visual media object while preserving its aspect ratio so that its height or width are equal to the value specified by the height and width attributes while some of the content may get clipped. Depending on the exact situation, either a horizontal or a vertical slice of the visual media object is displayed. Overflow width is clipped from the right of the media object. Overflow height is clipped from the bottom of the media object. scroll A scrolling mechanism should be invoked when the element's rendered contents exceed its bounds. Example
  • 17. 5.13 Embedded SMIL: Structure XHTML+TIME brings SMIL2 behaviours to HTML in IE5.5 and IE6 Declares the XML Namespace “t” (for time) URN provides a unique and persistent identifier for it Declare a CSS attribute for HTML elements to use “time2” behaviour Import the time2 behaviours into the namespace Recipe to include in the HEAD of the HTML document Could be included dynamically using SSI, PHP, ASP etc. Keep a local HTML+TIME template handy <html xmlns:t =&quot;urn:schemas-microsoft-com:time“ > <head> <style> .time {behavior: url(#default#time2);} </style> <?import namespace=t urn=&quot;urn:schemas-microsoft-com:time“ implementation=&quot;#default#time2&quot; /> </head> <body> <!--Content goes here --> </body> </html>
  • 18. 5.14 Metainformation Use HTML <meta> tags as in any other web pages Check the organisation’s metadata standards Greater range of metadata supported than in dedicated SMIL aware media players Consumed by search engine robots and used in the display of search results Include automatically as part of a dynamically generated web page <head> <meta name=&quot;author&quot; content=&quot;John Smith&quot;> <meta name=&quot;description&quot; content=&quot;A SMIL presentation of the SWCP&quot;> <meta name=&quot;keywords&quot; content=&quot;SMIL, smil, walking, coastal, path&quot;> </head>
  • 19. 5.15 Layout and Positioning Layout is controlled using Cascading Style Sheets (CSS2) CSS cannot define the size of a browser window Call a javascript function for window.open <div> is used to declare discreet division in the HTML page class attribute is used call time behaviours Use the style attribute to define position position:absolute position:relative Use top and left for most positioning right, bottom, width and height can be used Position with pixel values for consistency Other values can be used – em pt in mm Provide an id to permit reference to the div Example <body> . . . <div class=&quot;time&quot; id=&quot;intro&quot; style=&quot;position:absolute; left:50px; top:50px&quot;> <p>South West Coastal Path: Summer 2000</p> </div> . . . </body>
  • 20. 5.15.1 Using Cascading Style Sheet Example .txtPanel /* Define style for text panel */ { /* This can be called from class attribute */ position:absolute; top:90px; /* Use pixel values */ left:420px; width:200px; height:260px; background-color:#silver; /* Background is white */ z-index:2 /* Set z-index for this style */ } #rootContainer /* Define style for root window */ { /* Applied to element with corresponding id attribute value */ position:absolute; top:0px; left:0px; width:640px; height:480px; background-color:#99ccff; z-index:0 /* Set z-index for this style */ }
  • 21. 5.16 Layering and Fitting z-index value defines the layering of overlapping <div> elements Value is a point on a z-axis extending towards and away from the viewer Higher values are displayed over lower values Values can be positive or negative numbers: “5” or “-4” Progression using sequential ordering 1,2,3 or 10, 20, 30 etc. is suggested Exactly the same as the z-index in the CSS2 specification fit attribute is not available Use CSS2 elements and attributes supported in IEv6 overflow overflowx and overflowy Values are: visible scroll hidden auto See MSDN Library for further details Examples <body> <t:img class=&quot;time&quot; id=&quot;swcpimg1&quot; begin=&quot;2&quot; dur=&quot;7&quot; z-index=&quot;2&quot; src=&quot;images/img2045.jpeg“ style=&quot;position:absolute; top:120px; left:140px&quot;/> </body>