question about multimedia renderings
Dear list, I’m planning to add an explanation about multimedia inclusion to the wiki, but first I wanted to discuss an issue I have found. I have the following sample (adapted from scrn-wid.mklx): \setupinteraction[state=start] \starttext \null\page \definerenderingwindow[myrenderingwindow] [width=\textwidth, height=\textwidth, %openpageaction=StartCurrentRendering, %closepageaction=StopCurrentRendering, openpageaction=StartRendering{\currentrendering}, closepageaction=StopRendering{\currentrendering}, framecolor=red] \startTEXpage[offset=1em, pagestate=start] \userendering[key-name][video/mp4][video.mp4] [embed=yes, auto, ] \placerenderingwindow[myrenderingwindow][key-name] \stopTEXpage \null\page \stoptext \userendering[][][auto] would enable automatic play or stop when the page with the rendering is reached or left (respectively). I cannot get it working. Neither do work the commented lines in \definerenderingwindow. Inspecting the PDF code, the screen annotation only gets an additional actions dictionary (https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/...) with /PO and /PC entries, when open and close page actions are set to StartRendering{\currentrendering} and StopRendering{\currentrendering}. Just for reference, this is the screen annotation object with the additional actions dictionary: 13 0 obj << /Type /Annot /A << /AN 13 0 R /OP 0 /R 12 0 R /S /Rendition >> /AA << /PC << /AN 13 0 R /OP 1 /R 12 0 R /S /Rendition >> /PO << /AN 13 0 R /OP 0 /R 12 0 R /S /Rendition >> >> /Border [ 0 0 0 ] /P 14 0 R /Subtype /Screen /T <FEFF006B00650079002D006E0061006D0065> /Rect [ 12.353668 12.353668 437.54664 437.54664 ]
endobj
And this is what I get with \userendering[][][auto]: 13 0 obj << /Type /Annot /A << /AN 13 0 R /OP 0 /R 12 0 R /S /Rendition >> /Border [ 0 0 0 ] /P 14 0 R /Subtype /Screen /T <FEFF006B00650079002D006E0061006D0065> /Rect [ 12.353668 12.353668 437.54664 437.54664 ]
endobj
Could anyone be so kind to confirm the issue? Many thanks for your help, Pablo
On Sun Jan 15, 2023 at 10:49 PM CET, Pablo Rodriguez via ntg-context wrote:
Dear list,
I’m planning to add an explanation about multimedia inclusion to the wiki, but first I wanted to discuss an issue I have found.
I have the following sample (adapted from scrn-wid.mklx):
\setupinteraction[state=start] \starttext \null\page \definerenderingwindow[myrenderingwindow] [width=\textwidth, height=\textwidth, %openpageaction=StartCurrentRendering, %closepageaction=StopCurrentRendering, openpageaction=StartRendering{\currentrendering}, closepageaction=StopRendering{\currentrendering}, framecolor=red] \startTEXpage[offset=1em, pagestate=start] \userendering[key-name][video/mp4][video.mp4] [embed=yes, auto, ] \placerenderingwindow[myrenderingwindow][key-name] \stopTEXpage \null\page \stoptext
\userendering[][][auto] would enable automatic play or stop when the page with the rendering is reached or left (respectively).
I cannot get it working. Neither do work the commented lines in \definerenderingwindow.
Inspecting the PDF code, the screen annotation only gets an additional actions dictionary (https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/...) with /PO and /PC entries, when open and close page actions are set to StartRendering{\currentrendering} and StopRendering{\currentrendering}.
Just for reference, this is the screen annotation object with the additional actions dictionary:
13 0 obj << /Type /Annot /A << /AN 13 0 R /OP 0 /R 12 0 R /S /Rendition >> /AA << /PC << /AN 13 0 R /OP 1 /R 12 0 R /S /Rendition >> /PO << /AN 13 0 R /OP 0 /R 12 0 R /S /Rendition >> >> /Border [ 0 0 0 ] /P 14 0 R /Subtype /Screen /T <FEFF006B00650079002D006E0061006D0065> /Rect [ 12.353668 12.353668 437.54664 437.54664 ]
endobj
And this is what I get with \userendering[][][auto]:
13 0 obj << /Type /Annot /A << /AN 13 0 R /OP 0 /R 12 0 R /S /Rendition >> /Border [ 0 0 0 ] /P 14 0 R /Subtype /Screen /T <FEFF006B00650079002D006E0061006D0065> /Rect [ 12.353668 12.353668 437.54664 437.54664 ]
endobj
Could anyone be so kind to confirm the issue?
AFAICT I based the auto option on the "Start/StopCurrentRendering" actions (2021-09-14) which we later agreed to remove (2021-09-17), so there was a bug. Reasoning for removal of the "Current" variants at the time: On Tue Sep 14, 2021 at 9:37 PM CEST, Hans Hagen wrote:
Because \currentrendering is local we could as well drop the Current variants ... it's not like people will put hundreds of videos in a file so enforcing the named one makes sense.
So Start/StopRendering{label} should be used instead (Hans already redid most of the examples, you found the two places in scrn-wid.mklx where there is an incosistency. I would think that something like the attached could work. But in some cases it fails on the TeX side with something I am not sure about. I probably overlooked something. Anyways the idea is to just use the Start/StopRendering actions with the correct label. Michal
On 1/16/23 02:42, Michal Vlasák via ntg-context wrote:
[...] I would think that something like the attached could work. But in some cases it fails on the TeX side with something I am not sure about. I probably overlooked something. Anyways the idea is to just use the Start/StopRendering actions with the correct label.
Hi Michal, many thanks for your reply. Your code fixes the "auto" option. At least with the following sample: \setupinteraction[state=start] \unexpanded\def\IncludeVideo[#1] {\definerenderingwindow[#1] [width=\textwidth, height=\textwidth, framecolor=red] \userendering[#1][video/mp4][#1] [embed=yes, auto] \placerenderingwindow[#1][#1]} \starttext \null\page \startTEXpage[offset=1em, pagestate=start] \IncludeVideo[video-1.mp4] \stopTEXpage \null\page \startTEXpage[offset=1em, pagestate=start] \IncludeVideo[video-2.mp4] \stopTEXpage \null\page \stoptext I attach a diff and complete file with the the fix from today and the addition of controls, volume, repeat and opacity you sent me some days ago (already sent in https://mailman.ntg.nl/pipermail/dev-context/2022/003957.html). Just in case Hans may review your code and merge into ConTeXt. Many thanks for your help, Pablo
participants (2)
-
Michal Vlasák
-
Pablo Rodriguez