nxenos83 52 Posted February 15, 2017 Share Posted February 15, 2017 What's the difference between the two? Is there a reason that the MediaInfo is available in the PlaybackProgressEventArgs, but not the ItemChangeEvenetArgs? Link to comment Share on other sites More sharing options...
Luke 37272 Posted February 16, 2017 Share Posted February 16, 2017 hi @@nxenos83. In ItemChangeArgs you have the full library item. PlaybackProgressEventArgs also contains the full library item using the Item property. However, if an app wanted to report that it was playing something not contained in the emby library, then of course Item would be null and instead you'd have MediaInfo, which would just be things like title, etc. Link to comment Share on other sites More sharing options...
nxenos83 52 Posted February 16, 2017 Author Share Posted February 16, 2017 thanks @@Luke, Is there a way to get a MediaInfo object from a library item during the ItemAdded event? I poked around the code but only found BaseItemInfo type referenced in session manger. If I'm trying to take action when an episode is added, should I just use Item.GetContentTyp() to determine what type of item is being added? Link to comment Share on other sites More sharing options...
Luke 37272 Posted February 16, 2017 Share Posted February 16, 2017 what you can do is try to cast it to an Audio or Video object. Those classes will have some light media info characteristics designed for display. If that is not enough then you can call Audio/Video .GetMediaStreams(), but that is a separate db query so use only if needed. thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now