This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onDestroy() { | |
super.onDestroy(); | |
leaveChannel(); | |
RtcEngine.destroy(); | |
mRtcEngine = null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void joinChannel() { | |
mRtcEngine.joinChannel(null, channelName, "Optional Data", 0); | |
} | |
private void leaveChannel() { | |
mRtcEngine.leaveChannel(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void setupLocalVideo() { | |
FrameLayout container = (FrameLayout) findViewById(R.id.local_video_view_container); | |
SurfaceView surfaceView = RtcEngine.CreateRendererView(getBaseContext()); | |
surfaceView.setZOrderMediaOverlay(true); | |
container.addView(surfaceView); | |
mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_FIT, 0)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void setupVideoProfile() { | |
mRtcEngine.enableVideo(); | |
mRtcEngine.setVideoEncoderConfiguration(new VideoEncoderConfiguration(VideoEncoderConfiguration.VD_640x480, VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15, | |
VideoEncoderConfiguration.STANDARD_BITRATE, | |
VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VideoActivity extends AppCompatActivity { | |
public void onLocalAudioMuteClicked(View view) { | |
ImageView iv = (ImageView) view; | |
if (iv.isSelected()) { | |
iv.setSelected(false); | |
iv.clearColorFilter(); | |
} else { | |
iv.setSelected(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VideoActivity extends AppCompatActivity { | |
private RtcEngine mRtcEngine; | |
private String channelName; | |
private int channelProfile; | |
public static final String LOGIN_MESSAGE = "com.agora.example.agorabroadcast.CHANNEL_LOGIN"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Intent; | |
import android.graphics.PorterDuff; | |
import android.support.annotation.Nullable; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.SurfaceView; | |
import android.view.View; | |
import android.widget.FrameLayout; | |
import android.widget.ImageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Intent; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.EditText; | |
import android.widget.RadioButton; | |
import io.agora.rtc.Constants; | |
public class MainActivity extends AppCompatActivity { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
public void onRadioButtonClicked(View view) { | |
boolean checked = ((RadioButton) view).isChecked(); | |
switch (view.getId()) { | |
case R.id.host: | |
if (checked) { | |
channelProfile = Constants.CLIENT_ROLE_BROADCASTER; | |
} | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
int channelProfile; | |
public static final String channelMessage = "com.agora.example.agorabroadcast.CHANNEL"; | |
public static final String profileMessage = "com.agora.example.agorabroadcast.PROFILE"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |