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

fix android bug #182

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ android {

dependencies {

implementation 'live.videosdk:rtc-android-sdk:0.1.17'
// implementation 'live.videosdk:rtc-android-sdk:0.1.21'
implementation 'com.github.zujonow:rtc-android-sdk:c07cf2f462'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected void onCreate(Bundle savedInstanceState) {
// 2. Initialize VideoSDK Meeting
meeting = VideoSDK.initMeeting(
MeetingActivity.this, meetingId, participantName,
micEnabled, webcamEnabled,null, null, true,null);
micEnabled, webcamEnabled,null, null, true,null,null,null);

// 3. Add event listener for listening upcoming events
meeting.addEventListener(meetingEventListener);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package live.videosdk.rtc.android.quickstart;

import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -24,12 +25,23 @@ public class ParticipantAdapter extends RecyclerView.Adapter<ParticipantAdapter.

private final List<Participant> participants = new ArrayList<>();

private PeerViewHolder viewHolder;

public ParticipantAdapter(Meeting meeting) {
// adding the local participant(You) to the list
participants.add(meeting.getLocalParticipant());


// adding Meeting Event listener to get the participant join/leave event in the meeting.
meeting.addEventListener(new MeetingEventListener() {

@Override
public void onMeetingJoined() {
participants.clear();
participants.add(meeting.getLocalParticipant());
notifyDataSetChanged();
super.onMeetingJoined();
}

@Override
public void onParticipantJoined(Participant participant) {
// add participant to the list
Expand All @@ -53,6 +65,17 @@ public void onParticipantLeft(Participant participant) {
notifyItemRemoved(pos);
}
}

@Override
public void onMeetingStateChanged(String state) {
Log.d("TAG", "onMeetingStateChanged: particiapantAdapter");
if(state.equals("FAILED")){
viewHolder.participantView.clearImage();
viewHolder.participantView.removeTrack();
viewHolder.participantView.releaseSurfaceViewRenderer();
}
super.onMeetingStateChanged(state);
}
});
}

Expand All @@ -64,6 +87,7 @@ public PeerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType

@Override
public void onBindViewHolder(@NonNull PeerViewHolder holder, int position) {
viewHolder = holder;
Participant participant = participants.get(position);

holder.tvName.setText(participant.getDisplayName());
Expand Down
3 changes: 2 additions & 1 deletion android-rtc/Videosdk_android_java_quickstart/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ pluginManagement {
gradlePluginPortal()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
maven { url 'https://jitpack.io' }
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
Expand Down