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
void toggleSendMessage({required String text, required String peerId}) async { | |
if (text.isEmpty) { | |
print('Please input text to send.'); | |
return; | |
} | |
try { | |
await value.client?.agoraRtmClient.sendMessageToPeer2( | |
peerId, | |
RtmMessage.fromText(text), | |
).catchError(print); |
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
void updateMessages({required String peerId, required RtmMessage message, required bool isRemote}) { | |
value = value.copyWith(messages: [ | |
...value.messages, | |
MessageClass(text: message, remoteUid: peerId, isRemote: isRemote) | |
]); | |
} |
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
int remoteUid = value.matchedUsers![0].uid; | |
value = value.copyWith(likedUsers: [...?value.likedUsers, remoteUid]); | |
List<AgoraUser>? tempList = value.matchedUsers; | |
tempList?.removeAt(0); | |
value = value.copyWith(matchedUsers: tempList); |
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
await muteCurrentStream( | |
uid: widget.controller.value.matchedUsers![info.cardIndex].uid); | |
await unmuteStream(uid: widget.controller.value.matchedUsers![index].uid); |
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
AgoraVideoViewer( | |
client: widget.client, | |
layoutType: Layout.oneToOne, | |
remoteUid: widget.controller.value.matchedUsers?[index].uid, | |
), |
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
AgoraPreCallViewer( | |
client: client, | |
joinCallButton: () => // Add the Navigator to the next page here | |
) |
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
var agView: AgoraVideoViewer? = null | |
agView = AgoraVideoViewer( | |
this, AgoraConnectionData("my-app-id", appToken = "my-token"), | |
) | |
val set = FrameLayout.LayoutParams( | |
FrameLayout.LayoutParams.MATCH_PARENT, | |
FrameLayout.LayoutParams.MATCH_PARENT | |
) |
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 'package:agora_uikit/agora_uikit.dart'; | |
final AgoraClient client = AgoraClient( | |
agoraConnectionData: AgoraConnectionData( | |
appId: "<--Add your App Id here-->", | |
tempToken: '<--Add your temp token here-->', | |
channelName: "test", | |
username: "user", | |
), | |
); |
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
okHttpClient.newCall(request).enqueue(new Callback() { | |
@Override | |
public void onFailure(okhttp3.Call call, IOException e) { | |
} | |
@Override | |
public void onResponse(okhttp3.Call call, Response response) throws IOException { | |
} |
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
okHttpClient = new OkHttpClient.Builder() | |
.readTimeout(300,TimeUnit.SECONDS) | |
.writeTimeout(300,TimeUnit.SECONDS) | |
.proxy(new Proxy(HTTP, new InetSocketAddress("127.0.0.1", FpaProxyService.getInstance().getHttpProxyPort()))) | |
.build(); |
NewerOlder