From: Svjatoslav Agejenko Date: Mon, 4 May 2015 16:48:13 +0000 (+0300) Subject: support for indexing WebM videos X-Git-Tag: meviz-1.0~25 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=dfbc4d8ef09f9aa2deb4597184523dd316fa8071;p=meviz.git support for indexing WebM videos --- diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java index fff1b68..294189b 100644 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/AbstractIndexer.java @@ -44,6 +44,8 @@ public abstract class AbstractIndexer { if ("ogv".equals(fileExtension)) layout.enlistOgv(file, directory); + else if ("webm".equals(fileExtension)) + layout.enlistWebm(file, directory); else layout.enlistFile(file, directory); diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java index b41d83a..4a21863 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java @@ -76,4 +76,6 @@ public interface Layout { */ public void init(String galleryTitle, List path, final AbstractIndexer indexer, IndexingContext context); + + public void enlistWebm(AbstractFile file, DirectoryMetadata directory); } diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java index fd70b10..f721ba6 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/layouts/MixedLayout.java @@ -164,7 +164,7 @@ public class MixedLayout implements Layout { filesHtml.append("download as OGV"); + + file.fileName) + "\">download as OGV file"); filesHtml.append("\n"); @@ -272,4 +272,40 @@ public class MixedLayout implements Layout { return html.toString(); } + @Override + public void enlistWebm(AbstractFile abstractFile, + DirectoryMetadata directory) { + final GeneralFile file = (GeneralFile) abstractFile; + + filesHtml.append("
"); + + // watchable video + + String fileUrl = indexingContext.getGlobalUrl() + + UrlParamEncoder.encode(indexingContext.getLocalUrl() + "/" + + file.fileName); + + filesHtml.append("\n"); + filesHtml.append("
\n"); + + // video title + filesHtml + .append("Video: " + + FilePathParser + .getFileNameWithoutExtension(file.fileName) + + "            "); + + // video download link + filesHtml.append("download as WebM file"); + + filesHtml.append("
\n"); + + filesHtml.append("\n"); + } }