All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.api.rs.subtitles.SRTReader Maven / Gradle / Ivy

Go to download

Subtitles are related to media, but are implemented completely parallel. Classes to contain, parse, and assemble subtitle objects are here.

There is a newer version: 8.3.0
Show newest version
package nl.vpro.api.rs.subtitles;

import java.io.InputStream;
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.WEBVTTandSRT;

/**
 * @author Michiel Meeuwissen
 * @since 4.8
 */
@Provider
@Consumes(Constants.SRT)
public class SRTReader extends AbstractIteratorReader {


    public SRTReader() {
        super(Constants.SRT_TYPE);
    }

    @Override
    protected Iterator read(InputStream entityStream) {
        return WEBVTTandSRT.parseSRT(null, entityStream).iterator();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy