Skip to main content
Skip table of contents

Presentation JavaScript API

pitcherInit()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Pitcher calls this function on page scroll. Important: Do not add listeners on Page Init or Page Load, as those can be called when the page is cached! Instead, please override the PitcherInit function.

Source:

  • index.js

getInfo(params)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Runs as a callback per slide and automatically pushes the session and device information as a JSON string to be used in the presentation-type interactive documents.

Source:

  • index.js

Sample:

CODE
function getInfo(params){     var parsedParams = JSON.parse(params);}

shouldHoldOffOnImageSwap()

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Calls automatically per slide html just before switching the view from slideX.png image with the rendered slideX.html file. Useful if you want to complete some tasks in your interactive content before showing the html file on screen, default function returns false not to interfere with the png-html switch.

Source:

  • index.js

Sample:

CODE
function shouldHoldOffOnImageSwap(){     return false;}

loadFinished()

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Trigger the swap manually between the slideX.png and slideX.html. This function can be used if shouldHoldOffOnImageSwap() function returns true.

Source:

  • index.js

Sample:

CODE
function loadFinished(){     Ti.App.fireEvent('loadFinished');}

saveFromHTML(key,params)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

As webview doesn't support persistent cookies, this function can be used to make persistent values stored in Pitcher encrypted database.

Parameters:

Name

Type

Description

key

string

unique identifier

params

string

ie. a stringfied json object

Source:

  • index.js

getFromHTML(key,fullcallback,emptycallback)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

This function can be used to retrieve a persistent value stored in Pitcher encrypted database.

Parameters:

Name

Type

Description

key

string

unique identifier

fullcallback

string

callback function name which will receive if there is a saved value with this unique key

emptycallback

string

callback function name which will fire up if there is not a saved value with this unique key

Source:

  • index.js

send_email(subject,message,recipients,attachments)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Opens a new email window from the iOS mail app, pre-filled with recipients, message content and attachments (ie. pdf files).

Parameters:

Name

Type

Description

subject

string

email subject field

message

string

email content text

recipients

array

ie. ["info@pitcher.com","support@pitcher.com"]

attachments

array

ie. [filepath1,filepath2]

Source:

  • index.js

generatePDF(htmlString)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Generates a pdf file with the html string provided as a parameter. Callback goes to gotPDF function which returns the created PDF file.

Parameters:

Name

Type

Description

htmlString

string

html structure of the pdf page in a string format

Source:

  • index.js

gotPDF(filePath)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

gotPDF function receives the filePath of the generated PDF file as a callback. Send Email function can be called here to send the generated PDF file as an attachment.

Parameters:

Name

Type

Description

filePath

string

file path of the generated pdf file

Source:

  • index.js

hasNotes() → {string}

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Checks if this specific slide has notes

Source:

  • index.js

Returns:

YES/NO

Typestring

getNotes() → {string}

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Pitcher Remote Control calls this function to get the notes

Source:

  • index.js

Returns:

Contents of the notes to be visible on the device.

Typestring

basename(path, suffix) → {string}

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Gets the basename of a file path.

Parameters:

Name

Type

Description

path

string

Full disk path

suffix

string

A text to remove, such as an extension

Source:

  • index.js

Returns:

Basename of the file path

Typestring

getPageNumber(path, suffix) → {string}

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Gets the basename of a file path.

Parameters:

Name

Type

Description

path

string

Full disk path

suffix

string

A text to remove, such as an extension

Source:

  • index.js

Returns:

Basename of the file path

Typestring

gup(name) → {string}

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Gets the url parameters of the existing page

Parameters:

Name

Type

Description

name

string

A certain parameter name, similar to PHPs $_GET function

Source:

  • index.js

Returns:

value - returns the current value of the parameter provided

Typestring

customEvent()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Impact Android

Tells Pitcher to send a custom event to Pitcher Insight engine. You can use this function to keep track of custom clicks

Source:

  • index.js

closePresentation()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Android

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

Tells Pitcher to close the active presentation

Source:

  • index.js

showPage(pageURL, title)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

Launches another online page.

Parameters:

Name

Type

Description

pageURL

string

http:// or https:// full link

title

string

Title to be rendered

Source:

  • index.js

gotoPage(page)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Impact Android

Tells Pitcher to jump to another page. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

page

integer

Page #, 0 based

Source:

  • index.js

goBack()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

Not Supported Platforms:

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to go back one page, you can use this function to automatically calculate the previous page before a jump

Source:

  • index.js

showPDF(filename, title, 1, null, null, null, jumpPage, fileID)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to launch the PDF. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

filename

string

Full link to the PDF file on disk

title

string

Title to be rendered

jumpPage

integer

Page to launch PDF on. 1 based

fileID

integer

Pitcher file ID, important for links to function properly

Source:

  • index.js

load3D(filename, fileID)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to launch the 3D file. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

filename

string

Full link to the 3D file on disk

fileID

integer

Pitcher file ID, important for links to function properly

Source:

  • index.js

showPresentation(ID, subID)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to launch the Presentation. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

ID

integer

Pitcher file ID

subID

integer

Sub page to start the presentation on, 1 based

Source:

  • index.js

playVideo(filename)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to launch the Video. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

filename

string

Full link to the video file on disk param {boolean} isOnline - Whether online connection is necessary to play the video param {integer} fileID - Pitcher file ID, important for links to function properly

Source:

  • index.js

showSurvey(url)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to launch a survey. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

url

string

Full link to the survey folder on disk param {string} title - Title to be rendered param {integer} fileID - Pitcher file ID, important for links to function properly

Source:

  • index.js

showZip(url)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Tells Pitcher to launch an HTML5 file uploaded by the CMS. You can also use pitcherFile://#/# annotation. For more info please see the Developer manual

Parameters:

Name

Type

Description

url

string

Full link to the survey folder on disk param {string} title - Title to be rendered param {integer} fileID - Pitcher file ID, important for links to function properly

Source:

  • index.js

scrolled(isPitchingV, isTwoDV)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

Pitcher calls this function on page scroll. Important: Do not add listeners on Page Init or Page Load, as those can be called when the page is cached! Instead please override the PitcherInit function.

Parameters:

Name

Type

Description

isPitchingV

boolean

A boolean value representing whether Pitcher is in a 'call' mode or not, so certain layers can be hidden/visible, such as hotspot opacity

isTwoDV

boolean

A boolean value representing whether Pitcher is set up to utilize 2D navigation mode, so gestures can be adjusted accordingly.

Source:

  • index.js

goToAnimation()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Impact Android

Pitcher uses this function to check if a slide is animated, if yes, it launches Animation.html with the necessary page #

Source:

  • index.js

showAnimationButton()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

For animated slides, Pitcher shows the animation dots.

Source:

  • index.js

loadJSON()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Connect

  • Pitcher Impact Android

  • Pitcher Impact Windows

This function parses the JSON, adds hotspots, puts the thermometer on the left side, and starts automatically converted animation is page is marked as animated.

Source:

  • index.js

sendCLM(event)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

If emotional feedback is activated, which can send out emotional feedback to Pitcher Insight per slide, this function sends the event.

Source:

  • index.js

showHotSpots()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

Hotspots defined with Pitcher Admin and are saved in slideX.json file, parses into html and they can set to be visible with this function. Being called automatically depending on the user is in a call or not.

Source:

  • index.js

hideHotSpots()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

Hotspots defined with Pitcher Admin and are saved in slideX.json file, parses into html and they can set to be hidden with this function. Being called automatically depending on the user is in a call or not.

Source:

  • index.js

showNotes()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

Shows the speakers notes auto embedded div element if there are any speaker notes defined in slideX.json file.

Source:

  • index.js

closeNotes()

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

Not Supported Platforms:

  • Pitcher Connect

  • Pitcher Impact Android

Hides the speakers notes auto embedded div element if there are any speaker notes defined in slideX.json file.

Source:

  • index.js

generateTouch()

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Impact Windows

  • Pitcher Connect

  • Pitcher Impact Android

Pitcher Remote application interaction functions, these two "generateTouch" and "touchSynth" functions mimic touch events from the remote app, applies the same touch events on the presentation slideX.html file.

Source:

  • index.js

touchSynth(x, y, mode)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Impact Windows

  • Pitcher Connect

  • Pitcher Impact Android

Pitcher Remote application interaction functions, these two "generateTouch" and "touchSynth" functions mimic touch events from the remote app, applies the same touch events on the presentation slideX.html file.

Source:

  • index.js

showReferences(x, y)

Supported Platforms:

  • Pitcher Impact iOS

Not Supported Platforms:

  • Pitcher Impact Windows

  • Pitcher Connect

  • Pitcher Impact Android

Pitcher opens the native references popup with this API function. The cordinates of the popup can be given in x and y variables.

Source:

  • index.js

openPitcherFile(fileID)

Supported Platforms:

  • Pitcher Impact iOS

  • Pitcher Impact Windows

  • Pitcher Impact Android

Not Supported Platforms:

  • Pitcher Connect

Pitcher opens the requested file with this API function.

Source:

  • index.js

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.