Show how to embed a YouTube video in HTML (ChatGPT)

This commit is contained in:
Gerard Vermeulen 2024-06-16 14:07:33 +02:00
parent 38502a12a5
commit 566c64f8d9
1 changed files with 30 additions and 8 deletions

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