Any API documentation for the Cast package?

Viewed 122

so I recently got started with the flutter package cast in order to communicate with Chromecast devices. But I couldn't find any details on how to use it. If you could give me some help in actually playing a media file such as a song or a video that would be wholesome!

My current code:

CastSession session;
Future<void> _connect(BuildContext context, CastDevice object) async {
     session = await CastSessionManager().startSession(object);

 session.stateStream.listen((state) {
     if (state == CastSessionState.connected) {
         // Close my custom GUI
         Navigator.pop(context);
         _sendMessage(session);
     }
 });

 session.messageStream.listen((message) {
     print('receive message: $message');
 });
}

// My video playing code
        session.sendMessage(CastSession.kNamespaceReceiver, {
          'type': 'MEDIA',
          'link': 'http://somegeneratedurl.com',
        });
1 Answers

Ok, so I found a solution to the answer. There is unfortunately no command to play a video file. I've looked through the Gcast protocol reference and there is no command for playing video files. I found this package that can cast videos, and I'm gonna use that package instead.

Related