|
|
|
@ -57,7 +57,7 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
|
|
|
|
|
|
|
|
|
|
private SharedPreferences sp;
|
|
|
|
|
// private String rtmpUrl = "rtmp://192.168.50.250/live/0";
|
|
|
|
|
private String rtmpUrl = "rtmp://61.169.135.146/live/0";
|
|
|
|
|
private String rtmpUrl = "rtmp://127.0.0.1/live/0";
|
|
|
|
|
private String recPath = Environment.getExternalStorageDirectory().getPath() + "/test.mp4";
|
|
|
|
|
|
|
|
|
|
private SrsPublisher mPublisher;
|
|
|
|
@ -197,10 +197,11 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
|
|
|
|
|
SharedPreferences.Editor editor = sp.edit();
|
|
|
|
|
editor.putString("rtmpUrl", rtmpUrl);
|
|
|
|
|
editor.apply();
|
|
|
|
|
efu.setText(rtmpUrl + " cameraid=" + cameraId + " auto=" + autoStart);
|
|
|
|
|
// efu.setText(rtmpUrl + " cameraid=" + cameraId + " auto=" + autoStart);
|
|
|
|
|
efu.setText(rtmpUrl);
|
|
|
|
|
mPublisher.startPublish(rtmpUrl);
|
|
|
|
|
if (btnSwitchEncoder.getText().toString().contentEquals("soft encoder")) {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "Use hard encoder", Toast.LENGTH_SHORT).show();
|
|
|
|
|
// Toast.makeText(getApplicationContext(), "Use hard encoder", Toast.LENGTH_SHORT).show();
|
|
|
|
|
} else {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "Use soft encoder", Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
@ -585,17 +586,17 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onRecordPause() {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "Record paused", Toast.LENGTH_SHORT).show();
|
|
|
|
|
// Toast.makeText(getApplicationContext(), "Record paused", Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onRecordResume() {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "Record resumed", Toast.LENGTH_SHORT).show();
|
|
|
|
|
// Toast.makeText(getApplicationContext(), "Record resumed", Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onRecordStarted(String msg) {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "Recording file: " + msg, Toast.LENGTH_SHORT).show();
|
|
|
|
|
// Toast.makeText(getApplicationContext(), "Recording file: " + msg, Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|