/// <summary> /// Gets all video qualities available in a <see cref="MediaStreamInfoSet"/>. /// </summary> public static IEnumerable <VideoQuality> GetAllVideoQualities(this MediaStreamInfoSet streamInfoSet) { //streamInfoSet.GuardNotNull(nameof(streamInfoSet)); var qualities = new HashSet <VideoQuality>(); foreach (var streamInfo in streamInfoSet.Muxed) { qualities.Add(streamInfo.VideoQuality); } foreach (var streamInfo in streamInfoSet.Video) { qualities.Add(streamInfo.VideoQuality); } return(qualities); }
/// <summary> /// Gets all available media stream infos in a <see cref="MediaStreamInfoSet"/>. /// </summary> public static IEnumerable <MediaStreamInfo> GetAll(this MediaStreamInfoSet streamInfoSet) { //streamInfoSet.GuardNotNull(nameof(streamInfoSet)); foreach (var streamInfo in streamInfoSet.Muxed) { yield return(streamInfo); } foreach (var streamInfo in streamInfoSet.Audio) { yield return(streamInfo); } foreach (var streamInfo in streamInfoSet.Video) { yield return(streamInfo); } }
public static void f_add_URL(string mediaId, MediaStreamInfoSet media) { string key_audio = "M4A" + mediaId; string key_video = "MP4" + mediaId; var au = media.Audio.Where(x => x.Container == Container.M4A).Take(1).SingleOrDefault(); if (au != null) { m_dicProxy.TryAdd(key_audio, au.Url); } var vi = media.Muxed.Where(x => x.Container == Container.Mp4).Take(1).SingleOrDefault(); if (vi != null) { m_dicProxy.TryAdd(key_video, vi.Url); } }