startSession method
Implementation
Future<CastSession> startSession(CastDevice device, [Duration? timeout]) async {
String sessionId = 'client-${Random().nextInt(99999)}';
while (sessions.contains((x) => x.sessionId == sessionId)) {
sessionId = 'client-${Random().nextInt(99999)}';
}
final session = await CastSession.connect(sessionId, device, timeout);
sessions.add(session);
return session;
}