Update oEmbed thumbnail support.

This commit is contained in:
David Russell 2017-10-13 09:39:02 +07:00
parent 2f22fdb395
commit ac97fe1eb6
2 changed files with 10 additions and 3 deletions

View File

@ -47,9 +47,9 @@ public class PitchEmbed {
public String width = DEFAULT_WIDTH;
public String height = DEFAULT_HEIGHT;
public String author_url;
public String thumbnail_url;
public int thumbnail_width;
public int thumbnail_height;
public String thumbnail_url = DEFAULT_THUMB;
public String thumbnail_width;
public String thumbnail_height;
public static PitchEmbed build(GRSManager grsManager,
String url) {
@ -96,6 +96,8 @@ public class PitchEmbed {
this.author_url = authorUrl;
this.width = buildWidth(width, maxWidth, maxHeight);
this.height = buildHeight(height, maxWidth, maxHeight);
this.thumbnail_width = this.width;
this.thumbnail_height = this.height;
this.html = buildHTML(pl.url, this.width, this.height);
}
@ -160,6 +162,8 @@ public class PitchEmbed {
private final static String CACHE = "180";
private final static String DEFAULT_WIDTH = "960";
private final static String DEFAULT_HEIGHT = "700";
private final static String DEFAULT_THUMB =
"https://gitpitch.com/gitpitch-icon-black.jpg";
private final static String HTML_OPEN = "<iframe ";
private final static String HTML_WIDTH = "width=\"";

View File

@ -11,4 +11,7 @@
<html>@pembed.html</html>
<width type="integer">@pembed.width</width>
<height type="integer">@pembed.height</height>
<thumbnail_url>@pembed.thumbnail_url</thumbnail_url>
<thumbnail_width>@pembed.thumbnail_width</thumbnail_width>
<thumbnail_height>@pembed.thumbnail_height</thumbnail_height>
</oembed>