Code Monkey home page Code Monkey logo

Comments (9)

Tapanila avatar Tapanila commented on May 24, 2024

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.

nielscup avatar nielscup commented on May 24, 2024

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.

Tapanila avatar Tapanila commented on May 24, 2024

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.

nielscup avatar nielscup commented on May 24, 2024

That helps, thanks a lot!

from sharpcaster.

nielscup avatar nielscup commented on May 24, 2024

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.

Tapanila avatar Tapanila commented on May 24, 2024

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.

nielscup avatar nielscup commented on May 24, 2024

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:

  1. An unhandled exception occured.
    caused by:
    public async Task ConnectWithDestination() { await Write(MessageFactory.ConnectWithDestination(Client.CurrentApplicationTransportId)); }

  2. 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.

Tapanila avatar Tapanila commented on May 24, 2024

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.

Tapanila avatar Tapanila commented on May 24, 2024

If this is still an issue just re-open this

from sharpcaster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.