Skip to content

Commit abcaba0

Browse files
committed
HTML 5 player video function
fix #219
1 parent 6f5725a commit abcaba0

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

src/main/java/com/openkm/servlet/PreviewServlet.java

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -199,45 +199,19 @@ private void buildUrl(PreviewParams params, Document doc) throws DatabaseExcepti
199199
/**
200200
* Get PDF preview. Look into profile to get configured preview
201201
*/
202-
private void pdfPreview(PreviewParams params) throws ServletException, IOException, AccessDeniedException,
203-
PathNotFoundException, DatabaseException, PrincipalAdapterException {
204-
String selectedPreview = getDesiredPreview(params);
205-
206-
if (PREVIEWER_PDFJS.equals(selectedPreview)) {
207-
pdfjs(params);
208-
} else {
209-
flexpaper(params);
210-
}
202+
private void pdfPreview(PreviewParams params) throws IOException, PrincipalAdapterException {
203+
pdfjs(params);
211204
}
212205

213206
/**
214207
* Show PDF.js preview
215208
*/
216209
private void pdfjs(PreviewParams params) throws IOException {
217210
String contextPath = params.request.getContextPath();
218-
String url = contextPath + "/preview/pdfjs/index.jsp?pdfUrl="+URLEncoder.encode(params.pdfUrl, "UTF-8");
211+
String url = contextPath + "/preview/pdfjs/index.jsp?pdfUrl=" + URLEncoder.encode(params.pdfUrl, "UTF-8");
219212
params.response.sendRedirect(url);
220213
}
221214

222-
/**
223-
* Get desired preview
224-
*/
225-
private String getDesiredPreview(PreviewParams params) throws PrincipalAdapterException {
226-
Profile profile = OKMAuth.getInstance().getUserProfile(null, PrincipalUtils.getUser());
227-
String desiredPreview = PREVIEWER_PDFJS;
228-
229-
// previewEngine should have priority over the other options
230-
if (params.previewEngine != null && !params.previewEngine.isEmpty() && (PREVIEWER_PDFJS.equals(params.previewEngine))) {
231-
// Only use if there is a valid preview engine as parameter
232-
desiredPreview = params.previewEngine;
233-
} else if (profile != null) {
234-
// The first option is to use profile previewer
235-
desiredPreview = profile.getPrfMisc().getPreviewer();
236-
}
237-
238-
return desiredPreview;
239-
}
240-
241215
/**
242216
* Show html preview
243217
*/

0 commit comments

Comments
 (0)