https://github.com/stekel/kodi
Simple php class for interacting with a running Kodi instance
https://github.com/stekel/kodi
kodi laravel php
Last synced: 7 months ago
JSON representation
Simple php class for interacting with a running Kodi instance
- Host: GitHub
- URL: https://github.com/stekel/kodi
- Owner: stekel
- License: mit
- Created: 2018-02-19T17:13:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-26T13:25:34.000Z (over 4 years ago)
- Last Synced: 2024-12-11T03:53:55.507Z (about 1 year ago)
- Topics: kodi, laravel, php
- Language: PHP
- Size: 57.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Kodi
This package provides a simple api for interacting with a running Kodi instance using the Kodi jsonrpc api.
## Install
Via Composer
``` bash
$ composer require stekel/kodi
```
## Usage
### Laravel
``` php
use Kodi;
Kodi::player()->playPause(); // Play/Pause the currently playing media
```
### Manual
``` php
use stekel\Kodi\Kodi
$kodi = Kodi::connect('192.168.1.100', '8080', 'xbmc', 'xbmc');
$kodi->player()->playPause(); // Play/Pause the currently playing media
```
## Supported Functions
### Add-ons
| Function | Execution |
| -------- | --------- |
| Addons.GetAddons | `$kodi->addons()->getAddons();` |
| Addons.ExecuteAddon : script.playrandomvideos | `$kodi->addons()->playRandom($model)`
$model can be a `TvShow` or `Song` |
### Gui
| Function | Execution |
| -------- | --------- |
| GUI.ShowNotification | `$kodi->gui()->showNotification($title, $message);` |
### Player
| Function | Execution |
| -------- | --------- |
| Player.GetActivePlayers | `$kodi->player()->getActivePlayers();` |
| Player.Open | `$kodi->player()->open($model);`
$model can be an `Episode` or `Song` |
| Player.PlayPause | `$kodi->player()->playPause();` |
| Player.Stop | `$kodi->player()->stop();` |
| Player.GetItem | `$kodi->player()->getItem();`
Returns either an `Episode` or `Song` |
### Video Library
| Function | Execution |
| -------- | --------- |
| VideoLibrary.GetTVShows | `$kodi->videoLibrary()->getTvShows();` |
| VideoLibrary.GetTVShowDetails | `$kodi->videoLibrary()->getTVShowDetails(TvShow $tvshow);` |
| VideoLibrary.GetEpisodes | `$kodi->videoLibrary()->getEpisodes($tvShowId);` |
| VideoLibrary.GetRecentlyAddedEpisodes | `$kodi->videoLibrary()->recentlyAddedEpisodes($limit=3);` |
| VideoLibrary.Clean | `$kodi->videoLibrary()->clean();` |