### Example Session Object Source: https://dev.emby.media/doc/restapi/Remote-Control.html This is an example of a session object returned when querying for controllable sessions. It includes details about the client, user, and currently playing media. ```json { "SupportedCommands": [ "MoveUp", "MoveDown", "MoveLeft", "MoveRight", "PageUp", "PageDown", "PreviousLetter", "NextLetter", "ToggleOsdMenu", "ToggleContextMenu", "Select", "Back", "TakeScreenshot", "SendKey", "SendString", "GoHome", "GoToSettings", "VolumeUp", "VolumeDown", "Mute", "Unmute", "ToggleMute", "SetVolume", "SetAudioStreamIndex", "SetSubtitleStreamIndex", "ToggleFullscreen", "DisplayContent", "GoToSearch", "DisplayMessage", "Guide" ], "RemoteEndPoint": "192.168.1.4", "QueueableMediaTypes": [ "Video" ], "PlayableMediaTypes": [ "Audio", "Video", "Game", "Photo", "Book" ], "Id": "4de66e1e6b8a4cae89542dc6f7ee7623", "UserId": "e8837bc1ad67520e8cd2f629e3155721", "UserPrimaryImageTag": "605eed331af1e1a8770643ee6fd1c2b9", "UserName": "John", "AdditionalUsers": [], "ApplicationVersion": "3.0.5243.22734", "Client": "Emby Theater", "LastActivityDate": "2014-05-15T09:52:52.5898360Z", "NowViewingItem": { "Name": "Partridge", "Id": "0f8d0805a66f7ed429ecd8890146c7c3", "Type": "Episode", "MediaType": "Video", "RunTimeTicks": 12882240000, "PrimaryImageTag": "d7c02f11a99ba4b7381e86bb602596c1", "PrimaryImageItemId": "0f8d0805a66f7ed429ecd8890146c7c3", "LogoImageTag": "108e85fbb573fc406652374b785ec6be", "LogoItemId": "09bed955402d0bf2d59c2e9cee67beed", "ThumbImageTag": "01760cf565aaba7cd9ac5350bb46383b", "ThumbItemId": "09bed955402d0bf2d59c2e9cee67beed", "BackdropImageTag": "a6aeacb6a86f13e8c6a582ebf03b3f2a", "BackdropItemId": "09bed955402d0bf2d59c2e9cee67beed", "PremiereDate": "2013-04-04T04:00:00.0000000Z", "ProductionYear": 2013, "IndexNumber": 17, "ParentIndexNumber": 5, "SeriesName": "Parks and Recreation", "Artists": [], "MediaStreams": [], "Chapters": [] }, "DeviceName": "LIVINGROOM-PC", "DeviceId": "LIVINGROOM-PC", "PlayState": { "CanSeek": false, "IsPaused": false, "IsMuted": false } } ``` -------------------------------- ### Basic API Endpoint Example Source: https://dev.emby.media/doc/plugins/dev/Creating-Api-Endpoints.html This example shows how to create a simple API endpoint using the Route attribute for defining the URL and HTTP method, and implementing IService to handle requests. ```APIDOC ## GET /Weather ### Description Gets weather information for a given location. ### Method GET ### Endpoint /Weather ### Parameters #### Query Parameters - **Location** (string) - Required - The location for which to retrieve weather information. ### Request Example ``` GET /Weather?Location=London ``` ### Response #### Success Response (200) - **WeatherInfo** - An object describing the weather information. #### Response Example ```json { "example": "WeatherInfo object" } ``` ``` -------------------------------- ### Playback Started Source: https://dev.emby.media/doc/restapi/Playback-Check-ins.html Reports that media playback has started. This updates the server dashboard to show the currently playing item. ```APIDOC ## Playback Started ### Description To let the server know playback started, make an HTTP POST call to **/Sessions/Playing**. ### Method POST ### Endpoint /Sessions/Playing ### Request Body - **QueueableMediaTypes** (Array[string]) - Required - Accepted values: Audio, Video - **CanSeek** (boolean) - Required - **ItemId** (string) or **Item** (object) - Required - Use ItemId for library items, or Item object for external content. - **MediaSourceId** (string) - Required - **AudioStreamIndex** (int) - Optional - **SubtitleStreamIndex** (int) - Optional - **IsPaused** (boolean) - Required - **IsMuted** (boolean) - Required - **PositionTicks** (long) - Optional - **VolumeLevel** (int) - Optional (0-100) - **PlayMethod** (string) - Required - Accepted values: 'Transcode', 'DirectStream', 'DirectPlay' - **PlaySessionId** (string) - Required - **LiveStreamId** (string) - Required - **PlaylistIndex** (int) - Required - **PlaylistLength** (int) - Required - **SubtitleOffset** (float) - Required - **PlaybackRate** (float) - Required ### Item Object Properties (if ItemId is not used) - **Name** (string) - Required - **MediaType** (string) - Required - Accepted values: Audio, Video, Book, Game - **Type** (string) - Required - Accepted values: Movie, Episode, Trailer, Video, Audio, Book, Game - **RunTimeTicks** (long) - Optional - **PremiereDate** (Date) - Optional - **ProductionYear** (int) - Optional - **IndexNumber** (int) - Optional - **IndexNumberEnd** (int) - Optional - **ParentIndexNumber** (int) - Optional - **SeriesName** (string) - Optional - **Album** (string) - Optional - **Artists** (Array[string]) - Optional ### Request Example ```json { "QueueableMediaTypes": ["Video"], "CanSeek": true, "ItemId": "some-item-id", "MediaSourceId": "some-media-source-id", "IsPaused": false, "IsMuted": false, "PlayMethod": "DirectPlay", "PlaySessionId": "some-play-session-id", "LiveStreamId": "some-live-stream-id", "PlaylistIndex": 0, "PlaylistLength": 1, "SubtitleOffset": 0.0, "PlaybackRate": 1.0 } ``` ### Response (No specific response details provided in the source) ``` -------------------------------- ### Example - Show latest movies Source: https://dev.emby.media/doc/restapi/Latest-Items.html Demonstrates how to retrieve the latest 20 unplayed movies. ```APIDOC ## Example - Show latest movies This will display the latest 20 unplayed movies: ``` /Users/{UserId}/Items/Latest?IncludeItemTypes=Movie&Limit=20&IsPlayed=false ``` ``` -------------------------------- ### Example - Show latest episodes (with grouping) Source: https://dev.emby.media/doc/restapi/Latest-Items.html Demonstrates how to retrieve the latest 20 unplayed episodes, with grouping enabled. ```APIDOC ## Example - Show latest episodes (with grouping) This will display the latest 20 unplayed episodes: ``` /Users/{UserId}/Items/Latest?IncludeItemTypes=Episode&Limit=20&IsPlayed=false&GroupItems=true ``` ``` -------------------------------- ### EditableObjectCollection Example Source: https://dev.emby.media/doc/plugins/ui/features/nesting.html Demonstrates using EditableObjectCollection to create a dynamic number of child options, where members can be of different types. ```csharp [DisplayName("Collection of 3 Child Options")] public EditableObjectCollection Collection { get; set; } = new EditableObjectCollection { new ChildOptionExample(), new ChildOptionExample(), new ChildOptionExample(), }; ``` -------------------------------- ### Example - Show latest episodes for a specific series Source: https://dev.emby.media/doc/restapi/Latest-Items.html Demonstrates how to retrieve the latest 4 unplayed episodes for a specific series, with grouping disabled. ```APIDOC ## Example - Show latest episodes (with grouping) The result will then be a list of Series groupings. Now suppose the user clicks a Series in order to see the 4 episodes behind the grouping. This is achieved via: ``` /Users/{UserId}/Items/Latest?Limit=4&IsPlayed=false&GroupItems=false&ParentId={SeriesId} ``` ``` -------------------------------- ### Universal Audio API Endpoint Example Source: https://dev.emby.media/doc/restapi/Audio-Streaming.html Use this URL to stream audio, specifying supported formats and transcoding options. The server determines whether to direct play or transcode based on client capabilities and parameters. ```url /Audio/{Id}/universal?UserId=xxx&DeviceId=xxx&MaxStreamingBitrate=140000000&Container=opus,mp3,aac,m4a,flac,webma,webm,wav,ogg,aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac,m4a&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&MaxSampleRate=48000&PlaySessionId=1496213367201 ``` -------------------------------- ### Multiple sort orders for library items Source: https://dev.emby.media/doc/restapi/Browsing-the-Library.html Demonstrates how to apply multiple, potentially mixed-order, sort criteria to library items. This example sorts albums by release date descending, then by sort name ascending. ```http SortBy=ProductionYear,PremiereDate,SortName&SortOrder=Descending,Descending,Ascending ``` -------------------------------- ### Get List of Servers Source: https://dev.emby.media/doc/restapi/Emby-Connect.html Retrieves a list of Emby servers associated with a user's Connect account. ```APIDOC ## Get a list of servers for a user ### Description Send a GET request to `https://connect.emby.media/service/servers` to retrieve a list of servers linked to a user's Emby Connect account. ### Method GET ### Endpoint `https://connect.emby.media/service/servers` ### Query Parameters - `userId` (string) - Required - The `ConnectUserId` obtained from the authentication. ### Headers - `X-Application`: `AppName/AppVersion` - `X-Connect-UserToken`: The `ConnectAccessToken` obtained from authentication. ### Response #### Success Response (200) An array of server objects, each containing: - `AccessKey` (string) - The access key for the server. - `SystemId` (string) - The unique system ID of the server. - `Name` (string) - The name of the server. - `Url` (string) - The remote access URL for the server. - `LocalAddress` (string) - The local access URL for the server. ### Response Example ```json [ { "AccessKey": "someAccessKey", "SystemId": "someSystemId", "Name": "My Server", "Url": "https://my.server.com", "LocalAddress": "http://192.168.1.100:8096" } ] ``` ``` -------------------------------- ### Create a Basic API Endpoint Service Source: https://dev.emby.media/doc/plugins/dev/Creating-Api-Endpoints.html Defines a GET API endpoint for weather information. Includes the request DTO and the service implementation. ```csharp [Route("/Weather", "GET")] [Api(Description = "Gets weather information for a given location")] public class GetWeather : IReturn { public string Location { get; set; } } public class WeatherService : IService { public object Get(GetWeather request) { var result = GetWeatherInfo(); return result; } } ``` -------------------------------- ### Get Programs Source: https://dev.emby.media/doc/restapi/Live-TV.html Query for program (EPG) data. Useful properties include Name, EpisodeTitle, StartDate, and EndDate. ```APIDOC ## GET /LiveTv/Programs ### Description Queries for program (EPG) data. This endpoint allows filtering by various criteria and retrieving detailed program information. ### Method GET ### Endpoint /LiveTv/Programs ### Query Parameters - **channelId** (string) - Optional. Filter programs by Channel ID. - **seriesId** (string) - Optional. Filter programs by Series ID. - **startTimeAfter** (string) - Optional. Filter programs starting after a specific date-time (ISO 8601 format). - **startTimeBefore** (string) - Optional. Filter programs starting before a specific date-time (ISO 8601 format). - **endTimeBefore** (string) - Optional. Filter programs ending before a specific date-time (ISO 8601 format). - **isMovie** (boolean) - Optional. Filter for movies. - **isSports** (boolean) - Optional. Filter for sports programs. - **isNews** (boolean) - Optional. Filter for news programs. - **isKids** (boolean) - Optional. Filter for kids programs. - **isSeries** (boolean) - Optional. Filter for series. - **maxOfficialRating** (string) - Optional. Filter by maximum official rating. - **hasAction** (boolean) - Optional. Filter for programs with action. - **hasComedy** (boolean) - Optional. Filter for programs with comedy. - **hasDrama** (boolean) - Optional. Filter for programs with drama. - **hasRomance** (boolean) - Optional. Filter for programs with romance. - **hasSciFi** (boolean) - Optional. Filter for programs with sci-fi. - **hasChildrens** (boolean) - Optional. Filter for programs with children's content. - **hasSuspense** (boolean) - Optional. Filter for programs with suspense. - **hasFantasy** (boolean) - Optional. Filter for programs with fantasy. - **enableImageCache** (boolean) - Optional. Whether to include cached image URLs. - **imageUrlQuality** (integer) - Optional. Desired quality for image URLs. - **enableImages** (boolean) - Optional. Whether to include images. - **enableUserData** (boolean) - Optional. Whether to include user data. - **userId** (string) - Optional. The ID of the user to retrieve data for. - **limit** (integer) - Optional. The maximum number of programs to return. - **offset** (integer) - Optional. The number of programs to skip. - **sortBy** (string) - Optional. Property to sort programs by (e.g., 'Name', 'StartDate'). - **sortOrder** (string) - Optional. Order of sorting ('Ascending', 'Descending'). - **startIndex** (integer) - Optional. The starting index for pagination. ### Response #### Success Response (200) - **Programs** (array of objects) - **Name** (string) - The name of the series or program. - **EpisodeTitle** (string) - The title of the specific episode (if applicable). - **OfficialRating** (string) - The official rating of the program. - **RunTimeTicks** (integer) - The duration of the program in ticks. - **StartDate** (string) - The start date and time of the program (ISO 8601 format). - **EndDate** (string) - The end date and time of the program (ISO 8601 format). - **IsMovie** (boolean) - True if the program is a movie. - **IsSports** (boolean) - True if the program is sports. - **IsNews** (boolean) - True if the program is news. - **IsKids** (boolean) - True if the program is for kids. - **IsSeries** (boolean) - True if the program is part of a series. - **ChannelId** (string) - The ID of the channel the program airs on. - **Id** (string) - The unique identifier for the program. ``` -------------------------------- ### Live TV Info Source: https://dev.emby.media/doc/restapi/Live-TV.html Retrieve general information about the Live TV service, including its installation status and enabled users. ```APIDOC ## GET /LiveTv/Info ### Description Retrieves information about the Live TV service, such as whether it is installed and enabled, and which users have access. ### Method GET ### Endpoint /LiveTv/Info ### Response #### Success Response (200) - **IsEnabled** (boolean) - Indicates if Live TV is installed and enabled on the server. - **EnabledUsers** (array of string) - A list of user IDs that have access to Live TV. ``` -------------------------------- ### Set Display Name and Description Attributes Source: https://dev.emby.media/doc/plugins/ui/features/basics.html Use DisplayNameAttribute and DescriptionAttribute to set custom names and descriptions for properties. This example shows how to apply these attributes to a string property. ```csharp [DisplayName("Name of the Demo")] [Description("Most items can have a display name and a description. This is the description text.")] public string DemoName { get; set; } = "GenericEdit Demo"; ``` -------------------------------- ### Get Default Timer Settings Source: https://dev.emby.media/doc/restapi/Live-TV.html Retrieve default timer settings, which can be used as a base for creating new timers. ```APIDOC ## GET /LiveTv/Timers/Defaults ### Description Retrieves default timer settings. This is useful for populating default times and padding values when scheduling a new timer. ### Method GET ### Endpoint /LiveTv/Timers/Defaults ### Query Parameters - **programId** (string) - Optional - If provided, the defaults will be tailored for this specific program. ### Response #### Success Response (200) - **PreBufferSeconds** (integer) - Default padding in seconds before the recording starts. - **PostBufferSeconds** (integer) - Default padding in seconds after the recording ends. - **StartDate** (string) - Default start date and time (ISO 8601 format). - **EndDate** (string) - Default end date and time (ISO 8601 format). - **Name** (string) - Default name for the timer. ``` -------------------------------- ### Get Channels Source: https://dev.emby.media/doc/restapi/Live-TV.html Query for available TV channels. Key properties include Name, Number, ChannelType, and CurrentProgram. ```APIDOC ## GET /LiveTv/Channels ### Description Queries for available TV channels. You can optionally request current program information for each channel. ### Method GET ### Endpoint /LiveTv/Channels ### Query Parameters - **isTunerRequired** (boolean) - Optional. Filter channels that require a tuner. - **type** (string) - Optional. Filter channels by type (e.g., 'tv', 'radio'). - **enableImageCache** (boolean) - Optional. Whether to include cached image URLs. - **imageUrlQuality** (integer) - Optional. Desired quality for image URLs. - **enableImages** (boolean) - Optional. Whether to include images. - **enableUserData** (boolean) - Optional. Whether to include user data like favorites. - **userId** (string) - Optional. The ID of the user to retrieve data for. - **limit** (integer) - Optional. The maximum number of channels to return. - **offset** (integer) - Optional. The number of channels to skip. - **sortBy** (string) - Optional. Property to sort channels by (e.g., 'Name', 'Number'). - **sortOrder** (string) - Optional. Order of sorting ('Ascending', 'Descending'). - **startIndex** (integer) - Optional. The starting index for pagination. ### Response #### Success Response (200) - **Channels** (array of objects) - **Name** (string) - The name of the channel. - **Number** (string) - The channel number. - **ChannelType** (string) - The type of the channel (e.g., 'tv', 'radio'). - **CurrentProgram** (object) - Information about the program currently airing on the channel (if requested). - **Id** (string) - The unique identifier for the channel. - **Images** (object) - Image URLs for the channel. - **UserData** (object) - User-specific data for the channel (e.g., IsFavorite). ``` -------------------------------- ### Compound Object Property Example Source: https://dev.emby.media/doc/plugins/ui/features/nesting.html Demonstrates using a regular class as an editable property. It's recommended to use classes derived from EditableOptionsBase for nesting. ```csharp [DisplayName("Compound Object Property")] [Description("This demonstrates the use of an existing plain regular class as editable property, even though " + "it is recommended to use classes derived from EditableOptionsBase for nesting.")] public ImageOption LimitedString { get; set; } = new ImageOption(); ``` -------------------------------- ### Get User Servers via Emby Connect Source: https://dev.emby.media/doc/restapi/Emby-Connect.html Retrieve a list of servers associated with a ConnectUserId. The 'X-Connect-UserToken' header must contain the ConnectUserToken value obtained during authentication. ```http GET https://connect.emby.media/service/servers?userId={ConnectUserId} Headers: X-Application: AppName/AppVersion X-Connect-UserToken: {ConnectUserToken} ``` -------------------------------- ### Double Input Source: https://dev.emby.media/doc/plugins/ui/features/basics.html Float and double values are displayed with 6 digits by default. This example shows a standard double property. ```csharp [DisplayName("Double Value")] [Description("Float and double values are shown with 6 digits by default")] public double DoubleValue { get; set; } = 3.141592; ``` -------------------------------- ### Basic Text Input Source: https://dev.emby.media/doc/plugins/ui/features/basics.html A simple string property will generate a basic text input field. This example shows a string property with a DisplayName attribute. ```csharp [DisplayName("Name of the Demo")] public string DemoName { get; set; } ``` -------------------------------- ### Sort library items by Artist and Album Source: https://dev.emby.media/doc/restapi/Browsing-the-Library.html Use the SortBy and SortOrder parameters to specify multiple sorting criteria for library items. This example sorts by Artist, then Album, in ascending order. ```http http://localhost:8096/emby/Users/e8837bc1ad67520e8cd2f629e3155721/Items?ParentId=20aef3be-ebda-f0d4-0096-8d179783e918&SortBy=Artist,Album&SortOrder=Ascending ``` -------------------------------- ### Create Custom Select List Source: https://dev.emby.media/doc/plugins/ui/features/selection.html Generate a list of EditorSelectOption items to populate a custom selection input. This example demonstrates creating a list of dates with specific options for enabling/disabling and tooltips. ```csharp public CreateSelectList() { var list = new List(); var date = DateTime.Now.Date; for (int i = 0; i < 30; i++) { list.Add( new EditorSelectOption { Value = date.ToString("O").Substring(0, 10), Name = date.ToString("D"), ShortName = date.ToString("ddd, d"), IsEnabled = date.DayOfWeek != DayOfWeek.Saturday && date.DayOfWeek != DayOfWeek.Sunday, ToolTip = "This is a tooltip: " + date.ToLongDateString(), Color = date.DayOfWeek == DayOfWeek.Sunday ? "red" : null, }); date = date.AddDays(1); } this.DatesList = list; } ``` -------------------------------- ### Double Input with Controlled Decimals Source: https://dev.emby.media/doc/plugins/ui/features/basics.html Control the number of displayed decimals for double values using the DecimalsAttribute. This example sets the display to 2 decimal places. ```csharp [DisplayName("Double Value with 2 Decimals")] [Decimals(2)] [Description("The number of decimals can be controlled through the DecimalsAttribute.")] public double DoubleValue2 { get; set; } = 3.1; ``` -------------------------------- ### Play Command Data Structure Source: https://dev.emby.media/doc/restapi/Web-Socket.html When a 'Play' message is received, the Data property will contain this JSON object. It specifies the items to play, the playback command, and optional parameters like start position and media source details. ```json { * ItemIds - an array of item id's to play * PlayCommand - PlayNow, PlayNext or PlayLast * StartPositionTicks - If supplied, this is the position in which the first title should start at. * MediaSourceId - If supplied, this is the media source that should be used for the first item * AudioStreamIndex - If supplied, this is the audio stream that should be used for the first item * SubtitleStreamIndex - If supplied, this is the subtitle stream that should be used for the first item * StartIndex - If supplied, and if playing a list of items, this is the index of the first item that should be played. } ``` -------------------------------- ### Get Timer by ID Source: https://dev.emby.media/doc/restapi/Live-TV.html Retrieve a single timer by its unique ID. ```APIDOC ## GET /LiveTv/Timers/{Id} ### Description Retrieves a specific recording timer using its unique ID. ### Method GET ### Endpoint /LiveTv/Timers/{Id} ### Parameters #### Path Parameters - **Id** (string) - Required - The unique identifier of the timer to retrieve. ### Response #### Success Response (200) - **Id** (string) - The unique identifier for the timer. - **ProgramInfo** (object) - Information about the program being recorded. May be null. - **Name** (string) - The name of the program/series. - **EpisodeTitle** (string) - The title of the episode. - **Id** (string) - The program ID. - **Images** (object) - Image URLs for the program. ``` -------------------------------- ### Get Timers Source: https://dev.emby.media/doc/restapi/Live-TV.html Query for scheduled recordings (timers). Timers can be filtered by ChannelId or SeriesTimerId. ```APIDOC ## GET /LiveTv/Timers ### Description Retrieves a list of scheduled recording timers. Timers can be filtered by channel or series timer ID. ### Method GET ### Endpoint /LiveTv/Timers ### Query Parameters - **channelId** (string) - Optional. Filter timers by Channel ID. - **seriesTimerId** (string) - Optional. Filter timers by Series Timer ID. - **userId** (string) - Optional. The ID of the user to retrieve timers for. - **enablePaging** (boolean) - Optional. Whether to enable pagination. - **limit** (integer) - Optional. The maximum number of timers to return. - **offset** (integer) - Optional. The number of timers to skip. - **sortBy** (string) - Optional. Property to sort timers by (e.g., 'Name', 'StartDate'). - **sortOrder** (string) - Optional. Order of sorting ('Ascending', 'Descending'). - **startIndex** (integer) - Optional. The starting index for pagination. ### Response #### Success Response (200) - **Timers** (array of objects) - **Id** (string) - The unique identifier for the timer. - **ProgramInfo** (object) - Information about the program being recorded. May be null. - **Name** (string) - The name of the program/series. - **EpisodeTitle** (string) - The title of the episode. - **Id** (string) - The program ID. - **Images** (object) - Image URLs for the program. ``` -------------------------------- ### Playback Stopped Source: https://dev.emby.media/doc/restapi/Playback-Check-ins.html Reports that media playback has stopped. The request body is identical to the playback started message. ```APIDOC ## Playback Stopped ### Description Once playback is stopped, make an HTTP POST call to **/Sessions/Playing/Stopped**. ### Method POST ### Endpoint /Sessions/Playing/Stopped ### Request Body The contents of the request are identical to the playback start message. - **QueueableMediaTypes** (Array[string]) - Required - Accepted values: Audio, Video - **CanSeek** (boolean) - Required - **ItemId** (string) or **Item** (object) - Required - Use ItemId for library items, or Item object for external content. - **MediaSourceId** (string) - Required - **AudioStreamIndex** (int) - Optional - **SubtitleStreamIndex** (int) - Optional - **IsPaused** (boolean) - Required - **IsMuted** (boolean) - Required - **PositionTicks** (long) - Optional - **VolumeLevel** (int) - Optional (0-100) - **PlayMethod** (string) - Required - Accepted values: 'Transcode', 'DirectStream', 'DirectPlay' - **PlaySessionId** (string) - Required - **LiveStreamId** (string) - Required - **PlaylistIndex** (int) - Required - **PlaylistLength** (int) - Required - **SubtitleOffset** (float) - Required - **PlaybackRate** (float) - Required ### Request Example ```json { "QueueableMediaTypes": ["Video"], "CanSeek": true, "ItemId": "some-item-id", "MediaSourceId": "some-media-source-id", "IsPaused": false, "IsMuted": false, "PlayMethod": "DirectPlay", "PlaySessionId": "some-play-session-id", "LiveStreamId": "some-live-stream-id", "PlaylistIndex": 0, "PlaylistLength": 1, "SubtitleOffset": 0.0, "PlaybackRate": 1.0 } ``` ### Response (No specific response details provided in the source) ``` -------------------------------- ### Multiple Usages of Child Class Source: https://dev.emby.media/doc/plugins/ui/features/nesting.html Shows how to use the defined ChildOptionExample class as properties multiple times within another class, allowing for repeated entry or reuse of option patterns. ```csharp [DisplayName("File Import 1")] public ChildOptionExample ChildOption1 { get; set; } = new ChildOptionExample(); [DisplayName("File Import 2")] public ChildOptionExample ChildOption2 { get; set; } = new ChildOptionExample(); ``` -------------------------------- ### Get Public Users Source: https://dev.emby.media/doc/restapi/User-Authentication.html Retrieve a list of public users from the server, which can be displayed on a visual login screen. ```APIDOC ## Get Public Users Make a call to **/Users/Public** to get all public users. Public users are users that the server admin has allowed to be displayed visually on the login screen. This can be managed by the server administrator by editing user permissions for each user. If there are records returned, the app has the option of displaying the users in a visual login screen. This is up to the application developer to decide. If there are no records returned then present a username/password text entry form. For each user, if PrimaryImageTag has a value, that indicates the user has an image. The image can then be downloaded using **/Users/{Id}/Images/{Type}**. Each user has a HasPassword property. This is used to determine if the user should be prompted to input a password. The application must authenticate regardless of this value. ``` -------------------------------- ### DisplayContent Command Arguments Source: https://dev.emby.media/doc/restapi/Web-Socket.html Use this command to display specific content. The 'Arguments' property should include the item's name, ID, and type. ```text DisplayContent (Arguments: ItemName, ItemId, ItemType) ``` -------------------------------- ### Get Series Timers Source: https://dev.emby.media/doc/restapi/Live-TV.html Query for series timers, which represent scheduled sequences of recordings. Can be sorted by Name or Priority. ```APIDOC ## GET /LiveTv/SeriesTimers ### Description Retrieves a list of series timers, which manage scheduled recordings for entire series. ### Method GET ### Endpoint /LiveTv/SeriesTimers ### Query Parameters - **userId** (string) - Optional. The ID of the user to retrieve series timers for. - **enablePaging** (boolean) - Optional. Whether to enable pagination. - **limit** (integer) - Optional. The maximum number of series timers to return. - **offset** (integer) - Optional. The number of series timers to skip. - **sortBy** (string) - Optional. Property to sort series timers by (e.g., 'Name', 'Priority'). - **sortOrder** (string) - Optional. Order of sorting ('Ascending', 'Descending'). - **startIndex** (integer) - Optional. The starting index for pagination. ### Response #### Success Response (200) - **SeriesTimers** (array of objects) - **Id** (string) - The unique identifier for the series timer. - **Name** (string) - The name of the series. - **Priority** (integer) - The priority of the series timer. - **RecordAnyChannel** (boolean) - Whether to record on any available channel for the series. ``` -------------------------------- ### Creating Playlists Source: https://dev.emby.media/doc/restapi/Playlists.html Allows for the creation of new playlists. You can specify the media type and the IDs of items to include. ```APIDOC ## Creating Playlists ### Description Creates a new playlist for a user. ### Method POST ### Endpoint /Playlists ### Parameters #### Query Parameters - **UserId** (string) - Required - The ID of the user for whom the playlist is created. - **Name** (string) - Required - The name of the playlist. - **MediaType** (string) - Optional - The type of media in the playlist (Audio/Video). Can be omitted if Ids are provided. - **Ids** (string) - Optional - A comma-delimited list of item IDs to add to the playlist. If provided, MediaType can be omitted. ### Request Example POST /Playlists?UserId=xxx&Name=xxx&MediaType=Video&Ids=1,2,3 ``` -------------------------------- ### Play Command API Source: https://dev.emby.media/doc/restapi/Remote-Control.html Use this endpoint to instruct a client to play media. Specify item IDs, play command, and optional playback parameters. ```http POST /Sessions/{Id}/Playing Content-Type: application/json { "ItemIds": "comma-delimited-list-of-item-ids", "PlayCommand": "PlayNow | PlayNext | PlayLast", "StartPositionTicks": 0, "MediaSourceId": "media-source-id", "AudioStreamIndex": 0, "SubtitleStreamIndex": 0, "StartIndex": 0 } ``` -------------------------------- ### SetVolume Command Arguments Source: https://dev.emby.media/doc/restapi/Web-Socket.html This command allows setting the client's volume. The 'Arguments' property should be a number between 0 and 100. ```text SetVolume (Arguments: Volume 0-100 scale) ``` -------------------------------- ### Define Plugin Configuration Class Source: https://dev.emby.media/doc/plugins/ui/index.html Use this class to define the configuration options for your plugin. Attributes like DisplayName, Description, EditFolderPicker, Required, and LogSeverity help in generating the UI and validating input. ```csharp public class PluginConfig { public override string EditorTitle => "Plugin Options"; public override string EditorDescription => "This is a description text, shown at the top of the options page.\n" + "The options below are examples for creating UI elements."; [DisplayName("Output Folder")] [Description("Please choose a folder for plugin output")] [EditFolderPicker] public string TargetFolder { get; set; } [Description("The log level determines how messages will be logged")] public LogSeverity LogLevel { get; set; } [Description("This value is required and needs to have a minimum length of 10")] [Required] public string MessageFormat { get; set; } } ``` -------------------------------- ### SetPlaybackRate Command Arguments Source: https://dev.emby.media/doc/restapi/Web-Socket.html Allows adjusting the playback rate. The 'Arguments' property should be a floating-point value representing the desired rate. ```text SetPlaybackRate (Arguments: PlaybackRate - floating point playback rate value) ``` -------------------------------- ### Boolean Input as Checkbox Source: https://dev.emby.media/doc/plugins/ui/features/basics.html Boolean properties are rendered as checkboxes. This example shows a standard boolean property initialized to true. ```csharp [DisplayName("Boolean Value")] [Description("Boolean properties are rendered as checkboxes.")] public bool BooleanValue { get; set; } = true; ``` -------------------------------- ### Implement IRequiresRegistration Interface Source: https://dev.emby.media/doc/plugins/dev/Other-Interfaces.html Implement this interface on your server entry point or any other class that needs to validate registration information. This method should be implemented to load a MBRegistrationRecord by using the PluginSecurityManager.GetRegistrationStatus call with the feature id that is to be validated. You should always re-load the registration record whenever this method is invoked. ```csharp public async Task LoadRegistrationInfoAsync() { var reg = await PluginSecurityManager.GetRegistrationStatus("CoverArt4", "CoverArt3"); } ``` -------------------------------- ### Sending a play command Source: https://dev.emby.media/doc/restapi/Remote-Control.html Instruct a client to play media items. ```APIDOC ## POST /Sessions/{Id}/Playing ### Description Instruct a client to play something by posting to the following url. ### Method POST ### Endpoint /Sessions/{Id}/Playing ### Parameters #### Request Body - **ItemIds** (string) - Required - A comma-delimited list of item id's - **PlayCommand** (string) - Required - PlayNow, PlayNext or PlayLast - **StartPositionTicks** (integer) - Optional - If supplied, this is the position in which the first title should start at. - **MediaSourceId** (string) - Optional - If supplied, this is the media source that should be used for the first item - **AudioStreamIndex** (integer) - Optional - If supplied, this is the audio stream that should be used for the first item - **SubtitleStreamIndex** (integer) - Optional - If supplied, this is the subtitle stream that should be used for the first item - **StartIndex** (integer) - Optional - If supplied, and if playing a list of items, this is the index of the first item that should be played. Note: StartPositionTicks is ignored when PlayCommand is PlayNext or PlayLast. ``` -------------------------------- ### Get Latest Items Source: https://dev.emby.media/doc/restapi/Latest-Items.html Retrieves a list of the latest items for a user. Supports standard query parameters and a specific GroupItems parameter. ```APIDOC ## GET /Users/{UserId}/Items/Latest ### Description Retrieves a list of the latest items for a user. Supports standard query parameters and a specific GroupItems parameter. ### Method GET ### Endpoint /Users/{UserId}/Items/Latest ### Parameters #### Query Parameters - **StartIndex** (integer) - Optional - The starting index of the items to retrieve. - **Limit** (integer) - Optional - The maximum number of items to return. - **Fields** (string) - Optional - Specifies which fields to include in the response. - **ParentId** (string) - Optional - Filters items by their parent container. - **IsPlayed** (boolean) - Optional - Filters items based on their played status. - **IncludeItemTypes** (string) - Optional - Filters items by their type (e.g., Movie, Episode). - **GroupItems** (boolean) - Optional - If true, items from the same container will be grouped. Defaults to true. ### Response #### Success Response (200) - The response will contain a list of items, potentially grouped if `GroupItems` is true. The `ChildCount` property will indicate the group count for grouped items. #### Response Example ```json { "Items": [ { "Name": "Example Series", "Id": "series123", "Type": "Series", "ChildCount": 4 } ] } ``` ``` -------------------------------- ### Configure Debugging Executable Source: https://dev.emby.media/doc/plugins/dev/index.html Set up a new debugging profile in Visual Studio to launch Emby Server directly. This allows you to debug your plugin by attaching the Visual Studio debugger to the running Emby Server process. ```xml Executable: "C:\\Program Files\\Emby-Server\\EmbyServer.exe" Working Directory: "C:\\Program Files\\Emby-Server\\" Command line argument: -nointerface ``` -------------------------------- ### Create Radio Options List Source: https://dev.emby.media/doc/plugins/ui/features/radio.html Create a list of EditorRadioOption objects to populate a custom radio group. Each option can have a primary text, secondary text, and an enabled state. ```csharp public CreateList() { var radioList = new List(); radioList.Add(new EditorRadioOption { Value = 0, PrimaryText = "This is Option 1", SecondaryText = "What's special about radio options is that these can have a primary text " + "and a secondary text which can display the option in more detail", }); radioList.Add(new EditorRadioOption { Value = 1, PrimaryText = "This is another Option", SecondaryText = string.Concat(Enumerable.Repeat("This is a long text which spans over multiple lines. ", 5)), }); radioList.Add(new EditorRadioOption { Value = 0, PrimaryText = "This is a a third Option", SecondaryText = "But this option is disabled. It cannot be selected at this time for some reason", IsEnabled = false, }); this.RadioList = radioList; } ``` -------------------------------- ### Define Normal Get-Only Property Source: https://dev.emby.media/doc/plugins/ui/features/states.html Properties without a 'set' accessor are not rendered by default. This example defines a normal get-only string property. ```csharp [DisplayName("Name of the Demo - Normal")] [Description("This is the description.")] public string DemoName { get; } = "GenericEdit Demo"; ``` -------------------------------- ### Add Post-Build Copy Command Source: https://dev.emby.media/doc/plugins/dev/index.html Configure a post-build event in your project file to automatically copy the compiled plugin to the Emby Server plugins folder. This ensures the server always has the latest version of your plugin after a build. ```xml ``` -------------------------------- ### Get HLS Stream URL Source: https://dev.emby.media/doc/restapi/Http-Live-Streaming.html This endpoint provides the master playlist for HLS streaming of a video. It requires the video ID and other playback-related parameters. ```APIDOC ## GET /Videos/{Id}/master.m3u8 ### Description Provides the master HLS playlist for a video. ### Method GET ### Endpoint /Videos/{Id}/master.m3u8 ### Parameters #### Path Parameters - **Id** (string) - Required - The ID of the video. #### Query Parameters - **MediaSourceId** (string) - Required - The ID of the media source. - **DeviceId** (string) - Required - The ID of the device. - **AudioCodec** (string) - Optional - Desired audio codec. - **AudioBitrate** (integer) - Optional - Desired audio bitrate. - **MaxAudioChannels** (integer) - Optional - Maximum audio channels. - **AudioSampleRate** (integer) - Optional - Desired audio sample rate. - **VideoCodec** (string) - Optional - Desired video codec. - **VideoBitrate** (integer) - Optional - Desired video bitrate. - **MaxWidth** (integer) - Optional - Maximum video width. - **MaxHeight** (integer) - Optional - Maximum video height. - **Profile** (string) - Optional - H.264 profile. - **Level** (string) - Optional - H.264 level. - **AudioStreamIndex** (integer) - Optional - Index of the audio stream to use. - **SubtitleStreamIndex** (integer) - Optional - Index of the subtitle stream to use (if burning into video). ### Response #### Success Response (200) - The response will be an M3U8 playlist file. ``` -------------------------------- ### Basic Plugin Configuration Class Source: https://dev.emby.media/doc/plugins/ui/index.html A C# class representing plugin settings that can be serialized for saving or loading. This serves as the basis for the declarative UI. ```csharp public class PluginConfig { public string TargetFolder { get; set; } public LogSeverity LogLevel { get; set; } public string MessageFormat { get; set; } } ``` -------------------------------- ### Localize Attribute Strings with DescriptionL Source: https://dev.emby.media/doc/plugins/ui/localization.html To enable localization for attribute strings, append 'L' to the attribute name. Ensure a Resources.resx file exists with at least one string resource. ```csharp [DescriptionL("My description")] ``` -------------------------------- ### Query-based Views - Resumeable Items Source: https://dev.emby.media/doc/restapi/Browsing-the-Library.html Display resumeable items, limit the results, and sort by date played using query parameters like `Limit`, `Recursive`, `SortBy`, `SortOrder`, and `Filters`. ```APIDOC ## GET /Users/{UserId}/Items (Resumeable Items) ### Description Retrieves resumeable items, limited to a specified number and sorted by date played. ### Endpoint /Users/{UserId}/Items ### Query Parameters - **Limit** (integer) - Optional - The maximum number of results to return. - **Recursive** (boolean) - Optional - Set to true to search recursively through subfolders. - **SortBy** (string) - Optional - Field to sort by (e.g., DatePlayed). - **SortOrder** (string) - Optional - Order to sort in (e.g., Descending). - **Filters** (string) - Optional - Filter criteria (e.g., IsResumable). ``` -------------------------------- ### DisplayMessage Command Arguments Source: https://dev.emby.media/doc/restapi/Web-Socket.html This command displays a message to the user. Arguments include a header, text, and an optional timeout in milliseconds. If omitted, the message will be modal. ```text DisplayMessage (Arguments: Header, Text, TimeoutMs - if timeout is omitted, message should be modal) ``` -------------------------------- ### Define Normal and ReadOnly Properties Source: https://dev.emby.media/doc/plugins/ui/features/states.html Use the ReadOnly attribute to mark properties as non-editable. This example shows regular and read-only string and multiline text properties. ```csharp [DisplayName("Name of the Demo - Normal")] [Description("This is the description.")] public string DemoName { get; set; } = "GenericEdit Demo"; [DisplayName("Name of the Demo - ReadOnly")] [Description("This is the description.")] [ReadOnly(true)] public string DemoName1 { get; set; } = "GenericEdit Demo"; [DisplayName("Multiline Text - Normal")] [Description("This is the description.")] [EditMultiline(4)] public string MultilineText { get; set; } = string.Concat(Enumerable.Repeat("This is a long text which spans over multiple lines. ", 10)); [DisplayName("Multiline Text - ReadOnly")] [Description("This is the description.")] [EditMultiline(4)] [ReadOnly(true)] public string MultilineText1 { get; set; } = string.Concat(Enumerable.Repeat("This is a long text which spans over multiple lines. ", 10)); ```