private string GeneratePublishVideoHtml(VideoContext context)
        {
            //check for special cases--whitelist blog providers and such
            string output;

            if (VideoProviderManager.CheckForWhitelist(context.BlogProviderId, ProviderId, Id, HtmlSize, out output))
            {
                return(String.Format(CultureInfo.InvariantCulture, "<div>{0}</div>", output));
            }

            // generate 'smart' html based on the user's preference
            AdaptiveHtmlObject adaptiveHtmlObject = new AdaptiveHtmlObject(VideoProvider.GenerateEmbedHtml(EmbedFormat, Id, HtmlSize), Url);

            if (HtmlSize != VideoSnapshotSize)
            {
                adaptiveHtmlObject.PreviewImageSize = HtmlSize;
            }
            adaptiveHtmlObject.OpenPreviewInNewWindow = OpenInNewWindow;
            HtmlType htmlType;

            //determine player style
            VideoPlayerStyle playerStyle = context.DetermineAppropriatePlayer(Url != String.Empty);

            switch (playerStyle)
            {
            case VideoPlayerStyle.Automatic:
                htmlType = HtmlType.AdaptiveHtml;
                break;

            case VideoPlayerStyle.PreviewWithLink:
                htmlType = HtmlType.PreviewHtml;
                break;

            case VideoPlayerStyle.EmbeddedInPage:
                htmlType = HtmlType.ObjectHtml;
                break;

            default:
                Trace.Fail("Unexpected PlayerStyle: " + playerStyle.ToString());
                htmlType = HtmlType.PreviewHtml;
                break;
            }

            string path = GetSnapshotPathIfNeeded(htmlType, context);

            if (!string.IsNullOrEmpty(path))
            {
                adaptiveHtmlObject.PreviewImageSrc = path;
            }
            else
            {
                htmlType = HtmlType.ObjectHtml;
            }

            return(adaptiveHtmlObject.GenerateHtml(htmlType));
        }
        private string GeneratePublishVideoHtml(VideoContext context)
        {
            //check for special cases--whitelist blog providers and such
            string output;
            if (VideoProviderManager.CheckForWhitelist(context.BlogProviderId, ProviderId, Id, HtmlSize, out output))
            {
                return String.Format(CultureInfo.InvariantCulture, "<div>{0}</div>", output);
            }

            // generate 'smart' html based on the user's preference
            AdaptiveHtmlObject adaptiveHtmlObject = new AdaptiveHtmlObject(VideoProvider.GenerateEmbedHtml(EmbedFormat, Id, HtmlSize), Url);
            if (HtmlSize != VideoSnapshotSize)
                adaptiveHtmlObject.PreviewImageSize = HtmlSize;
            adaptiveHtmlObject.OpenPreviewInNewWindow = OpenInNewWindow;
            HtmlType htmlType;

            //determine player style
            VideoPlayerStyle playerStyle = context.DetermineAppropriatePlayer(Url != String.Empty);
            switch (playerStyle)
            {
                case VideoPlayerStyle.Automatic:
                    htmlType = HtmlType.AdaptiveHtml;
                    break;

                case VideoPlayerStyle.PreviewWithLink:
                    htmlType = HtmlType.PreviewHtml;
                    break;

                case VideoPlayerStyle.EmbeddedInPage:
                    htmlType = HtmlType.ObjectHtml;
                    break;

                default:
                    Trace.Fail("Unexpected PlayerStyle: " + playerStyle.ToString());
                    htmlType = HtmlType.PreviewHtml;
                    break;
            }

            string path = GetSnapshotPathIfNeeded(htmlType, context);

            if (!string.IsNullOrEmpty(path))
            {
                adaptiveHtmlObject.PreviewImageSrc = path;
            }
            else
            {
                htmlType = HtmlType.ObjectHtml;
            }

            return adaptiveHtmlObject.GenerateHtml(htmlType);
        }