use of org.apache.wicket.resource.FileSystemResourceReference in project openmeetings by apache.
the class WbWebSocketHelper method addFileUrl.
public static JSONObject addFileUrl(String ruid, JSONObject _file, BaseFileItem fi, Client c) {
JSONObject file = new JSONObject(_file.toString(new NullStringer()));
final FileSystemResourceReference ref;
final PageParameters pp = new PageParameters().add("id", fi.getId()).add("ruid", ruid).add("wuid", _file.optString("uid"));
if (c != null) {
pp.add("uid", c.getUid());
}
file.put("deleted", !fi.exists());
switch(fi.getType()) {
case Video:
ref = new RoomResourceReference();
file.put(PARAM__SRC, urlFor(ref, pp));
file.put(PARAM__POSTER, urlFor(new RoomPreviewResourceReference(), pp));
break;
case Recording:
ref = new Mp4RecordingResourceReference();
file.put(PARAM__SRC, urlFor(ref, pp));
file.put(PARAM__POSTER, urlFor(new PngRecordingResourceReference(), pp));
break;
case Presentation:
ref = new RoomResourceReference();
file.put(PARAM__SRC, urlFor(ref, pp));
break;
default:
ref = new RoomResourceReference();
file.put(PARAM_SRC, urlFor(ref, pp));
break;
}
return file;
}
Aggregations