Changes made after review to make code cleaner and used <iframe> instead of <embed> as per youtube standards along with using HTML5 syntax instead of HTML4.

This commit is contained in:
Ravi Ranjan 2019-10-10 12:38:32 +01:00
parent dc49d8042b
commit 94c29fdcfe
2 changed files with 5 additions and 15 deletions

View File

@ -77,24 +77,14 @@
<provider>
<id>56744E0A-1892-4b56-B7FF-3A2568EE2D27</id>
<serviceName>YouTube</serviceName>
<editorFormat xpp:if="version lt 15.4.3104.0816">
<editorFormat>
<![CDATA[
<embed src="http://www.youtube.com/embed/{videoId}" wmode="transparent" width="{width}" height="{height}"></embed>
<iframe src="http://www.youtube.com/embed/{videoId}" width="{width}" height="{height}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
]]>
</editorFormat>
<editorFormat xpp:if="version gte 15.4.3104.0816">
<embedFormat>
<![CDATA[
<embed src="http://www.youtube.com/embed/{videoId}?hd=1" wmode="transparent" width="{width}" height="{height}"></embed>
]]>
</editorFormat>
<embedFormat xpp:if="version lt 15.4.3104.0816">
<![CDATA[
<object width="{width}" height="{height}"><param name="movie" value="http://www.youtube.com/embed/{videoId}&hl=en"></param><embed src="http://www.youtube.com/embed/{videoId}&hl=en" width="{width}" height="{height}"></embed></object>
]]>
</embedFormat>
<embedFormat xpp:if="version gte 15.4.3104.0816">
<![CDATA[
<object width="{width}" height="{height}"><param name="movie" value="http://www.youtube.com/embed/{videoId}?hl=en&hd=1"></param><embed src="http://www.youtube.com/embed/{videoId}?hl=en&hd=1" width="{width}" height="{height}"></embed></object>
<object width="{width}" height="{height}"><param name="movie" value="http://www.youtube.com/embed/{videoId}&hl=en"></param><iframe src="http://www.youtube.com/embed/{videoId}&hl=en" width="{width}" height="{height}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></object>
]]>
</embedFormat>
<embedPatterns>

View File

@ -376,7 +376,7 @@ namespace OpenLiveWriter.PostEditor.Video
private static string CreateHtml(string html, string color)
{
return String.Format(CultureInfo.InvariantCulture, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"><head><meta content='IE=Edge' http-equiv='X-UA-Compatible'/></head><body style='margin: 0; padding: 0;background-color: #{1}'>{0}</body></html>", html, color);
return String.Format(CultureInfo.InvariantCulture, "<!DOCTYPE html><html><head><meta content='IE=Edge' http-equiv='X-UA-Compatible'/></head><body style='margin: 0; padding: 0;background-color: #{1}'>{0}</body></html>", html, color);
}
private void lblService_SizeChanged(object sender, EventArgs e)