- Print
API: Play
- Print
ShopLive.setAccessKey
You must set AccessKey
to use Shoplive Android SDK
.
Parameter name | Type | Description |
---|---|---|
accesskey | String | ShopLive AccessKey |
Sample code
Related guides: Starting Shoplive Player
ShopLive.play
Starting video play with CampaignKey
.
Parameter name | Type | Description |
---|---|---|
context | Context | context |
data | ShopLivePlayerData | ShopLivePlayerData |
ShopLivePlayerData
Property name | Type | Description |
---|---|---|
campaignKey | String | Campaign key of video |
keepWindowStateOnPlayExecuted | Boolean | Whether to start playing while keeping the current play mode (pip, fullscreen) of the player.
|
referrer | String? | Referrer information |
Sample code
Related guides: Starting Shoplive Player
ShopLive.showPreviewPopup
The campaign (broadcast) key is used to play the video in mute mode in the preview view.
Parameter name | Type | Description |
---|---|---|
activity | Activity | Activity |
data | ShopLivePreviewData | Preview-related data |
ShopLivePreviewData
Property name | Type | Description |
---|---|---|
campaignKey | String | campaign key to play |
maxHeight | Int | max height (default 180dp) |
maxWidth | Int | max width (default 180dp) |
marginTop | Int | margin Top (default 16dp) |
marginBottom | Int | margin Bottom (default 16dp) |
marginLeft | Int | margin Left (default 16dp) |
marginRight | Int | margin Right (default 16dp) |
isMuted | Boolean | mute feature (default false) |
canTransition | Boolean | Whether to Use Screen Transition Animation |
canVibrated | Boolean | Whether to Vibrate When Moving the Preview Off the Screen |
useCloseButton | Boolean | Visibility of the Close Button on the Preview |
enabledSwipeOut | Boolean | Determines whether to allow closing the Preview by moving it off the screen |
useCustomAction | Boolean | Instead of directly moving to the broadcast detail screen, the event is passed to the |
position | ShopLivePreviewPositionConfig | Specifies the position of the Preview:
|
referrer | String? | Referrer tracking |
onClickListener | View.OnClickListener? | Event handler for clicks on the Preview |
onCloseListener | ShopLivePreview.OnCloseListener? | Event handler for close on the Preview |
ShopLive.setPreviewTransitionAnimation
When using the useCustomAction
feature in the Preview function, you can utilize the transitionAnimation
.
Sample code
Related guides: Campaign Preview
ShopLive.hidePreviewPopup
Hides the popup-style preview that is currently playing.
Sample code
ShopLivePreview
You can implement the preview directly through the ShopLivePreview
or ShopLiveSwipePreview
components.
start
Starting to play preview
Parameter name | Type | Description |
---|---|---|
accessKey | String? | access key |
campaignKey | String? | campaign key |
pause
Pausing preview
Resuming preview
Releasing (terminating) preview
setLifecycleObserver
By registering a LifecycleOwner
, the preview player can automatically play or pause according to the lifecycle.
Parameter name | Type | Description |
---|---|---|
owner | LifecycleOwner | LifecycleOwner |
setOnCloseListener
You can receive events for the termination of the preview.
setOnDimensionRatioListener
You can obtain the aspect ratio of the preview screen.