👉 Support this work via GitHub Sponsors
A lightweight major mode to open media (audio/video) files in an Emacs buffer.
This package is available on MELPA:
(use-package ready-player
:ensure t
:config
(ready-player-mode +1))
To customize supported media files, set ready-player-supported-media
before toggling ready-player-mode
.
You can optionally toggle media recognition on and off interactively via M-x ready-player-mode
.
ready-player-mode
relies on command line utilities to play media.
By default, ready-player-mode
will try to use either mpv
, vlc
, ffplay
, or mplayer
(in that order). Customize ready-player-open-playback-commands
to your preference.
Install either of these using your favorite method.
On macOS:
brew install mpv
Metadata is extracted using ffprobe
, which comes bundled with ffmpeg.
Install using your favorite method.
On macOS:
brew install ffmpeg
ready-player-mode
prefers ffmpegthumbnailer to generate thumbnails, but will fallback to ffmpeg
otherwise.
Install using your favorite method.
On macOS:
brew install ffmpegthumbnailer
If you’d like to use different utilities to play video and audio, you can use ready-player-open-playback-commands
for this with something like:
(setq ready-player-open-playback-commands
'((ready-player-is-audio-p "mpg123")
(ready-player-is-video-p "mpv")))
Custom variable | Description |
---|---|
ready-player-supported-media | Supported media types. |
ready-player-thumbnail-max-pixel-height | Maximum thumbnail pixel height. |
ready-player-supported-video | Supported video media. |
ready-player-shuffle | Next media item is selected at random within current directory. |
ready-player-mode-hook | Hook run after entering or leaving `ready-player-mode’. |
ready-player-play-icon | Play button icon string, for example: “⏵”. |
ready-player-previous-icon | Previous button icon string, for example: “<<”. |
ready-player-multi-buffer | When non-nil, enable opening multiple buffers with parallel playback. |
ready-player-cache-metadata | When non-nil, cache metadata. |
ready-player-cache-thumbnails | When non-nil, cache thumbnail. |
ready-player-major-mode-hook | Hook run after entering Ready Player mode. |
ready-player-supported-audio | Supported audiomedia. |
ready-player-mode | Non-nil if Ready-Player mode is enabled. |
ready-player-stop-icon | Stop icon string, for example: “■”. |
ready-player-shuffle-icon | Shuffle icon string, for example: “⤮”. |
ready-player-repeat | Continue playing if there’s more media in current directory. |
ready-player-autoplay | When non-nil, automatically start playing when media file opens. |
ready-player-open-externally-icon | Open externally button icon string, for example: “➦”. |
ready-player-show-thumbnail | When non-nil, display file’s thumbnail if available. |
ready-player-hide-modeline | If non-nil, hides mode line in buffer. |
ready-player-next-icon | Next button icon string, for example: “>>”. |
ready-player-major-mode-map | Keymap for `ready-player’. |
ready-player-autoplay-icon | Autoplay icon string, for example: “⚡”. |
ready-player-open-playback-commands | Command line utilities to try for playback. |
ready-player-major-mode-syntax-table | Syntax table for `ready-player-major-mode’. |
ready-player-display-dired-playback-buffer-display-action | Choose how to display the associated playback `dired’ buffer. |
ready-player-repeat-icon | Repeat icon string, for example: “⇆”. |
By default, ready-player-mode
will try to use macOS SF Symbols (if available) for ready-player-play-icon
ready-player-stop-icon
and ready-player-open-externally-icon
.
You’ll need to enable SF symbol rendering in Emacs (before loading =ready-player.el=).
(when (memq system-type '(darwin))
(set-fontset-font t nil "SF Pro Display" nil 'append))
If macOS SF Symbols aren’t available, << ⏵ ■ >> ➦ ⇆
are used as a fallback. These can be customized (see all icon variables), though may not be the best alternative. Happy to take suggestions!
d | ready-player-view-dired-playback-buffer | View associated `dired’ playback buffer. |
ready-player-set-album-artwork | Select image and set as album artwork. | |
ready-player-lookup-song | Look up current song on Discogs. | |
u | ready-player-unmark-dired-file | Unmark the current file in the appropriate `dired’ buffer(s). |
ready-player-stop | Stop media playback. | |
SPC | ready-player-toggle-play-stop | Toggle play/stop of media. |
ready-player-play | Start media playback. | |
g | ready-player-reload-buffer | Reload media from file. |
o or e | ready-player-open-externally | Open visited file in default external program. |
ready-player-toggle-autoplay | Toggle autoplay setting. | |
ready-player-toggle-modeline | Toggle displaying the mode line. | |
ready-player-mode | Toggle Ready Player mode media file recognition. | |
ready-player-version | Show Ready Player Mode version. | |
ready-player-toggle-shuffle | Toggle shuffle setting. | |
n | ready-player-next | Open the next media file in the same directory. |
p | ready-player-previous | Open the previous media file in the same directory. |
q | ready-player-quit | Quit `ready-player-major-mode’ window and kill buffer. |
ready-player-major-mode | Major mode to preview and play media files. | |
ready-player-toggle-repeat | Toggle repeat setting. | |
TAB | ready-player-next-button | Navigate to next button. |
<backtab> | ready-player-previous-button | Navigate to previous button. |
ready-player-download-album-artwork | Download album artwork. | |
m | ready-player-mark-dired-file | Mark the current file in the appropriate `dired’ buffer(s). |
ready-player-load-dired-playback-buffer | Open a `dired’ buffer If DIRED-BUFFER is nil, offer to pick on. |