-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Description
Hi, I've recently implemented the RTMP exo player extension, and the stream is correct, but randomly after a certain amount of time the screen freezes, with no exception being thrown. After adding some logs, I can see the the player listener onPlayerStateChanged is triggered with state ENDED. I'm appending a section of my code
This is how I initialize the player:
`
public void onResponse(Call call, Response response) throws IOException {
RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory();
MediaSource mediaSource = new ExtractorMediaSource.Factory(rtmpDataSourceFactory)
.createMediaSource(Utils.streamURLGenerator(
response.body().string(),
findChannel(PreferenceUtils.getStringPreferences("CHANNEL", "")).getId()));
player.prepare(mediaSource, true, true);
player.setPlayWhenReady(true);
}
`
This is how the URL is being created:
`
public static Uri streamURLGenerator(String loadBalancerUrl, String channel)
{
return Uri.parse("http://"+loadBalancerUrl+":1935/live/"+channel+" live=1");
}
`
Why is it going to state ENDED? Is there a workaround to recover or avoid this state?
I'll be appending in an email the stream url.
Reactions are currently unavailable