getComponent getcomponent

JavaScript API reference for Smart Crop Video Viewer.

getComponent(componentId)

Returns a reference to the Viewer SDK component that is used by the viewer. The web page can use this method to extend or customize the behavior of the out-of-box viewer. Call this method only after the initComplete viewer callback has run, otherwise the component may not be created yet by the viewer logic.

Parameters section-4fb77a645fdd45b3aaa5079c31e3bb05

*componentID* - {String} an ID of the Viewer SDK component used by the viewer. This viewer supports the following component IDs:

Component ID
Viewer SDK component class name
parameterManager
s7sdk.ParameterManager
container
s7sdk.common.Container
mediaSet
s7sdk.set.MediaSet
smartCropVideoPlayer
s7sdk.video.SmartCropVideoPlayer
fullScreenButton
s7sdk.common.FullScreenButton
mutableVolume
s7sdk.video.MutableVolume
playPauseButton
s7sdk.common.PlayPauseButton
videoScrubber
s7sdk.video.VideoScrubber
videoTime
s7sdk.video.VideoTime
closedCaptionButton
s7sdk.common.ClosedCaptionButton
controls
s7sdk.common.ControlBar
socialShare
s7sdk.share.SocialShare
twitterShare
s7sdk.share.TwitterShare
facebookShare
s7sdk.share.FacebookShare
linkShare
s7sdk.share.LinkShare
emailShare
s7sdk.share.EmailShare
embedShare
s7sdk.share.EmbedShare

When working with SDK APIs, it is important to use correct fully qualified SDK namespace as described in [Viewer SDK namespace]
(https://experienceleague.adobe.com/c-html5-aem-asset-viewers/c-html5-aem-smartcropvideo/r-html5-aem-smartcropvideo-viewer-namespace.html?lang=en#concept-679bfabb3e3e4c12a285c4e9c4144153).

Refer to the Viewer SDK API documentation for more information about a particular component.

Returns section-1d3cf85bc7cc4dfe9670e038d02b9101

{Object} A reference to Viewer SDK component. The method returns null if the componentId is not a supported viewer component or if the component was not yet created by the viewer logic.

Example section-9e9332aa86b74a5fb321375c03fdc5b3

<instance>.setHandlers({
 "initComplete":function() {
  var smartCropVideoPlayer = <instance>.getComponent("smartCropVideoPlayer");
}
})
recommendation-more-help
b7426f53-aad9-4c00-83fc-664f30f681e8