本文整理汇总了C#中System.VideoInfo类的典型用法代码示例。如果您正苦于以下问题:C# VideoInfo类的具体用法?C# VideoInfo怎么用?C# VideoInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VideoInfo类属于System命名空间,在下文中一共展示了VideoInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DiscoverDynamicCategories
public override int DiscoverDynamicCategories()
{
if (Settings.Categories == null) Settings.Categories = new BindingList<Category>();
cc = new CookieContainer();
string data = GetWebData(@"https://www.filmon.com/tv/live", userAgent: userAgent, cookies: cc);
string jsondata = @"{""result"":" + Helpers.StringUtils.GetSubString(data, "var groups =", @"if(!$.isArray").Trim().TrimEnd(';') + "}";
JToken jt = JObject.Parse(jsondata) as JToken;
foreach (JToken jCat in jt["result"] as JArray)
{
RssLink cat = new RssLink();
cat.Name = jCat.Value<string>("title");
cat.Description = jCat.Value<string>("description");
cat.Thumb = jCat.Value<string>("logo_uri");
Settings.Categories.Add(cat);
JArray channels = jCat["channels"] as JArray;
List<VideoInfo> videos = new List<VideoInfo>();
foreach (JToken channel in channels)
{
VideoInfo video = new VideoInfo();
video.Thumb = channel.Value<string>("logo");
video.Description = channel.Value<string>("description");
video.Title = channel.Value<string>("title");
video.VideoUrl = @"https://www.filmon.com/ajax/getChannelInfo";
video.Other = String.Format(@"channel_id={0}&quality=low", channel.Value<string>("id"));
videos.Add(video);
}
cat.Other = videos;
}
Settings.DynamicCategoriesDiscovered = true;
return Settings.Categories.Count;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:31,代码来源:FilmonUtil.cs
示例2: GetVideoUrl
public override string GetVideoUrl(VideoInfo video)
{
CookieContainer newCc = new CookieContainer();
foreach (Cookie c in cc.GetCookies(new Uri(@"https://www.filmon.com/")))
{
newCc.Add(c);
}
NameValueCollection headers = new NameValueCollection();
headers.Add("Accept", "*/*");
headers.Add("User-Agent", userAgent);
headers.Add("X-Requested-With", "XMLHttpRequest");
string webdata = GetWebData(video.VideoUrl, (string)video.Other, newCc, headers: headers);
JToken jt = JObject.Parse(webdata) as JToken;
JArray streams = jt.Value<JArray>("streams");
video.PlaybackOptions = new Dictionary<string, string>();
foreach (JToken stream in streams)
{
string serverUrl = stream.Value<string>("url");
RtmpUrl res = new RtmpUrl(serverUrl);
res.Live = true;
res.PlayPath = stream.Value<string>("name");
int p = serverUrl.IndexOf("live/?id");
res.App = serverUrl.Substring(p);
video.PlaybackOptions.Add(stream.Value<string>("quality"), res.ToString());
}
return video.PlaybackOptions.First().Value;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:32,代码来源:FilmonUtil.cs
示例3: GetVideos
public override List<VideoInfo> GetVideos(Category category)
{
List<VideoInfo> videos = new List<VideoInfo>();
String sessionIdData = GetWebData("https://orangetv.orange.es/atv/api/anonymous?appId=es.orange.pc&appVersion=1.0");
String sessionId = (String)JObject.Parse(sessionIdData).SelectToken("sessionId");
NameValueCollection headers = new NameValueCollection();
headers.Add("Accept", "*/*");
headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.3");
headers.Add("Accept-Encoding", "gzip,deflate,sdch");
headers.Add("Accept-Language", "es-ES,es;q=0.8");
headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1");
headers.Add("X-Aspiro-TV-Session", sessionId);
String canalesData = GetWebData("https://orangetv.orange.es/atv/api/epg?from=now&offset=-2h&duration=16h&view=epg&byTags=SmoothStreaming%40sourceType", headers: headers);
JArray canalesJson = JArray.Parse(canalesData);
for (int i = 0; i < canalesJson.Count; i++)
{
JToken canal = canalesJson[i];
VideoInfo video = new VideoInfo();
video.Title = (String)canal["title"];
video.Thumb = (String)canal["images"]["LOGO"];
video.VideoUrl = "https://orangetv.orange.es/#!channel/" + (String)canal["id"] + "/play";
videos.Add(video);
}
return videos;
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:25,代码来源:OrangeTVWebUtil.cs
示例4: GetVideoUrl
public override string GetVideoUrl(VideoInfo video)
{
var data = GetWebData(video.VideoUrl);
var videoUrl = "";
var baseDownloadUrl = "http://www.gametrailers.com/feeds/video_download/";
if (data != null && data.Length > 0)
{
if (regEx_PlaylistUrl != null)
{
try
{
var m = regEx_PlaylistUrl.Match(data);
while (m.Success)
{
var contentid = HttpUtility.HtmlDecode(m.Groups["contentid"].Value);
var token = HttpUtility.HtmlDecode(m.Groups["token"].Value);
var finalDownloadUrl = baseDownloadUrl + contentid + "/" + token;
var dataJson = GetWebData(finalDownloadUrl);
var o = JObject.Parse(dataJson);
videoUrl = o["url"].ToString().Replace("\"", "");
break;
}
}
catch (Exception eVideoUrlRetrieval)
{
Log.Debug("Error while retrieving Video Url: " + eVideoUrlRetrieval);
}
return videoUrl;
}
}
return null;
}
开发者ID:lopeztuparles,项目名称:mp-onlinevideos2,代码行数:33,代码来源:GameTrailersUtil.cs
示例5: GetVideoUrl
//protected override CookieContainer GetCookie()
//{
// if (OnlyGerman) return base.GetCookie();
// else return null;
//}
public override string GetVideoUrl(VideoInfo video)
{
string result = base.GetVideoUrl(video);
if (video.PlaybackOptions == null && !string.IsNullOrEmpty(result))
result = Movie2KFilmVideoInfo.getPlaybackUrl(result, this);
return result;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:13,代码来源:Movie2KFilmUtil.cs
示例6: VideoViewModel
public VideoViewModel(VideoInfo videoInfo, Category category, string siteName, string utilName, bool isDetailsVideo)
: base(Consts.KEY_NAME, isDetailsVideo ? ((DetailVideoInfo)videoInfo).Title2 : videoInfo.Title)
{
VideoInfo = videoInfo;
Category = category;
SiteName = siteName;
SiteUtilName = utilName;
IsDetailsVideo = isDetailsVideo;
_titleProperty = new WProperty(typeof(string), videoInfo.Title);
_title2Property = new WProperty(typeof(string), isDetailsVideo ? ((DetailVideoInfo)videoInfo).Title2 : string.Empty);
_descriptionProperty = new WProperty(typeof(string), videoInfo.Description);
_lengthProperty = new WProperty(typeof(string), videoInfo.Length);
_airdateProperty = new WProperty(typeof(string), videoInfo.Airdate);
_thumbnailImageProperty = new WProperty(typeof(string), videoInfo.ThumbnailImage);
_contextMenuEntriesProperty = new WProperty(typeof(ItemsList), null);
eventDelegator = OnlineVideosAppDomain.Domain.CreateInstanceAndUnwrap(typeof(PropertyChangedDelegator).Assembly.FullName, typeof(PropertyChangedDelegator).FullName) as PropertyChangedDelegator;
eventDelegator.InvokeTarget = new PropertyChangedExecutor()
{
InvokeHandler = (s, e) =>
{
if (e.PropertyName == "ThumbnailImage") ThumbnailImage = (s as VideoInfo).ThumbnailImage;
else if (e.PropertyName == "Length") Length = (s as VideoInfo).Length;
}
};
VideoInfo.PropertyChanged += eventDelegator.EventDelegate;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:29,代码来源:VideoViewModel.cs
示例7: GetMultipleVideoUrls
public override List<string> GetMultipleVideoUrls(VideoInfo video, bool inPlaylist = false)
{
string url = GetVideoUrl(video);
if (inPlaylist)
video.PlaybackOptions.Clear();
return new List<string>() { url };
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:7,代码来源:BBCiPlayerUtil.cs
示例8: GetVideos
public override List<VideoInfo> GetVideos(Category category)
{
List<VideoInfo> listVideos = new List<VideoInfo>();
string url = (category as RssLink).Url;
string webData = GetWebData((category as RssLink).Url);
Regex r = new Regex(@"href=""(?<url>[^""]*)""></a><span\sclass=""play_video""></span>\s*<img\ssrc=""(?<thumb>[^""]*)""\swidth=""120""\sheight=""90""\salt=""""\s/>\s*</div>\s*<p>\s*<strong>(?<title>[^<]*)</strong>\s*<span>(?<description>[^<]*)<br/>(?<description2>[^<]*)</span>\s*</p>",
RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture);
Match m = r.Match(webData);
while (m.Success)
{
VideoInfo video = new VideoInfo()
{
VideoUrl = m.Groups["url"].Value,
Title = m.Groups["title"].Value,
Thumb = m.Groups["thumb"].Value,
Description = m.Groups["description"].Value.Trim() + "\n" + m.Groups["description2"].Value.Trim()
};
listVideos.Add(video);
m = m.NextMatch();
}
return listVideos;
}
开发者ID:JSurf,项目名称:mp-onlinevideos2,代码行数:26,代码来源:GulliUtil.cs
示例9: GetVideoUrl
public override string GetVideoUrl(VideoInfo video)
{
string res = base.GetVideoUrl(video);
if (video.PlaybackOptions != null && video.PlaybackOptions.Count > 1)
return video.PlaybackOptions.Last().Value;
return res;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:7,代码来源:TweakersNetUtil.cs
示例10: GetVideoUrl
public override string GetVideoUrl(VideoInfo video)
{
string webData = GetWebData(video.VideoUrl);
Match m = regEx_FileUrl.Match(webData);
if (m.Success)
{
string newUrl = m.Groups["m0"].Value + "?authenticity_token=" + HttpUtility.UrlEncode(m.Groups["m1"].Value);
webData = GetWebData(newUrl);
m = Regex.Match(webData, @"url:\s\\""(?<url>[^\\]*)\\[^{]*{[^{]*{\\n\s*url:\s\\""[^""]*"",\\n\s*netConnectionUrl:\s\\""(?<netConnectionUrl>[^\\]*)\\""", defaultRegexOptions);
if (m.Success)
{
string ncUrl = m.Groups["netConnectionUrl"].Value;
string[] parts = ncUrl.Split('/');
string playPath = parts[4];
bool live = webData.Contains("live = true");
if (live)
{
int p = playPath.IndexOf("stream");
if (p >= 0) playPath = playPath.Insert(p, "/");
}
RtmpUrl result = new RtmpUrl(ncUrl)
{
PlayPath = m.Groups["url"].Value,
App = String.Format("{0}/{1}{2}", parts[3], parts[4], m.Groups["m1"].Value),
Live = live
};
return result.ToString();
}
}
return String.Empty;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:33,代码来源:EventCasterUtil.cs
示例11: GetVideoUrl
public override String GetVideoUrl(VideoInfo video)
{
string data = GetWebData(video.VideoUrl);
Match m = regEx_URL.Match(data);
if (m.Success)
{
ut_section_id = m.Groups["ut_section_id"].Value;
media_id = m.Groups["media_id"].Value;
site_id = m.Groups["site_id"].Value;
section_id = m.Groups["section_id"].Value;
}
data = GetWebData("http://dnevnik.hr/bin/player/?mod=serve&site_id=" + site_id + "&media_id=" + media_id +
"&userad_id=§ion_id=" + section_id);
m = regEx_URLFile.Match(data);
if (m.Success)
{
FileUrl = m.Groups["FileUrl"].Value;
FileServer = m.Groups["FileServer"].Value;
FileType = m.Groups["FileType"].Value;
if (string.IsNullOrEmpty(FileType))
FileType = "flv";
data = "http://vid" + FileServer + ".dnevnik.hr/" + FileUrl + "-2" + "." + FileType;
}
return data;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:26,代码来源:NovaTV.cs
示例12: GetVideoUrl
public override String GetVideoUrl(VideoInfo video)
{
video.PlaybackOptions = new Dictionary<string, string>();
var html = GetWebData<HtmlDocument>(video.VideoUrl);
var itemprop = html.DocumentNode.Descendants("span").FirstOrDefault(s => s.GetAttributeValue("itemprop", "") == "contentUrl");
return itemprop.GetAttributeValue("content", "");
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:7,代码来源:NdrUtil.cs
示例13: GetVideos
public override List<VideoInfo> GetVideos(Category category)
{
List<VideoInfo> vids = new List<VideoInfo>();
string channelReg = @"<strong>(?<title>.*?)\s-(?<links>.*?)</strong><br />";
string urlReg = @"href=""(?<link>sop://[^""]*)""";
foreach (Match channelMatch in new Regex(channelReg, RegexOptions.Singleline).Matches(category.Other as string))
{
int x = 1;
string title = channelMatch.Groups["title"].Value;
foreach (Match link in new Regex(urlReg).Matches(channelMatch.Groups["links"].Value))
{
VideoInfo vid = new VideoInfo();
vid.Title = title;
if (x > 1)
vid.Title += string.Format(" ({0})", x);
vid.VideoUrl = link.Groups["link"].Value;
vids.Add(vid);
x++;
}
}
return vids;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:26,代码来源:FootballStreamingInfoUtil.cs
示例14: Video
/// <summary>
///
/// </summary>
/// <param name="src">视频源文件</param>
public Video(string src)
{
if (!System.IO.File.Exists(src))
throw new Exception(src + " Not Found.");
_Source = src;
Info = MediaHelper.GetVideoInfo(src);
}
开发者ID:yonglehou,项目名称:dotNETCore-Extensions,代码行数:11,代码来源:Video.cs
示例15: GetVideos
public override List<VideoInfo> GetVideos(Category category)
{
JArray videos = category.Other as JArray;
List<VideoInfo> res = new List<VideoInfo>();
foreach (JToken videoId in videos)
{
VideoInfo video = new VideoInfo();
string id = videoId.Value<string>();
if (contentList.ContainsKey(id))
{
JToken vid = contentList[id];
video.Title = vid["title"].Value<string>();
JToken descr = vid["description"];
if (descr != null)
video.Description = descr.Value<string>();
JToken thumb = vid["thumbnailUrl"];
if (thumb != null)
video.Thumb = thumb.Value<string>();
video.Length = TimeSpan.FromSeconds(vid["length"].Value<int>() / 1000).ToString();
video.Airdate = epoch.AddSeconds(vid["publishedDate"].Value<double>() / 1000).ToString();
video.VideoUrl = baseUrl + "channels/" + category.Name + "/" + id;
video.Other = id;
res.Add(video);
}
}
return res;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:28,代码来源:ToonsTv.cs
示例16: GetVideoUrl
public override string GetVideoUrl(VideoInfo video)
{
Match m = Regex.Match("exp=2575783636001 " + (string)video.Other, @"exp=(?<experienceId>[^\s]+)\s(?<contentId>[^$]+)$");
AMFArray renditions = GetResultsFromViewerExperienceRequest(m, video.VideoUrl);
string res = FillPlaybackOptions(video, renditions);
int firstDiff = int.MaxValue;
int lastDiff = int.MaxValue;
if (video.PlaybackOptions != null)
{
foreach (KeyValuePair<string, string> kv in video.PlaybackOptions)
{
string url = kv.Value;
int i = 0;
while (i < url.Length && i < res.Length && url[i] == res[i]) i++;
if (i < firstDiff)
firstDiff = i;
i = 0;
while (i < url.Length && i < res.Length && url[url.Length - 1 - i] == res[res.Length - i - 1]) i++;
if (i < lastDiff)
lastDiff = i;
}
video.PlaybackOptions = video.PlaybackOptions.ToDictionary(u => u.Key, u => format(firstDiff, lastDiff, u.Value));
}
if (firstDiff > 0)
return format(firstDiff, lastDiff, res);
else
return res;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:32,代码来源:ToonsTv.cs
示例17: Play
public override void Play(VideoInfo video)
{
if (IsPlaying)
return;
Task.Factory.StartNew(() =>
{
Process process;
if (video.IsPlaylist)
process = Process.Start(PlayerPath, '"' + video.Uri + '"');
else
{
string init = '"' + video.Uri + '"';
if (video.ResumePosition > 0)
{
double n = video.ResumePosition;
n /= 1000;
init += " --start=\"" + n.ToString(CultureInfo.InvariantCulture) + "\"";
}
if (video.SubtitlePaths != null && video.SubtitlePaths.Count > 0)
{
foreach (string s in video.SubtitlePaths)
{
init += " --sub-file=\"" + s + "\"";
}
}
process = Process.Start(PlayerPath, init);
}
if (process != null)
{
IsPlaying = true;
process.WaitForExit();
IsPlaying = false;
}
});
}
开发者ID:ElementalCrisis,项目名称:jmmclient,代码行数:35,代码来源:ExternalMPVVideoPlayer.cs
示例18: GetVideos
public override List<VideoInfo> GetVideos(Category category)
{
if (true.Equals(category.Other)) //videos in serwisy informacyjne
{
string sav = videoListRegExFormatString;
videoListRegExFormatString = "{0}";
var res = base.GetVideos(category);
videoListRegExFormatString = sav;
return res;
}
string webData = GetWebData(((RssLink)category).Url);
JObject contentData = JObject.Parse(webData);
if (contentData != null)
{
JArray items = contentData["items"] as JArray;
if (items != null)
{
List<VideoInfo> result = new List<VideoInfo>();
foreach (JToken item in items)
if (!item.Value<bool>("payable") && item.Value<int>("play_mode") == 1)
{
VideoInfo video = new VideoInfo();
video.Title = item.Value<string>("title");
video.VideoUrl = String.Format(videoListRegExFormatString, item.Value<string>("_id"));
video.Description = item.Value<string>("description_root");
video.Thumb = getImageUrl(item);
video.Airdate = item.Value<string>("publication_start_dt") + ' ' + item.Value<string>("publication_start_hour");
result.Add(video);
}
return result;
}
}
return null;
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:34,代码来源:VodTvpUtil.cs
示例19: GetVideoUrl
public override String GetVideoUrl(VideoInfo video)
{
video.PlaybackOptions = new Dictionary<string, string>();
var json = GetWebData<JObject>(video.VideoUrl);
foreach (var quality in json["videoJsonPlayer"]["VSR"])
{
string qualityName = string.Format("{0} | {1} | {2}",
quality.First.Value<string>("versionShortLibelle").PadRight(3),
quality.First.Value<string>("mediaType").PadRight(4),
quality.First.Value<string>("quality"));
if (quality.First.Value<string>("mediaType") == "rtmp")
{
if (!video.PlaybackOptions.ContainsKey(qualityName))
{
string host = quality.First.Value<string>("streamer");
string file = quality.First.Value<string>("url");
string playbackUrl = new MPUrlSourceFilter.RtmpUrl(host) { TcUrl = host, PlayPath = "mp4:" + file }.ToString();
video.PlaybackOptions.Add(qualityName, playbackUrl);
}
}
else if (quality.First.Value<string>("mediaType") == "mp4")
{
string file = quality.First.Value<string>("url");
video.PlaybackOptions.Add(qualityName, file);
}
}
return video.PlaybackOptions.FirstOrDefault(q => q.Key.Contains(videoQuality.ToString())).Value;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:29,代码来源:ArtePlus7Util.cs
示例20: LoadGeneralVideos
/// <summary>
/// Load the videos for the selected category - will only handle general category types
/// </summary>
/// <param name="parentCategory"></param>
/// <returns></returns>
public static List<VideoInfo> LoadGeneralVideos(Category parentCategory)
{
var doc = new XmlDocument();
var result = new List<VideoInfo>();
var path = "/brandLongFormInfo/allEpisodes/longFormEpisodeInfo"; // default the path for items without series
doc.Load(parentCategory.CategoryInformationPage());
if (!string.IsNullOrEmpty(parentCategory.SeriesId()))
{
path = "/brandLongFormInfo/allSeries/longFormSeriesInfo[seriesNumber='" + parentCategory.SeriesId() + "'] /episodes/longFormEpisodeInfo";
}
foreach (XmlNode node in doc.SelectNodes(path))
{
var item = new VideoInfo();
item.Title = node.SelectSingleNodeText("title1") + (string.IsNullOrEmpty(node.SelectSingleNodeText("title2")) ? string.Empty : " - ") + node.SelectSingleNodeText("title2");
item.Description = node.SelectSingleNodeText("synopsis");
//item.ImageUrl = Properties.Resources._4OD_RootUrl + node.SelectSingleNodeText("pictureUrl");
item.Thumb = node.SelectSingleNodeText("pictureUrl");
DateTime airDate;
if (DateTime.TryParse(node.SelectSingleNodeText("txTime"), out airDate))
item.Airdate = airDate.ToString("dd MMM yyyy");
item.Other = doc.SelectSingleNodeText("/brandLongFormInfo/brandWst") + "~" + node.SelectSingleNodeText("requestId");
result.Add(item);
}
return result;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:37,代码来源:_4ODVideoParser.cs
注:本文中的System.VideoInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论