Playback

Interact with the playback and auto-tracking system in Seanime.

Seanime provides APIs for controlling media playback and interacting with the underlying Playback Manager and MPV. These APIs give plugins access to the same functionality Seanime uses internally for media tracking and player control.

Permissions

{
  //...
  "plugin": {
    "permissions": {
      "scopes": ["playback"]
    }
  }
}

Core methods

playUsingMediaPlayer

playUsingMediaPlayer(filePath)

Plays a local file using the configured media player, with automatic tracking.

Parameters:

  • filePath: String - Path to a scanned local video file

Note: This only works with files properly scanned by Seanime. Using it with unscanned files will result in tracking errors.

Example:

streamUsingMediaPlayer

streamUsingMediaPlayer(windowTitle, streamUrl, anime, aniDbEpisode)

Streams a video from a URL using the configured media player, with automatic tracking.

Parameters:

  • windowTitle: String - Title for the player window

  • streamUrl: String - URL of the video stream

  • anime: AL_BaseAnime - AniList anime object

  • aniDbEpisode: String - AniDB episode number

Example:

registerEventListener

registerEventListener(id, callback)

Registers a listener for playback events.

Parameters:

  • id: String - Unique identifier for the listener

  • callback: Function(event: PlaybackEvent) - Function called when an event occurs

Example:

pause

Pauses the current playback.

Example:

resume

Resumes the paused playback.

Example:

seek

Seeks to a specific position in the current playback.

Parameters:

  • seconds: Number - The position to seek to in seconds

Example:

cancel

Cancels the current playback tracking (does not stop the player).

Example:

getNextEpisode

Gets the next episode to play for the current media.

Example:

playNextEpisode

Plays the next episode for the current media.

Example:

Best Practices

Media Tracking

The playback API is designed for tracked media files that are part of the Seanime library:

Last updated