Comments (2)
Disconnect feature is not working in current example. (master, HEAD a0cf9d4).
After the sample app successfully connects to the cast device, by clicking in the top left tab bar icon and calling disconnect, with the current declaration:
void disconnect() async { if (null != _castSender) { await _castSender.disconnect(); final prefs = await SharedPreferences.getInstance(); prefs.remove('cast_session_host'); prefs.remove('cast_session_port'); prefs.remove('cast_session_device_name'); prefs.remove('cast_session_device_type'); prefs.remove('cast_session_sender_id'); prefs.remove('cast_session_destination_id'); setState(() { _castSender = null; _servicesFound = false; _castConnected = false; _discover(); }); } }
the app does not disconnect from the cast device.
Solution: (cast_sender.dart)
Future<bool> disconnect() async { if (null != _connectionChannel && null != _castSession?.castMediaStatus) { _connectionChannel.sendMessage({ 'type': 'CLOSE', 'sessionId': _castSession.castMediaStatus.sessionId, }); } if (null != _socket) { await _socket.destroy(); } _dispose(); connectionDidClose = true; return true; }
TO
Future<bool> disconnect() async { if (null != _connectionChannel) { _connectionChannel.sendMessage({ 'type': 'CLOSE', }); } if (null != _socket) { await _socket.destroy(); } _dispose(); connectionDidClose = true; return true; }
from flutter_chromecast_example.
That actually works. I'm facing some network issues here, which lead me to undeterministic tests. I expect them to be solved later on and I'll comment again.
from flutter_chromecast_example.
Related Issues (13)
- Update plugin HOT 1
- Supporting playback of video files in local storage HOT 1
- Cast Image HOT 2
- Updated Example
- Cannot run with Flutter 0.11.3 HOT 5
- The getter 'host' isn't defined for the class 'ServiceInfo' HOT 4
- Can't discover chromecast devices HOT 3
- Example crashing in Android Simulator -- UiThread Method called outside of main thread -- in Native code HOT 6
- Display image while playing an audio HOT 6
- EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE HOT 1
- Unable to resolve dep version requirements HOT 1
- Errors on build attempt - AAPT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_chromecast_example.