public override void CreateContentFromUrl(string url, ref string title, ISmartContent content)
 {
     try
     {
         // download the video
         Video video = VideoProviderManager.FindVideo(url);
         if (video == null)
         {
             throw new ContentCreationException(
                       Res.Get(StringId.Plugin_Video_Cannot_Parse_Url),
                       Res.Get(StringId.Plugin_Video_Cannot_Parse_Url_Message));
         }
         VideoSmartContent vsc = new VideoSmartContent(content);
         vsc.Initialize(video, null);
     }
     catch (ContentCreationException)
     {
         throw;
     }
     catch (VideoPluginException ex)
     {
         throw new ContentCreationException(ex.Title, ex.Description);
     }
     catch (Exception ex)
     {
         VideoPluginUnexpectedException exception = new VideoPluginUnexpectedException(ex);
         throw new ContentCreationException(exception.Title, exception.Description);
     }
 }
 public override void CreateContentFromUrl(string url, ref string title, ISmartContent content)
 {
     try
     {
         // download the video
         Video video = VideoProviderManager.FindVideo(url);
         if (video == null)
         {
             throw new ContentCreationException(
                 Res.Get(StringId.Plugin_Video_Cannot_Parse_Url),
                 Res.Get(StringId.Plugin_Video_Cannot_Parse_Url_Message));
         }
         VideoSmartContent vsc = new VideoSmartContent(content);
         vsc.Initialize(video, null);
     }
     catch (ContentCreationException)
     {
         throw;
     }
     catch (VideoPluginException ex)
     {
         throw new ContentCreationException(ex.Title, ex.Description);
     }
     catch (Exception ex)
     {
         VideoPluginUnexpectedException exception = new VideoPluginUnexpectedException(ex);
         throw new ContentCreationException(exception.Title, exception.Description);
     }
 }
 public void CreateContentFromEmbed(string embed, ISmartContent content)
 {
     try
     {
         // download the video
         Video             video = VideoProviderManager.FindVideo(embed);
         VideoSmartContent vsc   = new VideoSmartContent(content);
         vsc.Initialize(video, null);
         if (video == null)
         {
             throw new ContentCreationException(
                       "Unable to Parse Video Embed", "Unknown provider or incomplete embed.");
         }
     }
     catch (ContentCreationException)
     {
         throw;
     }
     catch (VideoPluginException ex)
     {
         throw new ContentCreationException(ex.Title, ex.Description);
     }
     catch (Exception ex)
     {
         VideoPluginUnexpectedException exception = new VideoPluginUnexpectedException(ex);
         throw new ContentCreationException(exception.Title, exception.Description);
     }
 }
        public override void OnResizeComplete(ISmartContent content, Size newSize)
        {
            // access content object
            VideoSmartContent VideoContent = new VideoSmartContent(content);

            // update html size
            VideoContent.HtmlSize = newSize;
        }
        public override void OnResizeStart(ISmartContent content, ResizeOptions options)
        {
            // access content object
            VideoSmartContent VideoContent = new VideoSmartContent(content);

            // make sure we keep to the current aspect ratio
            options.AspectRatio = VideoContent.HtmlSize.Width / (double)VideoContent.HtmlSize.Height;
        }
        public override string GenerateEditorHtml(ISmartContent content, IPublishingContext publishingContext)
        {
            VideoSmartContent VideoContent = new VideoSmartContent(content);
            string            html         = VideoContent.GenerateEditorHtml(publishingContext);

            ((IInternalContent)content).RefreshCallback = VideoContent.GetRefreshCallback();
            return(html);
        }
        protected override void OnSelectedContentChanged()
        {
            // make connection to settings and elements
            _VideoContent = new VideoSmartContent(SelectedContent);

            base.OnSelectedContentChanged();

            // update the settings UI
            InitializeSettingsUI();

            // force a layout for dynamic control flow
            PerformLayout();

            UpdatePadding();
            // WinLive 121985: Cannot select the 'Enter Video Caption Here' edit control.
            //OnContentEdited();

            UpdateAspectRatio();
        }
        private DialogResult CreateContentForm(IWin32Window dialogOwner, ISmartContent content, List <MediaTab> videoSources, int selectedTab)
        {
            using (new WaitCursor())
            {
                IBlogContext      blogContext       = dialogOwner as IBlogContext;
                VideoSmartContent videoSmartContent = new VideoSmartContent(content);
                using (MediaInsertForm videoBrowserForm = new MediaInsertForm(videoSources, blogContext.CurrentAccountId, selectedTab, videoSmartContent, Res.Get(StringId.Plugin_Videos_Select_Video_Form), true))
                {
                    if (videoBrowserForm.ShowDialog(dialogOwner) == DialogResult.OK)
                    {
                        string VIDEO_LAST_PERMISSION = "Video.lastPermission";
                        Options.SetString(VIDEO_LAST_PERMISSION, videoSmartContent.Permission);

                        videoBrowserForm.SaveContent(videoSmartContent);

                        return(DialogResult.OK);
                    }
                    else
                    {
                        return(DialogResult.Cancel);
                    }
                }
            }
        }
        protected override void OnSelectedContentChanged()
        {
            // make connection to settings and elements
            _VideoContent = new VideoSmartContent(SelectedContent);

            base.OnSelectedContentChanged();

            // update the settings UI
            InitializeSettingsUI();

            // force a layout for dynamic control flow
            PerformLayout();

            UpdatePadding();
            // WinLive 121985: Cannot select the 'Enter Video Caption Here' edit control.
            //OnContentEdited();

            UpdateAspectRatio();
        }
 public void CreateContentFromEmbed(string embed, ISmartContent content)
 {
     try
     {
         // download the video
         Video video = VideoProviderManager.FindVideo(embed);
         VideoSmartContent vsc = new VideoSmartContent(content);
         vsc.Initialize(video, null);
         if (video == null)
         {
             throw new ContentCreationException(
                 "Unable to Parse Video Embed", "Unknown provider or incomplete embed.");
         }
     }
     catch (ContentCreationException)
     {
         throw;
     }
     catch (VideoPluginException ex)
     {
         throw new ContentCreationException(ex.Title, ex.Description);
     }
     catch (Exception ex)
     {
         VideoPluginUnexpectedException exception = new VideoPluginUnexpectedException(ex);
         throw new ContentCreationException(exception.Title, exception.Description);
     }
 }
        private DialogResult CreateContentForm(IWin32Window dialogOwner, ISmartContent content, List<MediaTab> videoSources, int selectedTab)
        {
            using (new WaitCursor())
            {
                IBlogContext blogContext = dialogOwner as IBlogContext;
                VideoSmartContent videoSmartContent = new VideoSmartContent(content);
                using (MediaInsertForm videoBrowserForm = new MediaInsertForm(videoSources, blogContext.CurrentAccountId, selectedTab, videoSmartContent, Res.Get(StringId.Plugin_Videos_Select_Video_Form), true))
                {
                    if (videoBrowserForm.ShowDialog(dialogOwner) == DialogResult.OK)
                    {
                        string VIDEO_LAST_PERMISSION = "Video.lastPermission";
                        Options.SetString(VIDEO_LAST_PERMISSION, videoSmartContent.Permission);

                        videoBrowserForm.SaveContent(videoSmartContent);

                        return DialogResult.OK;
                    }
                    else
                    {
                        return DialogResult.Cancel;
                    }
                }
            }
        }
        public override void OnResizeComplete(ISmartContent content, Size newSize)
        {
            // access content object
            VideoSmartContent VideoContent = new VideoSmartContent(content);

            // update html size
            VideoContent.HtmlSize = newSize;
        }
        public override void OnResizeStart(ISmartContent content, ResizeOptions options)
        {
            // access content object
            VideoSmartContent VideoContent = new VideoSmartContent(content);

            // make sure we keep to the current aspect ratio
            options.AspectRatio = VideoContent.HtmlSize.Width / (double)VideoContent.HtmlSize.Height;
        }
 public override string GeneratePublishHtml(ISmartContent content, IPublishingContext publishingContext)
 {
     VideoSmartContent VideoContent = new VideoSmartContent(content);
     return VideoContent.GeneratePublishHtml(publishingContext);
 }
 public override string GenerateEditorHtml(ISmartContent content, IPublishingContext publishingContext)
 {
     VideoSmartContent VideoContent = new VideoSmartContent(content);
     string html = VideoContent.GenerateEditorHtml(publishingContext);
     ((IInternalContent)content).RefreshCallback = VideoContent.GetRefreshCallback();
     return html;
 }
        public override string GeneratePublishHtml(ISmartContent content, IPublishingContext publishingContext)
        {
            VideoSmartContent VideoContent = new VideoSmartContent(content);

            return(VideoContent.GeneratePublishHtml(publishingContext));
        }