ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Michal Vlasák via ntg-context" <ntg-context@ntg.nl>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Cc: "Michal Vlasák" <lahcim8@gmail.com>, "Pablo Rodriguez" <oinos@gmx.es>
Subject: Re: JavaScript in multimedia PDF
Date: Sun, 08 Aug 2021 23:00:10 +0200	[thread overview]
Message-ID: <CDEFMBFFF77U.3PFSB801RVQ1D@phobos> (raw)
In-Reply-To: <0e6922fe-35f8-8542-3ee2-8739fd6e2949@gmx.es>

On Sun Aug 8, 2021 at 8:22 PM CEST, Pablo Rodriguez via ntg-context wrote:
> I don’t know why I get the following message:
>
> TypeError: a.doc is undefined
>
> It seems to be caused by "app.media.openPlayer", but the code is copied
> from the documentation Adobe released early this year.

Is there a newer document than "JavaScript for Acrobat API Reference"
(May 2015)?

Anyways, I thought that the culprit is that you only specify the
rendition (what to play) and not screen (where to play):


     function GoToFirstSlide(label) {
     this.pageNum = 0 ;
     var rendition = this.media.getRendition(label) ;
    +var screen = this.media.getAnnots({ nPage: 0})[0];
     var player = app.media.openPlayer({
         rendition: rendition,
    +    annot: screen,
       });
     }

But as it turns out, while the screen query succesfully returns an
object, the rendition query returns null.

The PDF 1.7 standard specifies that the name (/N) of Rendition PDF
object should be Unicode, but that doesn't seem to make it work either,
as does deleting the name of the media clip (which was the same).

(But I now get "Invalid arguments" error for the "app.media.openPlayer"
call, which is kind of expected.)

Can you confirm, that "rendition" is null on your side as well?

    console.println(rendition);
    console.println(screen);
    console.show();


Michal Vlasák
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-08-08 21:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08 18:22 Pablo Rodriguez via ntg-context
2021-08-08 21:00 ` Michal Vlasák via ntg-context [this message]
2021-08-09  6:32   ` Pablo Rodriguez via ntg-context
2021-08-10 21:52     ` Michal Vlasák via ntg-context
2021-08-11 13:59       ` Pablo Rodriguez via ntg-context
2021-08-11 20:40         ` Michal Vlasák via ntg-context
2021-08-11 22:55           ` Hans Hagen via ntg-context
2021-08-12  1:02             ` Michal Vlasák via ntg-context
2021-08-12 14:36               ` Pablo Rodriguez via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CDEFMBFFF77U.3PFSB801RVQ1D@phobos \
    --to=ntg-context@ntg.nl \
    --cc=lahcim8@gmail.com \
    --cc=oinos@gmx.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).