|
|
|
@ -195,28 +195,28 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
|
|
|
|
|
if (autoStart != 0) {
|
|
|
|
|
|
|
|
|
|
startRTMPServer();
|
|
|
|
|
mHandler.postDelayed(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
// rtmpUrl = "rtmp://61.169.135.146/live/0";
|
|
|
|
|
SharedPreferences.Editor editor = sp.edit();
|
|
|
|
|
editor.putString("rtmpUrl", rtmpUrl);
|
|
|
|
|
editor.apply();
|
|
|
|
|
efu.setText(rtmpUrl + "rotation= " + rotation + " 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();
|
|
|
|
|
} else {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "Use soft encoder", Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
btnPublish.setText("stop");
|
|
|
|
|
btnSwitchEncoder.setEnabled(false);
|
|
|
|
|
btnPause.setEnabled(true);
|
|
|
|
|
mPublisher.switchCameraFace(cameraId, rotation);
|
|
|
|
|
}
|
|
|
|
|
}, 500);
|
|
|
|
|
// mHandler.postDelayed(new Runnable() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void run() {
|
|
|
|
|
//// rtmpUrl = "rtmp://61.169.135.146/live/0";
|
|
|
|
|
// SharedPreferences.Editor editor = sp.edit();
|
|
|
|
|
// editor.putString("rtmpUrl", rtmpUrl);
|
|
|
|
|
// editor.apply();
|
|
|
|
|
// efu.setText(rtmpUrl + "rotation= " + rotation + " 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();
|
|
|
|
|
// } else {
|
|
|
|
|
// Toast.makeText(getApplicationContext(), "Use soft encoder", Toast.LENGTH_SHORT).show();
|
|
|
|
|
// }
|
|
|
|
|
// btnPublish.setText("stop");
|
|
|
|
|
// btnSwitchEncoder.setEnabled(false);
|
|
|
|
|
// btnPause.setEnabled(true);
|
|
|
|
|
// mPublisher.switchCameraFace(cameraId, rotation);
|
|
|
|
|
// }
|
|
|
|
|
// }, 500);
|
|
|
|
|
} else {
|
|
|
|
|
mPublisher.switchCameraFace(cameraId, rotation);
|
|
|
|
|
}
|
|
|
|
|