References
Events
abstract class EyesonEventListener {
open fun onPermissionsNeeded(neededPermissions: List<NeededPermissions>) {}
open fun onMeetingJoining(meetingInfo: MeetingInfo) {}
open fun onMeetingJoined(meetingInfo: MeetingInfo) {}
open fun onMeetingJoinFailed(callRejectionReason: CallRejectionReason) {}
open fun onMeetingTerminated(callTerminationReason: CallTerminationReason) {}
open fun onMeetingLocked(locked: Boolean) {}
open fun onStreamingModeChanged(p2p: Boolean) {}
open fun onVideoSourceUpdate(visibleUsers: List<UserInfo>, presenter: UserInfo?) {}
open fun onAudioMutedBy(user: UserInfo) {}
open fun onMediaPlayback(playing: List<Playback>) {}
open fun onMediaPlaybackStartResponse(
playId: String?,
mediaPlaybackResponse: MediaPlaybackResponse
) {}
open fun onMediaPlaybackStopResponse(
playId: String,
mediaPlaybackResponse: MediaPlaybackResponse
) {}
open fun onPresentationUpdate(presentationUpdate: PresentationUpdate) {}
open fun onPresentationStartResponse(presentationResponse: PresentationResponse) {}
open fun onPresentationStopResponse(presentationResponse: PresentationResponse) {}
open fun onBroadcastUpdate(activeBroadcasts: BroadcastUpdate) {}
open fun onRecordingUpdate(recording: Recording) {}
open fun onSnapshotUpdate(snapshots: SnapshotUpdate) {}
open fun onConnectionStatisticUpdate(statistic: ConnectionStatistic) {}
open fun onOptionsUpdate(meetingOptions: MeetingOptions) {}
open fun onUserJoinedMeeting(users: List<UserInfo>) {}
open fun onUserLeftMeeting(users: List<UserInfo>) {}
open fun onUserListUpdate(users: List<UserInfo>, playbackPlayIds: List<String>) {}
open fun onVoiceActivity(user: UserInfo, active: Boolean) {}
open fun onChatMessageReceived(user: UserInfo, message: String, timestamp: Date) {}
open fun onCustomMessageReceived(user: UserInfo, message: String, timestamp: Date) {}
open fun onCameraSwitchDone(isFrontCamera: Boolean) {}
open fun onCameraSwitchError(error: String) {}
}
Classes
NeededPermissions
enum class NeededPermissions(val permissions: String) {
RECORD_AUDIO(Manifest.permission.RECORD_AUDIO),
CAMERA(Manifest.permission.CAMERA);
}
MeetingInfo
data class MeetingInfo(
val accessKey: String,
val name: String,
val startedAt: Date,
val user: UserInfo,
val locked: Boolean,
val guestToken: String,
val guestLink: String,
val activeRecording: Recording?,
val activeBroadcasts: BroadcastUpdate?,
val snapshots: SnapshotUpdate?,
val meetingOptions: MeetingOptions
)
MeetingOptions
data class MeetingOptions(
val backgroundColor: String,
val broadcastAvailable: Boolean,
val customFields: Map<String, String>,
val exitUrl: String?,
val kickAvailable: Boolean,
val layout: String,
val layoutAvailable: Boolean,
val layoutMap: List<LayoutMapEntry>,
val layoutName: String?,
val layoutUsers: List<String>,
val lockAvailable: Boolean,
val reactionAvailable: Boolean,
val recordingAvailable: Boolean,
val sfuMode: String,
val showLabel: Boolean,
val showNames: Boolean,
val suggestGuestNames: Boolean,
val voiceActivation: Boolean,
val widescreen: Boolean,
) {
data class LayoutMapEntry(val x: Int, val y: Int, val width: Int, val height: Int)
}
UserInfo
data class UserInfo(
val id: String,
val name: String,
val avatar: String?,
val guest: Boolean,
val joinedAt: Date
)
PermalinkMeetingInfo
data class PermalinkMeetingInfo(
val id: String,
val createdAt: String,
val guestToken: String,
val expiresAt: Date?,
val room: Room,
val team: Team,
val options: MeetingOptions,
) {
data class Team(
val name: String,
)
data class Room(
val id: String,
val name: String,
val startedAt: Date?,
)
}
Recording
data class Recording(
val id: String,
val duration: Int?,
val downloadLink: String?,
val createdAt: Date,
val user: UserInfo
)
BroadcastUpdate
data class BroadcastUpdate(val broadcasts: List<Broadcast>) {
data class Broadcast(
val id: String,
val platform: String,
val playerUrl: String,
val user: UserInfo
)
}
SnapshotUpdate
data class SnapshotUpdate(val snapshots: List<Snapshot>){
data class Snapshot(
val id: String,
val name: String,
val creator: UserInfo,
val createdAt: Date,
val downloadLink: String
)
}
CallRejectionReason
enum class CallRejectionReason(val rejectCode: Int) {
UNSPECIFIED(-7),
BAD_REQUEST(400),
FORBIDDEN(403),
NOT_FOUND(404),
GONE(410),
ERROR(500),
SERVICE_UNAVAILABLE(503),
UNWANTED(607);
}
CallTerminationReason
enum class CallTerminationReason(val terminationCode:Int) {
UNSPECIFIED(-7),
OK(200),
FORBIDDEN(403),
ERROR(500),
UNWANTED(607);
}
Playback
data class Playback(
val url: String,
val name: String?,
val playId: String?,
val replacedUser: UserInfo?,
val audio: Boolean,
val loopCount: Int
)
MediaPlaybackResponse
enum class MediaPlaybackResponse(val responseCode: Int) {
UNSPECIFIED(-7),
OK(200),
CREATED(201),
BAD_REQUEST(400),
NOT_FOUND(404),
GONE(410),
ERROR(500);
companion object {
fun isSuccessful(code: Int): Boolean {
return code == OK.responseCode || code == CREATED.responseCode
}
}
fun isSuccessful(): Boolean {
return MediaPlaybackResponse.isSuccessful(responseCode)
}
}
PresentationResponse
enum class PresentationResponse(val responseCode: Int) {
UNSPECIFIED(-7),
OK(200),
CREATED(201),
BAD_REQUEST(400),
NOT_FOUND(404),
CONFLICT(409),
GONE(410),
ERROR(500);
companion object {
private val mapping = entries.associateBy(PresentationResponse::responseCode)
fun fromResponseCode(code: Int) = mapping[code] ?: UNSPECIFIED
fun isSuccessful(code: Int): Boolean {
return code == OK.responseCode || code == CREATED.responseCode
}
}
fun isSuccessful(): Boolean {
return PresentationResponse.isSuccessful(responseCode)
}
}
ConnectionStatistic
data class ConnectionStatistic(
val timestampInMicros: Long,
val audioOut: EntrySent,
val videoOut: EntrySent,
val audioIn: EntryReceived,
val videoIn: EntryReceived
) {
data class EntrySent(
val jitterInSeconds: Double,
val bytesSentDelta: Long,
val packetsSentDelta: Long,
val packetsLostDelta: Long,
val roundTripTimeInSeconds: Double
)
data class EntryReceived(
val jitterInSeconds: Double,
val bytesReceivedDelta: Long,
val packetsReceivedDelta: Long,
val packetsLostDelta: Long
)
}
AudioDevice
sealed class AudioDevice {
object SpeakerPhone : AudioDevice()
object WiredHeadset : AudioDevice()
object Earpiece : AudioDevice()
object Bluetooth : AudioDevice()
object None : AudioDevice()
}