Exemplo n.º 1
0
        private Item GetItem(IPluginContent content, string host)
        {
            Item item;

            if (content is IPluginContainer)
            {
                item = new ItemContainer(null, _device)
                {
                    Title = "[" + content.Title + "]"
                };
            }
            else if (content.Translation == TranslationType.VoD)
            {
                item = new ItemVideo(null, _device)
                {
                    Title = content.Title
                };
                item.ContentUrl = host + "/" + _plugin.Id + "/play?id=" + content.Id;
            }
            else
            {
                item = new ItemStream(null, MediaType.Video, _device)
                {
                    Title      = content.Title,
                    ContentUrl =
                        string.IsNullOrEmpty(content.GetUrl(host))
                            ? string.Format("{0}/{1}/play?id={2}", host, Id, content.Id)
                            : content.GetUrl(host)
                };
            }


            item.ParentId = ParentId + "_" + Id;
            item.Id       = item.ParentId + "_" + content.Id;
            if (!string.IsNullOrEmpty(content.Parent.Id))
            {
                item.ParentId = item.ParentId + "_" + content.Parent.Id;
            }
            item.IconUrl = content.Icon;


            item.Type = MediaType.Video;
            return(item);
        }
Exemplo n.º 2
0
        private Item GetItem(IPluginContent content, string host)
        {
            Item item;
            if (content is IPluginContainer)
            {
                item = new ItemContainer(null, _device) {Title = "[" + content.Title + "]"};
            }
            else if (content.Translation == TranslationType.VoD)
            {
                item = new ItemVideo(null, _device) {Title = content.Title};
                item.ContentUrl = host + "/" + _plugin.Id + "/play?id=" + content.Id;
            }
            else
            {
                item = new ItemStream(null, MediaType.Video, _device)
                {
                    Title = content.Title,
                    ContentUrl =
                        string.IsNullOrEmpty(content.GetUrl(host))
                            ? string.Format("{0}/{1}/play?id={2}", host, Id, content.Id)
                            : content.GetUrl(host)
                };
            }


            item.ParentId = ParentId + "_" + Id;
            item.Id = item.ParentId + "_" + content.Id;
            if (!string.IsNullOrEmpty(content.Parent.Id))
                item.ParentId = item.ParentId + "_" + content.Parent.Id;
            item.IconUrl = content.Icon;
            
            
            item.Type = MediaType.Video;
            return item;

        }