@@ -41,7 +41,7 @@ public IBinder onBind(Intent intent) {
4141 @ Override
4242 public void onCreate () {
4343 super .onCreate ();
44- Log .e (TAG , "Create" );
44+ Log .d (TAG , "Create" );
4545 sharedPreferences = PreferenceManager .getDefaultSharedPreferences (this );
4646 notificationManager = (NotificationManager ) getSystemService (Context .NOTIFICATION_SERVICE );
4747 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
@@ -53,7 +53,7 @@ public void onCreate() {
5353
5454 @ Override
5555 public int onStartCommand (Intent intent , int flags , int startId ) {
56- Log .e (TAG , "Start" );
56+ Log .d (TAG , "Start" );
5757 endpoint = String .format ("%s/%s" , sharedPreferences .getString ("RtmpUrl" , "" ), sharedPreferences .getString ("RtmpKey" , "" ));
5858 prepareStreaming ();
5959 startStreaming ();
@@ -80,7 +80,6 @@ private void startStreaming() {
8080 0 ,
8181 dpi
8282 )) {
83- Log .i (TAG , String .valueOf (Integer .parseInt (sharedPreferences .getString ("OutputFramerate" , "60" ))));
8483 boolean audioInitialized ;
8584 if (sharedPreferences .getString ("AudioSource" , "0" ).equals ("internal" ) && Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
8685 audioInitialized = rtmpDisplayBase .prepareInternalAudio (64 * 1024 , 32000 , true , false , false );
@@ -145,6 +144,7 @@ public static void init(Context context, ConnectCheckerRtmp connectCheckerRtmp)
145144 dpi = dm .densityDpi ;
146145
147146 if (rtmpDisplayBase == null ) {
147+ sharedPreferences = PreferenceManager .getDefaultSharedPreferences (appContext );
148148 rtmpDisplayBase = new RtmpDisplay (appContext , true , connectChecker );
149149 if (!sharedPreferences .getString ("RtmpUsername" , "" ).isEmpty () && !sharedPreferences .getString ("RtmpPassword" , "" ).isEmpty ()) {
150150 rtmpDisplayBase .setAuthorization (sharedPreferences .getString ("RtmpUsername" , "" ), sharedPreferences .getString ("RtmpPassword" , "" ));
0 commit comments