Created
June 6, 2011 12:55
-
-
Save knowtheory/1010187 to your computer and use it in GitHub Desktop.
JS Bridge functions for the videojuicer player
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // available events that can be fed to addListener | |
| [ 'player.ready', | |
| 'player.unready', | |
| 'player.resume', | |
| 'player.pause', | |
| 'player.seek', | |
| 'player.duration', | |
| 'player.durationResolved', | |
| 'player.durationUnresolved', | |
| 'player.fullscreen', | |
| 'player.windowed', | |
| 'player.volume', | |
| 'player.muted', | |
| 'player.unmuted', | |
| 'player.userIdle', | |
| 'player.userEngaged' ]; | |
| // Example | |
| // note that the second argument to addListener MUST be a string. | |
| // Either a function definition as a string, or a function name/handle as a string. | |
| $player.addListener("player.ready", "function() { $player.resume() }") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Functions available through the player's JavaScript bridge. Callable on the player object | |
| Callbacks.registerCallback('getViewportWidth', this.getViewportWidth); | |
| Callbacks.registerCallback('getViewportHeight', this.getViewportHeight); | |
| Callbacks.registerCallback('isFullscreen', this.onIsFullscreen); | |
| Callbacks.registerCallback('getVersion', this.onGetVersion); | |
| Callbacks.registerCallback('getSMILKitVersion', this.onGetSMILKitVersion); | |
| Callbacks.registerCallback('getStyleKitVersion', this.onGetStyleKitVersion); | |
| Callbacks.registerCallback('getUtilKitVersion', this.onGetUtilKitVersion); | |
| Callbacks.registerCallback('sessionCreate', this.onSessionCreate); | |
| Callbacks.registerCallback('sessionCreateWithURL', this.onSessionCreateWithURL); | |
| Callbacks.registerCallback('sessionRefresh', this.onSessionRefresh); | |
| Callbacks.registerCallback('sessionBack', this.onSessionBack); | |
| Callbacks.registerCallback('sessionForward', this.onSessionForward); | |
| Callbacks.registerCallback([ 'isSessionReady', 'sessionReloaded', 'sessionReady' ], this.onSessionReady); | |
| Callbacks.registerCallback('addListener', this.onAddListener); | |
| Callbacks.registerCallback([ 'showControls' ], this.onShowControls); | |
| Callbacks.registerCallback([ 'hideControls' ], this.onHideControls); | |
| Callbacks.registerCallback([ 'areControlsShown' ], this.onAreControlsShown); | |
| Callbacks.registerCallback([ 'appendCSS' ], null); | |
| Callbacks.registerCallback([ 'importCSS' ], null); | |
| Callbacks.registerCallback([ 'loadPresentation' ], this.onLoadPresentation); | |
| Callbacks.registerCallback([ 'refresh' ], this.onPresentationRefresh); | |
| Callbacks.registerCallback([ 'historyBack' ], this.onPresentationBack); | |
| Callbacks.registerCallback([ 'historyForward' ], this.onPresentationForward); | |
| Callbacks.registerCallback([ 'resume' ], this.onResumePlayback); | |
| Callbacks.registerCallback([ 'pause' ], this.onPausePlayback); | |
| Callbacks.registerCallback([ 'seek' ], this.onSeekPlayback); | |
| Callbacks.registerCallback([ 'playingNow' ], this.onPlayingNow); | |
| Callbacks.registerCallback([ 'getDuration', 'duration' ], this.onGetDuration); | |
| Callbacks.registerCallback([ 'getOffset', 'offset' ], this.onGetOffset); | |
| Callbacks.registerCallback([ 'getVolume', 'volume' ], this.onGetVolume); | |
| Callbacks.registerCallback([ 'setVolume' ], this.onSetVolume); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment