pym-loader

Methods

initializePym(pym, doNotRaiseEvents)

Initialize pym instances if Pym.js itself is available

Source:
Parameters:
Name Type Description
pym String

Pym.js loaded library.

doNotRaiseEvents Boolean

flag to avoid sending custom events

loadPymViaEmbedding(pymUrl)

As another loading fallback approach
try to append the script tag to the head of the document
via http://stackoverflow.com/questions/6642081/jquery-getscript-methods-internal-process
via http://unixpapa.com/js/dyna.html

Source:
Parameters:
Name Type Description
pymUrl String

Url where Pym.js can be found

pageLoaded()

Callback to initialize Pym.js on document load events

Source:

tryLoadingWithJQuery(pymUrl)

Load pym through jQuery async getScript module
Since this loader can be embedded multiple times in the same post
the function manages a global flag called pymloading to avoid
possible race conditions

Source:
Parameters:
Name Type Description
pymUrl String

Url where Pym.js can be found

tryLoadingWithRequirejs(pymUrl)

Load pym with Requirejs if it is available on the page
Used in CorePublisher CMS member sites with persistent players
Create a different context to allow multiversion
via: http://requirejs.org/docs/api.html#multiversion

Source:
Parameters:
Name Type Description
pymUrl String

Url where Pym.js can be found

(inner) _raiseCustomEvent(eventName)

Create and dispatch a custom pym-loader event

Source:
Parameters:
Name Type Description
eventName String