HTML5 Viewer SDK API Documentation 

Namespaces


Class Index

Classes in s7sdk.event

Class s7sdk.event.UserEvent

A UserEvent is dispatched by the SDK Viewer components when a user-initiated action occurs. These events are typically used for tracking purposes. The TrackingManager uses the disabletracking and enabletracking parameters that are associated with a specific component to determine which event types - trackEvent - to dispatch. If these parameters are not included, all UserEvent event types create JavaScript calls. See the TrackingManager documentation for more information. You can add UserEvent event listeners to the HTML element where the viewer resides, or to the upper-level window object. TrackingManager is not required when handling UserEvent events. In the UserEvent.NOTF_USER_EVENT handler, the event has a property called event.s7event that contains the pertinent event data.

Supported events for each component
FlyoutZoomViews7sdk.event.UserEvent.PAN
s7sdk.event.UserEvent.ZOOM
s7sdk.event.UserEvent.SWAP
NavigationViews7sdk.event.UserEvent.SWAP
ZoomTargetss7sdk.event.UserEvent.TARG
ZoomViews7sdk.event.UserEvent.PAN
s7sdk.event.UserEvent.SWAP
s7sdk.event.UserEvent.ZOOM
InteractiveSwatchess7sdk.event.UserEvent.INTERACTIVE_SWATCH
CallToActions7sdk.event.UserEvent.INTERACTIVE_SWATCH
InteractiveThumbnailGridViews7sdk.event.UserEvent.INTERACTIVE_THUMBNAIL_GRID_VIEW_SWATCH
MediaSets7sdk.event.UserEvent.SWAP
PageScrubbers7sdk.event.UserEvent.SWAP
PageViews7sdk.event.UserEvent.PAGE
s7sdk.event.UserEvent.PAN
s7sdk.event.UserEvent.ZOOM
s7sdk.event.UserEvent.SWAP
SpinViews7sdk.event.UserEvent.PAN
s7sdk.event.UserEvent.SWAP
s7sdk.event.UserEvent.SPIN
s7sdk.event.UserEvent.ZOOM
Swatchess7sdk.event.UserEvent.SWAP
s7sdk.event.UserEvent.SWATCH
ThumbnailGridViews7sdk.event.UserEvent.SWAP
s7sdk.event.UserEvent.SWATCH
RecutPlayers7sdk.event.UserEvent.STOP
s7sdk.event.UserEvent.PLAY
s7sdk.event.UserEvent.PAUSE
VideoPlayers7sdk.event.UserEvent.PLAY
s7sdk.event.UserEvent.STOP
s7sdk.event.UserEvent.PAUSE
s7sdk.event.UserEvent.SWAP
s7sdk.event.UserEvent.MILESTONE
s7sdk.event.UserEvent.METADATA
ImageMapEffects7sdk.event.UserEvent.HREF
s7sdk.event.UserEvent.ITEM
ParameterManagers7sdk.event.UserEvent.LOAD
CarouselViews7sdk.event.UserEvent.BANNER
s7sdk.event.UserEvent.SWAP

Class Summary
Constructor Attributes Constructor Name and Description
 
s7sdk.event.UserEvent(trackEvent, data, bubbles)
Field Summary
Field Attributes Field Name and Description
<static>  
s7sdk.event.UserEvent.BANNER
Defines the value of the trackEvent property for a BANNER event object.
<static>  
s7sdk.event.UserEvent.HREF
Defines the value of the trackEvent property for an HREF event object.
<static>  
s7sdk.event.UserEvent.INTERACTIVE_SWATCH
Defines the value of the trackEvent property for a INTERACTIVE_SWATCH event object.
<static>  
Defines the value of the trackEvent property for a INTERACTIVE_THUMBNAIL_GRID_VIEW_SWATCH event object.
<static>  
s7sdk.event.UserEvent.ITEM
Defines the value of the trackEvent property for an ITEM event object.
<static>  
s7sdk.event.UserEvent.LOAD
Defines the value of the trackEvent property for a LOAD event object.
<static>  
s7sdk.event.UserEvent.METADATA
Defines the value of the trackEvent property for a METADATA event object.
<static>  
s7sdk.event.UserEvent.MILESTONE
Defines the value of the trackEvent property for a MILESTONE event object.
<static>  
s7sdk.event.UserEvent.NOTF_USER_EVENT
Defines the value of the type property for a UserEvent event object.
<static>  
s7sdk.event.UserEvent.PAGE
Defines the value of the trackEvent property for a PAGE event object.
<static>  
s7sdk.event.UserEvent.PAN
Defines the value of the trackEvent property for a PAN event object.
<static>  
s7sdk.event.UserEvent.PAUSE
Defines the value of the trackEvent property for a PAUSE event object.
<static>  
s7sdk.event.UserEvent.PLAY
Defines the value of the trackEvent property for a PLAY event object.
<static>  
s7sdk.event.UserEvent.RECORD
Defines the value of the trackEvent property for a RECORD event object.
<static>  
s7sdk.event.UserEvent.SPIN
Defines the value of the trackEvent property for a SPIN event object.
<static>  
s7sdk.event.UserEvent.STOP
Defines the value of the trackEvent property for a STOP event object.
<static>  
s7sdk.event.UserEvent.SWAP
Defines the value of the trackEvent property for a SWAP event object.
<static>  
s7sdk.event.UserEvent.SWATCH
Defines the value of the trackEvent property for a SWATCH event object.
<static>  
s7sdk.event.UserEvent.TARG
Defines the value of the trackEvent property for a TARG event object.
<static>  
s7sdk.event.UserEvent.ZOOM
Defines the value of the trackEvent property for a ZOOM event object.
Method Summary
Method Attributes Method Name and Description
 
Returns a copy of the data array in which the items are the respective URI encoded strings.
 
Returns a string that contains all the properties of the UserEvent object.
Class Detail
s7sdk.event.UserEvent(trackEvent, data, bubbles)
UserEvent example
To see what events are emitted from a viewer, this example logs all UserEvent objects
using the UserEvent.toString() function:

window.addEventListener(s7sdk.event.UserEvent.NOTF_USER_EVENT,
    function(event) {console.log("UserEvent - " + event.s7event.toString());},
    false);

The addEventListener call is made from one of the
s7sdk.Event.SDK_READY listener functions.
Parameters:
trackEvent
data
bubbles
See:
s7sdk.TrackingManager
s7sdk.image.FlyoutZoomView
s7sdk.image.NavigationView
s7sdk.image.ZoomTargets
s7sdk.image.ZoomView
s7sdk.set.MediaSet
s7sdk.set.SpinView
s7sdk.set.Swatches
s7sdk.video.VideoPlayer
s7sdk.set.CarouselView
Field Detail
<static> s7sdk.event.UserEvent.BANNER
Defines the value of the trackEvent property for a BANNER event object. The data that is associated with this event type is "banner image name, banner number (position in the set), banner title (if available)" which results in the following output string:

BANNER, banner image name, banner number (position in the set), banner title (if available)

Where banner number is the current frame, and banner title is the label that is associated with the asset in the frame. If no label is present then this value returns empty. The event is dispatched by the CarouselView component when image is changed inside the component.
See:
s7sdk.set.CarouselView

<static> s7sdk.event.UserEvent.HREF
Defines the value of the trackEvent property for an HREF event object. The data that is associated with this event type is "rollover_key | href | altText" which results in the following output string:

HREF, rollover_key | href | altText

The rollover_key value from the image map is returned if available, if not the href value is used if present otherwise the altText value is returned. If none of these three values is present the event is not emitted. This event is emitted when the user clicks on an image map area.
See:
s7sdk.image.ImageMapEffect

<static> s7sdk.event.UserEvent.INTERACTIVE_SWATCH
Defines the value of the trackEvent property for a INTERACTIVE_SWATCH event object. The data that is associated with this event type is the "href" of that swatch. The event is dispatched when the user clicks an interactive swatch.
See:
s7sdk.set.InteractiveSwatches

<static> s7sdk.event.UserEvent.INTERACTIVE_THUMBNAIL_GRID_VIEW_SWATCH
Defines the value of the trackEvent property for a INTERACTIVE_THUMBNAIL_GRID_VIEW_SWATCH event object. The data that is associated with this event type is the "href" of that swatch. The event is dispatched when the user clicks an interactive thumbnail grid view swatch.
See:
s7sdk.set.InteractiveThumbnailGridView

<static> s7sdk.event.UserEvent.ITEM
Defines the value of the trackEvent property for an ITEM event object. The data that is associated with this event type is "rollover_key | href | altText" which results in the following output string:

ITEM, rollover_key | href | altText

The rollover_key value from the image map is returned if available, if not the href value is used if present otherwise the altText value is returned. If none of these three values is present the event is not emitted. This event is emitted when the user moves into an image map area.
See:
s7sdk.image.ImageMapEffect

<static> s7sdk.event.UserEvent.LOAD
Defines the value of the trackEvent property for a LOAD event object. The data that is associated with this event type is "viewer type, viewer name, viewer version, sdk version, company, asset" which results in the following output string:

LOAD, viewer type, viewer name, viewer version, sdk version, company, asset

Where viewer type is a string that specifies the type of viewer. By default it is set to s7_html5_sdk. You can specify the viewer type in the viewer property of the ParameterManager. The page name is the name of the html wrapper that contains the component instance that is throwing the event. In this case, the instance of the ParameterManager. The viewer version is the version that is set in the viewer property of the ParameterManager. It defaults to unknown. The company and the asset refer to the company that the viewer is served for, and the main asset that is displayed in the viewer. The sdk version is the SDK version upon which the viewer is based.
See:
s7sdk.ParameterManager

<static> s7sdk.event.UserEvent.METADATA
Defines the value of the trackEvent property for a METADATA event object. The data that is associated with this event type for video content is:

METADATA, event type, video length or playhead

event type can be either DURATION or SEEK. If event type is DURATION the third value will be video length. If it is SEEK, the third value will be time seeked to in the video. This event is not used for other asset types.
See:
s7sdk.video.VideoPlayer

<static> s7sdk.event.UserEvent.MILESTONE
Defines the value of the trackEvent property for a MILESTONE event object. The data that is associated with this event type is "25 | 50 | 75 | 100" which results in the following output string:

MILESTONE, percentage of playback

Where percentage of playback is the percentage of video play completed. The event is dispatched by the VideoPlayer component when the video player reaches 25, 50, 75 and 100 percent of video play.

<static> s7sdk.event.UserEvent.NOTF_USER_EVENT
Defines the value of the type property for a UserEvent event object.

<static> s7sdk.event.UserEvent.PAGE
Defines the value of the trackEvent property for a PAGE event object. The data that is associated with this event type is "frame, page label" which results in the following output string:

PAGE, frame, page label

Where frame is the current frame, and page label is the label that is associated with the asset in the frame. If no label is present then this value returns empty. The event is dispatched by the PageView component in the frameChanged handler after every nextPage except for the initial page loaded.
See:
s7sdk.set.PageView

<static> s7sdk.event.UserEvent.PAN
Defines the value of the trackEvent property for a PAN event object.

PAN

The event is dispatched when pan is triggered on the image.
See:
s7sdk.set.SpinView
s7sdk.image.ZoomView
s7sdk.image.FlyoutZoomView

<static> s7sdk.event.UserEvent.PAUSE
Defines the value of the trackEvent property for a PAUSE event object. The data that is associated with this event type is "timestamp" which results in the following output string:

PAUSE, timestamp

Where timestamp is the video time in milliseconds when the event occurs, if known (real). The event is dispatched when the movie is paused as a result of user interaction.

<static> s7sdk.event.UserEvent.PLAY
Defines the value of the trackEvent property for a PLAY event object. The data that is associated with this event type is "timestamp" which results in the following output string:

PLAY, timestamp

Where timestamp is the video time in milliseconds when the event occurs, if known (real). The event is dispatched when the movie starts playing as a result of user interaction. The event is also dispatched if the video is set to autoplay on load.

<static> s7sdk.event.UserEvent.RECORD
Defines the value of the trackEvent property for a RECORD event object.

RECORD

The event is dispatched when the movie starts recording as a result of user interaction.

<static> s7sdk.event.UserEvent.SPIN
Defines the value of the trackEvent property for a SPIN event object. The data that is associated with this event type is "frameNumber" which results in the following output string:

SPIN, frameNumber

The event is dispatched when spin is triggered on the image.
See:
s7sdk.set.SpinView

<static> s7sdk.event.UserEvent.STOP
Defines the value of the trackEvent property for a STOP event object. The data that is associated with this event type is "timestamp" which results in the following output string:

STOP, timestamp

Where timestamp is the video time in milliseconds when the event occurs, if known (real). The event is dispatched when the movie is stopped as a result of user interaction, and when the movie played to the end.

<static> s7sdk.event.UserEvent.SWAP
Defines the value of the trackEvent property for a SWAP event object. The data that is associated with this event type is "asset" which results in the following output string:

SWAP, 0, asset

Where asset is the newly set asset through user action. The 0 value is a placeholder. This event is dispatched by components that support the asset modifier when the existing asset value is replaced with a new one. The event is dispatched when the components setAsset() API is called with a new asset value.
See:
s7sdk.set.Swatches#setAsset()
s7sdk.image.ZoomView#setAsset()
s7sdk.image.FlyoutZoomView#setAsset()

<static> s7sdk.event.UserEvent.SWATCH
Defines the value of the trackEvent property for a SWATCH event object. The data that is associated with this event type is "frame, image label" which results in the following output string:

SWATCH, frame, image label

Where frame is the current frame, and image label is the label that is associated with the asset in the frame. If no label is present, the value is returned empty. The event is dispatched when the user clicks a swatch or mouses over it when in rollover mode.
See:
s7sdk.set.Swatches

<static> s7sdk.event.UserEvent.TARG
Defines the value of the trackEvent property for a TARG event object. The data that is associated with this event type is "id, label, user data" which results in the following output string:

TARG, id, label, user data

Sent by the ZoomTargets component when a user selects a target. The label and user data are empty if they are not defined for the zoom target.

<static> s7sdk.event.UserEvent.ZOOM
Defines the value of the trackEvent property for a ZOOM event object. The data that is associated with this event type is "scale" which results in the following output string:

ZOOM, scale

The event is dispatched when zoom is triggered on the image.
See:
s7sdk.set.SpinView
s7sdk.image.ZoomView
s7sdk.image.FlyoutZoomView
Method Detail
getEncodedData()
Returns a copy of the data array in which the items are the respective URI encoded strings.

toString()
Returns a string that contains all the properties of the UserEvent object. This string is in the following format:

type,data

Returns:
A string that contains all the properties of the UserEvent.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jan 30 2020 16:40:36 GMT+0200 (EET)