Skip to content
Johann Klähn edited this page Aug 1, 2022 · 7 revisions

Welcome to the mpv.el wiki!

Tips

Using org-mode for transcription (tested with Org mode version 9.4)

To create a mpv: link type that is completely analogous to file: links but opens using mpv-play instead, use:

(defun org-mpv-complete-link (&optional arg)
  (replace-regexp-in-string
   "file:" "mpv:"
   (org-link-complete-file arg)
   t t))
(org-link-set-parameters "mpv"
  :follow #'mpv-play :complete #'org-mpv-complete-link)

In my transcriptions I use the description list format of org-timer-item:

- 0:02:21 :: Finding the smallest and second smallest element.

Using the following hook, M-RET will insert a new item with the timestamp of the current playback position, if point is in in a timer list:

(defun my:mpv/org-metareturn-insert-playback-position ()
  (when-let ((item-beg (org-in-item-p)))
    (when (and (not (bound-and-true-p org-timer-start-time))
               (mpv-live-p)
               (save-excursion
                 (goto-char item-beg)
                 (and (not (org-invisible-p)) (org-at-item-timer-p))))
      (mpv-insert-playback-position t))))
(add-hook 'org-metareturn-hook #'my:mpv/org-metareturn-insert-playback-position)

You can further add the following snippet to have mpv seek to the position of a timestamp when pressing /RET/ in an org buffer:

(add-hook 'org-open-at-point-functions #'mpv-seek-to-position-at-point)
Clone this wiki locally