Giter Club home page Giter Club logo

empv.el's Introduction

empv.el

An Emacs media player, based on mpv. More precisely this package provides somewhat comprehensive interface to mpv with bunch of convenient functionality like an embedded radio manager, YouTube interface, local music/video library manager etc.

empv is mostly focused on audio but it also provides some means to manage videos. It also supports YouTube searches for consuming audios or videos.

Workflow is generally M-x empv-something and completing-read based, no buffers or complex interfaces (except for the tabulated YouTube results with thumbnails). Scroll down to see available interactive functions.

Installation

First, you need to install mpv, go check out it’s installation instructions for your operating system/distribution. Easiest way to install empv.el would be using either straigt or quelpa package managers:

;; Using straight:
(straight-use-package '(empv :type git :host github :repo "isamert/empv.el"))
(use-package empv
  :ensure t
  :straigt (:host github :repo "isamert/empv.el"))

;; Using quelpa:
(use-package empv
  :ensure t
  :quelpa (empv
           :fetcher github
           :repo "isamert/empv.el"))

Another option is just downloading empv.el file and putting into your load-path, afterwards you can simply do the following in your init.el:

(require 'empv)

Some functionality may require the external program fd. You are also advised to install it.

Embark and Consult integration

If you have consult and embark installed on your Emacs, empv.el will automatically integrate itself with them. If you have consult installed, you get search suggestions during YouTube searches (empv-youtube) and if you have embark installed you get embark actions for playing/enqueueing selected media. This makes it easy to enqueue bunch of media results using embark-act-all, or you can call embark-act on a file inside a dired buffer and you’ll see options to play or enqueue given file or folder.

To enable embark integration, add the following to your init file:

(empv-initialize-embark)

Functionality and configuration

Do M-x and then search for empv- to list all available functions. Also check out all configuration options by doing M-x customize-group empv RET. I’ll go over some extra configuration options that you may want to use:

Keybindings

No default keybindings are provided but there is empv-map keymap which contains all the useful empv actions. You can bind this keymap to a key, like following:

(bind-key "C-x m" empv-map)

…and now you can do C-x m t to toggle playback, for example. Do M-x describe-keymap empv-map to list all actions in this keymap.

Some keys are repeatable in this keymap. Continuing with the example above, you can do C-x m n to switch to the next media item in the playlist and if you want to go to the next item again just hit n this time (or N to go back one item), as it’s repeatable. Keys that control sound level, playback speed are also repeatable.

General YouTube configuration

empv.el lets you search in YouTube videos/playlists and play them in background or just play the video itself. It also let’s you view YouTube comments of a video in a nicely formatted org buffer. This is done through invidious API. It’s a privacy respecting frontend (and API) for YouTube. To be able to use these features, you need to set an invidious instance manually, like:

(setq empv-invidious-instance "https://some-invidious-instance.com/api/v1")

You can select an invidious instance from here.

The entrypoint function is empv-youtube which asks your input to search in YouTube videos. If you have consult installed, it’ll also show you search suggestions while you are typing.

Thumbnails greatly help to identify the right video in a search. Using completing-read may sometimes fall short here and for that you can use empv-youtube-tabulated. This function searches given term in YouTube and display them in a buffer with video thumbnails.

You can also set empv-youtube-use-tabulated-results to a non-nil value to make YouTube commands use the tabulated interface by default at all times.

Viewing YouTube videos

If you start playing a YouTube video, it’ll start playing in background. You may be tempted to call empv-toggle-video to start watching the video itself but it’ll not work. mpv tries to be smart when it’s in background and it only downloads the audio if it’s possible. If you want to be able to watch YouTube videos whenever you want, you need to add something like this to your configuration to force-download videos:

(add-to-list 'empv-mpv-args "--ytdl-format=best")

See this page for how you can use --ytdl-format option.

Saving playback position

empv-save-and-exit shuts down empv and saves the current playing position but you can also add --save-position-on-quit to empv-mpv-args to get the same effect by default so that every time you quit empv, it’ll automatically save the playback position of the currently playing file and it’ll seek to previous position on start.

(add-to-list 'empv-mpv-args "--save-position-on-quit")

empv.el's People

Contributors

isamert avatar arian-d avatar abougouffa avatar jasonhemann avatar mefff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.