本文整理汇总了C#中Playlist.SetDebugFile方法的典型用法代码示例。如果您正苦于以下问题:C# Playlist.SetDebugFile方法的具体用法?C# Playlist.SetDebugFile怎么用?C# Playlist.SetDebugFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist.SetDebugFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartPlayVideo
public virtual async Task StartPlayVideo(MediaElement element)
{
AssertUtil.NotNull(Parser, "unsupport url");
Videos = await Parser.ParseAsync(Url);
AssertUtil.NotNull(Videos, "no videos");
#if DEBUG
foreach (var videoItem in Videos)
{
Debug.WriteLine(videoItem);
}
#endif
if (Videos.Count > 1)
{
var plist = new Playlist(PlaylistTypes.NetworkHttp);
var cfgs = default(PlaylistNetworkConfigs);
cfgs.UniqueId = DateTime.UtcNow.ToString();
cfgs.DownloadRetryOnFail = true;
cfgs.DetectDurationForParts = false;
cfgs.HttpUserAgent = string.Empty;
cfgs.HttpReferer = string.Empty;
cfgs.HttpCookie = string.Empty;
plist.NetworkConfigs = cfgs;
foreach (var video in Videos)
{
plist.Append(video.Url, video.Size, (float)video.Seconds);
}
#if DEBUG
var debugFile = Path.Combine(ApplicationData.Current.TemporaryFolder.Path, "DebugFile.mkv");
Debug.WriteLine(string.Format("DebugFile File:{0}", debugFile));
plist.SetDebugFile(debugFile);
#endif
var s = "plist://WinRT-TemporaryFolder_" + Path.GetFileName(await plist.SaveAndGetFileUriAsync());
element.Source = new Uri(s);
}
else if (Videos.Count == 1)
{
element.Source = new Uri(Videos[0].Url);
}
}