Repository: openmeetings Updated Branches: refs/heads/master 49d0cf36e -> 1a4c48368
[OPENMEETINGS-1641] video poster is fixed Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/1a4c4836 Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/1a4c4836 Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/1a4c4836 Branch: refs/heads/master Commit: 1a4c483682100f8ca7016a730277a422181df070 Parents: 49d0cf3 Author: Maxim Solodovnik <solomax...@gmail.com> Authored: Sat Sep 9 01:14:04 2017 +0700 Committer: Maxim Solodovnik <solomax...@gmail.com> Committed: Sat Sep 9 01:14:04 2017 +0700 ---------------------------------------------------------------------- .../web/room/RoomPreviewResourceReference.java | 65 ++++++++++++++++++++ 1 file changed, 65 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/openmeetings/blob/1a4c4836/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPreviewResourceReference.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPreviewResourceReference.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPreviewResourceReference.java new file mode 100644 index 0000000..8511479 --- /dev/null +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPreviewResourceReference.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License") + you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openmeetings.web.room; + +import static org.apache.openmeetings.util.OmFileHelper.EXTENSION_JPG; +import static org.apache.openmeetings.util.OmFileHelper.JPG_MIME_TYPE; + +import java.io.File; + +import org.apache.openmeetings.db.entity.file.FileExplorerItem; +import org.apache.openmeetings.db.entity.file.FileItem; +import org.apache.wicket.request.resource.IResource.Attributes; + +public class RoomPreviewResourceReference extends RoomResourceReference { + private static final long serialVersionUID = 1L; + private static final String DEFAULT_NAME = "wb-room-file-preview"; + + public RoomPreviewResourceReference() { + super(DEFAULT_NAME); + } + + public RoomPreviewResourceReference(String name) { + super(name); + } + + @Override + protected String getMimeType(FileExplorerItem r) { + return JPG_MIME_TYPE; + } + + @Override + protected FileExplorerItem getFileItem(Attributes attr) { + FileExplorerItem f = super.getFileItem(attr); + if (f != null && FileItem.Type.Video == f.getType()) { + return f; + } + return null; + } + + @Override + protected File getFile(FileExplorerItem f, Attributes attr) { + return getFile(f, EXTENSION_JPG); + } + + @Override + protected String getFileName(FileExplorerItem f) { + return f.getFileName(EXTENSION_JPG); + } +}