red5pro / streaming-android

This repository contains a simple project with a number of Android examples that can be used for testing and reference.
Other
84 stars 35 forks source link

App Crashes when subscribing a stream if it is not published. #171

Open zainkhalid91 opened 4 years ago

zainkhalid91 commented 4 years ago

Hi! So i am facing this issue for about a week now. When i open the subscribe activity App Crashes if a stream is not published yet. How can I resolve this issue. I don't get any logs or a specific error. However if i publish the stream before opening the activity everything works fine.

zainkhalid91 commented 4 years ago

When there is no stream published stream.client java.lang.NullPointerException

my code

configuration = new R5Configuration(R5StreamProtocol.RTSP, UrlManager.R5_CONFIGURATION_URL, 8554, "live", 1.0f);
        configuration.setLicenseKey(UrlManager.R5_LICENCE_KEY);
        stream = new R5Stream(new R5Connection(configuration));
        stream.client = this;
        stream.setListener(this);
        r5ConnectionEvent = R5ConnectionEvent.CONNECTED;
//        stream.audioController = new R5AudioController();
//        stream.audioController.sampleRate = 44100;
        Log.d("Subscriber", ":onConnectionEvent " + r5ConnectionEvent.message);
        videoView.showDebugView(true);
        stream.setLogLevel(R5Stream.LOG_LEVEL_DEBUG);
        videoView.attachStream(stream);
        stream.play("####");