private async void MediaPlayer_SelectedCaptionChanged(object sender, RoutedPropertyChangedEventArgs<Caption> e)
{
try
{
// only process for WebVTT captions
if (ClosedCaptionType.WebVTTSidecar != this._CaptionType)
return;
if (null != this._WebVTTCaptions)
{
this._WebVTTCaptions.Cancel();
this._WebVTTCaptions = null;
}
if (null != e.NewValue && this._Controller.IsValid)
{
this._WebVTTCaptions = new HLSWebVTTCaptions(this._MediaPlayer, _Controller);
await this._WebVTTCaptions.DownloadAllSegmentsAsync(e.NewValue.Id, this._MediaPlayer.Position);
}
}
catch { }
}