diff options
Diffstat (limited to 'tex/context/base/mkiv/lpdf-mov.lua')
-rw-r--r-- | tex/context/base/mkiv/lpdf-mov.lua | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/tex/context/base/mkiv/lpdf-mov.lua b/tex/context/base/mkiv/lpdf-mov.lua index a0f82b25b..0f0eefd2f 100644 --- a/tex/context/base/mkiv/lpdf-mov.lua +++ b/tex/context/base/mkiv/lpdf-mov.lua @@ -17,13 +17,16 @@ local pdfdictionary = lpdf.dictionary local pdfarray = lpdf.array local pdfborder = lpdf.border +-- We should actually make sure that inclusion only happens once. But this mechanism +-- is dropped in pdf anyway so it will go away (read: mapped onto the newer mechanisms). + function nodeinjections.insertmovie(specification) -- managed in figure inclusion: width, height, factor, repeat, controls, preview, label, foundname local width = specification.width local height = specification.height local factor = specification.factor or number.dimenfactors.bp local moviedict = pdfdictionary { - F = specification.foundname, + F = specification.foundname or specification.file, Aspect = pdfarray { factor * width, factor * height }, Poster = (specification.preview and true) or false, } @@ -36,7 +39,7 @@ function nodeinjections.insertmovie(specification) Subtype = pdfconstant("Movie"), Border = bs, C = bc, - T = format("movie %s",specification.label), + T = format("movie %s",specification.tag or specification.label), Movie = moviedict, A = controldict, } @@ -44,24 +47,23 @@ function nodeinjections.insertmovie(specification) end function nodeinjections.insertsound(specification) - -- managed in interaction: repeat, label, foundname - local soundclip = interactions.soundclips.soundclip(specification.label) - if soundclip then - local controldict = pdfdictionary { - Mode = (specification["repeat"] and pdfconstant("Repeat")) or nil - } - local sounddict = pdfdictionary { - F = soundclip.filename - } - local bs, bc = pdfborder() - local action = pdfdictionary { - Subtype = pdfconstant("Movie"), - Border = bs, - C = bc, - T = format("sound %s",specification.label), - Movie = sounddict, - A = controldict, + local controldict = nil + if specification["repeat"] then + controldict = pdfdictionary { + Mode = pdfconstant("Repeat") } - context(nodeinjections.annotation(0,0,0,action())) -- test: context(...) end + local sounddict = pdfdictionary { + F = specification.foundname or specification.file + } + local bs, bc = pdfborder() + local action = pdfdictionary { + Subtype = pdfconstant("Movie"), + Border = bs, + C = bc, + T = format("sound %s",specification.tag or specification.label), + Movie = sounddict, + A = controldict, + } + context(nodeinjections.annotation(0,0,0,action())) -- test: context(...) end |