com.google.android.exoplayer2.RenderersFactory Java Examples
The following examples show how to use
com.google.android.exoplayer2.RenderersFactory.
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: DownloadHelper.java From MediaSDK with Apache License 2.0 | 6 votes |
/** * Creates a {@link DownloadHelper} for DASH streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for DASH streams. * @throws IllegalStateException If the DASH module is missing. */ public static DownloadHelper forDash( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_DASH, uri, /* cacheKey= */ null, createMediaSourceInternal( DASH_FACTORY_CONSTRUCTOR, uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #2
Source File: Util.java From Telegram with GNU General Public License v2.0 | 6 votes |
/** * Extract renderer capabilities for the renderers created by the provided renderers factory. * * @param renderersFactory A {@link RenderersFactory}. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers. * @return The {@link RendererCapabilities} for each renderer created by the {@code * renderersFactory}. */ public static RendererCapabilities[] getRendererCapabilities( RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) { Renderer[] renderers = renderersFactory.createRenderers( new Handler(), new VideoRendererEventListener() {}, new AudioRendererEventListener() {}, (cues) -> {}, (metadata) -> {}, drmSessionManager); RendererCapabilities[] capabilities = new RendererCapabilities[renderers.length]; for (int i = 0; i < renderers.length; i++) { capabilities[i] = renderers[i].getCapabilities(); } return capabilities; }
Example #3
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 6 votes |
/** * Creates a {@link DownloadHelper} for HLS streams. * * @param uri A playlist {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for HLS streams. * @throws IllegalStateException If the HLS module is missing. */ public static DownloadHelper forHls( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_HLS, uri, /* cacheKey= */ null, createMediaSourceInternal( HLS_FACTORY_CONSTRUCTOR, uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #4
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 6 votes |
/** * Creates a {@link DownloadHelper} for SmoothStreaming streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for SmoothStreaming streams. * @throws IllegalStateException If the SmoothStreaming module is missing. */ public static DownloadHelper forSmoothStreaming( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_SS, uri, /* cacheKey= */ null, createMediaSourceInternal( SS_FACTORY_CONSTRUCTOR, uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #5
Source File: Util.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
/** * Extract renderer capabilities for the renderers created by the provided renderers factory. * * @param renderersFactory A {@link RenderersFactory}. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers. * @return The {@link RendererCapabilities} for each renderer created by the {@code * renderersFactory}. */ public static RendererCapabilities[] getRendererCapabilities( RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) { Renderer[] renderers = renderersFactory.createRenderers( new Handler(), new VideoRendererEventListener() {}, new AudioRendererEventListener() {}, (cues) -> {}, (metadata) -> {}, drmSessionManager); RendererCapabilities[] capabilities = new RendererCapabilities[renderers.length]; for (int i = 0; i < renderers.length; i++) { capabilities[i] = renderers[i].getCapabilities(); } return capabilities; }
Example #6
Source File: Util.java From MediaSDK with Apache License 2.0 | 6 votes |
/** * Extract renderer capabilities for the renderers created by the provided renderers factory. * * @param renderersFactory A {@link RenderersFactory}. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers. * @return The {@link RendererCapabilities} for each renderer created by the {@code * renderersFactory}. */ public static RendererCapabilities[] getRendererCapabilities( RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) { Renderer[] renderers = renderersFactory.createRenderers( new Handler(), new VideoRendererEventListener() {}, new AudioRendererEventListener() {}, (cues) -> {}, (metadata) -> {}, drmSessionManager); RendererCapabilities[] capabilities = new RendererCapabilities[renderers.length]; for (int i = 0; i < renderers.length; i++) { capabilities[i] = renderers[i].getCapabilities(); } return capabilities; }
Example #7
Source File: ExoMediaPlayer.java From PlayerBase with Apache License 2.0 | 5 votes |
public ExoMediaPlayer(){ mAppContext = AppContextAttach.getApplicationContext(); RenderersFactory renderersFactory = new DefaultRenderersFactory(mAppContext); DefaultTrackSelector trackSelector = new DefaultTrackSelector(mAppContext); mInternalPlayer = new SimpleExoPlayer.Builder(mAppContext, renderersFactory) .setTrackSelector(trackSelector).build(); // Measures bandwidth during playback. Can be null if not required. mBandwidthMeter = new DefaultBandwidthMeter.Builder(mAppContext).build(); mInternalPlayer.addListener(mEventListener); }
Example #8
Source File: DownloadHelper.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for SmoothStreaming streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for SmoothStreaming streams. * @throws IllegalStateException If the SmoothStreaming module is missing. */ public static DownloadHelper forSmoothStreaming( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_SS, uri, /* cacheKey= */ null, SS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #9
Source File: DownloadHelper.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for HLS streams. * * @param uri A playlist {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for HLS streams. * @throws IllegalStateException If the HLS module is missing. */ public static DownloadHelper forHls( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_HLS, uri, /* cacheKey= */ null, HLS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #10
Source File: DownloadHelper.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for DASH streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for DASH streams. * @throws IllegalStateException If the DASH module is missing. */ public static DownloadHelper forDash( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_DASH, uri, /* cacheKey= */ null, DASH_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #11
Source File: DownloadHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for SmoothStreaming streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for SmoothStreaming streams. * @throws IllegalStateException If the SmoothStreaming module is missing. */ public static DownloadHelper forSmoothStreaming( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_SS, uri, /* cacheKey= */ null, SS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #12
Source File: DownloadHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for HLS streams. * * @param uri A playlist {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for HLS streams. * @throws IllegalStateException If the HLS module is missing. */ public static DownloadHelper forHls( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_HLS, uri, /* cacheKey= */ null, HLS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #13
Source File: DownloadHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for DASH streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by * {@code renderersFactory}. * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for * downloading. * @return A {@link DownloadHelper} for DASH streams. * @throws IllegalStateException If the DASH module is missing. */ public static DownloadHelper forDash( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, DefaultTrackSelector.Parameters trackSelectorParameters) { return new DownloadHelper( DownloadRequest.TYPE_DASH, uri, /* cacheKey= */ null, DASH_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null), trackSelectorParameters, Util.getRendererCapabilities(renderersFactory, drmSessionManager)); }
Example #14
Source File: ExoPlayerCreator.java From no-player with Apache License 2.0 | 5 votes |
@NonNull public SimpleExoPlayer create(DrmSessionCreator drmSessionCreator, DefaultDrmSessionEventListener drmSessionEventListener, MediaCodecSelector mediaCodecSelector, TrackSelector trackSelector) { DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = drmSessionCreator.create(drmSessionEventListener); SubtitleDecoderFactory subtitleDecoderFactory = new NoPlayerSubtitleDecoderFactory(); RenderersFactory renderersFactory = new SimpleRenderersFactory( context, EXTENSION_RENDERER_MODE_OFF, DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS, mediaCodecSelector, subtitleDecoderFactory ); DefaultLoadControl loadControl = new DefaultLoadControl(); return ExoPlayerFactory.newSimpleInstance(context, renderersFactory, trackSelector, loadControl, drmSessionManager); }
Example #15
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for SmoothStreaming streams. * * @param context Any {@link Context}. * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @return A {@link DownloadHelper} for SmoothStreaming streams. * @throws IllegalStateException If the SmoothStreaming module is missing. */ public static DownloadHelper forSmoothStreaming( Context context, Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forSmoothStreaming( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, getDefaultTrackSelectorParameters(context)); }
Example #16
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** @deprecated Use {@link #forDash(Context, Uri, Factory, RenderersFactory)} */ @Deprecated public static DownloadHelper forDash( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forDash( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT); }
Example #17
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for DASH streams. * * @param context Any {@link Context}. * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @return A {@link DownloadHelper} for DASH streams. * @throws IllegalStateException If the DASH module is missing. */ public static DownloadHelper forDash( Context context, Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forDash( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, getDefaultTrackSelectorParameters(context)); }
Example #18
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** @deprecated Use {@link #forHls(Context, Uri, Factory, RenderersFactory)} */ @Deprecated public static DownloadHelper forHls( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forHls( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT); }
Example #19
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Creates a {@link DownloadHelper} for HLS streams. * * @param context Any {@link Context}. * @param uri A playlist {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @return A {@link DownloadHelper} for HLS streams. * @throws IllegalStateException If the HLS module is missing. */ public static DownloadHelper forHls( Context context, Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forHls( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, getDefaultTrackSelectorParameters(context)); }
Example #20
Source File: DownloadHelper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** @deprecated Use {@link #forSmoothStreaming(Context, Uri, Factory, RenderersFactory)} */ @Deprecated public static DownloadHelper forSmoothStreaming( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forSmoothStreaming( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORT); }
Example #21
Source File: ExoMediaPlayer.java From VideoDemoJava with MIT License | 5 votes |
public ExoMediaPlayer(){ mAppContext = AppContextAttach.getApplicationContext(); RenderersFactory renderersFactory = new DefaultRenderersFactory(mAppContext); DefaultTrackSelector trackSelector = new DefaultTrackSelector(); mInternalPlayer = ExoPlayerFactory.newSimpleInstance(renderersFactory, trackSelector); // Measures bandwidth during playback. Can be null if not required. mBandwidthMeter = new DefaultBandwidthMeter(); mInternalPlayer.addListener(mEventListener); }
Example #22
Source File: VideoPlayer.java From bcm-android with GNU General Public License v3.0 | 5 votes |
public VideoPlayer(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); inflate(context, R.layout.video_player_layout, this); BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter); TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory); LoadControl loadControl = new DefaultLoadControl(); RenderersFactory renderersFactory = new DefaultRenderersFactory(getContext()); this.exoView = findViewById(R.id.video_view); this.exoPlayer = ExoPlayerFactory.newSimpleInstance(renderersFactory, trackSelector, loadControl); this.exoPlayer.addListener(new ExoPlayerListener()); if (exoView != null) { exoView.setPlayer(exoPlayer); } this.audioView = findViewById(R.id.audio_btn); this.audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); // VolumeChangeObserver.INSTANCE.registerReceiver(); // VolumeChangeObserver.INSTANCE.addCallback(observerCallback); audioVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); exoPlayer.setVolume(audioVolume); if (audioVolume == 0) { audioView.setImageResource(R.drawable.common_video_player_mute_icon); isMuted = true; } }
Example #23
Source File: DefaultPlayer.java From ARVI with Apache License 2.0 | 5 votes |
public DefaultPlayer(@NonNull Context context, @NonNull RenderersFactory renderersFactory, @NonNull TrackSelector trackSelector, @NonNull LoadControl loadControl, @Nullable BandwidthMeter bandwidthMeter) { this( context, renderersFactory, trackSelector, loadControl, bandwidthMeter, null ); }
Example #24
Source File: DefaultPlayer.java From ARVI with Apache License 2.0 | 5 votes |
public DefaultPlayer(@NonNull Context context, @NonNull RenderersFactory renderersFactory, @NonNull TrackSelector trackSelector, @NonNull LoadControl loadControl, @Nullable BandwidthMeter bandwidthMeter, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) { this.context = checkNonNull(context).getApplicationContext(); this.eventHandler = new PlayerEventListenerRegistry(); this.renderersFactory = checkNonNull(renderersFactory); this.trackSelector = checkNonNull(trackSelector); this.loadControl = checkNonNull(loadControl); this.bandwidthMeter = bandwidthMeter; this.drmSessionManager = drmSessionManager; }
Example #25
Source File: DefaultPlayer.java From ARVI with Apache License 2.0 | 4 votes |
public DefaultPlayer(@NonNull Context context, @NonNull RenderersFactory renderersFactory, @NonNull TrackSelector trackSelector, @NonNull LoadControl loadControl) { this( context, renderersFactory, trackSelector, loadControl, null ); }
Example #26
Source File: QueuedExoPlayer.java From Jockey with Apache License 2.0 | 4 votes |
public QueuedExoPlayer(Context context) { mContext = context; mState = ExoPlayerState.IDLE; mQueue = Collections.emptyList(); mSourceFactory = new DefaultDataSourceFactory(mContext, USER_AGENT); mExtractorsFactory = new DefaultExtractorsFactory(); RenderersFactory renderersFactory = new DefaultRenderersFactory(mContext); TrackSelector trackSelector = new DefaultTrackSelector(new FixedTrackSelection.Factory()); LoadControl loadControl = new DefaultLoadControl(); SimpleExoPlayer baseInstance = ExoPlayerFactory.newSimpleInstance( renderersFactory, trackSelector, loadControl); mExoPlayer = new EqualizedExoPlayer(context, baseInstance); mExoPlayer.addListener(new Player.EventListener() { @Override public void onLoadingChanged(boolean isLoading) { Timber.i("onLoadingChanged (%b)", isLoading); } @Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { Timber.i("onPlayerStateChanged"); QueuedExoPlayer.this.onPlayerStateChanged(playbackState); } @Override public void onRepeatModeChanged(int repeatMode) { Timber.i("onRepeatModeChanged (%d)", repeatMode); } @Override public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) { Timber.i("onShuffleModeEnabledChanged (%b)", shuffleModeEnabled); } @Override public void onTimelineChanged(Timeline timeline, Object manifest) { Timber.i("onTimelineChanged"); dispatchDurationUpdateIfNeeded(); } @Override public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) { Timber.i("onTracksChanged"); } @Override public void onPlayerError(ExoPlaybackException error) { Timber.i("onPlayerError"); QueuedExoPlayer.this.onPlayerError(error); } @Override public void onPositionDiscontinuity(int reason) { Timber.i("onPositionDiscontinuity"); QueuedExoPlayer.this.onPositionDiscontinuity(reason); } @Override public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) { Timber.i("onPlaybackParametersChanged"); } @Override public void onSeekProcessed() { Timber.i("okSeekProcessed"); } }); }
Example #27
Source File: ExoVideoView.java From DKVideoPlayer with Apache License 2.0 | 4 votes |
public void setRenderersFactory(RenderersFactory renderersFactory) { mRenderersFactory = renderersFactory; }
Example #28
Source File: ExoMediaPlayer.java From DKVideoPlayer with Apache License 2.0 | 4 votes |
public void setRenderersFactory(RenderersFactory renderersFactory) { mRenderersFactory = renderersFactory; }
Example #29
Source File: DownloadHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 3 votes |
/** * Creates a {@link DownloadHelper} for DASH streams. * * @param uri A manifest {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @return A {@link DownloadHelper} for DASH streams. * @throws IllegalStateException If the DASH module is missing. */ public static DownloadHelper forDash( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forDash( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, DEFAULT_TRACK_SELECTOR_PARAMETERS); }
Example #30
Source File: DownloadHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 3 votes |
/** * Creates a {@link DownloadHelper} for HLS streams. * * @param uri A playlist {@link Uri}. * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist. * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are * selected. * @return A {@link DownloadHelper} for HLS streams. * @throws IllegalStateException If the HLS module is missing. */ public static DownloadHelper forHls( Uri uri, DataSource.Factory dataSourceFactory, RenderersFactory renderersFactory) { return forHls( uri, dataSourceFactory, renderersFactory, /* drmSessionManager= */ null, DEFAULT_TRACK_SELECTOR_PARAMETERS); }