mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 18:36:11 +02:00
mobile & web rgba stream
This commit is contained in:
parent
9ecacadd4a
commit
7c5a136b6b
6 changed files with 76 additions and 130 deletions
|
@ -10,12 +10,6 @@ final List<StreamSubscription<MouseEvent>> mouseListeners = [];
|
|||
final List<StreamSubscription<KeyboardEvent>> keyListeners = [];
|
||||
|
||||
class PlatformFFI {
|
||||
static void clearRgbaFrame() {}
|
||||
|
||||
static Uint8List? getRgba() {
|
||||
return context.callMethod('getRgba');
|
||||
}
|
||||
|
||||
static String getByName(String name, [String arg = '']) {
|
||||
return context.callMethod('getByName', [name, arg]);
|
||||
}
|
||||
|
@ -31,7 +25,7 @@ class PlatformFFI {
|
|||
version = getByName('version');
|
||||
}
|
||||
|
||||
static void setEventCallback(void Function(Map<String, dynamic>) fun) async {
|
||||
static void setEventCallback(void Function(Map<String, dynamic>) fun) {
|
||||
context["onGlobalEvent"] = (String message) {
|
||||
try {
|
||||
Map<String, dynamic> event = json.decode(message);
|
||||
|
@ -42,6 +36,14 @@ class PlatformFFI {
|
|||
};
|
||||
}
|
||||
|
||||
static void setRgbaCallback(void Function(Uint8List) fun) {
|
||||
context["onRgba"] = (Uint8List? rgba) {
|
||||
if (rgba != null) {
|
||||
fun(rgba);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static void startDesktopWebListener() {
|
||||
mouseListeners.add(
|
||||
window.document.onContextMenu.listen((evt) => evt.preventDefault()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue