Using the “Video Player Plus” with the “Insert VPP JavaScript” Action

| No Comments

This article is part two of “Actions in Action at Adobe”. Please read through the first article and familiarize yourself with and install the Video Player Plus before continuing.

Note: Instruction in this post require Adobe Acrobat X Pro

Overview:

The new Actions Wizard in Adobe Acrobat X can be leveraged to automate repetitive tasks. One such task is the ability to add document level JavaScript and set actions on objects in a PDF document. Because object level JavaScript can only be attached to specific objects, buttons and layers, in this use case, strict naming conventions must be adhered to when authoring documents using InDesign.

Setup:
After setting up the Video Player Plus, download and open the Insert_VPP_JavaScripts.sequ action file and allow Acrobat to add it to the list of Actions. This file contains the Action that will appear in the Actions Wizard panel in Acrobat X Pro.

Authoring Guidelines for InDesign:

Layer Naming:
When exporting to PDF, only top level InDesign layers are converted to PDF layers. In order for the inserted JavaScript to function properly the following naming conventions must be used.

warning

The ‘‘warning’’ layer contains a single graphic that warns the user that they are not viewing the PDF file in a supported tool. Adobe viewers are able to hide this layer through JavaScript that runs when the document is opened. Third party tools typically will not be capable of hiding this layer. This graphic should be on the first page and in the upper ½ of the layout. It may, in other forms, be used throughout the document but is not required.

interactive

Document elements which should appear in the PDF file only when opened in Reader version 9 or higher

non-Interactive

Document elements which should appear in the PDF file only when opened in a version of Reader lower than version 9

playMessage

The only object on this layer should be a message that will appear when a user rolls over the ‘‘playMovie’’ button in the PDF file

playMessageHD

The only object on this layer should be a message that will appear when a user rolls over the ‘‘playMovieHD’’ button in the PDF file

playMessageMask

The only object on this layer should be a white box that masks the ‘‘playMessage’’ and ‘‘playMessageHD’’ layers. Because most 3rd party viewers display all layers all the time, the ‘‘playMessage’’ and
‘‘playMessageHD’’ will always show and the overlapping text can be distracting. This layer compensates for that condition. This layer must be on top of the ‘‘playMessage’’ and ‘‘playMessageHD’’ layers.

static

Optional: All document elements that should appear regardless of viewer version should be on this layer. This layer name is ignored by the scripts and is provided only for clarity. You are not require to use the name ‘‘static’’ or only add these types of elements to a single layer but it is good convention for future editing.

Note: Hidden layers in InDesign are hidden by default when exported to PDF and viewed in Adobe viewers. Some 3rd party viewers, inaccurately, do not hide these layers. You should consider this when creating your InDesign file. Do not rely on hidden layers to hide objects that you no not wish to be seen, remove them instead.

IMPORTANT: Be sure all layers are set to be visible before exporting.

Button Naming:
There are two important buttons that the JavaScript in the Insert_VPP_JavaScripts will modify. In order for the JavaScript to function properly the following naming conventions must be used.

playMovie

This button triggers the embedded movie to play. Only the ‘‘Normal’’ and ‘‘Rollover’’ stated need to be defined. No actions need to be defined using InDesign for this button. The Insert_VPP_JavaScripts Action will add the appropriate actions.

playMovieHD

This button triggers the streaming movie to play. Only the ‘‘Normal’’ and ‘‘Rollover’’ stated need to be defined. No actions need to be defined using InDesign for this button. The Insert_VPP_JavaScripts Action will add the appropriate actions. When the action is run, you will be asked to supply the URL to the streaming movie. This is not the embed code. The URL must point to a video file and the name must end in either .FLV or .F4V.

Authoring the Embedded Video:
The embedded video needs to have a poster image derived from the video itself, preferably near the start of the video but good design trumps this guideline. Choose an image that works for the rest of the page. There should be only one embedded video per document. Additional videos can be added as links to Adobe TV or other hosted libraries.

Use the controller ‘‘SkinOverAllNoVolNoCaptionNoFull’’ Check ‘‘Show Controller on Rollover’’
Navigation Points are not required.

Creating your Interactive PDF file.

  1. Export the InDesign file to PDF using the settings in the image below.
  2. Upon completion, the file will open in Acrobat
  3. Select File -> Action Wizard -> Insert_VPP_JavaScripts
  4. You will be asked to supply the URL to the streaming movie. This is not the embed code. The URL must point to a video file and the name must end in either .FLV or .F4V.
  5. When the action completes, save the file. Note: even though the save button is dimmed, you need to save the file; part of the JavaScript that runs resets the save flag on the file so that users are not prompted to save the file when button states are changed.
  6. Test the file.

You can try this out using the resources below.

Meridien InDesign Template – You’ll get a few linking errors when you open it up, ignore them. The file is completely functional. The file contains a low resolution embedded video.

Example link to Streaming Video – You can stream this example video from the Adobe TV server. Use this URL in step 4 above. Copy the text, don’t go to the link.

Completed Meridien PDF file: Your final file should work like this one.