PowerPoint Presentation part 2

Published on
Embed video
Share video
Ask about this video

Scene 1 (0s)

T i m i n g M o d e l B a s i c s 63 Interactive Timing and Events • In the normal course of processing, the activation hierarchy of a SMIL document determines the rendering of document elements. • The user can influence the elements selected by using SMIL events. • The event architecture allows document components that are waiting to be activated or terminated to actually start or stop. • Several uses of events allowed in SMIL 2.0, but the most important new semantic introduced in SMIL 3.0 was the combination of events and the begin/end attributes. • In further combination with the <excl> element, events provide a very powerful mechanism for conditional content activation..

Scene 2 (28s)

T i m i n g M o d e l B a s i c s 64 Interactive Timing and Events • SMIL also supports a rich hyperlinking architecture. • The fundamental concept of the SMIL link : it models a temporal seek in a presentation. • Rather than simply activating a target element, the target play state that is activated is identical to the state that the presentation would have been in if the target point had been arrived at “naturally.” • (One exception is that all intervening event-based activation is ignored.) This means that all nodes temporally between the source and destination of the link need to be evaluated to see if they would have contributed to the final target play state. • The temporal seeking and activation facility allow very polished presentation construction—but its implementation in the agent is not for the fainthearted..

Scene 3 (1m 0s)

T i m i n g M o d e l B a s i c s 65 Applying SMIL Timing Attributes • SMIL was designed so that obvious structural relationships between elements—and the intrinsic duration of continuous media objects—could be used to specify most timing and synchronization relationships explicitly. • There are many occasions, however, when the default synchronization behavior might not be expressive enough to build a particular media message. • For this reason, SMIL provides a host of timing control attributes..

Scene 4 (1m 20s)

T i m i n g M o d e l B a s i c s 66 General Timing Control Attributes • The general timing control attributes supported by SMIL are begin, dur, and end. • The begin attribute controls when a particular element starts relative to its syncbase, the dur attribute controls the element’s simple duration, and the end attribute controls the end of the active duration. (In general, begin + dur = end, but this is not always true.) • All three of these attributes retain their behavior from SMIL 1.0. • The principal SMIL 2.0 extension to begin and end is that they attributes support a list of begin/end times instead of a single begin/end value. • This is not particularly useful for simple SMIL applications, but it is very useful if a combination of SMIL’s scheduled and event-based timing is used..

Scene 5 (1m 54s)

T i m i n g M o d e l B a s i c s 67 General Timing Control Attributes Attribute: begin • Each of SMIL’s time containers defines a default begin time for its children. • The default for <par> is the start of that <par>, while the default for a <seq> depends on the lexical order of its children: The first child starts at the start of the <seq>, and each successive child starts after the preceding child has ended. • SMIL allows this default behavior to be overridden by the begin attribute. • Usually, this clock value contains a nonzero positive temporal offset, such as: All of these values represent a begin delay of 10 s..

Scene 6 (2m 22s)

T i m i n g M o d e l B a s i c s 68 General Timing Control Attributes Attribute: begin and the <seq> element • There is one restriction on the use of the begin attribute that is important for all SMIL versions: A <seq> time container may only have a single begin attribute value and that value must contain a nonnegative clock value. • Multiple begin time lists are not allowed in a <seq>, and neither is explicit syncbase timing. • In the following set of statements, line 4 is not valid SMIL, but lines 5 through 7 are valid and provide the same functionality as was intended in line 4:.

Scene 7 (2m 47s)

T i m i n g M o d e l B a s i c s 69 General Timing Control Attributes Attribute: begin and the <seq> element.

Scene 8 (2m 56s)

T i m i n g M o d e l B a s i c s 70 General Timing Control Attributes Attribute: dur • The dur attribute establishes the simple duration of an element. • When used with a media object, it defines how much of that media object will be used. • When used with a time container, it defines a limit on the simple duration of that container. • If the defined duration is longer than the time container or media object, temporal and rendering padding will result..

Scene 9 (3m 17s)

T i m i n g M o d e l B a s i c s 71 General Timing Control Attributes Attribute: end • A SMIL element ends at the end of its active duration. • This is determined by either the element’s content or the parent time container. • An element can also specify a non-default end time via the end attribute. • The end attribute provides explicit control over the end of the active duration. • As with begin, the end attribute can specify a single clock value or an explicit syncbase (with optional clock value offset), or a list of values. • Unlike the begin attribute, there is no restriction on the use of end with <seq> elements. • Note that even if multiple end times are specified, the associated element will end only once—this is when the first end condition is met..

Scene 10 (3m 49s)

T i m i n g M o d e l B a s i c s 72 General Timing Control Attributes Attribute: end • Line 2 says that the video will end whenever the temporal element snarf ends. (This is an example of syncbase timing.) • Line 3 states that the video will end at either 35 s after the start of its rendering or 5 s after the end of the syncbase element snarf..

Scene 11 (4m 7s)

T i m i n g M o d e l B a s i c s 73 Object Persistence Attributes Attribute: fill • SMIL allows an object to remain visible after the end of its active duration by specifying a fill attribute. • If fill is set to “freeze,” the object will remain visible until the end of its parent time container. • If it is set to “remove,” the object is removed as soon as its active duration ends. • The default for visual media is effectively “freeze”; fill has no meaning for audio media. • There are some special cases for fill that allow the visibility of an object to extend past the active duration of its parent (such as when transitions exist)..

Scene 12 (4m 35s)

T i m i n g M o d e l B a s i c s 74 Object Persistence Attributes Attribute: fill • The value of fill also determines how long an object remains “clickable” for linking and interaction. • If the fill attribute is applied to a time container, then the rendering state of all of the children (and descendants of the children) is set to their respective fill behavior at the moment the active duration of the container ends..

Scene 13 (4m 55s)

T i m i n g M o d e l B a s i c s 75 Extended Timing Control Attributes Attribute: min • The min attribute can be used to specify an explicit minimum active duration on an element. • It accepts either a clock value or “media” as values. • The default value of min is “0,” which is the same as saying that the value is unconstrained. • The value media may only be used on media objects; its use says the minimum duration is the implicit value of the media object..

Scene 14 (5m 17s)

T i m i n g M o d e l B a s i c s 76 Extended Timing Control Attributes Attribute: max • The max attribute can be used to constrain the maximum active duration of an element. • It is similar to min, except that an explicit value of indefinite can be specified. (This is also the default.) • The behavior of the max attribute is predictable, although finding relevant use cases can be a challenge. For example, consider the following statements: • Both elements have the same behavior.

Scene 15 (5m 39s)

T i m i n g M o d e l B a s i c s 77 Extended Timing Control Attributes Attribute: endsync • Where min and max provide clock value-based constraints on element timing, SMIL provides the endsync attribute to provide logical control on timed objects. • As in SMIL 1.0, if a <par> has multiple children, it can specify that the entire <par> ends when the first child ends, when the last child ends, or when a named child ends using the endsync attribute. • This attribute can be assigned to the <par> and <excl>time containers..

Scene 16 (6m 3s)

T i m i n g M o d e l B a s i c s 78 Extended Timing Control Attributes Attribute: endsync • The default value of endsync is “last” • When endsync = “all” the element waits for all of its children to play to completion at least once, regardless of whether they have scheduled or interactive begin times. • The behavior of the endsync attribute is intuitive, except when combined with the dur and/or end attributes. • This is because having both an endsync and a dur or end will cause conflicting definitions of element duration..

Scene 17 (6m 26s)

T i m i n g M o d e l B a s i c s 79 Extended Timing Control Attributes Attribute: endsync • In order to resolve these conflicts, the following rules are applied by a SMIL agent: 1. If dur and endsync are specified on the same element, the endsync is ignored. 2. If end and endsync are specified on the same element, the endsync is ignored..

Scene 18 (6m 44s)

T i m i n g M o d e l B a s i c s 80 Repeating Objects and Substructures • The default behavior of all elements is that they play once, for either an implicit or explicit duration. • The SMIL repeatCount attribute allows an iteration factor to be defined that acts as a multiplier of the object’s simple duration. • (The resulting duration is the active duration.) A special value indefinite is used to specify that an element repeats continually until its (parent) timing context ends. • The repeatDur attribute defines duration for all of the repeated iterations..

Scene 19 (7m 7s)

T i m i n g M o d e l B a s i c s 81 Repeating Objects and Substructures Attribute: repeatCount • The repeatCount attribute makes the element’s content sub-presentation or media object to repeat the stated number of times. • Its value can be either a number or indefinite. • A numeric value indicates the media object plays that number of times. • Fractional values, specified with decimal points, can be used as well. • A repeat count may also be applied to time containers. • The following statement specifies that snarf is to be repeated 4.5 times:.

Scene 20 (7m 31s)

T i m i n g M o d e l B a s i c s 82 Repeating Objects and Substructures Attribute: repeatDur • The repeatDur attribute is similar in most respects to repeatCount, except that duration is given instead of a multiplier. • It states that the element is to repeat its playback until the specified duration has passed. • The following statement specifies that snarf is to be repeated for 15 s:.

Scene 21 (7m 49s)

A d v a n c e d T i m i n g a n d S y n c h r o n i z a t i o n A t t r i b u t e s 83 • SMIL provides a collection of advanced attributes to control synchronization behavior and to facilitate integration of SMIL into other XML languages. • While these attributes are rather esoteric for a complete discussion here, we introduce them briefly in the following sections..

Scene 22 (8m 5s)

A d v a n c e d T i m i n g a n d S y n c h r o n i z a t i o n A t t r i b u t e s 84 SMIL Synchronization Control Attributes • In a perfect world, all of the defined timing in a specification would be implemented perfectly by a SMIL agent. • Unfortunately, the world is not only imperfect—it is also unpredictable. • In order to provide some measure of control in the face unpredictably, SMIL provides three high-level synchronization control attributes: ❑ syncBehavior, which allows a presentation to define whether there can be slippage in implementing the composite timeline of the presentation ❑ syncTolerance, which defines how much slip is allowed ❑ syncMaster, which allows a particular element to become the “master” timebase against which all others are measured..

Scene 23 (8m 34s)

A d v a n c e d T i m i n g a n d S y n c h r o n i z a t i o n A t t r i b u t e s 85 SMIL Synchronization Control Attributes syncBehavior • This attribute specifies how a media element should behave when its timing is not synchronized with the other media elements. • Possible Values: ❑ parallel: The default value. The media plays as soon as possible. ❑ wait: The media waits for the synchronized elements to start before it plays. ❑ freeze: The media freezes (pauses) when it is out of sync..

Scene 24 (8m 56s)

A d v a n c e d T i m i n g a n d S y n c h r o n i z a t i o n A t t r i b u t e s 86 SMIL Synchronization Control Attributes syncTolerance • This attribute defines the maximum acceptable deviation (in seconds) for synchronization. • It helps to manage slight timing divergences between media elements. • Typically used with syncBehavior. syncMaster • This attribute indicates that the current element should control the timing of other media elements. • It defines which media element is the master for synchronization..

Scene 25 (9m 16s)

A d v a n c e d T i m i n g a n d S y n c h r o n i z a t i o n A t t r i b u t e s 87 SMIL Synchronization Control Attributes Example : syncTolerance & syncBehavior • The video will wait for the audio to start before playing, within a tolerance of 2s <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/TR/2001/REC-smil20- 20010605/smil20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/"> <body> <seq> <par syncBehavior="wait" syncTolerance="2s"> <video src="v1.mp4" dur="10s" /> <audio src="audio1.mp3" dur="10s" /> </par> </seq> </body> </smil>.

Scene 26 (9m 45s)

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/TR/2001/REC-smil20-20010605/smil20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/"> <body> <seq> <video src="v0.mp4" dur="10s" syncMaster="true" /> <par> <audio src="audio1.mp3" dur="10s" syncBehavior="wait" /> <text x="10" y="50" font-size="20" fill="black"> Sample Text <animate id="anim1" attributeName="opacity" from="0" to="1" dur="10s" repeatCount="indefinite" syncBehavior="freeze" /> </text> </par> </seq> </body> </smil> A d v a n c e d T i m i n g a n d S y n c h r o n i z a t i o n A t t r i b u t e s 88 SMIL Synchronization Control Attributes Example : syncMaster • The video is the master and dictates the timing for the audio and text. • The text fades in and out in sync with the audio..

Scene 27 (10m 18s)

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/TR/2001/REC-smil20-20010605/smil20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/"> <body> <svg width="400" height="200" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="100" r="40" fill="blue"> <animate attributeName="cx" from="50" to="350" dur="5s“ repeatCount="indefinite"/> </circle> </svg> </body> </smil> S M I L A n i m a t i o n s 89 • The basic animation Element is <animate>, it defines the animation. • It animates an attribute over a specified duration. Animating SVG Graphics: • You can use SVG (Scalable Vector Graphics) within SMIL to create animations. • Here’s an example of animating a circle’s position:.

Scene 28 (10m 52s)

S M I L A n i m a t i o n s 90 Animating Text: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/TR/2001/REC-smil20- 20010605/smil20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/"> <body> <svg width="400" height="200" xmlns="http://www.w3.org/2000/svg"> <text id="text" x="50" y="100" font-family="Verdana" font-size="24" fill="black"> Hello, SMIL! <animate attributeName="opacity" from="1" to="0" dur="2s" repeatCount="indefinite" /> </text> </svg> </body> </smil>.

Scene 29 (11m 19s)

S M I L A n i m a t i o n s 91 <animate>: • Defines the animation. It animates an attribute over a specified duration. <set>: • Sets an attribute to a specific value for a specified duration. • attributeName: The attribute to set. • to: The value to set the attribute to. • begin: When to start the setting. • dur: Duration for which to keep the attribute set..

Scene 30 (11m 38s)

S M I L c o n d i t i o n a l e l e m e n t s 92 • SMIL includes conditional elements that help manage media playback based on certain conditions. • Here are the primary conditional elements in SMIL, along with their descriptions and examples: <switch>: • Allows you to provide multiple alternatives for media playback. • It chooses the first child element that is supported by the user agent (browser or player)..

Scene 31 (11m 56s)

S M I L c o n d i t i o n a l e l e m e n t s 93 <switch>: • The player will attempt to play v1.mp4. If it cannot, it will try v2.mp4. If neither video can be played, it will display the text "Video not supported." <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/TR/2001/REC-smil20- 20010605/smil20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/"> <body> <switch> <video src="v1.mp4" /> <video src="v2.mp4" /> <fallback> <text>Video not supported.</text> </fallback> </switch> </body> </smil>.