Search in sources :

Example 6 with VideoTranscodingImpl

use of org.olat.modules.video.model.VideoTranscodingImpl in project openolat by klemens.

the class VideoTranscodingDAO method createVideoTranscoding.

/**
 * Factory method to create and persist new video transcoding objects for a
 * given video resource
 *
 * @param videoResource
 * @param resolution
 * @param format
 * @return
 */
VideoTranscoding createVideoTranscoding(OLATResource videoResource, int resolution, String format) {
    VideoTranscodingImpl videoTranscoding = new VideoTranscodingImpl();
    videoTranscoding.setCreationDate(new Date());
    videoTranscoding.setLastModified(videoTranscoding.getCreationDate());
    videoTranscoding.setVideoResource(videoResource);
    videoTranscoding.setResolution(resolution);
    videoTranscoding.setFormat(format);
    videoTranscoding.setStatus(VideoTranscoding.TRANSCODING_STATUS_WAITING);
    dbInstance.getCurrentEntityManager().persist(videoTranscoding);
    return videoTranscoding;
}
Also used : VideoTranscodingImpl(org.olat.modules.video.model.VideoTranscodingImpl) Date(java.util.Date)

Aggregations

Date (java.util.Date)6 VideoTranscodingImpl (org.olat.modules.video.model.VideoTranscodingImpl)6 VideoTranscoding (org.olat.modules.video.VideoTranscoding)4