本文整理汇总了C#中ITrack.Pause方法的典型用法代码示例。如果您正苦于以下问题:C# ITrack.Pause方法的具体用法?C# ITrack.Pause怎么用?C# ITrack.Pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITrack
的用法示例。
在下文中一共展示了ITrack.Pause方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTrack
protected void AddTrack(ITrack track, bool isExternal = false)
{
_tracks.Add(track);
if (isExternal)
_externalTracks.Add(track);
else
_internalTracks.Add(track);
if (track.TrackType == TrackType.Audio)
{
// Update volume settings if it's an audio track
((AudioTrack)track).Volume = _audioVolume;
((AudioTrack)track).Balance = _audioBalance;
if (!isExternal && SupportsAudioTrackSwitching())
{
if (_mainAudioTrack != null)
{
// The main audio track has already been found
((AudioTrack)track).Mute = true;
}
else
{
// First audio track found . now the main one
_mainAudioTrack = (AudioTrack)track;
_mainAudioTrack.Mute = false;
}
}
}
else if (track.TrackType == TrackType.Video)
{
// If this track has a better time, update _nextVideoTrack
if (_nextVideoTrack == null || ((VideoTrack)track).GetNextFrameStartTime() < _nextVideoTrack.GetNextFrameStartTime())
_nextVideoTrack = (VideoTrack)track;
}
// Keep the track paused if we're paused
if (IsPaused)
track.Pause(true);
// Start the track if we're playing
if (IsPlaying && track.TrackType == TrackType.Audio)
((AudioTrack)track).Start();
}