nl.vpro.api.rs.subtitles.EBUReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of subtitles-domain Show documentation
Show all versions of subtitles-domain Show documentation
Subtitles are related to media, but are implemented completely parallel. Classes to contain, parse, and assemble subtitle objects are here.
package nl.vpro.api.rs.subtitles;
import java.io.InputStream;
import java.time.Duration;
import java.util.Iterator;
import javax.ws.rs.Consumes;
import javax.ws.rs.ext.Provider;
import nl.vpro.domain.subtitles.Cue;
import nl.vpro.domain.subtitles.EBU;
/**
* @author Michiel Meeuwissen
* @since 5.4
*/
@Provider
@Consumes(Constants.EBU)
public class EBUReader extends AbstractIteratorReader {
public EBUReader() {
super(Constants.EBU_TYPE);
}
@Override
protected Iterator read(InputStream entityStream) {
return EBU.parse(null, null, (timeLine) -> Duration.ZERO, entityStream).iterator();
}
}