Skip to content

Commit

Permalink
'#1859 Corrects logic to add controls for attached video playing
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdalla committed Nov 13, 2023
1 parent 36dab66 commit 2a36967
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,15 @@ public byte[] convertToHTML(List<DiscordRoot> drl, IItemSearcher searcher,
String exportPath = iped.parsers.util.Util.getExportPath(item);
String source = iped.parsers.util.Util.getSourceFileIfExists(item).orElse("");
byte[] thumb = item.getThumb();

out.println(" <a onclick=\"app.open('hash:" + att.getMediaHash() + "')\" href='"
+ Util.getExportPath(item) + "'>");
if (item.getThumb() != null) {
out.println(" <img src=\"data:image/jpeg;base64,"
+ Base64.getEncoder().encodeToString(thumb) + "\" title=\""
+ format(att.getFilename()) + "\">");
if (!item.getMediaType().toString().startsWith("video/")) {
if (thumb != null) {
out.println(" <img src=\"data:image/jpeg;base64,"
+ Base64.getEncoder().encodeToString(thumb) + "\" title=\""
+ format(att.getFilename()) + "\">");
}
}

out.println(" <BR/>");
Expand All @@ -534,13 +537,10 @@ public byte[] convertToHTML(List<DiscordRoot> drl, IItemSearcher searcher,
+ format(exportPath) + "\"" + " data-src2=\"" + format(source) + "\"" //$NON-NLS-3$
+ " title=\"" + att.getFilename() //$NON-NLS-1$
+ "\"/>");

} else {
out.println("<div class=\"videoImg iped-video\" title=\"Video\"" + " data-src1=\""
+ format(exportPath) + "\"" + " data-src2=\"" + format(source) + "\"></div>");
}
out.println("<div class=\"videoImg iped-video\" title=\"Video\"" + " data-src1=\""
+ format(exportPath) + "\"" + " data-src2=\"" + format(source) + "\"></div>");
}

} else {
out.println(" <DIV>" + format(att.getFilename()) + "</DIV>");
}
Expand Down

0 comments on commit 2a36967

Please sign in to comment.