Reverse-engineered remote protocol and commands for PRISM Live Studio v4.0.0+.
This repository provides a Dart library to use the remote protocol, which is compatible with Flutter (uses dart:io, no web support). If you wish to implement the protocol for yourself, protocol documentation is also provided.
A working program using these examples can be found in example/example.dart.
dependencies:
prism_connect: ^1.0.0import 'package:prism_connect/prism_connect.dart';(use the port from the QR code within the app):
PrismConnect prism = await PrismConnect.connect("127.0.0.1", 50000);(see src/protocol/commands directory for all available commands):
Command deviceInfo = await prism.sendCommand(GetDeviceInfoCommand());In case the command does not have a class, you can also use call to send a custom command:
Command deviceInfo = await prism.call("getDeviceInfo");Note: Command is a base class; the return type could actually be SuccessCommand/FailureCommand, or in this example, DeviceInfoCommand
prism.messageStream.listen((message) async {
print(message.command);
// Server sends this command to client every few seconds
if (message.command is GetDeviceInfoCommand) {
var deviceInfo = DeviceInfoCommand(
id: prism.deviceId,
name: DEVICE_NAME,
os: DEVICE_OS,
osVersion: DEVICE_OS_VERSION,
);
prism.reply(message, deviceInfo);
}
})await prism.disconnect();