Share via


Preempted Primary Segments

Windows Media Encoder SDK banner art

Because only one segment at a time can be primary, playback of a primary segment that cues other segments may be interrupted. For example, when you place a trigger for a primary segment in the Segment Trigger Track of another primary segment, playback transitions to the new primary segment when the trigger is reached. Similarly, if the Script Track in a primary segment calls a routine that plays another primary segment, playback transitions to the new primary when the script executes.

If you do not want playback of the current primary segment to stop when another segment is cued, you can set the cued segment to be a secondary segment as follows:

  • When using the segment trigger track of the current primary segment, select Secondary as the Type on the Segment tab of the Segment/Motif Trigger Properties window.
  • When using the Segment.Play method in a script, pass the IsSecondary flag as a parameter.

Alternatively, you can allow a new primary segment (B) to preempt the one currently playing (A), and then cue A to play again later, by using one of the following techniques:

  • Insert a trigger in the segment trigger track of B. Set the trigger to play A as a primary segment.
  • In the script routine that calls B, add a call to Segment.Play that cues A with the AtFinish flag. Segment A will begin playing when B reaches its end.