Comments (9)
Hey,
Were you able to connect to chromecast fine before doing that?
And are you talking about a sample project or your own project?
from sharpcaster.
I am using the sample Android project. I just found the cause of the issue: sometimes there are no devices returned and then this call ChromecastService.ConnectToChromecast(devices.First());
causes the error.
however I am now unable to restart my app and start a new cast: the Sharpcaster Demo Receiver remains open on my TV when I close the app and I cannot cast anything anymore. Is there any documentation on how to properly close the cast before leaving the app and then reopen a new cast?
from sharpcaster.
I clearly need to improve the Android sample.
There is automatic timeout on Chromecast which is around 2 minutes so even if the application is left open there is no problems.
If there is application open on Chromecast you can just send a open application command to Chromecast and it will open the new one or if it is the same application ID it will join the session.
Currently the documentation is really lacking
from sharpcaster.
That helps, thanks a lot!
from sharpcaster.
Hi Tapanila,
Would you be able to provide some sample code on how to reconnect to an open application? I am still unable to do so. I would expect to do something with ChromeCastClient.RunningApplication, but it is always null when I restart the app.
from sharpcaster.
When you do LaunchApplication by default it will reconnect to an open application.
The ChromeCastClient.RunningApplication is only populated after LaunchApplication has been called.
from sharpcaster.
But I have to connect to a Chromecast device before I can call LaunchApplication, right?
Anyways, streaming media works the first time I launch my app. But I am still getting a couple of errors when I quit the application and then restart it. I first connect to a chromecast device, and then call LaunchApplication on the _controller when connected to a chromecast device:
-
An unhandled exception occured.
caused by:
public async Task ConnectWithDestination() { await Write(MessageFactory.ConnectWithDestination(Client.CurrentApplicationTransportId)); }
-
Unable to write data to the transport connection: The socket has bee shut down.
When I call StopApplication and the LaunchApplication I get the following error:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'The Stream is closed.'.
Joining an existing application never happens in LaunchApplication.
from sharpcaster.
But I have to connect to a Chromecast device before I can call LaunchApplication, right?
Yep
Anyways, streaming media works the first time I launch my app. But I am still getting a couple of errors when I quit the application and then restart it.
Sorry but I do not understand what you are doing different after restarting? or how it is behaving differently after restart.
If you can share the code + steps how to reproduce the problem. That would help a lot with solving the issue
from sharpcaster.
If this is still an issue just re-open this
from sharpcaster.
Related Issues (20)
- White screen after casting webpage. HOT 1
- Launching Netflix Via SDK - REQUEST HOT 1
- Cast from local NAS HOT 1
- Does not provide video controlling feature HOT 1
- Trouble connecting to chromecast from desktop HOT 5
- How to cast an Local Image? HOT 2
- Restarting previous app? HOT 3
- Re connection Issues HOT 1
- Custom receiver issue
- Plex help HOT 2
- MediaStatusChanged, ChromecastStatusChanged events not firing? HOT 1
- Connect-Launch-Load Example does not work when no App loaded or different AppId loaded. HOT 4
- Create a Fake/Virtual ChromeCast device HOT 1
- Can sharpcaster be used in mirror an android screen to chromecast? HOT 6
- sharpcaster on android HOT 12
- Xamarin Ios HOT 2
- Remove console.Writeline() from ChromeCastClient.cs HOT 4
- Cant find sample application HOT 4
- Disconnected Event Handler not called on reception of CloseMessage HOT 4
- Are casting web page urls no longer supported? HOT 3
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 sharpcaster.