mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-12-03 11:30:49 +00:00
Enable tunneling in VideoManager
This commit is contained in:
parent
1f0345f16f
commit
e646192196
@ -34,6 +34,7 @@ import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.exoplayer.DefaultRenderersFactory;
|
||||
import androidx.media3.exoplayer.ExoPlayer;
|
||||
import androidx.media3.exoplayer.source.DefaultMediaSourceFactory;
|
||||
import androidx.media3.exoplayer.trackselection.DefaultTrackSelector;
|
||||
import androidx.media3.extractor.DefaultExtractorsFactory;
|
||||
import androidx.media3.extractor.ts.TsExtractor;
|
||||
import androidx.media3.ui.AspectRatioFrameLayout;
|
||||
@ -205,6 +206,17 @@ public class VideoManager implements IVLCVout.OnNewVideoLayoutListener {
|
||||
defaultRendererFactory.setExtensionRendererMode(DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON);
|
||||
exoPlayerBuilder.setRenderersFactory(defaultRendererFactory);
|
||||
|
||||
DefaultTrackSelector trackSelector = new DefaultTrackSelector(context);
|
||||
trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||
.setTunnelingEnabled(true)
|
||||
.setAudioOffloadPreferences(new TrackSelectionParameters.AudioOffloadPreferences.Builder()
|
||||
.setAudioOffloadMode(TrackSelectionParameters.AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_ENABLED)
|
||||
.build()
|
||||
)
|
||||
.build()
|
||||
);
|
||||
exoPlayerBuilder.setTrackSelector(trackSelector);
|
||||
|
||||
DefaultExtractorsFactory defaultExtractorsFactory = new DefaultExtractorsFactory().setTsExtractorTimestampSearchBytes(TsExtractor.DEFAULT_TIMESTAMP_SEARCH_BYTES * 3);
|
||||
exoPlayerBuilder.setMediaSourceFactory(new DefaultMediaSourceFactory(context, defaultExtractorsFactory));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user