Ejemplo n.º 1
0
        public static IEnumerable <ImageshopVideoData> GetVideosOfType(this ImageshopVideo video, string type)
        {
            if (video.Videos != null)
            {
                return(video.Videos.Where(x => x.Type.Equals(type, StringComparison.InvariantCultureIgnoreCase)));
            }

            return(Enumerable.Empty <ImageshopVideoData>());
        }
Ejemplo n.º 2
0
        public static string GetVideosJson(this ImageshopVideo video)
        {
            if (video.Videos != null)
            {
                var objectSerializer = ServiceLocator.Current.GetInstance <IObjectSerializer>();

                return(objectSerializer.Serialize(video.Videos.Select(x => new
                {
                    file = x.File,
                    label = x.Label,
                    type = x.Type,
                    fullFile = $"{x.File}/{video.Code}.{x.Type}"
                })));
            }

            return(null);
        }
Ejemplo n.º 3
0
 public static string GetUrlFriendlyCode(this ImageshopVideo video)
 {
     return(ServiceLocator.Current.GetInstance <IUrlSegmentGenerator>().Create(video.Code));
 }
Ejemplo n.º 4
0
 public static ImageshopVideoData GetFirstVideo(this ImageshopVideo video, string type)
 {
     return(video.Videos?.FirstOrDefault(x => x.Type.Equals(type, StringComparison.InvariantCultureIgnoreCase)));
 }
Ejemplo n.º 5
0
 public static ImageshopVideoData GetFirstVideo(this ImageshopVideo video)
 {
     return(video.Videos?.FirstOrDefault());
 }