From 5ce781abac99eedc87be597a8e44c364ccdf1cc9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 15 Jun 2021 14:32:38 +0900 Subject: ltx4yt --- texmf-dist/doc/latex/ltx4yt/README.md | 7 ++- texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.pdf | Bin 109008 -> 109498 bytes texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.tex | 14 ++--- texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.pdf | Bin 114454 -> 123755 bytes texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.tex | 15 +++-- .../latex/ltx4yt/examples/web-pkg/ltx4yt-w1.pdf | Bin 118148 -> 150134 bytes .../latex/ltx4yt/examples/web-pkg/ltx4yt-w1.tex | 35 ++++++----- .../latex/ltx4yt/examples/web-pkg/ltx4yt-w2.pdf | Bin 86073 -> 128904 bytes .../latex/ltx4yt/examples/web-pkg/ltx4yt-w2.tex | 17 +++-- texmf-dist/doc/latex/ltx4yt/ltx4yt-man.pdf | Bin 242168 -> 244848 bytes texmf-dist/doc/latex/ltx4yt/ltx4yt-man.tex | 61 +++++++++++++----- texmf-dist/doc/latex/ltx4yt/ltx4yt.pdf | Bin 1838044 -> 294199 bytes texmf-dist/source/latex/ltx4yt/ltx4yt.dtx | 70 +++++++++++++++------ texmf-dist/tex/latex/ltx4yt/ltx4yt.sty | 42 +++++++++---- 14 files changed, 175 insertions(+), 86 deletions(-) (limited to 'texmf-dist') diff --git a/texmf-dist/doc/latex/ltx4yt/README.md b/texmf-dist/doc/latex/ltx4yt/README.md index 63993ec3..5d8bea3f 100644 --- a/texmf-dist/doc/latex/ltx4yt/README.md +++ b/texmf-dist/doc/latex/ltx4yt/README.md @@ -1,5 +1,5 @@ The ltx4yt package -Dated: 2020-07-30 +Dated: 2021-06-08 What ltx4yt does is to provide some tools for creating links, dropdown lists, popup menus for playing selected YouTube videos in the default browser. Perfect @@ -10,10 +10,13 @@ All workflows are supported: pdflatex, lualatex, xelatex, dvips->distiller, and dvips->ps2pdf. In the latter case, the document should not use any document JavaScripts. -This package replaces yt4pdf, which is being withdrawn from CTAN. +This package replaces yt4pdf, which is withdrawn from CTAN. Now, I simply must get back to my retirement. +What's New (2021-06-08) Rewrote commands and examples to reflect a new method + of doing YouTube searches. + Dr. D. P. Story www.acrotex.net dpstory@uakron.edu diff --git a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.pdf b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.pdf index c85e343e..a6f37846 100644 Binary files a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.pdf and b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.pdf differ diff --git a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.tex b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.tex index 2f2a215b..b469f3da 100644 --- a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.tex +++ b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-1.tex @@ -25,15 +25,15 @@ \maketitle \textbf{Favorites to play:} Itemized links below use the \verb~\ytvId~ and \verb~\ytvId*~ commands, -the only \texttt{*} command is ``Kung-Fu Fighting* (Original),'' this one is played with advertisements +the only \texttt{*} command is ``Kung-Fu Fighting* (Bruce Lee),'' this one is played with advertisements and related/unrelated content. The links in this document should work across all PDF viewers and across all devices. \begin{flushleft}\raggedcolumns \begin{multicols}{2}\bfseries \begin{itemize} -\item \ytvId{GZ9e3Dy7obA}{Kung-Fu Fighting (Bruce Lee)} +\item \ytvId*{GZ9e3Dy7obA}{Kung-Fu Fighting* (Bruce Lee)} -\item \ytvId*{jhUkGIsKvn0}{Kung-Fu Fighting* (Original)} +\item \ytvId{jhUkGIsKvn0}{Kung-Fu Fighting (Original)} \item \ytvId{_iUnOpPEg0w}{TegrityGuy} @@ -44,6 +44,7 @@ and related/unrelated content. The links in this document should work across all \item \ytvId{5y9-EVmreU4}{Lori's Corner: Episode \#1} \item \ytvId{T9Yzo_hlwP0}{Intro to PDF Portfolios} + \end{itemize} \end{multicols} \end{flushleft} @@ -53,17 +54,14 @@ What follows are customized links created by \verb~\ytLink~. \ytLink{\embedId{5y9-EVmreU4}\params{autoplay=1&modestbranding=1}}{Lori's Corner: Episode \#1} (\verb~\embedId~ and \verb~\params~) -\ytLink{\embed{listType=search&list=Adobe Acrobat DC}}{Search for Adobe Acrobat DC} (\verb~\embed~ custom search) - -\ytLink{embed?listType=search&list=table tennis}{Totally custom search link} (surprise topic) +\ytLink{\search{Adobe Acrobat DC}}{Search for Adobe Acrobat DC} +\ytLink{\search{table tennis}}{Totally custom search link} (surprise topic) \ytLink{\channel{rocketjump}}{The RocketJump Channel} (\verb~\channel~) \ytLink{\user{freddiew}}{Freddie Diew's channel} (\verb~\user~) -\ytLink{\embedId{5y9-EVmreU4}\params{autoplay=1&controls=1&fs=1&modestbranding=1&playlist=T9Yzo_hlwP0,eNzrn8-JFSE}}{A playlist of three videos} - \textbf{PDF viewers:} \textsf{Acrobat}, \textsf{Acrobat Reader DC}, \textsf{PDFX-Change}, \textsf{SumatraPDF}, \textsf{evince}, \textsf{TeXworks} \textbf{Browsers:} \textsf{Microsoft Edge}, \textsf{Firefox}, \textsf{Google Chrome} diff --git a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.pdf b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.pdf index fc9ec84a..46df119a 100644 Binary files a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.pdf and b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.pdf differ diff --git a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.tex b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.tex index 83ca7876..12f74c02 100644 --- a/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.tex +++ b/texmf-dist/doc/latex/ltx4yt/examples/ltx4yt-2.tex @@ -20,8 +20,8 @@ \begin{popupmenu}{YTMenu} \puIdTitle{Select a YouTube Video}{} % A title has no ytId \begin{submenu}{title=Music Videos} - \puIdTitle{Kung-Fu Fighting (Bruce Lee)}{GZ9e3Dy7obA} - \puIdTitle{Kung-Fu Fighting* (Carl Douglas)}{jhUkGIsKvn0} + \puIdTitle{Kung-Fu Fighting* (Bruce Lee)}{GZ9e3Dy7obA} + \puIdTitle{Kung-Fu Fighting (Carl Douglas)}{jhUkGIsKvn0} \puIdTitle{Ink Spots - If I didn't care}{rvwfLe6sLis} \puIdTitle{Ink Spots* - My Prayer}{h7KJCns5v3g} \end{submenu} @@ -46,13 +46,12 @@ \puIdTitle{Learn \cs{LaTeX} in one video}{VhmkLrOjLsw} \end{popupmenu} - % After defining all menus used with YouTube videos, declare them using \ytUseMenus \ytUseMenus{YTMenu,YTSea} \declarePlayList{\playList}{% note: put parentheses within braces - \ytIdTitle{Kung-Fu Fighting {(Bruce Lee)}}{GZ9e3Dy7obA} - \ytIdTitle{Kung-Fu Fighting* {(Carl Douglas)}}{jhUkGIsKvn0} + \ytIdTitle{Kung-Fu Fighting* {(Bruce Lee)}}{GZ9e3Dy7obA} + \ytIdTitle{Kung-Fu Fighting {(Carl Douglas)}}{jhUkGIsKvn0} \ytIdTitle{RAF Sculthorpe {(Watch for my Mom at 6:22!)}}{K7H8QghVs9k} \ytIdTitle{Rocket Jump}{7XzdZ4KcI8Y} \ytIdTitle{Abdul And Cleopatra* - Jonathan Richman and the Modern Lovers}{mLDF5MBMWHE} @@ -62,6 +61,7 @@ \ytIdTitle{"Sea Hunt" US TV series {(1958-61)} lead-in}{Lz0aMoWh8Q4} } + \begin{document} \maketitle @@ -95,4 +95,9 @@ menu appears. Choose a YouTube video based on title. \ytSearch{}{11bp}\olBdry \ytClearQuery{}{11bp} +\ytLink{embed?listType=playlist&list=PL01A18BBA5912B01F}{{\LaTeX} Tutorial} (look for the play list control in upper right corner) + +\ytLink{\embedId{5y9-EVmreU4}\params{autoplay=1&controls=1&fs=1&modestbranding=1&playlist=T9Yzo_hlwP0,eNzrn8-JFSE}}{A playlist of three videos} + + \end{document} diff --git a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.pdf b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.pdf index 7069e972..837b1c68 100644 Binary files a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.pdf and b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.pdf differ diff --git a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.tex b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.tex index 8e554547..1227d956 100644 --- a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.tex +++ b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w1.tex @@ -21,10 +21,23 @@ } \talkdateLabel{Published:} +\optionalPageMatter{\begin{center} +\fcolorbox{blue}{webyellow}{\begin{minipage}{.67\linewidth}\raggedright\small +This document should function properly in the following devices. +\begin{description} +\item[PDF viewers:] \textsf{Acrobat}, \textsf{Acrobat Reader DC}, \textsf{PDFX-Change}, \textsf{SumatraPDF}, \textsf{evince}, \textsf{TeXworks} + +\item[Browsers:] \textsf{Microsoft Edge}, \textsf{Firefox}, \textsf{Google Chrome} + +\item[Devices:] \textsf{Android} smart phones, \textsf{iPhones}, \textsf{Android} tablets +\end{description} +\end{minipage}} +\end{center}} + \parindent=0pt\parskip6pt \rheader{} -\addtoWebHeight{7\baselineskip} +%\addtoWebHeight{7\baselineskip} \begin{document} @@ -33,15 +46,15 @@ \begin{center}\bfseries\Large\color{blue}LTX4YT -- Links\end{center} \textbf{Favorites to play:} Itemized links below use the \verb~\ytvId~ and \verb~\ytvId*~ commands, -the only \texttt{*} command is ``Kung-Fu Fighting* (Original),'' this one is played with advertisements +the only \texttt{*} command is ``Kung-Fu Fighting* (Bruce Lee),'' this one is played with advertisements and related/unrelated content. The links in this document should work across all PDF viewers and across all devices. \begin{flushleft}\raggedcolumns \begin{multicols}{2}\bfseries \begin{itemize} -\item \ytvId{GZ9e3Dy7obA}{Kung-Fu Fighting (Bruce Lee)} +\item \ytvId*{GZ9e3Dy7obA}{Kung-Fu Fighting* (Bruce Lee)} -\item \ytvId*{jhUkGIsKvn0}{Kung-Fu Fighting* (Original)} +\item \ytvId{jhUkGIsKvn0}{Kung-Fu Fighting (Original)} \item \ytvId{_iUnOpPEg0w}{TegrityGuy} @@ -61,22 +74,12 @@ What follows are customized links created by \verb~\ytLink~. \ytLink{\embedId{5y9-EVmreU4}\params{autoplay=1&modestbranding=1}}{Lori's Corner: Episode \#1} (\verb~\embedId~ and \verb~\params~) -\ytLink{\embed{listType=search&list=Adobe Acrobat DC}}{Search for Adobe Acrobat DC} (\verb~\embed~ custom search) - -\ytLink{embed?listType=search&list=table tennis}{Totally custom search link} (surprise topic) +\ytLink{\search{Adobe Acrobat DC}}{Search for Adobe Acrobat DC} +\ytLink{\search{table tennis}}{Totally custom search link} (surprise topic) \ytLink{\channel{rocketjump}}{The RocketJump Channel} (\verb~\channel~) \ytLink{\user{freddiew}}{Freddie Diew's channel} (\verb~\user~) -\ytLink{\embedId{5y9-EVmreU4}\params{autoplay=1&controls=1&fs=1&modestbranding=1&playlist=T9Yzo_hlwP0,eNzrn8-JFSE}}{A playlist of three videos} - -\textbf{PDF viewers:} \textsf{Acrobat}, \textsf{Acrobat Reader DC}, \textsf{PDFX-Change}, \textsf{SumatraPDF}, \textsf{evince}, \textsf{TeXworks} - -\textbf{Browsers:} \textsf{Microsoft Edge}, \textsf{Firefox}, \textsf{Google Chrome} - -\textbf{Devices:} \textsf{Android} smart phones, \textsf{iPhones}, \textsf{Android} tablets - \end{document} - diff --git a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.pdf b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.pdf index 958c36cb..53163774 100644 Binary files a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.pdf and b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.pdf differ diff --git a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.tex b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.tex index 31f3ca49..4fcaf481 100644 --- a/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.tex +++ b/texmf-dist/doc/latex/ltx4yt/examples/web-pkg/ltx4yt-w2.tex @@ -2,7 +2,7 @@ \usepackage[designv,extended]{web} \usepackage[usepopup]{ltx4yt} -%\previewOn +%\previewOn \parindent0pt \parskip6pt @@ -28,8 +28,8 @@ \begin{popupmenu}{YTMenu} \puIdTitle{Select a YouTube Video}{} % A title has no ytId \begin{submenu}{title=Music Videos} - \puIdTitle{Kung-Fu Fighting (Bruce Lee)}{GZ9e3Dy7obA} - \puIdTitle{Kung-Fu Fighting* (Carl Douglas)}{jhUkGIsKvn0} + \puIdTitle{Kung-Fu Fighting* (Bruce Lee)}{GZ9e3Dy7obA} + \puIdTitle{Kung-Fu Fighting (Carl Douglas)}{jhUkGIsKvn0} \puIdTitle{Ink Spots - If I didn't care}{rvwfLe6sLis} \puIdTitle{Ink Spots* - My Prayer}{h7KJCns5v3g} \end{submenu} @@ -59,8 +59,8 @@ \ytUseMenus{YTMenu,YTSea} \declarePlayList{\playList}{% note: put parentheses within braces - \ytIdTitle{Kung-Fu Fighting {(Bruce Lee)}}{GZ9e3Dy7obA} - \ytIdTitle{Kung-Fu Fighting* {(Carl Douglas)}}{jhUkGIsKvn0} + \ytIdTitle{Kung-Fu Fighting* {(Bruce Lee)}}{GZ9e3Dy7obA} + \ytIdTitle{Kung-Fu Fighting {(Carl Douglas)}}{jhUkGIsKvn0} \ytIdTitle{RAF Sculthorpe {(Watch for my Mom at 6:22!)}}{K7H8QghVs9k} \ytIdTitle{Rocket Jump}{7XzdZ4KcI8Y} \ytIdTitle{Abdul And Cleopatra* - Jonathan Richman and the Modern Lovers}{mLDF5MBMWHE} @@ -74,7 +74,7 @@ -%\maketitle +\maketitle \begin{center}\bfseries\Large\color{blue}LTX4YT -- Forms\end{center} @@ -107,4 +107,9 @@ menu appears. Choose a YouTube video based on title. \ytSearch{}{11bp}\olBdry \ytClearQuery{}{11bp} +\ytLink{embed?listType=playlist&list=PL01A18BBA5912B01F}{{\LaTeX} Tutorial} (look for the play list control in upper right corner) + +\ytLink{\embedId{5y9-EVmreU4}\params{autoplay=1&controls=1&fs=1&modestbranding=1&playlist=T9Yzo_hlwP0,eNzrn8-JFSE}}{A playlist of three videos} + + \end{document} diff --git a/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.pdf b/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.pdf index 672b8292..50bc0928 100644 Binary files a/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.pdf and b/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.pdf differ diff --git a/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.tex b/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.tex index aa98bee5..b656d91c 100644 --- a/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.tex +++ b/texmf-dist/doc/latex/ltx4yt/ltx4yt-man.tex @@ -85,7 +85,7 @@ email={dpstory@acrotex.net}, subject={Playing YouTube Videos in PDF}, talksite={\url{www.acrotex.net}}, - version={0.7, 2020/07/30}, + version={1.0, 2021/06/08}, keywords={AcroTeX, PDF, YouTube, Browser}, copyrightStatus=True, copyrightNotice={Copyright (C) \the\year, D. P. Story}, @@ -301,8 +301,8 @@ this document are brown. \paragraph*{An example.} There are two ``Kung-Fu Fighting'' videos of interest: \texttt{GZ9e3Dy7obA} and \texttt{jhUkGIsKvn0}; we set up likes for the first and twice for the second: \begin{quote} - \ytvId{GZ9e3Dy7obA}{Kung-Fu Fighting (Bruce Lee)}\\ - \verb~\ytvId{GZ9e3Dy7obA}{Kung-Fu Fighting (Bruce Lee)}~\\[3pt] + \ytvId*{GZ9e3Dy7obA}{Kung-Fu Fighting (Bruce Lee)}\\ + \verb~\ytvId*{GZ9e3Dy7obA}{Kung-Fu Fighting (Bruce Lee)}~\\[3pt] \ytvId{jhUkGIsKvn0}{Kung-Fu Fighting (Carl Douglas)}\\ \verb~\ytvId{jhUkGIsKvn0}{Kung-Fu Fighting (Carl Douglas)}~\\[3pt] \ytvId*{jhUkGIsKvn0}{Kung-Fu Fighting* (Carl Douglas)}\\ @@ -419,8 +419,8 @@ on to the field names of these two field; The pair \cs{ytComboList} and Below is an abbreviated example, more extensive examples are found in the demo files sited at the beginning of this section. \declarePlayList{\playList}{% note: put parentheses within braces - \ytIdTitle{Kung-Fu Fighting {(Bruce Lee)}}{GZ9e3Dy7obA} - \ytIdTitle{Kung-Fu Fighting* {(Carl Douglas)}}{jhUkGIsKvn0} + \ytIdTitle{Kung-Fu Fighting* {(Bruce Lee)}}{GZ9e3Dy7obA} + \ytIdTitle{Kung-Fu Fighting {(Carl Douglas)}}{jhUkGIsKvn0} \ytIdTitle{J\"{u}rgen's "favorite" song*}{mLDF5MBMWHE} \ytIdTitle{Learn \cs{LaTeX} in one video}{VhmkLrOjLsw} } @@ -433,8 +433,8 @@ Below is an abbreviated example, more extensive examples are found in the demo f \def\2{\llap{\rlap{\ding{183}}\hskip\amtIndent\relax}}\relax \begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={!~@}] \declarePlayList{\playList}{% note: put parentheses within braces -!quad\ytIdTitle{Kung-Fu Fighting {(Bruce Lee)}}{GZ9e3Dy7obA} -!quad\ytIdTitle{Kung-Fu Fighting* {(Carl Douglas)}}{jhUkGIsKvn0} +!quad\ytIdTitle{Kung-Fu Fighting* {(Bruce Lee)}}{GZ9e3Dy7obA} +!quad\ytIdTitle{Kung-Fu Fighting {(Carl Douglas)}}{jhUkGIsKvn0} !1!quad\ytIdTitle{J\"{u}rgen's "favorite" song*}{mLDF5MBMWHE} !2!quad\ytIdTitle{Learn \cs{LaTeX} in one video}{VhmkLrOjLsw} } @@ -566,7 +566,8 @@ constructing links is to use the \cs{ytLink} command. \def\3{\rlap{\hskip\ytlength\relax\ding{184}}}% \def\4{\rlap{\hskip\ytlength\relax\ding{185}}}% \def\5{\rlap{\hskip\ytlength\relax\ding{186}}}% -\def\6{\rlap{\hskip\ytlength\relax\llap{\sffamily(presets for \cs{ytvId})\hskip2\fboxsep\hskip2\fboxrule}}}% +\def\6{\rlap{\hskip\ytlength\relax\ding{187}}}% +\def\7{\rlap{\hskip\ytlength\relax\llap{\sffamily(presets for \cs{ytvId})\hskip2\fboxsep\hskip2\fboxrule}}}% \begin{minipage}{\bxSize} \begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] !1\ytLink{\embedId{!ameta(ytvId)}\params{!ameta(params)}}{!ameta(text)} @@ -575,7 +576,8 @@ constructing links is to use the \cs{ytLink} command. !4\ytLink{!ameta(spec)}{!ameta(text)} !5\ytLink{\channel{!ameta(name)}}{!ameta(text)} !5\ytLink{\user{!ameta(name)}}{!ameta(text)} -!6\ytvIdPresets{!ameta(KV-pairs)} +!6\ytLink{\search{!ameta(search-string)}}{!ameta(text)} +!7\ytvIdPresets{!ameta(KV-pairs)} \end{Verbatim} \end{minipage}\eVerb Each of these has an optional first argument \ameta{KV-pairs} that is not shown above. Let's take a look at each of these in turn and illustrate with examples. Yes, @@ -609,16 +611,19 @@ for a discussion. \verb!\ytLink{\watchId{5y9-EVmreU4}!\\ \null\qquad\verb!\params{autoplay=1}}{Lori's Corner: Episode \#1}! - \item[\ding{184}] A more general form that allows you to formulate general URLs. For example, we \emph{search} - for {\YT} videos on \app{Adobe Acrobat DC}:\\[3pt] - \ytLink{\embed{listType=search&list=Adobe Acrobat DC}}{Search for Adobe Acrobat DC}\\ - \verb!\ytLink{\embed{listType=search&list=Adobe Acrobat DC}}!\\ - \null\qquad\verb!{Search for Adobe Acrobat DC}! + \item[\ding{184}] A more general form that allows you to formulate general URLs. For example, we display + a play list for Adobe Acrobat Pro training:\goodbreak + \ytLink{\embed{listType=playlist&list=PL_dhPga7ruudhQiL-dqVhGcCqDpH1KqR_}}{Adobe Acrobat Pro Training}\\ + \verb!\ytLink{\embed{%!\\ + \null\qquad\verb!listType=playlist&list=PL_dhPga7ruudhQiL-dqVhGcCqDpH1KqR_}}!\\ + \null\qquad\verb!{Adobe Acrobat Pro Training}!\\[3pt] + Look for the playlist control in the upper right corner of the window. \item[\ding{185}] The most general form, \ameta{spec} is simply appended, ie, \texttt{https://www.youtube.com/\ameta{spec}}\\[3pt] - \ytLink{embed?listType=search&list=LaTeX typesetting}{Totally custom search link}\\ - \verb|\ytLink{embed?listType=search&list=LaTeX typesetting}|\\ - \null\qquad\verb|{Totally custom search link}| + \ytLink{embed?listType=playlist&list=PL01A18BBA5912B01F}{{\LaTeX} Tutorial}\\ + \verb|\ytLink{embed?listType=playlist&list=PL01A18BBA5912B01F}|\\ + \null\qquad\verb|{{\LaTeX} Tutorial}|\\[3pt] + Look for the playlist control in the upper right corner of the window. \item[\ding{186}] There are a couple of URLs for displaying a channel on \YT, at least there are a couple that I have discovered. Use this form to see channel of a particular contributor to {\YT}. For example,\\[3pt] @@ -630,6 +635,28 @@ for a discussion. To get the true \ameta{name} of a channel, go to {\YT} and search for that channel. For example, search for \textsf{RocketJump}. On the resulting page, click on a RocketJump link and look at the location bar in the browser to see the path, it may come up \texttt{c/rocketjump} or \texttt{user/freddiew}. + +\item[\ding{187}] In the previous version of this package, the syntax for + making a {\YT} search was presented as, + \[ + \verb!\ytLink{\embed{listType=search&list=Adobe Acrobat DC}}! + \] + However, according to the + \href{https://developers.google.com/youtube/player_parameters}{Google + developers web site} the \texttt{listType=search} key-value is no longer + supported as of Nov.\ 15, 2020. Use the \cs{search} key to make this same search, + \begin{align*} + &\text{\ytLink{\search{Adobe Acrobat DC}}{Adobe Acrobat DC}}\\& + \cs{ytLink\darg{\cs{search}\darg{Adobe Acrobat DC}}\darg{Search for Adobe Acrobat DC}} + \end{align*} + The above link expands to the URL + \[ + \texttt{https://www.youtube.com/results?search\_query=Adobe Acrobat DC} + \] + Once on the {\YT} web site, there are controls to further filter the + search. + + \end{enumerate} \newtopic\noindent There is a multi-line version of \cs{ytLink}. diff --git a/texmf-dist/doc/latex/ltx4yt/ltx4yt.pdf b/texmf-dist/doc/latex/ltx4yt/ltx4yt.pdf index 19dc2f61..d6d9f6b6 100644 Binary files a/texmf-dist/doc/latex/ltx4yt/ltx4yt.pdf and b/texmf-dist/doc/latex/ltx4yt/ltx4yt.pdf differ diff --git a/texmf-dist/source/latex/ltx4yt/ltx4yt.dtx b/texmf-dist/source/latex/ltx4yt/ltx4yt.dtx index ef6356d9..58c17d1e 100644 --- a/texmf-dist/source/latex/ltx4yt/ltx4yt.dtx +++ b/texmf-dist/source/latex/ltx4yt/ltx4yt.dtx @@ -14,11 +14,11 @@ % %\NeedsTeXFormat{LaTeX2e}[1997/12/01] %\ProvidesPackage{ltx4yt} -% [2020/07/30 v0.7 ltx4yt: Play YouTube videos in the default browser (dps)] +% [2021/06/08 v1.0 ltx4yt: Play YouTube videos in the default browser (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref} -\hypersetup{pdfpagemode=useNone} +\hypersetup{pdfpagemode=UseNone} \usepackage{fancyvrb} %\def\texorpdfstring#1#2{#1} %\pdfstringdefDisableCommands{\let\\\textbackslash} @@ -54,7 +54,7 @@ \def\meta#1{\textsl{\texttt{#1}}} \def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} \def\ltag{<}\def\rtag{>} -\def\EXCL{!} +\def\EXCL{!}\def\QMRK{?}\def\EQU{=} \let\app\textsf\let\pkg\textsf \begin{document} \GetFileInfo{ltx4yt.sty} @@ -92,11 +92,13 @@ % course is to develop some basic commands for playing YouTube videos in the default browser, preferably % without any annoying advertisements. This can be done for some videos, but for others it cannot be done. % +%\changes{v1.0}{2021/06/08}{Modify search-type macro to conform with new YouTube player parameters} %\changes{v0.1}{2020/07/17}{Begin new package \string\pkg{ltx4yt}} %\changes{v0.2}{2020/07/17}{Commands to pass arguments to urls} %\changes{v0.6}{2020/07/25}{Final version before first publication} %\changes{v0.7}{2020/07/30}{Corrected upload} -% \begin{macrocode} +%\changes{v0.8}{2020/08/01}{Added catcode protection} +%\begin{macrocode} \RequirePackage{xkeyval} % \end{macrocode} % \leavevmode\IndexOpt{usepopup} When this option is taken, additional code to support @@ -110,6 +112,13 @@ \let\lo@dpu\relax \AtEndOfPackage{\lo@dpu} \ProcessOptions +\edef\yt@restoreCats{% + \catcode`\noexpand\"=\the\catcode`\"\relax + \catcode`\noexpand\'=\the\catcode`\'\relax + \catcode`\noexpand\,=\the\catcode`\,\relax + \catcode`\noexpand\!=\the\catcode`\!\relax +} +\@makeother\"\@makeother\'\@makeother\,\@makeother\! \RequirePackage{xcolor} \RequirePackage{eforms} % \end{macrocode} @@ -169,15 +178,22 @@ % \item[{\ameta{text}}:] The text that displays the link. %\end{itemize} %\end{quote} +%\changes{v0.8}{2020/08/01}{added \string\cs{ytIdParams}} % \begin{macrocode} +\def\ytvIdParams#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\ytvIdP@rams\@empty\else\def\ytvIdP@rams{#1}\fi} +\let\ytvIdP@rams\@empty \newcommand{\ytvId}{\@ifstar{\def\yt@ask{*}\yt@@vId} {\let\yt@ask\@empty\yt@@vId}} -\newcommand{\yt@@vId}[3][]{% +\newcommand{\yt@@vId}[3][]{\begingroup + \ifx\ytvIdP@rams\@empty\let\ques\@empty\else + \ifx\yt@ask\@empty\def\ques{?}\else\def\ques{&}\fi + \fi \ifx\yt@ask\@empty - \def\yt@lnk@hash{embed/#2}\else - \def\yt@lnk@hash{watch?v=#2}\fi + \def\yt@lnk@hash{embed/#2\ques\ytvIdP@rams}\else + \def\yt@lnk@hash{watch?v=#2\ques\ytvIdP@rams}\fi \setLink[\presets{\yt@vIdPresets}#1 - \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}% + \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}\endgroup } % \end{macrocode} % \end{macro} @@ -188,12 +204,15 @@ % \begin{macrocode} \newcommand{\ytvIdML}{\@ifstar{\def\yt@ask{*}\yt@@vIdML} {\let\yt@ask\@empty\yt@@vIdML}} -\newcommand{\yt@@vIdML}[3][]{% +\newcommand{\yt@@vIdML}[3][]{\begingroup + \ifx\ytvIdP@rams\@empty\let\ques\@empty\else + \ifx\yt@ask\@empty\def\ques{?}\else\def\ques{&}\fi + \fi \ifx\yt@ask\@empty - \def\yt@lnk@hash{embed/#2}\else - \def\yt@lnk@hash{watch?v=#2}\fi + \def\yt@lnk@hash{embed/#2\ques\ytvIdP@rams}\else + \def\yt@lnk@hash{watch?v=#2\ques\ytvIdP@rams}\fi \mlsetLink[\presets{\yt@vIdPresets}#1 - \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}% + \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}\endgroup } % \end{macrocode} % \end{macro} @@ -217,6 +236,8 @@ % A form that does not specify a video ID. It is useful for more general actions, such as % searches, for example, % \begin{flushleft} +% \textcolor{red}{\textbf{Note:} \texttt{listType=search} is deprecated and will no longer be supported +% as of 15 November, 2020.} % |\ytLink{\embed{listType=search&list=Adobe Acrobat DC}}|\\ % \qquad|{Search for Adobe Acrobat DC}| % \end{flushleft} @@ -226,6 +247,8 @@ % \item |\ytLink{|\ameta{spec}|}{|\ameta{text}|}|\\[3pt] The most general form. The action of this % link is |\URI{\ytURL/|\ameta{spec}|}|; for example, % \begin{flushleft} +% \textcolor{red}{\textbf{Note:} \texttt{listType=search} is deprecated and will no longer be supported +% as of 15 November, 2020.} % |\ytLink{embed?listType=search&list=Adobe Acrobat DC}|\\ % \qquad|{Search for Adobe Acrobat DC}| % \end{flushleft} @@ -242,7 +265,7 @@ % As was illustrated above, the custom link \cs{ytLink} can pass various recognizable % parameters to YouTube. After reviewing, % \begin{flushleft} -% \url{https://developers.google.com/youtube/player_parameters#Parameters} +% \url{https://developers.google.com/youtube/player_parameters} % \end{flushleft} % the following parameters are recommended, some of them are illustrated in the % sample document \texttt{ltx4yt-1.tex}: @@ -252,7 +275,9 @@ % \item \texttt{fs=\ameta{\upshape{0\string|1}}} (default \texttt{1}) % \item \texttt{modestbranding=\ameta{\upshape{0\string|0}}} % \item \texttt{playlist=\ameta{list}} -% \item \texttt{listType=search\&list=\ameta{query}} +% \item \texttt{listType=search\&list=\ameta{query}}\\ +% \textcolor{red}{\textbf{Note:} \texttt{listType=search} is deprecated and will no longer be supported +% as of 15 November, 2020.} % \end{itemize} % The specialized needs of the document author is most easily accommodated through the use % of the \cs{ytLink} command, for example, @@ -263,7 +288,7 @@ % \begin{macrocode} \newif\ifytwatch \ytwatchfalse % \end{macrocode} -% \paragraph*{The \cs{ytLink} command.} Before getting to \cs{ytLink} an d\cs{ytLinkML}, +% \paragraph*{The \cs{ytLink} command.} Before getting to \cs{ytLink} and \cs{ytLinkML}, % there is a long stream of commands to parse the \ameta{spec} argument of \cs{ytLink}. % It goes through looking for \cs{watchId}, \cs{embedId}, \cs{embed}, and \cs{params}. % As it progresses, it adds code to the macro \cs{ytspec}, which at the end of things @@ -302,6 +327,7 @@ \def\embedId##1{embed/##1}% \def\params##1{##1}\def\embed##1{embed?##1}% \def\watchId##1{watch?v=##1}\def\channel##1{c/##1}% + \def\search##1{results?search_query=##1}% \def\user##1{user/##1}% \yt@@parse#2\@nil % returns arg in \ytspec \def\URLArg{\ytURL/\ytspec}% @@ -318,6 +344,7 @@ \def\embedId##1{embed/##1}% \def\params##1{##1}\def\embed##1{embed?##1}% \def\watchId##1{watch?v=##1}\def\channel##1{c/##1}% + \def\search##1{results?search_query=##1}% \def\user##1{user/##1}% \yt@@parse#2\@nil % returns arg in \ytspec \def\URLArg{\ytURL/\ytspec}% @@ -551,14 +578,18 @@ % \end{macro} % \begin{macro}{\ytSearch}\nmpsep{[\ameta{opts}]\darg{\ameta{wd}}\darg{\ameta{ht}}} % A push button what will search YouTube based on the query string. +% \textcolor{red}{\textbf{Note:} \texttt{listType=search} is deprecated and will +% no longer be supported as of 15 November, 2020.} +% \changes{v1.0}{2021/06/08}{Replace \string\texttt{embed\string\QMRK} in search with +% \string\texttt{results\string\QMRK\space search\string\_query\string\EQU}} % \begin{macrocode} \newcommand{\ytSearch}[3][]{% \pushButton[\CA{Search}#1\AAmouseup{% var f=this.getField("ytSearchTxt");\r var v=f.value;\r - if ( v.replace(/\string\s/g,"") != "" )\r\t - app.launchURL("\ytURL/embed?listType=search&list="+v);} - ]{ytSearchBtn}{#2}{#3}} + if ( (v=v.replace(/\string\\s/g,"+")) != "" )\r\t + app.launchURL("\ytURL/results?search_query="+v); + }]{ytSearchBtn}{#2}{#3}} % \end{macrocode} % \end{macro} % \begin{macro}{\ytClearQuery}\nmpsep{[\ameta{opts}]\darg{\ameta{wd}}\darg{\ameta{ht}}} @@ -643,9 +674,8 @@ console.println("will launch url: https://www.youtube.com/"+_hash); % \begin{macrocode} %<*pujs> %<*package> +\yt@restoreCats % % \end{macrocode} % \Finale \endinput - -https://developers.google.com/youtube/iframe_api_reference?csw=1 diff --git a/texmf-dist/tex/latex/ltx4yt/ltx4yt.sty b/texmf-dist/tex/latex/ltx4yt/ltx4yt.sty index 685ed1dc..83a8a080 100644 --- a/texmf-dist/tex/latex/ltx4yt/ltx4yt.sty +++ b/texmf-dist/tex/latex/ltx4yt/ltx4yt.sty @@ -19,7 +19,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[1997/12/01] \ProvidesPackage{ltx4yt} - [2020/07/30 v0.7 ltx4yt: Play YouTube videos in the default browser (dps)] + [2021/06/08 v1.0 ltx4yt: Play YouTube videos in the default browser (dps)] \RequirePackage{xkeyval} \DeclareOption{usepopup}{\def\lo@dpu{\InputIfFileExists{ytpu.def} {\PackageInfo{ltx4yt}{Loading ytpu.def}} @@ -28,6 +28,13 @@ \let\lo@dpu\relax \AtEndOfPackage{\lo@dpu} \ProcessOptions +\edef\yt@restoreCats{% + \catcode`\noexpand\"=\the\catcode`\"\relax + \catcode`\noexpand\'=\the\catcode`\'\relax + \catcode`\noexpand\,=\the\catcode`\,\relax + \catcode`\noexpand\!=\the\catcode`\!\relax +} +\@makeother\"\@makeother\'\@makeother\,\@makeother\! \RequirePackage{xcolor} \RequirePackage{eforms} \ifx\lo@dpu\relax\else @@ -39,23 +46,32 @@ \providecommand{\URI}[1]{/S/URI/URI(#1)} \def\ytNF{false} \def\ytURL{https://www.youtube.com} +\def\ytvIdParams#1{\def\@rgi{#1}\ifx\@rgi\@empty + \let\ytvIdP@rams\@empty\else\def\ytvIdP@rams{#1}\fi} +\let\ytvIdP@rams\@empty \newcommand{\ytvId}{\@ifstar{\def\yt@ask{*}\yt@@vId} {\let\yt@ask\@empty\yt@@vId}} -\newcommand{\yt@@vId}[3][]{% +\newcommand{\yt@@vId}[3][]{\begingroup + \ifx\ytvIdP@rams\@empty\let\ques\@empty\else + \ifx\yt@ask\@empty\def\ques{?}\else\def\ques{&}\fi + \fi \ifx\yt@ask\@empty - \def\yt@lnk@hash{embed/#2}\else - \def\yt@lnk@hash{watch?v=#2}\fi + \def\yt@lnk@hash{embed/#2\ques\ytvIdP@rams}\else + \def\yt@lnk@hash{watch?v=#2\ques\ytvIdP@rams}\fi \setLink[\presets{\yt@vIdPresets}#1 - \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}% + \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}\endgroup } \newcommand{\ytvIdML}{\@ifstar{\def\yt@ask{*}\yt@@vIdML} {\let\yt@ask\@empty\yt@@vIdML}} -\newcommand{\yt@@vIdML}[3][]{% +\newcommand{\yt@@vIdML}[3][]{\begingroup + \ifx\ytvIdP@rams\@empty\let\ques\@empty\else + \ifx\yt@ask\@empty\def\ques{?}\else\def\ques{&}\fi + \fi \ifx\yt@ask\@empty - \def\yt@lnk@hash{embed/#2}\else - \def\yt@lnk@hash{watch?v=#2}\fi + \def\yt@lnk@hash{embed/#2\ques\ytvIdP@rams}\else + \def\yt@lnk@hash{watch?v=#2\ques\ytvIdP@rams}\fi \mlsetLink[\presets{\yt@vIdPresets}#1 - \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}% + \A{\URI{\ytURL/\yt@lnk@hash}}]{#3}\endgroup } \newif\ifytwatch \ytwatchfalse \def\yt@@parse{\let\ytspec\@empty\yt@parse} @@ -83,6 +99,7 @@ \def\embedId##1{embed/##1}% \def\params##1{##1}\def\embed##1{embed?##1}% \def\watchId##1{watch?v=##1}\def\channel##1{c/##1}% + \def\search##1{results?search_query=##1}% \def\user##1{user/##1}% \yt@@parse#2\@nil % returns arg in \ytspec \def\URLArg{\ytURL/\ytspec}% @@ -93,6 +110,7 @@ \def\embedId##1{embed/##1}% \def\params##1{##1}\def\embed##1{embed?##1}% \def\watchId##1{watch?v=##1}\def\channel##1{c/##1}% + \def\search##1{results?search_query=##1}% \def\user##1{user/##1}% \yt@@parse#2\@nil % returns arg in \ytspec \def\URLArg{\ytURL/\ytspec}% @@ -159,9 +177,9 @@ \pushButton[\CA{Search}#1\AAmouseup{% var f=this.getField("ytSearchTxt");\r var v=f.value;\r - if ( v.replace(/\string\s/g,"") != "" )\r\t - app.launchURL("\ytURL/embed?listType=search&list="+v);} - ]{ytSearchBtn}{#2}{#3}} + if ( (v=v.replace(/\string\\s/g,"+")) != "" )\r\t + app.launchURL("\ytURL/results?search_query="+v); + }]{ytSearchBtn}{#2}{#3}} \newcommand{\ytClearQuery}[3][]{% \pushButton[\CA{Clear}#1 \AAmouseup{this.resetForm("ytSearchTxt");} -- cgit v1.2.3