/// <summary>
        /// Creates the JavaScript block and Flash div controls and adds them to the page
        /// </summary>
        protected override void CreateChildControls()
        {
            //Add the flash content panel to the page
            this.Controls.Clear();

            Panel vp = new Panel();

            vp.ID = this.ClientID;
            this.Controls.Add(vp);

            if (!VideoID.Equals(-1) || !PlayerID.Equals(-1))
            {
                //wmode
                WMode qWMode = BrightcoveSDK.WMode.Transparent;
                if (WMode.Equals(BrightcoveSDK.WMode.Opaque.ToString().ToLower()))
                {
                    qWMode = BrightcoveSDK.WMode.Opaque;
                }
                if (WMode.Equals(BrightcoveSDK.WMode.Window.ToString().ToLower()))
                {
                    qWMode = BrightcoveSDK.WMode.Window;
                }

                string  uniqueID  = "video_" + DateTime.Now.ToString("yyyy.MM.dd.HH.mm.ss.FFFF");
                Literal litScript = new Literal();
                if (PlaylistTabs.Any())
                {
                    litScript.Text = EmbedCode.GetTabbedPlayerEmbedCode(PlayerID, VideoID, PlaylistTabs.GetValues(), Height, Width, BackColor, AutoStart, qWMode, uniqueID);
                }
                else if (PlaylistCombos.Any())
                {
                    litScript.Text = EmbedCode.GetComboBoxPlayerEmbedCode(PlayerID, VideoID, PlaylistCombos.GetValues(), Height, Width, BackColor, AutoStart, qWMode, uniqueID);
                }
                else if (VideoList != -1)
                {
                    EmbedCode.GetVideoListPlayerEmbedCode(PlayerID, VideoID, VideoList, Height, Width, BackColor, AutoStart, qWMode, uniqueID);
                }
                else
                {
                    litScript.Text = EmbedCode.GetVideoPlayerEmbedCode(PlayerID, VideoID, Height, Width, BackColor, AutoStart, qWMode, uniqueID);
                }

                Controls.Add(litScript);
            }
        }
Ejemplo n.º 2
0
        public async Task AddPlaylist(string playlistName, PlaylistTabs playlistType)
        {
            if (!string.IsNullOrWhiteSpace(playlistName))
            {
                Playlist playlist = new Playlist(playlistName)
                {
                    Type = (int)playlistType
                };
                Configuration configuration = await dataService.Get <Configuration>(item => item.Type == nameof(MediaPages.Playlist));

                await dataService.Insert(playlist);

                if (configuration != null)
                {
                    playlistViewModel.Configuration = JsonConvert.DeserializeObject <PlaylistConfiguration>(configuration.JsonData);
                    playlistViewModel.Configuration.SelectedPlaylistId   = playlist.Id;
                    playlistViewModel.Configuration.SelectedPlaylistPage = PlaylistPages.Playlist;
                    configuration.JsonData = JsonConvert.SerializeObject(playlistViewModel.Configuration);
                    await dataService.Update(configuration);
                }
            }
        }