D
D
DARKENN2020-06-06 22:22:18
Java
DARKENN, 2020-06-06 22:22:18

How to solve net.butterflytv.rtmp_client error?

Mistake

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:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

The code
BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
                TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
                TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
                SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(getContext(), trackSelector);
                PlayerView playerView = inflate.findViewById(R.id.simple_player);
                playerView.setPlayer(player);
                RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory();
                MediaSource videoSource = new ExtractorMediaSource.Factory(rtmpDataSourceFactory).createMediaSource(Uri.parse("rtmp://******* live=1"));
                player.prepare(videoSource);
                player.setPlayWhenReady(true);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question