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

The following examples show how to use com.google.android.exoplayer2.text.TextOutput. 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: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
      eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
  buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
      eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[renderersList.size()]);
}
 
Example #2
Source File: SimpleRenderersFactory.java    From no-player with Apache License 2.0 6 votes vote down vote up
@Override
public Renderer[] createRenderers(Handler eventHandler,
                                  VideoRendererEventListener videoRendererEventListener,
                                  AudioRendererEventListener audioRendererEventListener,
                                  TextOutput textRendererOutput,
                                  MetadataOutput metadataRendererOutput,
                                  @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
    ArrayList<Renderer> renderersList = new ArrayList<>();
    buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
            eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
    buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
            eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
    buildTextRenderers(textRendererOutput, eventHandler.getLooper(), renderersList, subtitleDecoderFactory);
    buildMetadataRenderers(metadataRendererOutput, eventHandler.getLooper(),
            renderersList);
    buildMiscellaneousRenderers();
    return renderersList.toArray(new Renderer[renderersList.size()]);
}
 
Example #3
Source File: DefaultRenderersFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
      eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
  buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
      eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[renderersList.size()]);
}
 
Example #4
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onCues(List<Cue> cues) {
  currentCues = cues;
  for (TextOutput textOutput : textOutputs) {
    textOutput.onCues(cues);
  }
}
 
Example #5
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addTextOutput(TextOutput listener) {
  if (!currentCues.isEmpty()) {
    listener.onCues(currentCues);
  }
  textOutputs.add(listener);
}
 
Example #6
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Override
public void addTextOutput(TextOutput listener) {
  if (!currentCues.isEmpty()) {
    listener.onCues(currentCues);
  }
  textOutputs.add(listener);
}
 
Example #7
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive text events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addTextOutput(TextOutput)}.
 */
@Deprecated
public void setTextOutput(TextOutput output) {
  textOutputs.clear();
  if (output != null) {
    addTextOutput(output);
  }
}
 
Example #8
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Sets an output to receive text events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addTextOutput(TextOutput)}.
 */
@Deprecated
public void setTextOutput(TextOutput output) {
  textOutputs.clear();
  if (output != null) {
    addTextOutput(output);
  }
}
 
Example #9
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onCues(List<Cue> cues) {
  currentCues = cues;
  for (TextOutput textOutput : textOutputs) {
    textOutput.onCues(cues);
  }
}
 
Example #10
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Override
public void onCues(List<Cue> cues) {
  currentCues = cues;
  for (TextOutput textOutput : textOutputs) {
    textOutput.onCues(cues);
  }
}
 
Example #11
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive text events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addTextOutput(TextOutput)}.
 */
@Deprecated
public void setTextOutput(TextOutput output) {
  textOutputs.clear();
  if (output != null) {
    addTextOutput(output);
  }
}
 
Example #12
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addTextOutput(TextOutput listener) {
  if (!currentCues.isEmpty()) {
    listener.onCues(currentCues);
  }
  textOutputs.add(listener);
}
 
Example #13
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addTextOutput(TextOutput listener) {
  if (!currentCues.isEmpty()) {
    listener.onCues(currentCues);
  }
  textOutputs.add(listener);
}
 
Example #14
Source File: RendererProvider.java    From ExoMedia with Apache License 2.0 5 votes vote down vote up
public RendererProvider(@NonNull Context context, @NonNull Handler handler, @NonNull TextOutput captionListener, @NonNull MetadataOutput metadataListener,
                        @NonNull AudioRendererEventListener audioRendererEventListener, @NonNull VideoRendererEventListener videoRendererEventListener) {
    this.context = context;
    this.handler = handler;
    this.captionListener = captionListener;
    this.metadataListener = metadataListener;
    this.audioRendererEventListener = audioRendererEventListener;
    this.videoRendererEventListener = videoRendererEventListener;
}
 
Example #15
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive text events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addTextOutput(TextOutput)}.
 */
@Deprecated
public void setTextOutput(TextOutput output) {
  textOutputs.clear();
  if (output != null) {
    addTextOutput(output);
  }
}
 
Example #16
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onCues(List<Cue> cues) {
  currentCues = cues;
  for (TextOutput textOutput : textOutputs) {
    textOutput.onCues(cues);
  }
}
 
Example #17
Source File: GSYExoSubTitleVideoManager.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
public void prepare(String url, String subTitle, TextOutput textOutput, Map<String, String> mapHeadData, boolean loop, float speed, boolean cache, File cachePath, String overrideExtension) {
    Message msg = new Message();
    msg.what = HANDLER_PREPARE;
    msg.obj = new GSYExoSubTitleModel(url, subTitle, textOutput, mapHeadData, loop, speed, cache, cachePath, overrideExtension);
    sendMessage(msg);
    if (needTimeOutOther) {
        startTimeOutBuffer();
    }
}
 
Example #18
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addTextOutput(TextOutput listener) {
  if (!currentCues.isEmpty()) {
    listener.onCues(currentCues);
  }
  textOutputs.add(listener);
}
 
Example #19
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets an output to receive text events, removing all existing outputs.
 *
 * @param output The output.
 * @deprecated Use {@link #addTextOutput(TextOutput)}.
 */
@Deprecated
public void setTextOutput(TextOutput output) {
  textOutputs.clear();
  if (output != null) {
    addTextOutput(output);
  }
}
 
Example #20
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onCues(List<Cue> cues) {
  currentCues = cues;
  for (TextOutput textOutput : textOutputs) {
    textOutput.onCues(cues);
  }
}
 
Example #21
Source File: GSYExoSubTitlePlayer.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public TextOutput getTextOutput() {
    return mTextOutput;
}
 
Example #22
Source File: DefaultRenderersFactory.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      eventHandler,
      videoRendererEventListener,
      allowedVideoJoiningTimeMs,
      renderersList);
  buildAudioRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      buildAudioProcessors(),
      eventHandler,
      audioRendererEventListener,
      renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildCameraMotionRenderers(context, extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[0]);
}
 
Example #23
Source File: DefaultRenderersFactory.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  if (drmSessionManager == null) {
    drmSessionManager = this.drmSessionManager;
  }
  ArrayList<Renderer> renderersList = new ArrayList<>();
  buildVideoRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      eventHandler,
      videoRendererEventListener,
      allowedVideoJoiningTimeMs,
      renderersList);
  buildAudioRenderers(
      context,
      extensionRendererMode,
      mediaCodecSelector,
      drmSessionManager,
      playClearSamplesWithoutKeys,
      enableDecoderFallback,
      buildAudioProcessors(),
      eventHandler,
      audioRendererEventListener,
      renderersList);
  buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
      extensionRendererMode, renderersList);
  buildCameraMotionRenderers(context, extensionRendererMode, renderersList);
  buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
  return renderersList.toArray(new Renderer[0]);
}
 
Example #24
Source File: GSYExoSubTitlePlayer.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public void removeTextOutput(TextOutput textOutput) {
    if(mInternalPlayer != null) {
        mInternalPlayer.removeTextOutput(textOutput);
    }
}
 
Example #25
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void removeTextOutput(TextOutput listener) {
  textOutputs.remove(listener);
}
 
Example #26
Source File: GSYExoSubTitleModel.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public void setTextOutput(TextOutput textOutput) {
    this.textOutput = textOutput;
}
 
Example #27
Source File: GSYExoSubTitleModel.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public TextOutput getTextOutput() {
    return textOutput;
}
 
Example #28
Source File: GSYExoSubTitlePlayerManager.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public void removeTextOutput(TextOutput textOutput) {
    if(mediaPlayer != null) {
        mediaPlayer.removeTextOutput(textOutput);
    }
}
 
Example #29
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void removeTextOutput(TextOutput listener) {
  textOutputs.remove(listener);
}
 
Example #30
Source File: GSYExoSubTitleModel.java    From GSYVideoPlayer with Apache License 2.0 4 votes vote down vote up
public GSYExoSubTitleModel(String url, String subTitle, TextOutput textOutput, Map<String, String> mapHeadData, boolean loop, float speed, boolean cache, File cachePath, String overrideExtension) {
    super(url, mapHeadData, loop, speed, cache, cachePath, overrideExtension);
    this.subTitle = subTitle;
    this.textOutput = textOutput;
}