summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/rmannot/examples/rma/vpx-btn.tex
blob: 6abd2873eddee4b594da6d1729a48d06f17f24e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
\documentclass{article}
\usepackage{amsmath}
%
% the driver line is not necessary if you
% have aebpro.cfg configured to your driver.
%
\usepackage[%
%    driver=dvips,
    web={pro,tight,usesf},
    eforms,graphicxsp={showembeds}
]{aeb_pro}
\usepackage{rmannot}

\useVideoPlayerX

\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom
\screensize{5in}{5.5in}             % height, width

\DeclareDocInfo
{
    title=The \texttt{rmannot} Package\texorpdfstring{\\[1ex]}{: }Playing Videos with VPX,
    author=D. P. Story,
    university=Acro\negthinspace\TeX.Net,
    email=dpstory@acrotex.net,
    subject={Demo of the rmannot package, playing and streaming videos},
    keywords={Adobe Acrobat, JavaScript, VideoPlayerX, ActionScript, RMA},
    talksite=\url{http://www.acrotex.net},
    talkdate={October 2016},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) 2008--\the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\talkdateLabel{Published:}

\def\AcroTeX{Acro\!\TeX}

\newcommand{\myRMFiles}{%
    C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/rmannot/RMfiles}
\saveNamedPath{horse1}{\myRMFiles/horse1.flv}
\saveNamedPath{playtime}{\myRMFiles/sample.flv}
\saveNamedPath{elephants}{http://www.math.uakron.edu/~dpstory/videos/elephants.flv}
\saveNamedPath{loadingvid}{\myRMFiles/loadingvid.mp4}
\saveNamedPath{skin8}{\PathToSkins/MinimaUnderPlayBackSeekCounterVolMuteNoFull.swf}
\makePoster[hiresbb]{aebmovie_poster}{aebmovie_poster}

\begin{insDLJS}{playerJS}{JS for VPX}
var isOver=/over(?!.*?\/)/i; // search for "over" even in a url
function playerX(rm,source,skin,skinColor) {
    rm.activated = true;
    rm.callAS(\mmSkin, skin);
    if ( isOver.test(skin) ) rm.callAS(\mmSkinAutoHide, true);
    rm.callAS(\mmSkinColor, skinColor);
    rm.callAS(\mmSource, source);
    rm.callAS(\mmShowLoopButton, false);
    rm.callAS(\mmPlay);
}
function vpx_init(r,pg) {
    var rm=this.getAnnotRichMedia(pg,r);
    rm.callAS(\mmIsLooping,false);
    rm.callAS(\mmSetScaleMode, "maintainAspectRatio"); // "noScale", "exactFit", "maintainAspectRatio" (alias "showAll")
}
\end{insDLJS}

\newcommand\playJS[3]{%
    var rm = this.getAnnotsRichMedia(this.pageNum)[0];\r
    if (rm.activated)\r\t
        playerX(rm,"#1","\Name{#2}","#3");\r
    else {\r\t
        rm.activated=true;\r\t
        var _to=app.setTimeOut('playerX(rm,"#1","\Name{#2}","#3")',1000);\r
    }
}

\parindent=0pt\parskip6pt\pagestyle{empty}

\begin{document}

\maketitle

\begin{center}%\previewtrue
\resizebox{.67\linewidth}{!}
    {\rmAnnot[poster=aebmovie_poster,skin=none,name=myRMA,
        resources={horse1,playtime,skin1,skin2,skin3}]{320bp}{240bp}{loadingvid}}\\[3bp]
    \pushButton[\TU{Embedded}\CA{Horse}\A{\JS{\playJS{\Name{horse1}}{skin2}{0x5F5F5F}}}]{playHorse}{}{11bp}\kern1bp
    \pushButton[\TU{Embedded}\CA{Playing}\A{\JS{\playJS{\Name{playtime}}{skin2}{0xFF0000}}}]{playTime}{}{11bp}\kern1bp
    \pushButton[\TU{Streamed}\CA{Elephants}\A{\JS{\playJS{\urlName{elephants}}{skin3}{0x0000FF}}}]{playElephants}{}{11bp}
\end{center}

\end{document}