DARKENN
@DARKENN

Как решить ошибку ExoPlayer?

Ошибка:
E/ExoPlayerImplInternal: Source error.
    net.butterflytv.rtmp_client.RtmpClient$RtmpIOException: RTMP error: -3
        at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:222)
        at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:60)
        at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
        at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:961)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)


Манифест:
implementation 'net.butterflytv.utils:rtmp-client:3.1.0'
    implementation 'com.google.android.exoplayer:exoplayer:2.11.0'
    implementation 'com.google.android.exoplayer:extension-rtmp:2.9.6'

Код:
//initiate Player
//Create a default TrackSelector
        BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
        TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
        TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);

//Create the player
        SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(getContext(), trackSelector);
        PlayerView playerView = inflate.findViewById(R.id.simple_player);
        playerView.setPlayer(player);

        RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory();
// This is the MediaSource representing the media to be played.
        MediaSource videoSource = new ExtractorMediaSource.Factory(rtmpDataSourceFactory)
                .createMediaSource(Uri.parse("rtmp://************"));

// Prepare the player with the source.
        player.prepare(videoSource);
//auto start playing
        player.setPlayWhenReady(true);
        return inflate;
  • Вопрос задан
  • 253 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы