import org.apache.log4j.Logger;
import eu.svjatoslav.commons.file.FilePathParser;
-import eu.svjatoslav.commons.network.UrlParamEncoder;
import eu.svjatoslav.meviz.htmlindexer.AbstractIndexer;
import eu.svjatoslav.meviz.htmlindexer.Constants;
import eu.svjatoslav.meviz.htmlindexer.IndexingContext;
import eu.svjatoslav.meviz.htmlindexer.Layout;
+import eu.svjatoslav.meviz.htmlindexer.Utils;
import eu.svjatoslav.meviz.htmlindexer.metadata.Dimension;
import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata;
import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile;
filesHtml.append("<div style=\"clear: both;\"><a href=\""
+ indexingContext.getGlobalUrl()
- + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+ + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+ fullFileName) + "\">" + fullFileName + "</a>\n");
filesHtml.append(" ("
+ FilePathParser.getFileSizeDescription(file.getFileLength())
// clickable image thumbnail
filesHtml.append("<a href=\""
+ indexingContext.getGlobalUrl()
- + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
+ + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+ picture.fileName) + "\">\n");
+
filesHtml.append("<img border=\"0\" src=\""
+ getImageThumbnailUrl(picture) + "\"/></a><br/>\n");
filesHtml
.append("<source type=\"video/ogg\" codecs=\"theora, vorbis\" src=\""
+ indexingContext.getGlobalUrl()
- + UrlParamEncoder.encode(indexingContext.getLocalUrl()
- + "/" + file.fileName) + "\">\n");
+ + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+ + file.fileName) + "\">\n");
filesHtml.append("</source>\n");
filesHtml.append("</video>\n");
filesHtml.append("<br/>\n");
// video download link
filesHtml.append("<a href=\""
+ indexingContext.getGlobalUrl()
- + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/"
- + file.fileName) + "\">download as OGV</a>");
+ + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+ + file.fileName) + "\">download as OGV file</a>");
filesHtml.append("</div>\n");
return html.toString();
}
+ @Override
+ public void enlistWebm(AbstractFile abstractFile,
+ DirectoryMetadata directory) {
+ final GeneralFile file = (GeneralFile) abstractFile;
+
+ filesHtml.append("<div style=\"margin: 30px; clear: both;\">");
+
+ // watchable video
+
+ String fileUrl = indexingContext.getGlobalUrl()
+ + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+ + file.fileName);
+
+ filesHtml.append("<video controls>\n");
+ filesHtml.append(" <source src=\"" + fileUrl
+ + "\" type='video/webm;codecs=\"vp8, opus\"'/>\n");
+ filesHtml.append("</video>\n");
+ filesHtml.append("<br/>\n");
+
+ // video title
+ filesHtml
+ .append("Video: <b>"
+ + FilePathParser
+ .getFileNameWithoutExtension(file.fileName)
+ + "<b/> ");
+
+ // video download link
+ filesHtml.append("<a href=\""
+ + indexingContext.getGlobalUrl()
+ + Utils.urlEncode(indexingContext.getLocalUrl() + "/"
+ + file.fileName) + "\">download as WebM file</a>");
+
+ filesHtml.append("</div>\n");
+
+ filesHtml.append("\n");
+ }
}