private string GetSnapshotPathIfNeeded(HtmlType htmlType, VideoContext context)
        {
            // NOTE: We skip this behavior on IE9+ because of WinLive 589461.
            if (htmlType == HtmlType.ObjectHtml || ApplicationEnvironment.BrowserVersion.Major >= 9)
            {
                return(null);
            }

            try
            {
                IHTMLElement element = context.GetElement(((IInternalContent)_content).Id);

                if (element != null)
                {
                    element = ((IHTMLDOMNode)element).firstChild as IHTMLElement;
                }

                if (element != null && (element is IViewObject))
                {
                    Bitmap snapshot = HtmlScreenCaptureCore.TakeSnapshot((IViewObject)element, element.offsetWidth, element.offsetHeight);
                    UpdateVideoSnapshot(snapshot);
                }

                Uri uri = _content.Files.GetUri(_content.Properties.GetString(VIDEO_PUBLISH_IMAGE, String.Empty));

                if (uri != null)
                {
                    return(uri.ToString());
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed to take video snapshot: " + ex);
            }

            return(null);
        }
        private string GetSnapshotPathIfNeeded(HtmlType htmlType, VideoContext context)
        {
            // NOTE: We skip this behavior on IE9+ because of WinLive 589461.
            if (htmlType == HtmlType.ObjectHtml || ApplicationEnvironment.BrowserVersion.Major >= 9)
            {
                return null;
            }

            try
            {
                IHTMLElement element = context.GetElement(((IInternalContent)_content).Id);

                if (element != null)
                {
                    element = ((IHTMLDOMNode)element).firstChild as IHTMLElement;
                }

                if (element != null && (element is IViewObject))
                {
                    Bitmap snapshot = HtmlScreenCaptureCore.TakeSnapshot((IViewObject)element, element.offsetWidth, element.offsetHeight);
                    UpdateVideoSnapshot(snapshot);
                }

                Uri uri = _content.Files.GetUri(_content.Properties.GetString(VIDEO_PUBLISH_IMAGE, String.Empty));

                if (uri != null)
                    return uri.ToString();
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed to take video snapshot: " + ex);
            }

            return null;
        }