Пример #1
0
        /// <inheritdoc />
        public virtual VideoViewModel GetViewModel()
        {
            var viewModel = new VideoViewModel();

            viewModel.CssClass = this.CssClass;

            if (this.Id != Guid.Empty)
            {
                LibrariesManager librariesManager = LibrariesManager.GetManager(this.ProviderName);
                var videoItem = librariesManager.GetVideos()
                                .Where(i => i.Id == this.Id)
                                .SingleOrDefault();

                if (videoItem == null || !videoItem.Visible || videoItem.Status != ContentLifecycleStatus.Live)
                {
                    return(viewModel);
                }

                viewModel.HasSelectedVideo = true;
                viewModel.AspectRatio      = this.AspectRatio;
                viewModel.Width            = this.Width;
                viewModel.Height           = this.Height;
                viewModel.Item             = new ItemViewModel(videoItem);
            }

            return(viewModel);
        }
Пример #2
0
        /// <inheritdoc />
        public virtual VideoViewModel GetViewModel()
        {
            var viewModel = new VideoViewModel();
            viewModel.CssClass = this.CssClass;

            if (this.Id != Guid.Empty)
            {
                LibrariesManager librariesManager = LibrariesManager.GetManager(this.ProviderName);
                var videoItem = librariesManager.GetVideos()
                    .Where(i => i.Id == this.Id)
                    .SingleOrDefault();

                if (videoItem == null || !videoItem.Visible || videoItem.Status != ContentLifecycleStatus.Live)
                    return viewModel;

                viewModel.HasSelectedVideo = true;
                viewModel.AspectRatio = this.AspectRatio;
                viewModel.Width = this.Width;
                viewModel.Height = this.Height;
                viewModel.Item = new ItemViewModel(videoItem);
            }

            return viewModel;
        }