FileDocCategorySizeDatePackage
SRTRenderer.javaAPI DocAndroid 5.1 API6656Thu Mar 12 22:22:30 GMT 2015android.media

SRTRenderer

public class SRTRenderer extends android.media.SubtitleController.Renderer
hide

Fields Summary
private final android.content.Context
mContext
private final boolean
mRender
private final android.os.Handler
mEventHandler
private WebVttRenderingWidget
mRenderingWidget
Constructors Summary
public SRTRenderer(android.content.Context context)

        this(context, null);
    
SRTRenderer(android.content.Context mContext, android.os.Handler mEventHandler)

        this.mContext = mContext;
        this.mRender = (mEventHandler == null);
        this.mEventHandler = mEventHandler;
    
Methods Summary
public SubtitleTrackcreateTrack(MediaFormat format)

        if (mRender && mRenderingWidget == null) {
            mRenderingWidget = new WebVttRenderingWidget(mContext);
        }

        if (mRender) {
            return new SRTTrack(mRenderingWidget, format);
        } else {
            return new SRTTrack(mEventHandler, format);
        }
    
public booleansupports(MediaFormat format)

        if (format.containsKey(MediaFormat.KEY_MIME)) {
            if (!format.getString(MediaFormat.KEY_MIME)
                    .equals(MediaPlayer.MEDIA_MIMETYPE_TEXT_SUBRIP)) {
                return false;
            };
            return mRender == (format.getInteger(MediaFormat.KEY_IS_TIMED_TEXT, 0) == 0);
        }
        return false;