public ActionResult Library()
        {
            var videos = from v in videoRepository.GetAll()
                         let thumbnailLocation = locatorService.GetAssetThumbnailLocationUrl(v)
                                                 select new VideoItem()
            {
                Title        = v.Name,
                VideoUrl     = locatorService.GetAssetLocationUrl(v),
                ThumbnailUrl = String.IsNullOrEmpty(thumbnailLocation) ? string.Empty : Url.Content(thumbnailLocation)
            };

            return(View(new VideoLibraryModel {
                Videos = videos.ToList()
            }));
        }
Beispiel #2
0
        public ActionResult Library()
        {
            var videos = from v in videoRepository.GetAll()
                         let thumbnailLocation = locatorService.GetAssetThumbnailLocationUrl(v)
                                                 select new { Asset = v, ThumbnailLocation = String.IsNullOrEmpty(thumbnailLocation) ? string.Empty : Url.Content(thumbnailLocation) };

            var filter = new SmoothStreamingFilter();


            var result = from v in videos
                         where filter.Filter.Invoke(v.Asset)
                         select new VideoItem
            {
                Title        = v.Asset.Name,
                VideoUrl     = locatorService.GetAssetLocationUrl(v.Asset),
                ThumbnailUrl = v.ThumbnailLocation
            };

            return(View(new VideoLibraryModel {
                Videos = result.ToList()
            }));
        }