Search in sources :

Example 1 with VideoMetadataImpl

use of org.olat.modules.video.model.VideoMetadataImpl in project OpenOLAT by OpenOLAT.

the class VideoManagerImpl method readVideoMetadataFile.

@Override
public VideoMetadata readVideoMetadataFile(OLATResource videoResource) {
    VFSContainer baseContainer = FileResourceManager.getInstance().getFileResourceRootImpl(videoResource);
    VFSLeaf metaDataFile = (VFSLeaf) baseContainer.resolve(FILENAME_VIDEO_METADATA_XML);
    try {
        return (VideoMetadata) XStreamHelper.readObject(XStreamHelper.createXStreamInstance(), metaDataFile);
    } catch (Exception e) {
        log.error("Error while parsing XStream file for videoResource::" + videoResource, e);
        // return an empty, so at least it displays something and not an error
        VideoMetadata meta = new VideoMetadataImpl();
        meta.setWidth(800);
        meta.setHeight(600);
        return meta;
    }
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) VFSContainer(org.olat.core.util.vfs.VFSContainer) VideoMetadataImpl(org.olat.modules.video.model.VideoMetadataImpl) VideoMetadata(org.olat.modules.video.VideoMetadata) SchedulerException(org.quartz.SchedulerException) IOException(java.io.IOException)

Example 2 with VideoMetadataImpl

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

the class VideoManagerImpl method readVideoMetadataFile.

@Override
public VideoMetadata readVideoMetadataFile(OLATResource videoResource) {
    VFSContainer baseContainer = FileResourceManager.getInstance().getFileResourceRootImpl(videoResource);
    VFSLeaf metaDataFile = (VFSLeaf) baseContainer.resolve(FILENAME_VIDEO_METADATA_XML);
    try {
        return (VideoMetadata) XStreamHelper.readObject(XStreamHelper.createXStreamInstance(), metaDataFile);
    } catch (Exception e) {
        log.error("Error while parsing XStream file for videoResource::" + videoResource, e);
        // return an empty, so at least it displays something and not an error
        VideoMetadata meta = new VideoMetadataImpl();
        meta.setWidth(800);
        meta.setHeight(600);
        return meta;
    }
}
Also used : VFSLeaf(org.olat.core.util.vfs.VFSLeaf) VFSContainer(org.olat.core.util.vfs.VFSContainer) VideoMetadataImpl(org.olat.modules.video.model.VideoMetadataImpl) VideoMetadata(org.olat.modules.video.VideoMetadata) SchedulerException(org.quartz.SchedulerException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)2 VideoMetadata (org.olat.modules.video.VideoMetadata)2 VideoMetadataImpl (org.olat.modules.video.model.VideoMetadataImpl)2 SchedulerException (org.quartz.SchedulerException)2