Giter Site home page Giter Site logo

Comments (7)

kakone avatar kakone commented on July 26, 2024

You need to call the IMediaChannel.GetStatusAsync() method (only works in version 1.6.4).

from googlecast.

cncb-gh avatar cncb-gh commented on July 26, 2024

This keeps getting in the state where the following exception is thrown when IMediaChannel.GetStatusAsync() is called even after the connection is made and the media starts playing? Thanks for your help.

Value cannot be null.
Parameter name: MediaSessionId


  at GoogleCast.Channels.MediaChannel.SetMediaSessionId (GoogleCast.Messages.Media.MediaSessionMessage message) [0x00007] in <bd0bbdc0a0dc47da8839ff1a146a06c9>:0 
  at GoogleCast.Channels.MediaChannel+<SendAsync>d__6.MoveNext () [0x000bb] in <bd0bbdc0a0dc47da8839ff1a146a06c9>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <43dbbdc147f2482093d8409abb04c233>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <43dbbdc147f2482093d8409abb04c233>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <43dbbdc147f2482093d8409abb04c233>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0 
  at GoogleCast.Channels.MediaChannel+<GetStatusAsync>d__8.MoveNext () [0x00067] in <bd0bbdc0a0dc47da8839ff1a146a06c9>:0 

from googlecast.

kakone avatar kakone commented on July 26, 2024

Can you share a sample code, I don't reproduce the problem.
With the code in the README file, if I do mediaStatus = await mediaChannel.GetStatusAsync(); after the LoadAsync method, it works well.

from googlecast.

cncb-gh avatar cncb-gh commented on July 26, 2024

It appears that an uncaught exception in my StatusChanged event handler was causing this. Sorry about that.

It appears that every time that GetStatusAsync() is called it causes a StatusChanged event to be fired. Also, GetStatusAsync() seems to throw an exception when the player is IDLE. Is this to be expected? How does the IMediaChannel.Status property fit into this? Thanks again.

from googlecast.

kakone avatar kakone commented on July 26, 2024

OK, I see the problem. I'm going to correct it as soon as possible.

from googlecast.

kakone avatar kakone commented on July 26, 2024

It appears that every time that GetStatusAsync() is called it causes a StatusChanged event to be fired

Yes, when we received an updated status message, the Status property is updated, so the StatusChanged event is fired.

GetStatusAsync() seems to throw an exception when the player is IDLE

Fixed in version 1.6.6

from googlecast.

cncb-gh avatar cncb-gh commented on July 26, 2024

I upgraded to v1.6.6 and still seem to get this exception when calling IMediaChannel.GetStatusAsync() when no media is playing:

System.InvalidOperationException

Sequence contains no elements: at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010]

from googlecast.

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.