Comments (7)
You need to call the IMediaChannel.GetStatusAsync()
method (only works in version 1.6.4).
from googlecast.
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.
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.
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.
OK, I see the problem. I'm going to correct it as soon as possible.
from googlecast.
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.
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)
- Serialization.InvalidDataContractException for GenericMediaMetadata HOT 1
- Cannot set metadata HOT 2
- Sender.Disconnected event not fired as expected HOT 1
- Setting volume and custom name+logo for receiver? HOT 5
- Provide an ID along with FriendlyName? HOT 3
- Way to control queue after it has been loaded? HOT 4
- DeviceLocator not finding any casting devices HOT 2
- Cast webpage, youtube HOT 3
- How to send Webpage URL to Chromecast HOT 1
- [Feature] Scan from specific IP address HOT 3
- Cast local file HOT 2
- Problem when loading .srt subtitles HOT 1
- Streaming audio on the fly
- Just update something?
- Only Sender ?
- iOS 14 not finding any cast receivers HOT 1
- Set NetworkInterface for FindReceiversContinuous
- didn't connected to Chrome in ios release mode but working fine in debug mode HOT 3
- Can I use custom reciever too? HOT 1
- Any way to send regular string messages?
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 googlecast.