Compare commits

...

2 Commits

View File

@ -2954,15 +2954,17 @@ See `org-link-parameters' for details about PATH, DESC and FORMAT."
:CUSTOM_ID: sec:make-org-yt-link-type
:END:
Listing [[lst:define-org-yt-link-type][define org-yt-link type]] implements code to open the link to the
following YouTube video [[yt:eaZUZCzaIgw][Extending org-mode to handle YouTube links]] using the
following [[https://raw.githubusercontent.com/bitspook/spookmax.d/master/readme.org][Emacs setup]]. Note: Listing [[lst:define-org-yt-link-type][define org-yt-link type]] does only
implement normal =html= links, but no embedded =html= frames.
Listing [[lst:define-org-yt-link-type]] implements code to open the link to the
following YouTube video [[yt:eaZUZCzaIgw][Extending org-mode to handle YouTube links]] modifying
code from the following [[https://raw.githubusercontent.com/bitspook/spookmax.d/master/readme.org][Emacs setup]].
Opening [[yt:eaZUZCzaIgw][Extending org-mode to handle YouTube links]] may fail due to a bug in the
interface between =mpv= and =yt-dlp=. Listing [[lst:set-emms-options][set EMMS options]] indicates how to
work around this bug at the cost of making the user interface less clean.
However, the link [[yt:48JlgiBpw_I][Absolute Beginner's Guide to Emacs]] works always.
Opening [[yt:eaZUZCzaIgw][Extending org-mode to handle YouTube links]] may fail due to an old
(fixed) bug in =mpv=. However, the link [[yt:48JlgiBpw_I][Absolute Beginner's Guide to Emacs]]
works always.
NOTE: Listing [[lst:define-org-yt-link-type][define org-yt-link type]] does only implement normal =html= links
instead of embedded video links, but listing [[lst:howto-embed-yt]] shows a working
=html= example of how to embed a YouTube video in an inline frame element.
#+caption[Define an =org-link= type for =YouTube=]:
#+caption: Define an =org-link= type for =YouTube=.
@ -3001,6 +3003,26 @@ However, the link [[yt:48JlgiBpw_I][Absolute Beginner's Guide to Emacs]] works a
"yt" :follow #'org-yt-emms-open :export #'org-yt-export)))
#+end_src
#+caption[How to embed a =YouTube= video in =HTML=]:
#+caption: How to embed a =YouTube= video in =HTML=.
#+name: lst:howto-embed-yt
#+begin_src html -n :exports code :tangle yegge.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ChatGPT: How to embed a YouTube video in HTML</title>
</head>
<body>
<h1>Steve Yegge embedded YouTube video</h1>
<iframe width="630" height="420"
src="https://www.youtube.com/embed/lkIicfzPBys"
allowfullscreen></iframe>
</body>
</html>
#+end_src
*** [[https://tecosaur.github.io/emacs-config/#translate-capital-keywords][Translate capital keywords (old) to lower case (new)]]
:PROPERTIES:
:CUSTOM_ID: sec:convert-upper-to-lower-case-keywords
@ -6065,25 +6087,17 @@ for ~mpv~ while eliminating use of ~mpd~.
#+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'emms)
(with-eval-after-load 'emms
(emms-all)
;; Since `emms-all' may add `emms-player-mpd' to `emms-player-list',
;; get rid off `emms-player-mpd' after calling `emms-all'.
(emms-all) ;; Restrict now to `emms-player-mpd' use only.
(setopt emms-player-list '(emms-player-mpv)))
(with-eval-after-load 'emms-mode-line
(setopt emms-mode-line-format ""))
(with-eval-after-load 'emms-player-mpv
(setopt emms-player-mpv-update-metadata t)
;; Uncomment the next two lines in case of too many broken YouTube links:
(add-to-list 'emms-player-mpv-parameters "--ytdl-format=best" 'append)
(add-to-list 'emms-player-mpv-parameters "--config=no" 'append)
;; The two previous lines may make the setup less user friendly.
(add-to-list 'emms-player-mpv-parameters "--fullscreen" 'append))
(setopt emms-player-mpv-update-metadata t
emms-player-mpv-parameters
(append emms-player-mpv-parameters
'("--ytdl-format=best" "--config=no" "--fullscreen"))))
(with-eval-after-load 'emms-playing-time
(setopt emms-playing-time-display-format " %s "))
(with-eval-after-load 'emms-streams
(setopt emms-streams-file
(no-littering-expand-etc-file-name "emms/streams.emms"))))