- Previous: launchMakePhotoShow
- Up: JavaScript APIs
- Next: Developer Callbacks
Viewer Customization
You can optionally include a JavaScript configuration block immediately before the viewer embed code supplied by the authoring callback. This block allows you to override the default playback parameters on the viewer widget and to set up parameters to be passed to the authoring widget if a user clicks "Make a PhotoShow" in the viewer. All of these parameters should be stored in a JavaScript object called PhotoShow_Viewer_Config.
See the viewer overview for more background on the viewer.
<!-- Site overrides: -->
<script type="text/javascript">
var PhotoShow_Viewer_Config = {
// Optional overrides to viewer widget configuration:
viewerWidth: 'WIDTH',
viewerHeight: 'HEIGHT',
autoPlayBack: true,
muteOnStart: true,
permalink: 'LINK_TO_PAGE_CONTAINING_SHOW',
divId: 'YOUR_DIV_ID',
// Optional information passed to authoring widget if invoked from viewer:
postShow: 'YOUR_CALLBACK_URL',
userId: 'YOUR_USER_ID',
sessionKey: 'YOUR_SESSION_ID',
contentId: 'YOUR_UNIQUE_CONTENT_ID'
}
</script>
<!-- Embed code provided by authoring widget: -->
<script type="text/javascript" src="http:/view.ds1.photoshow.com/publish/ab1cd4sd.js"></script>
- PhotoShow_Viewer_Config
- object, required
- An associative array of additional parameters used to override the default viewer settings. The object must be called PhotoShow_Viewer_Config. Any of the parameters described below can be included in the PhotoShow_Viewer_Config object.
Viewer Override Parameters
- developerKey
- string, optional
- Your developer key. If this value is provided, the PhotoShow viewer will display your branding.
- viewerWidth
- integer, optional
- The desired width of the embedded PhotoShow Viewer widget, in pixels. You should specify at most one of viewerWidth or viewerHeight.
- Default: 466
- Minimum: 272
- viewerHeight
- integer, optional
- The desired height of the embedded PhotoShow Viewer widget, in pixels. You should specify at most one of viewerWidth or viewerHeight. If both viewerWidth and viewerHeight settings are specified, viewerHeight will be ignored in order to preserve the standard PhotoShow Viewer aspect ratio.
- Default: 375, or (viewerWidth * 3/4) + 25
- Minimum: 229
- autoPlayBack
- boolean, optional
- Controls whether the PhotoShow should begin playing immediately (when enough pictures have loaded). If false, the viewer will wait for the user to click Play before starting the show.
- Default: true
- muteOnStart
- boolean, optional
- Controls whether the PhotoShow should have its music/audio muted. This setting only affects the initial state of the viewer widget; users can always mute or un-mute the audio by clicking the button in the viewer.
- Default: false
- permalink
- string, optional
- The absolute URL at which this particular PhotoShow can be viewed. This link is used for "send to a friend" emails initiated from the viewer widget, and is provided to users within the viewer widget to copy and paste for sharing the show. It defaults to the page containing the PhotoShow, so in most cases you will not need to override it. However, if you have a preferred public link format, or if the page URL contains session keys or other information that should not be shared, you should specify a more appropriate permalink.
- If you set permalink to the empty string, the PhotoShow will have no permalink and email sharing and linking from within the viewer will be disabled.
- Default: the page on which the PhotoShow is currently being displayed (that is,
window.location.href) - divId
- string, required
- The id of the
<div>where the PhotoShow should be inserted. The contents of this<div>will be completely replaced by the PhotoShow. - If divId is not specified, the PhotoShow will be inserted in place at the JavaScript call.
- Default: none
Parameters passed by viewer to the authoring widget
- postShow
- string, required
- The absolute URL of a callback function on your server that will accept embed code for the PhotoShow. See the post callback section of the authoring widget guide for more details.
- Default: none
- userId
- string, optional
- A unique user id (optional, but highly recommended). PhotoShow treats this as opaque and permanent. It will use it to group together shows created by the same user. PhotoShow will hand the userId back to you as part of the post callback.
- Default: none
- sessionKey
- string, optional
- A session key or similar authorization context. PhotoShow treats this as opaque and transient. PhotoShow will hand the sessionId back to you as part of the post callback.
- Default: none
- contentId
- string, optional (required for editable shows)
- A unique content id assigned by you -- often, an an internal ID within your content management system. PhotoShow treates this as opaque and transient. If the user edits the PhotoShow, this contentId will be provided to your post callback, and you can use it to identify the particular PhotoShow being edited and replace its code with the newly-edited PhotoShow embed.
- Default: none
- Previous: launchMakePhotoShow
- Up: JavaScript APIs
- Next: Developer Callbacks

Comments
Please sign in to post a comment.