IINA+ Module Reference

New in version 0.2.2.

Control IINA+ (https://github.com/CarterLi/iina) using JXA-like syntax.

Classes:

IINAObjectClass(value)

An enumeration.

XAIINAApplication(properties)

A class for managing and interacting with IINA.app.

XAIINAAudioTrack(properties)

An audio media track.

XAIINAAudioTrackList(properties[, filter])

A wrapper around lists of audio tracks that employs fast enumeration techniques.

XAIINAPlayer(properties)

A player in IINA.app.

XAIINAPlayerList(properties[, filter])

A wrapper around lists of players that employs fast enumeration techniques.

XAIINAPlaylistItem(properties)

An item in a playlist.

XAIINAPlaylistItemList(properties[, filter])

A wrapper around lists of playlist items that employs fast enumeration techniques.

XAIINASubtitleTrack(properties)

A subtitle media track.

XAIINASubtitleTrackList(properties[, filter])

A wrapper around lists of subtitle tracks that employs fast enumeration techniques.

XAIINATrack(properties)

A media track.

XAIINATrackList(properties[, filter])

A wrapper around lists of tracks that employs fast enumeration techniques.

XAIINAVideoTrack(properties)

A video media track.

XAIINAVideoTrackList(properties[, filter])

A wrapper around lists of video tracks that employs fast enumeration techniques.

class PyXA.apps.IINA.IINAObjectClass(value)[source]

Bases: Enum

An enumeration.

Attributes:

APPLICATION

AUDIO_TRACK

PLAYER

PLAYLIST_ITEM

SUBTITLE_TRACK

TRACK

VIDEO_TRACK

WINDOW

APPLICATION = 'capp'
AUDIO_TRACK = 'cTrA'
PLAYER = 'cPla'
PLAYLIST_ITEM = 'cPLI'
SUBTITLE_TRACK = 'cTrS'
TRACK = 'cTra'
VIDEO_TRACK = 'cTrV'
WINDOW = 'cwin'
class PyXA.apps.IINA.XAIINAApplication(properties)[source]

Bases: XASBApplication, XACanOpenPath

A class for managing and interacting with IINA.app.

New in version 0.2.2.

Classes:

PlayerState(value)

States of a player.

TrackType(value)

States of a player.

Attributes:

frontmost

Is IINA the active application?

name

The name of the application.

version

The version number of the application.

Methods:

next_frame()

Advance to the next frame.

next_item()

Advance to the next playlist item.

pause()

Pause playback.

play()

Begin or resume playback.

players([filter])

Returns a list of players, as PyXA objects, matching the given filter.

playpause()

Toggle the playing/paused state of the player.

previous_frame()

Return to the previous frame.

previous_item()

Return to the previous playlist item.

class PlayerState(value)[source]

Bases: Enum

States of a player.

Attributes:

PAUSED

Playback is paused

PLAYING

Playback is playing

SEEKING

The player is seeking

PAUSED = 1800426352

Playback is paused

PLAYING = 1800426320

Playback is playing

SEEKING = 1800426323

The player is seeking

class TrackType(value)[source]

Bases: Enum

States of a player.

Attributes:

AUDIO

Audio track

SUBTITLE

Subtitle track

VIDEO

Video track

AUDIO = 1800688705

Audio track

SUBTITLE = 1800688723

Subtitle track

VIDEO = 1800688726

Video track

property frontmost: bool

Is IINA the active application?

property name: str

The name of the application.

next_frame()[source]

Advance to the next frame.

New in version 0.2.2.

next_item()[source]

Advance to the next playlist item.

New in version 0.2.2.

pause()[source]

Pause playback.

New in version 0.2.2.

play()[source]

Begin or resume playback.

New in version 0.2.2.

players(filter: dict | None = None) XAIINAPlayerList[source]

Returns a list of players, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned players will have, or None

Returns:

The list of players

Return type:

XAIINAPlayerList

New in version 0.2.2.

playpause()[source]

Toggle the playing/paused state of the player.

New in version 0.2.2.

previous_frame()[source]

Return to the previous frame.

New in version 0.2.2.

previous_item()[source]

Return to the previous playlist item.

New in version 0.2.2.

property version: str

The version number of the application.

class PyXA.apps.IINA.XAIINAAudioTrack(properties)[source]

Bases: XAObject

An audio media track.

New in version 0.2.2.

Attributes:

channel_count

The number of audio channels in the track.

sample_rate

The sample rate of the audio track.

property channel_count: int

The number of audio channels in the track.

property sample_rate: int

The sample rate of the audio track.

class PyXA.apps.IINA.XAIINAAudioTrackList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of audio tracks that employs fast enumeration techniques.

All properties of audio tracks can be called as methods on the wrapped list, returning a list containing each tracks’s value for the property.

New in version 0.2.2.

Methods:

by_channel_count(channel_count)

by_sample_rate(sample_rate)

channel_count()

sample_rate()

by_channel_count(channel_count: int) XAIINAAudioTrack | None[source]
by_sample_rate(sample_rate: int) XAIINAAudioTrack | None[source]
channel_count() list[int][source]
sample_rate() list[int][source]
class PyXA.apps.IINA.XAIINAPlayer(properties)[source]

Bases: XAObject, XACloseable

A player in IINA.app.

New in version 0.2.2.

Attributes:

aspect_ratio

The current aspect ratio.

audio_volume

The audio output volume (0 = minimum, 150 = maximum, 100 = normal).

current_audio_track

The index of the current audio track.

current_playlist_item

The current playlist item.

current_subtitle_track

The index of the current subtitle track.

current_video_track

The index of the current video track.

file

The currently playing file.

file_loop

The file loop setting (whether the file should loop continuously).

flipped

Whether the video is flipped (vertically).

fullscreen

Is the player in fullscreen?

id

The unique ID of the player.

mirrored

Whether the video is mirrored (horizontally).

music_mode

Is the playing in music mode?

muted

Has the audio output been muted?

name

The name of the player.

pip

Is the player in picture-in-picture mode? (macOS 10.12+)

playback_speed

The playback speed.

position

The playback position in seconds.

rotation

The current video rotation in degrees.

second_subtitle_track

The index of the second subtitle track.

state

The playback state.

url

The currently playing URL.

window

The player's currently visible window.

Methods:

audio_tracks([filter])

Returns a list of audio tracks, as PyXA objects, matching the given filter.

next_frame()

Advance to the next frame.

next_item()

Advance to the next playlist item.

pause()

Pause playback.

play()

Begin or resume playback.

playlist_items([filter])

Returns a list of playlist items, as PyXA objects, matching the given filter.

playpause()

Toggle the playing/paused state of the player.

previous_frame()

Return to the previous frame.

previous_item()

Return to the previous playlist item.

subtitle_tracks([filter])

Returns a list of subtitle tracks, as PyXA objects, matching the given filter.

tracks([filter])

Returns a list of tracks, as PyXA objects, matching the given filter.

video_tracks([filter])

Returns a list of video tracks, as PyXA objects, matching the given filter.

property aspect_ratio: str

The current aspect ratio.

audio_tracks(filter: dict | None = None) XAIINAAudioTrackList[source]

Returns a list of audio tracks, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned audio tracks will have, or None

Returns:

The list of audio tracks

Return type:

XAIINAAudioTrackList

New in version 0.2.2.

property audio_volume: int

The audio output volume (0 = minimum, 150 = maximum, 100 = normal).

property current_audio_track: XAIINAAudioTrack

The index of the current audio track.

property current_playlist_item: XAIINAPlaylistItem

The current playlist item.

property current_subtitle_track: XAIINASubtitleTrack

The index of the current subtitle track.

property current_video_track: XAIINAVideoTrack

The index of the current video track.

property file: XAPath

The currently playing file.

property file_loop: bool

The file loop setting (whether the file should loop continuously).

property flipped: bool

Whether the video is flipped (vertically).

property fullscreen: bool

Is the player in fullscreen?

property id: str

The unique ID of the player.

property mirrored: bool

Whether the video is mirrored (horizontally).

property music_mode: bool

Is the playing in music mode?

property muted: bool

Has the audio output been muted?

property name: str

The name of the player.

next_frame()[source]

Advance to the next frame.

New in version 0.2.2.

next_item()[source]

Advance to the next playlist item.

New in version 0.2.2.

pause()[source]

Pause playback.

New in version 0.2.2.

property pip: bool

Is the player in picture-in-picture mode? (macOS 10.12+)

play()[source]

Begin or resume playback.

New in version 0.2.2.

property playback_speed: float

The playback speed.

playlist_items(filter: dict | None = None) XAIINAPlaylistItemList[source]

Returns a list of playlist items, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlist items will have, or None

Returns:

The list of playlist items

Return type:

XAIINAPlaylistItemList

New in version 0.2.2.

playpause()[source]

Toggle the playing/paused state of the player.

New in version 0.2.2.

property position: float

The playback position in seconds.

previous_frame()[source]

Return to the previous frame.

New in version 0.2.2.

previous_item()[source]

Return to the previous playlist item.

New in version 0.2.2.

property rotation: int

The current video rotation in degrees.

property second_subtitle_track: XAIINASubtitleTrack

The index of the second subtitle track.

property state: PlayerState

The playback state.

subtitle_tracks(filter: dict | None = None) XAIINASubtitleTrackList[source]

Returns a list of subtitle tracks, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned subtitle tracks will have, or None

Returns:

The list of subtitle tracks

Return type:

XAIINASubtitleTrackList

New in version 0.2.2.

tracks(filter: dict | None = None) XAIINATrackList[source]

Returns a list of tracks, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None

Returns:

The list of tracks

Return type:

XAIINATrackList

New in version 0.2.2.

property url: XAURL

The currently playing URL.

video_tracks(filter: dict | None = None) XAIINAVideoTrackList[source]

Returns a list of video tracks, as PyXA objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned video tracks will have, or None

Returns:

The list of video tracks

Return type:

XAIINAVideoTrackList

New in version 0.2.2.

property window: XASBWindow

The player’s currently visible window.

class PyXA.apps.IINA.XAIINAPlayerList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of players that employs fast enumeration techniques.

All properties of players can be called as methods on the wrapped list, returning a list containing each player’s value for the property.

New in version 0.2.2.

Methods:

aspect_ratio()

audio_volume()

by_aspect_ratio(aspect_ratio)

by_audio_volume(audio_volume)

by_current_audio_track(current_audio_track)

by_current_playlist_item(current_playlist_item)

by_current_subtitle_track(current_subtitle_track)

by_current_video_track(current_video_track)

by_file(file)

by_file_loop(file_loop)

by_flipped(flipped)

by_fullscreen(fullscreen)

by_id(id)

by_mirrored(mirrored)

by_music_mode(music_mode)

by_muted(muted)

by_name(name)

by_pip(pip)

by_playback_speed(playback_speed)

by_position(position)

by_rotation(rotation)

by_second_subtitle_track(second_subtitle_track)

by_state(state)

by_url(url)

by_window(window)

current_audio_track()

current_playlist_item()

current_subtitle_track()

current_video_track()

file()

file_loop()

flipped()

fullscreen()

id()

mirrored()

music_mode()

muted()

name()

pip()

playback_speed()

position()

rotation()

second_subtitle_track()

state()

url()

window()

aspect_ratio() list[str][source]
audio_volume() list[int][source]
by_aspect_ratio(aspect_ratio: str) XAIINAPlayer | None[source]
by_audio_volume(audio_volume: int) XAIINAPlayer | None[source]
by_current_audio_track(current_audio_track: XAIINAAudioTrack) XAIINAPlayer | None[source]
by_current_playlist_item(current_playlist_item: XAIINAPlaylistItem) XAIINAPlayer | None[source]
by_current_subtitle_track(current_subtitle_track: XAIINASubtitleTrack) XAIINAPlayer | None[source]
by_current_video_track(current_video_track: XAIINAVideoTrack) XAIINAPlayer | None[source]
by_file(file: XAPath | str) XAIINAPlayer | None[source]
by_file_loop(file_loop: bool) XAIINAPlayer | None[source]
by_flipped(flipped: bool) XAIINAPlayer | None[source]
by_fullscreen(fullscreen: bool) XAIINAPlayer | None[source]
by_id(id: str) XAIINAPlayer | None[source]
by_mirrored(mirrored: bool) XAIINAPlayer | None[source]
by_music_mode(music_mode: bool) XAIINAPlayer | None[source]
by_muted(muted: bool) XAIINAPlayer | None[source]
by_name(name: str) XAIINAPlayer | None[source]
by_pip(pip: bool) XAIINAPlayer | None[source]
by_playback_speed(playback_speed: float) XAIINAPlayer | None[source]
by_position(position: float) XAIINAPlayer | None[source]
by_rotation(rotation: int) XAIINAPlayer | None[source]
by_second_subtitle_track(second_subtitle_track: XAIINASubtitleTrack) XAIINAPlayer | None[source]
by_state(state: PlayerState) XAIINAPlayer | None[source]
by_url(url: XAURL | str) XAIINAPlayer | None[source]
by_window(window: XASBWindow) XAIINAPlayer | None[source]
current_audio_track() XAIINAAudioTrackList[source]
current_playlist_item() XAIINAPlaylistItemList[source]
current_subtitle_track() XAIINASubtitleTrackList[source]
current_video_track() XAIINAVideoTrackList[source]
file() list[XAPath][source]
file_loop() list[bool][source]
flipped() list[bool][source]
fullscreen() list[bool][source]
id() list[str][source]
mirrored() list[bool][source]
music_mode() list[bool][source]
muted() list[bool][source]
name() list[str][source]
pip() list[bool][source]
playback_speed() list[float][source]
position() list[float][source]
rotation() list[int][source]
second_subtitle_track() XAIINASubtitleTrackList[source]
state() list[PlayerState][source]
url() list[XAURL][source]
window() XASBWindowList[source]
class PyXA.apps.IINA.XAIINAPlaylistItem(properties)[source]

Bases: XAObject

An item in a playlist.

New in version 0.2.2.

Attributes:

current

Whether the item is the currently selected item.

currently_playing

Whether the item is currently playng.

file

The file path of the item on the disk.

name

The name of the item.

network

Whether the item is an internet location item.

url

The URL of the item.

property current: bool

Whether the item is the currently selected item.

property currently_playing: bool

Whether the item is currently playng.

property file: XAPath

The file path of the item on the disk.

property name: str

The name of the item.

property network: bool

Whether the item is an internet location item.

property url: XAURL

The URL of the item.

class PyXA.apps.IINA.XAIINAPlaylistItemList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of playlist items that employs fast enumeration techniques.

All properties of playlist items can be called as methods on the wrapped list, returning a list containing each item’s value for the property.

New in version 0.2.2.

Methods:

by_current(current)

by_currently_playing(currently_playing)

by_file(file)

by_name(name)

by_network(network)

by_url(url)

current()

currently_playing()

file()

name()

network()

url()

by_current(current: bool) XAIINAPlaylistItem | None[source]
by_currently_playing(currently_playing: bool) XAIINAPlaylistItem | None[source]
by_file(file: XAPath | str) XAIINAPlaylistItem | None[source]
by_name(name: str) XAIINAPlaylistItem | None[source]
by_network(network: bool) XAIINAPlaylistItem | None[source]
by_url(url: XAURL | str) XAIINAPlaylistItem | None[source]
current() list[bool][source]
currently_playing() list[bool][source]
file() list[XAPath][source]
name() list[str][source]
network() list[bool][source]
url() list[XAURL][source]
class PyXA.apps.IINA.XAIINASubtitleTrack(properties)[source]

Bases: XAObject

A subtitle media track.

New in version 0.2.2.

class PyXA.apps.IINA.XAIINASubtitleTrackList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of subtitle tracks that employs fast enumeration techniques.

All properties of subtitle tracks can be called as methods on the wrapped list, returning a list containing each tracks’s value for the property.

New in version 0.2.2.

class PyXA.apps.IINA.XAIINATrack(properties)[source]

Bases: XAObject

A media track.

New in version 0.2.2.

Attributes:

codec

The audio/video codec of the track.

default

Whether this is the default track.

info_string

A text description of the track.

language

The language of the track.

name

The name of the track.

type

The type of the track, either audio, video, or subtitle.

property codec: str

The audio/video codec of the track.

property default: bool

Whether this is the default track.

property info_string: str

A text description of the track.

property language: str

The language of the track.

property name: str

The name of the track.

property type: TrackType

The type of the track, either audio, video, or subtitle.

class PyXA.apps.IINA.XAIINATrackList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of tracks that employs fast enumeration techniques.

All properties of tracks can be called as methods on the wrapped list, returning a list containing each tracks’s value for the property.

New in version 0.2.2.

Methods:

by_codec(codec)

by_default(default)

by_info_string(info_string)

by_language(language)

by_name(name)

by_type(type)

codec()

default()

info_string()

language()

name()

type()

by_codec(codec: str) XAIINATrack | None[source]
by_default(default: bool) XAIINATrack | None[source]
by_info_string(info_string: str) XAIINATrack | None[source]
by_language(language: str) XAIINATrack | None[source]
by_name(name: str) XAIINATrack | None[source]
by_type(type: TrackType) XAIINATrack | None[source]
codec() list[str][source]
default() list[bool][source]
info_string() list[str][source]
language() list[str][source]
name() list[str][source]
type() list[TrackType][source]
class PyXA.apps.IINA.XAIINAVideoTrack(properties)[source]

Bases: XAObject

A video media track.

New in version 0.2.2.

Attributes:

fps

The frames per second of the video.

height

The height of the video in pixels.

width

The width of the video in pixels.

property fps: float

The frames per second of the video.

property height: int

The height of the video in pixels.

property width: int

The width of the video in pixels.

class PyXA.apps.IINA.XAIINAVideoTrackList(properties: dict, filter: dict | None = None)[source]

Bases: XAList

A wrapper around lists of video tracks that employs fast enumeration techniques.

All properties of video tracks can be called as methods on the wrapped list, returning a list containing each tracks’s value for the property.

New in version 0.2.2.

Methods:

by_fps(fps)

by_height(height)

by_width(width)

fps()

height()

width()

by_fps(fps: float) XAIINAVideoTrack | None[source]
by_height(height: int) XAIINAVideoTrack | None[source]
by_width(width: int) XAIINAVideoTrack | None[source]
fps() list[float][source]
height() list[int][source]
width() list[int][source]