Share via


peers

banner art

Previous Next

peers

The peers attribute controls how media elements within a priorityClass element interrupt one another.

Syntax

  peers= "defer" | "never" | "pause" | "stop"

Remarks

The WMS SMIL Playlist Parser plug-in enforces case sensitivity on the peers attribute.

This attribute must have one of the following values.

Value Description
defer If a child element attempts to begin when another child element is active, the interrupting element is deferred until the active element completes its active duration.
never If a child element attempts to begin when another child element is active, the interrupting element is prevented from starting.
pause If a child element attempts to begin when another child element is active, the active element is paused and will resume when the interrupting element completes its active duration.
stop If a child element attempts to begin when another child element is active, the active element is stopped. This is the default value.

This attribute can be applied only to priorityClass element. The peers, higher, and lower attributes can be applied to a single priorityClass simultaneously.

Example Code

In the following example, the elements in the playlist are played in the following order.

  1. The first media element plays for 20 seconds before it is interrupted by the second media element
  2. The second media element plays for 30 seconds.
  3. When the second element has finished, the first element resumes playing.
<?wsx version="1.0"?>
<smil>
  <excl>
    <priorityClass id=" p1" peers="pause">
        <media id="m1" src="c:\wmpub\wmroot\Audio_1.wma" 
             begin="0s" dur="60s" />
        <media id="m2" src="c:\wmpub\wmroot\Audio_2.wma" 
             begin="m1.begin + 20" dur="30s"/>
    </priorityClass>
  </excl>
</smil>

If the peers attribute had been set to "defer", the second media element would not begin playing until the first had finished. If the peers attribute had been set to "never", the second media element would never play. If the peers attribute had been set to "stop", the first media element would be interrupted after 20 seconds and would never resume.

The next example provides a more complete illustration of how media elements can be interrupted. The values assigned to the attributes in the first priorityClass, peers and lower, indicate that each media element is stopped when another media element in the same block starts, but that no media element is stopped for a lower priority class. In the second priorityClass, the value assigned to the peers attribute indicates that media elements in this class that interrupt the active element are deferred until the active element has finished. In the third priorityClass, the value assigned to the higher attribute indicates that media elements in this class are paused for elements in higher priority classes, but that they will resume playing, where they were paused, when the higher priority elements are finished. The elements in the playlist are played in the following order. Assume that the actual length of the files audio1.wmv through audio5.wmv is 30 seconds each and that the actual length of audio6.wmv is 60 seconds.

  1. e1-p3-m1 starts and runs for 30 seconds of its 60-second length.
  2. e1-p2-m1 interrupts and runs for 30 seconds. e1-p3-m1 pauses and runs later.
  3. e1-p2-m2 starts when e1-p2-m1 ends and runs for 30 seconds. Because the peers attribute in the priority class indicates that the interrupting element is deferred until the active element finishes, e1-p2-m2 cannot interrupt e1-p2-m1 even though it is set to begin when e1-p2-m1 begins.
  4. e1-p1-m1 starts when e1-p2-m2 ends and runs for 20 seconds. It is stopped by its peer, e1-p1-m2, because the value "stop" is assigned to the peers attribute.
  5. e1-p1-m2 interrupts e1-p1-m1 and runs for 30 seconds.
  6. e1-p3-m1 resumes play and runs to the end of its duration.
  7. e1-p2-m3 never plays because it tries to interrupt e1-p1-m2, and the lower attribute on the first priority class indicates that e1-p1-m2 cannot be interrupted by a media element in a lower priority class.
<?wsx version="1.0"?>
<smil>
  <excl>
    <priorityClass id="e1-p1" peers="stop" lower="never">
        <media id="e1-p1-m1" src="c:\wmpub\wmroot\audio1.wma" 
             begin="e1-p2-m2.end" />
        <media id="e1-p1-m2" src="c:\wmpub\wmroot\audio2.wma" 
             begin="e1-p1-m1.begin + 20" />
    </priorityClass>

    <priorityClass id="e1-p2" peers="defer">
        <media id="e1-p2-m1" src="c:\wmpub\wmroot\audio3.wma"
             begin="e1-p3-m1.begin + 30" dur="30" />
        <media id="e1-p2-m2" src="c:\wmpub\wmroot\audio4.wma"
             begin="e1-p2-m1.begin" dur ="30" />
        <media id="e1-p2-m3" src="c:\wmpub\wmroot\audio5.wma"
             begin="e1-p1-m2.begin + 15"/>
    </priorityClass>

    <priorityClass id="e1-p3" higher="pause">
        <media id="e1-p3-m1" src="c:\wmpub\wmroot\audio6.wma"
             begin="0" dur="60" />
    </priorityClass>

  </excl>
</smil>

If e1-p1-m2 was scheduled to begin playing 60 seconds after e1-p1-m1 finished playing, nothing would be streamed for 60 seconds. Setting the peers attribute to "stop" when one element ends playing before a second element begins creates "dead air" between the elements. That is, nothing is streamed to users until the second element is scheduled to begin streaming. Creating multiple dead air segments between elements is not supported in Windows Media Services 9 Series.

See Also

Previous Next