|
|
|
@ -214,11 +214,14 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
if (btnPublish.getText().toString().contentEquals("publish")) {
|
|
|
|
|
rtmpUrl = efu.getText().toString();
|
|
|
|
|
if (rtmpUrl == null || rtmpUrl.isEmpty()) {
|
|
|
|
|
Toast.makeText(getApplicationContext(), "没有正确的推送地址", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
SharedPreferences.Editor editor = sp.edit();
|
|
|
|
|
editor.putString("rtmpUrl", rtmpUrl);
|
|
|
|
|
editor.apply();
|
|
|
|
|
|
|
|
|
|
efu.setText(rtmpUrl);
|
|
|
|
|
mPublisher.startPublish(rtmpUrl);
|
|
|
|
|
// mPublisher.startCamera();
|
|
|
|
|
mPublisher.switchCameraFace(cameraId);
|
|
|
|
|