summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/embed.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/base/embed.asy')
-rw-r--r--Build/source/utils/asymptote/base/embed.asy44
1 files changed, 21 insertions, 23 deletions
diff --git a/Build/source/utils/asymptote/base/embed.asy b/Build/source/utils/asymptote/base/embed.asy
index 165de0b7534..8f982332d86 100644
--- a/Build/source/utils/asymptote/base/embed.asy
+++ b/Build/source/utils/asymptote/base/embed.asy
@@ -1,38 +1,36 @@
if(latex()) {
usepackage("hyperref");
texpreamble("\hypersetup{"+settings.hyperrefOptions+"}");
- texpreamble("
-\ifx\pdfhorigin\undefined%
-\usepackage[3D,dvipdfmx]{movie15}
-\else%
-\usepackage[3D]{movie15}
-\fi%
-\FPmessagesfalse%
-");
+ usepackage("media9","bigfiles");
}
-// See http://www.ctan.org/tex-archive/macros/latex/contrib/movie15/README
+// See http://www.ctan.org/tex-archive/macros/latex/contrib/media9/doc/media9.pdf
// for documentation of the options.
-// Embed object in pdf file
-string embed(string name, string options="", real width=0, real height=0)
+// Embed PRC or SWF content in pdf file
+string embedplayer(string name, string text="", string options="",
+ real width=0, real height=0)
{
- if(options != "") options="["+options+"]{";
- if(width != 0) options += (string) (width/pt)+"pt";
- options += "}{";
- if(height != 0) options += (string) (height/pt)+"pt";
- return "\includemovie"+options+"}{"+name+"}";
+ if(width != 0) options += ",width="+(string) (width/pt)+"pt";
+ if(height != 0) options += ",height="+(string) (height/pt)+"pt";
+ return "\includemedia["+options+"]{"+text+"}{"+name+"}";
}
-string hyperlink(string url, string text)
+// Embed media in pdf file
+string embed(string name, string text="", string options="",
+ real width=0, real height=0)
{
- return "\href{"+url+"}{"+text+"}";
+ return embedplayer("VPlayer.swf",text,"label="+name+
+ ",activate=pageopen,addresource="+name+
+ ",flashvars={source="+name+"&scaleMode=letterbox},"+
+ options,width,height);
}
-string link(string label, string text, string options="")
+string link(string label, string text="Play")
{
- // Run LaTeX twice to resolve references.
- settings.twice=true;
- if(options != "") options="["+options+"]";
- return "\movieref"+options+"{"+label+"}{"+text+"}";
+ return "\PushButton[
+ onclick={
+ annotRM['"+label+"'].activated=true;
+ annotRM['"+label+"'].callAS('playPause');
+ }]{\fbox{"+text+"}}";
}