-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I Implemented Screen Casting using Default ID in flutter app but when i try to connect Chrome cast , I encountered issue mentioned below
- [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could either mean that the input has been truncated or that an embedded message misreported its own length.
This is my MainActivity code :
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
manifest code :
Dart Code to connect chrome cast :
Future _connectToYourApp(BuildContext context, CastDevice object) async {
final session = await CastSessionManager().startSession(object);
session.stateStream.listen((state) {
if (state == CastSessionState.connected) {
final snackBar = SnackBar(content: Text('Connected'));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
_sendMessageToYourApp(session);
}
});
session.messageStream.listen((message) {
print('receive message: $message');
});
session.sendMessage(CastSession.kNamespaceReceiver, {
'type': 'LAUNCH',
'appId': 'CC1AD845',
});
}
help me to resolve this issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels