Search in sources :

Example 1 with FileSystemResourceReference

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;
}
Also used : JSONObject(com.github.openjson.JSONObject) Mp4RecordingResourceReference(org.apache.openmeetings.web.user.record.Mp4RecordingResourceReference) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) RoomResourceReference(org.apache.openmeetings.web.room.RoomResourceReference) PngRecordingResourceReference(org.apache.openmeetings.web.user.record.PngRecordingResourceReference) NullStringer(org.apache.openmeetings.util.NullStringer) RoomPreviewResourceReference(org.apache.openmeetings.web.room.RoomPreviewResourceReference) FileSystemResourceReference(org.apache.wicket.resource.FileSystemResourceReference)

Aggregations

JSONObject (com.github.openjson.JSONObject)1 NullStringer (org.apache.openmeetings.util.NullStringer)1 RoomPreviewResourceReference (org.apache.openmeetings.web.room.RoomPreviewResourceReference)1 RoomResourceReference (org.apache.openmeetings.web.room.RoomResourceReference)1 Mp4RecordingResourceReference (org.apache.openmeetings.web.user.record.Mp4RecordingResourceReference)1 PngRecordingResourceReference (org.apache.openmeetings.web.user.record.PngRecordingResourceReference)1 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)1 FileSystemResourceReference (org.apache.wicket.resource.FileSystemResourceReference)1