Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/4.2.2 #348

Merged
merged 45 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
310c136
add preload channel function
Jun 12, 2023
69a0d32
set remote video canvas background color
Jun 13, 2023
7d2305b
add preload channel function
Jun 13, 2023
759545e
[Android]adapt to 421 sdk, adjust case and fix some bug.
xgfd3 Jun 15, 2023
5a82d72
[Android][Audio]adapt to 421 sdk and adjust cases.
xgfd3 Jun 15, 2023
368d0c2
add multi camera function
Jun 15, 2023
d7a52b6
[Windows]Adapt to 421 sdk; adjust cases.
xgfd3 Jun 15, 2023
913e4ed
fix fu readme
Jun 16, 2023
e06e8f2
Merge branch 'dev/4.2.1' of github.com:AgoraIO/API-Examples into dev/…
Jun 16, 2023
cbf5ff0
[Android]renew the include header files of agora-simple-filter
xgfd3 Jun 16, 2023
ec20a70
fix preload channel
Jun 16, 2023
3d69464
fix preload channel
Jun 16, 2023
69164da
[Android]add MultiEncodedVideoSourceTracks case.
xgfd3 Jun 19, 2023
7d4dd8e
add custom video encode capture
Jun 19, 2023
54cb70f
[Android]Incorporate MultiEncodedVideoSourceTracks examples into Mult…
xgfd3 Jun 19, 2023
3eea077
add custom video encode capture
Jun 20, 2023
bd39541
Merge remote-tracking branch 'origin/main' into dev/4.2.1
xgfd3 Jun 25, 2023
20853f8
Merge branch 'dev/4.2.1' of github.com:AgoraIO/API-Examples into dev/…
Jun 25, 2023
4ef8e3a
[windows]add pushEncodedVideoImage case.
xgfd3 Jun 25, 2023
0a7b22a
[windows]update rtc sdk url.
xgfd3 Jun 25, 2023
3007bcb
fix custom capture encode publish stream bug
Jun 25, 2023
aa6f57d
Merge branch 'dev/4.2.1' of github.com:AgoraIO/API-Examples into dev/…
Jun 26, 2023
5f047a8
[Android]fix profile value setting error for using enum ordinal value.
xgfd3 Jun 27, 2023
afe06e5
[Android]perfect live streaming case.
xgfd3 Jun 27, 2023
e8c4c76
[Android]perfect the error alert in channel encryption case.
xgfd3 Jun 27, 2023
de3dc53
[Android]fix multi video track bug(NMS-13863).
xgfd3 Jun 27, 2023
9a654f9
[Android]perfect MediaRecoder case.
xgfd3 Jun 27, 2023
1410a45
[Android][Audio]fix token fill bug.
xgfd3 Jun 27, 2023
6bcebcb
fix not display join2success state
Jun 27, 2023
7563696
fix mutil camera publish stream bug
Jun 28, 2023
ec9a0de
fix custom audio render bug
Jun 28, 2023
9646f68
Merge branch 'dev/4.2.1' of github.com:AgoraIO/API-Examples into dev/…
Jun 28, 2023
7921b22
fix canvas background color bug
Jun 28, 2023
5f7eb64
[Android]1.perfect watermark config;2.perfect audio route display;3.s…
xgfd3 Jun 30, 2023
12dee61
[Android]update rtc version to 422.
xgfd3 Jun 30, 2023
3ac22e8
adapts beauty scene API
Jul 10, 2023
ddea633
add screen scenario type
Jul 12, 2023
a6b6c0d
[Android]Integrate beautyAPI.
xgfd3 Jul 12, 2023
1199179
[Android]update beauty config README.
xgfd3 Jul 12, 2023
238bd67
add swift screen share code
Jul 18, 2023
283e556
Merge branch 'dev/4.2.1' of github.com:AgoraIO/API-Examples into dev/…
Jul 18, 2023
a0af25d
fix xcode 14.3.1 version error
Jul 19, 2023
0f3c187
[Android]update repositories config.
xgfd3 Jul 26, 2023
3890cb7
update sdk version to 4.2.2
Jul 27, 2023
c1ee2b5
Merge branch 'dev/4.2.1' of github.com:AgoraIO/API-Examples into dev/…
Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Android/APIExample-Audio/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
implementation fileTree(dir: "${localSdkPath}", include: ['*.jar', '*.aar'])
}
else{
def agora_sdk_version = "4.2.1"
def agora_sdk_version = "4.2.2"
// case 1: full single lib with voice only
implementation "io.agora.rtc:voice-sdk:${agora_sdk_version}"
// case 2: partial libs with voice only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ protected final void showLongToast(final String msg)
});
}

protected final void showShortToast(final String msg)
{
runOnUIThread(() -> {
Context context = getContext();
if(context == null){
return;
}
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
});
}

protected final void runOnUIThread(Runnable runnable){
this.runOnUIThread(runnable, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public void onDestroy()
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (parent == audioScenario) {
engine.setAudioScenario(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()).ordinal());
engine.setAudioScenario(Constants.AudioScenario.getValue(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString())));
}
}

Expand Down Expand Up @@ -356,8 +356,8 @@ private void joinChannel(String channelId)
/**In the demo, the default is to enter as the anchor.*/
engine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);
engine.setAudioProfile(
Constants.AudioProfile.valueOf(audioProfile.getSelectedItem().toString()).ordinal(),
Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()).ordinal()
Constants.AudioProfile.getValue(Constants.AudioProfile.valueOf(audioProfile.getSelectedItem().toString())),
Constants.AudioScenario.getValue(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()))
);

/**Please configure accessToken in the string_config file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ private void joinChannel(String channelId) {
engine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);
// audio config
engine.setAudioProfile(
Constants.AudioProfile.valueOf(audioProfile.getSelectedItem().toString()).ordinal(),
Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()).ordinal()
Constants.AudioProfile.getValue(Constants.AudioProfile.valueOf(audioProfile.getSelectedItem().toString())),
Constants.AudioScenario.getValue(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()))
);

/**Please configure accessToken in the string_config file.
Expand Down Expand Up @@ -566,7 +566,7 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
}

if (parent == audioScenario) {
engine.setAudioScenario(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()).ordinal());
engine.setAudioScenario(Constants.AudioScenario.getValue(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString())));
return;
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,51 +46,13 @@
public class JoinChannelAudioByToken extends BaseFragment implements View.OnClickListener
{
private static final String TAG = JoinChannelAudioByToken.class.getSimpleName();
private Spinner audioProfileInput;
private Spinner audioScenarioInput;
private EditText et_app_id, et_channel, et_token;
private Button mute, join, speaker;
private SeekBar record, playout, inear;
private Switch inEarSwitch;
private Button join;
private RtcEngine engine;
private int myUid;
private boolean joined = false;
private AudioSeatManager audioSeatManager;

private SeekBar.OnSeekBarChangeListener seekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if(engine == null){
return;
}
if(seekBar.getId() == record.getId()){
engine.adjustRecordingSignalVolume(progress);
}
else if(seekBar.getId() == playout.getId()){
engine.adjustPlaybackSignalVolume(progress);
}
else if(seekBar.getId() == inear.getId()){
if(progress == 0){
engine.enableInEarMonitoring(false);
}
else {
engine.enableInEarMonitoring(true);
engine.setInEarMonitoringVolume(progress);
}
}
}

@Override
public void onStartTrackingTouch(SeekBar seekBar) {

}

@Override
public void onStopTrackingTouch(SeekBar seekBar) {

}
};

@Override
public void onCreate(@Nullable Bundle savedInstanceState)
{
Expand All @@ -114,47 +76,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
et_app_id = view.findViewById(R.id.et_app_id);
et_channel = view.findViewById(R.id.et_channel);
et_token = view.findViewById(R.id.et_token);
audioProfileInput = view.findViewById(R.id.audio_profile_spinner);
audioScenarioInput = view.findViewById(R.id.audio_scenario_spinner);
audioScenarioInput.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(joined){
int scenario = Constants.AudioScenario.valueOf(audioScenarioInput.getSelectedItem().toString()).ordinal();
engine.setAudioScenario(scenario);
}
}

@Override
public void onNothingSelected(AdapterView<?> parent) {

}
});
view.findViewById(R.id.btn_join).setOnClickListener(this);
mute = view.findViewById(R.id.microphone);
mute.setOnClickListener(this);
speaker = view.findViewById(R.id.btn_speaker);
speaker.setOnClickListener(this);
speaker.setActivated(true);
record = view.findViewById(R.id.recordingVol);
playout = view.findViewById(R.id.playoutVol);
inear = view.findViewById(R.id.inEarMonitorVol);
record.setOnSeekBarChangeListener(seekBarChangeListener);
playout.setOnSeekBarChangeListener(seekBarChangeListener);
inear.setOnSeekBarChangeListener(seekBarChangeListener);
inEarSwitch = view.findViewById(R.id.inEarMonitorSwitch);
inEarSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
if(engine == null){
return;
}
engine.enableInEarMonitoring(isChecked);
inear.setEnabled(isChecked);
});
record.setEnabled(false);
playout.setEnabled(false);
inear.setEnabled(false);
inEarSwitch.setEnabled(false);

audioSeatManager = new AudioSeatManager(
view.findViewById(R.id.audio_place_01),
view.findViewById(R.id.audio_place_02),
Expand Down Expand Up @@ -189,7 +111,6 @@ private boolean createRtcEngine(String appId) {
* The SDK uses this class to report to the app on SDK runtime events.
*/
config.mEventHandler = iRtcEngineEventHandler;
config.mAudioScenario = Constants.AudioScenario.valueOf(audioScenarioInput.getSelectedItem().toString()).ordinal();
config.mAreaCode = ((MainApplication)getActivity().getApplication()).getGlobalSettings().getAreaCode();
engine = RtcEngine.create(config);
/**
Expand Down Expand Up @@ -254,47 +175,16 @@ public void onClick(View v)

if (createRtcEngine(appId)) {
joinChannel(channelId, token);
audioProfileInput.setEnabled(false);
}
}
else
{
joined = false;
join.setText(getString(R.string.join));
speaker.setText(getString(R.string.speaker));
speaker.setEnabled(false);
mute.setText(getString(R.string.closemicrophone));
mute.setEnabled(false);
audioProfileInput.setEnabled(true);
record.setEnabled(false);
playout.setEnabled(false);
inear.setEnabled(false);
inEarSwitch.setEnabled(false);
inEarSwitch.setChecked(false);
audioSeatManager.downAllSeats();
destroyRtcEngine();
}
}
else if (v.getId() == R.id.microphone)
{
if(engine == null){
return;
}
mute.setActivated(!mute.isActivated());
mute.setText(getString(mute.isActivated() ? R.string.openmicrophone : R.string.closemicrophone));
/**Turn off / on the microphone, stop / start local audio collection and push streaming.*/
engine.muteLocalAudioStream(mute.isActivated());
}
else if (v.getId() == R.id.btn_speaker)
{
if(engine == null){
return;
}
speaker.setActivated(!speaker.isActivated());
speaker.setText(getString(speaker.isActivated() ? R.string.speaker : R.string.earpiece));
/**Turn off / on the speaker and change the audio playback route.*/
engine.setEnableSpeakerphone(speaker.isActivated());
}
}

/**
Expand All @@ -305,12 +195,6 @@ private void joinChannel(String channelId, String token)
/**In the demo, the default is to enter as the anchor.*/
engine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);

int profile = Constants.AudioProfile.valueOf(audioProfileInput.getSelectedItem().toString()).ordinal();
engine.setAudioProfile(profile);

int scenario = Constants.AudioScenario.valueOf(audioScenarioInput.getSelectedItem().toString()).ordinal();
engine.setAudioScenario(scenario);

engine.setDefaultAudioRoutetoSpeakerphone(true);

ChannelMediaOptions option = new ChannelMediaOptions();
Expand Down Expand Up @@ -387,14 +271,8 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed)
@Override
public void run()
{
speaker.setEnabled(true);
mute.setEnabled(true);
join.setEnabled(true);
join.setText(getString(R.string.leave));
record.setEnabled(true);
playout.setEnabled(true);
inear.setEnabled(inEarSwitch.isChecked());
inEarSwitch.setEnabled(true);
audioSeatManager.upLocalSeat(uid);
}
});
Expand Down
Loading
Loading