Skip to content

xenodium/ready-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

👉 Support this work via GitHub Sponsors

Ready Player Mode

A lightweight major mode to open media (audio/video) files in an Emacs buffer.

Install / Setup

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.

Toggle recognition

You can optionally toggle media recognition on and off interactively via M-x ready-player-mode.

External dependencies

Playback

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

Metadata is extracted using ffprobe, which comes bundled with ffmpeg.

Install using your favorite method.

On macOS:

brew install ffmpeg

Thumbnails

ready-player-mode prefers ffmpegthumbnailer to generate thumbnails, but will fallback to ffmpeg otherwise.

Install using your favorite method.

On macOS:

brew install ffmpegthumbnailer

Customizations

Video vs audio

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 variableDescription
ready-player-supported-mediaSupported media types.
ready-player-thumbnail-max-pixel-heightMaximum thumbnail pixel height.
ready-player-supported-videoSupported video media.
ready-player-shuffleNext media item is selected at random within current directory.
ready-player-mode-hookHook run after entering or leaving `ready-player-mode’.
ready-player-play-iconPlay button icon string, for example: “⏵”.
ready-player-previous-iconPrevious button icon string, for example: “<<”.
ready-player-multi-bufferWhen non-nil, enable opening multiple buffers with parallel playback.
ready-player-cache-metadataWhen non-nil, cache metadata.
ready-player-cache-thumbnailsWhen non-nil, cache thumbnail.
ready-player-major-mode-hookHook run after entering Ready Player mode.
ready-player-supported-audioSupported audiomedia.
ready-player-modeNon-nil if Ready-Player mode is enabled.
ready-player-stop-iconStop icon string, for example: “■”.
ready-player-shuffle-iconShuffle icon string, for example: “⤮”.
ready-player-repeatContinue playing if there’s more media in current directory.
ready-player-autoplayWhen non-nil, automatically start playing when media file opens.
ready-player-open-externally-iconOpen externally button icon string, for example: “➦”.
ready-player-show-thumbnailWhen non-nil, display file’s thumbnail if available.
ready-player-hide-modelineIf non-nil, hides mode line in buffer.
ready-player-next-iconNext button icon string, for example: “>>”.
ready-player-major-mode-mapKeymap for `ready-player’.
ready-player-autoplay-iconAutoplay icon string, for example: “⚡”.
ready-player-open-playback-commandsCommand line utilities to try for playback.
ready-player-major-mode-syntax-tableSyntax table for `ready-player-major-mode’.
ready-player-display-dired-playback-buffer-display-actionChoose how to display the associated playback `dired’ buffer.
ready-player-repeat-iconRepeat icon string, for example: “⇆”.

Buttons (macOS SF Symbols)

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))

Buttons (Linux)

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!

Commands

fready-player-seek-forwardSeek forward.
dready-player-view-dired-playback-bufferView associated `dired’ playback buffer.
ready-player-set-album-artworkSelect image and set as album artwork.
ready-player-lookup-songLook up current song on Discogs.
uready-player-unmark-dired-fileUnmark the current file in the appropriate `dired’ buffer(s).
ready-player-stopStop media playback.
SPCready-player-toggle-play-stopToggle play/stop of media.
ready-player-playStart media playback.
bready-player-seek-backwardSeek backward.
gready-player-reload-bufferReload media from file.
o or eready-player-open-externallyOpen visited file in default external program.
aready-player-toggle-autoplayToggle autoplay setting.
ready-player-toggle-modelineToggle displaying the mode line.
ready-player-download-album-artwork-and-set-metadataDownload album artwork set media metadata.
ready-player-modeToggle Ready Player mode media file recognition.
ready-player-versionShow Ready Player Mode version.
sready-player-toggle-shuffleToggle shuffle setting.
nready-player-nextOpen the next media file in the same directory.
pready-player-previousOpen the previous media file in the same directory.
ready-player-load-m3u-playlistLoad an .m3u playlist.
qready-player-quitQuit `ready-player-major-mode’ window and kill buffer.
ready-player-major-modeMajor mode to preview and play media files.
iready-player-show-infoShow playback info in the echo area.
ready-player-view-playerSwitch to player buffer.
rready-player-toggle-repeatToggle repeat setting.
TABready-player-next-buttonNavigate to next button.
<backtab>ready-player-previous-buttonNavigate to previous button.
ready-player-download-album-artworkDownload album artwork to media directory.
mready-player-mark-dired-fileMark the current file in the appropriate `dired’ buffer(s).
ready-player-load-dired-playback-bufferOpen a `dired’ buffer If DIRED-BUFFER is nil, offer to pick on.

👉 Support this work via GitHub Sponsors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published