-
Notifications
You must be signed in to change notification settings - Fork 298
docs and support for player and library events #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/library-and-player-resources
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## event response Object | ||
|
|
||
| Used as a response for [`definePlayerHandler`](../requests/definePlayerHandler.md) and [`defineLibraryHandler`](../requests/defineLibraryHandler.md) | ||
|
|
||
| ``success`` - **required** - bool, either true or false, representing if the handling of the event was successful or not. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ This allows Stremio or other similar applications to aggregate content seamlessl | |
|
|
||
| To define a minimal addon, you only need an HTTP server/endpoint serving a `/manifest.json` file and responding to resource requests at `/{resource}/{type}/{id}.json`. | ||
|
|
||
| Currently used resources are: `catalog`, `meta`, `stream`, `subtitles`, `watchStatus`. | ||
| Currently used resources are: `catalog`, `meta`, `stream`, `subtitles`, `player`, `library`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| `/catalog/{type}/{id}.json` - catalogs of media items; `type` denotes the type, such as `movie`, `series`, `channel`, `tv`, and `id` denotes the catalog ID, which is custom and specified in your manifest, `id` is required as an addon can hold multiple catalogs | ||
|
|
||
|
|
@@ -21,14 +21,24 @@ Currently used resources are: `catalog`, `meta`, `stream`, `subtitles`, `watchSt | |
|
|
||
| `/subtitles/{type}/{id}.json` - list of all subtitles for a particular item; `type` again denotes the type, the `id` in this case is the Open Subtitles file hash, while `extraArgs` (read below) is used for `videoID` (the ID of the particular item, as found in the catalog or a video ID) and `videoSize` (video file size in bytes) | ||
|
|
||
| `/player/{type}/{id}/{extraArgs}.json` - TODO | ||
| the `player` and `library` resources are events. in other resources the addon is supposed to provide data. but in event resources the addon recieves data and is expected to process that given data then respond with the success or failure of that processing. | ||
|
|
||
| `/player/{type}/{videoID}/{extraArgs}.json` - a player event; `type` again denotes the type, and `videoID` is the video ID | ||
|
|
||
| Where `extraArgs` can be one of: | ||
| - Play: `action=play¤tTime={milliseconds}&duration={milliseconds}` | ||
| - Start: `action=start¤tTime={milliseconds}&duration={milliseconds}` | ||
| - End: `action=end¤tTime={milliseconds}&duration={milliseconds}` | ||
| - Pause: `action=pause¤tTime={milliseconds}&duration={milliseconds}` | ||
|
Comment on lines
29
to
32
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| `/library/{type}/{id}/{extraArgs}.json` - a library event; `type` again denotes the type, and `id` is the ID of the particular item | ||
|
|
||
| Where `extraArgs` can be one of: | ||
| - Add to library: `action=libraryAdd` | ||
| - Remove from library: `action=libraryRemove` | ||
|
Comment on lines
+37
to
+38
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to rename these to |
||
| - Mark as watched: `action=watched&videoId={videoID}` | ||
| - Mark as unwatched: `action=unwatched&videoId={videoID}` | ||
|
|
||
| The JSON format of the response to these resources is described [here](./api/responses/). | ||
|
|
||
| To pass extra args, such as the ones needed for `catalog` resources (e.g. `search`, `skip`), you should define a route of the format `/{resource}/{type}/{id}/{extraArgs}.json` where `extraArgs` is the query string stringified object of extra arguments (for example `"search=game%20of%20thrones&skip=100"`) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.