Skip to content

Commit 0357c33

Browse files
committed
Handle RTMP basic auth
1 parent 2692be0 commit 0357c33

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/src/main/java/com/fpvout/digiview/MainActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ public void onNewBitrateRtmp(long bitrate) {
110110
@Override
111111
public void onDisconnectRtmp() {
112112
updateLiveButtonIcon();
113+
runOnUiThread(() -> {
114+
bitrateTextview.setText("");
115+
});
113116
}
114117

115118
@Override

app/src/main/java/com/fpvout/digiview/StreamingService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)