예제 #1
0
        public override void Process(MediaGenerateMarkupArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Generator, "args.Generator");

            if (args.PlayerItem == null)
            {
                args.PlayerItem = args.Database.GetItem(args.Properties.PlayerId);

                if (args.PlayerItem == null)
                {
                    LogHelper.Warn("Selected player item could not be found. Default player will be used.", this);

                    args.PlayerItem = args.Generator.GetDefaultPlayer(args);
                }
            }

            if (args.PlayerItem != null)
            {
                args.Properties.PlayerId = args.PlayerItem.ID;
            }
            else
            {
                LogHelper.Warn("Player item could not be found. Player markup generation will be stopped.", this);

                args.AbortPipeline();
            }
        }
        public override void Process(MediaGenerateMarkupArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.Database, "args.Database");
            Assert.ArgumentNotNull(args.Properties, "args.PlayerProperties");

            if (args.MediaItem == null)
            {
                args.MediaItem = args.Database.GetItem(args.Properties.ItemId);
            }

            if (args.MediaItem != null)
            {
                args.Properties.ItemId = args.MediaItem.ID;

                if (args.MarkupType == MarkupType.Html)
                {
                    args.Properties.Template = args.MediaItem.TemplateID;
                }
            }
            else
            {
                LogHelper.Warn("Media item could not be found. Player markup generation will be stopped.", this);

                args.AbortPipeline();
            }
        }
        public override void Process(MediaGenerateMarkupArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.MediaItem, "args.MediaItem");

            if (args.AccountItem == null)
            {
                args.AccountItem = AccountManager.GetAccountItemForDescendant(args.MediaItem);

                if (args.AccountItem == null)
                {
                    LogHelper.Warn("Account item could not be found. Player markup generation will be stopped.", this);

                    args.AbortPipeline();
                }
            }
        }
예제 #4
0
        public override void Process(MediaGenerateMarkupArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (args.MediaItem != null)
            {
                args.Database = args.MediaItem.Database;
            }
            else if (args.Database == null)
            {
                args.Database = Context.ContentDatabase ?? Context.Database;

                if (args.Database == null)
                {
                    LogHelper.Warn("Database is null. Player markup generation will be stopped.", this);
                    args.AbortPipeline();
                }
            }
        }
        /// <summary>
        /// Processes determining the markup generator.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        public override void Process(MediaGenerateMarkupArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            Assert.ArgumentNotNull(args.MediaItem, "args.MediaItem");

            IPlayerMarkupGenerator generator = MediaFrameworkContext.GetPlayerMarkupGenerator(args.MediaItem.TemplateID);

            if (generator != null)
            {
                args.Generator = generator;

                if (args.MarkupType == MarkupType.Html)
                {
                    args.Properties.MediaId = args.Generator.GetMediaId(args.MediaItem);
                }
            }
            else
            {
                LogHelper.Warn("Player markup generator couldn't be determine for player. Player markup generation will be stopped.", this);

                args.AbortPipeline();
            }
        }