File file = provider.getVODProviderFile(scope, name);
if (file != null && file.canRead()) {
IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
IStreamableFileService service = factory.getService(file);
if (service != null) {
ITagReader reader = null;
try {
IStreamableFile streamFile = service.getStreamableFile(file);
reader = streamFile.getReader();
duration = (double) reader.getDuration() / 1000;
} catch (IOException e) {
log.error("Error read stream file {}. {}", file.getAbsolutePath(), e);
} finally {
if (reader != null) {
reader.close();
}
}
} else {
log.error("No service found for {}", file.getAbsolutePath());
}