com.google.android.exoplayer2.text.TextRenderer Java Examples

The following examples show how to use com.google.android.exoplayer2.text.TextRenderer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TextRendererOutput.java    From no-player with Apache License 2.0 5 votes vote down vote up
TextRenderer.Output output() {
    return new TextRenderer.Output() {
        @Override
        public void onCues(List<Cue> cues) {
            TextCues textCues = ExoPlayerCueMapper.map(cues);
            playerView.setSubtitleCue(textCues);
        }
    };
}
 
Example #2
Source File: RendererProvider.java    From ExoMedia with Apache License 2.0 5 votes vote down vote up
@NonNull
protected List<Renderer> buildCaptionRenderers() {
    List<Renderer> renderers = new ArrayList<>();

    renderers.add(new TextRenderer(captionListener, handler.getLooper()));

    return renderers;
}
 
Example #3
Source File: DefaultRenderersFactory.java    From MediaSDK with Apache License 2.0 3 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildTextRenderers(
    Context context,
    TextOutput output,
    Looper outputLooper,
    @ExtensionRendererMode int extensionRendererMode,
    ArrayList<Renderer> out) {
  out.add(new TextRenderer(output, outputLooper));
}
 
Example #4
Source File: DefaultRenderersFactory.java    From Telegram-FOSS with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildTextRenderers(
    Context context,
    TextOutput output,
    Looper outputLooper,
    @ExtensionRendererMode int extensionRendererMode,
    ArrayList<Renderer> out) {
  out.add(new TextRenderer(output, outputLooper));
}
 
Example #5
Source File: DefaultRenderersFactory.java    From Telegram with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildTextRenderers(
    Context context,
    TextOutput output,
    Looper outputLooper,
    @ExtensionRendererMode int extensionRendererMode,
    ArrayList<Renderer> out) {
  out.add(new TextRenderer(output, outputLooper));
}
 
Example #6
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be
 *     called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildTextRenderers(Context context, TextOutput output, Looper outputLooper,
    @ExtensionRendererMode int extensionRendererMode,
    ArrayList<Renderer> out) {
  out.add(new TextRenderer(output, outputLooper));
}
 
Example #7
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param output An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be
 *     called.
 * @param extensionRendererMode The extension renderer mode.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildTextRenderers(Context context, TextOutput output, Looper outputLooper,
    @ExtensionRendererMode int extensionRendererMode,
    ArrayList<Renderer> out) {
  out.add(new TextRenderer(output, outputLooper));
}
 
Example #8
Source File: SimpleRenderersFactory.java    From no-player with Apache License 2.0 2 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *  @param output       An output for the renderers.
 * @param outputLooper The looper associated with the thread on which the output should be
 *                     called.
 * @param outRenderers An array to which the built renderers should be appended.
 * @param decoderFactory A factory from which to obtain {@link SubtitleDecoder} instances.
 */
private void buildTextRenderers(TextOutput output, Looper outputLooper, List<Renderer> outRenderers, SubtitleDecoderFactory decoderFactory) {
    outRenderers.add(new TextRenderer(output, outputLooper, decoderFactory));
}
 
Example #9
Source File: SimpleExoPlayer.java    From K-Sonic with MIT License 2 votes vote down vote up
/**
 * Sets an output to receive text events.
 *
 * @param output The output.
 */
public void setTextOutput(TextRenderer.Output output) {
  textOutput = output;
}
 
Example #10
Source File: SimpleExoPlayer.java    From K-Sonic with MIT License 2 votes vote down vote up
/**
 * Builds text renderers for use by the player.
 *
 * @param context The {@link Context} associated with the player.
 * @param mainHandler A handler associated with the main thread's looper.
 * @param extensionRendererMode The extension renderer mode.
 * @param output An output for the renderers.
 * @param out An array to which the built renderers should be appended.
 */
protected void buildTextRenderers(Context context, Handler mainHandler,
    @ExtensionRendererMode int extensionRendererMode, TextRenderer.Output output,
    ArrayList<Renderer> out) {
  out.add(new TextRenderer(output, mainHandler.getLooper()));
}