Jump to content

Using PlaybackInfo in a Plugin


roaku

Recommended Posts

roaku

I've got a plugin going that needs to be able to access mediastream info about each *version* of an Item.

I've found this endpoint that provides the data I need: /Items/[itemid]/PlaybackInfo

And I've loaded up the ApiClient in my C# project and am now working on actually retrieving API data from within the plugin.

My questions are:

  • Is making http requests to the API the only option from a Plugin context, or is there a native C# API to fetch the same data?
  • If making http is the only approach, is there an Emby class that can provide server context info like hostname or ip and port?

 

Thanks for taking a look.

Link to comment
Share on other sites

roaku

I have since discovered ILibraryManager and that Item has a GetMediaSources method built in.

 

This delivers the data I need natively:

item.GetMediaSources(true, false, _libraryManager.GetLibraryOptions(item));

 

Edited by roaku
Link to comment
Share on other sites

Hi, yes that's probably close enough to getting you what you want. That's what the /PlaybackInfo api uses.

Link to comment
Share on other sites

roaku

Ok thanks. Feel free to clue me in if there's some method argument tweaking or something I can do to get even closer to what PlaybackInfo is doing. :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...