- Print
API - Option
- Print
ShopLive.setUser
Setting user information for Shoplive.
Sample code
val user = ShopLiveCommonUser().apply {
userId = "testId"
userName = "kate"
age = 20
gender = ShopLiveCommonUserGender.NEUTRAL
userScore = 100
}
ShopLive.setUser(user)
enum
ShopLiveUserGender
Value | Explanation |
---|---|
Male | male |
Female | female |
Neutral | No gender specified |
Related guides: Simple authentication user account linking
ShopLive.setAuthToken
This is the security authentication token (JWT) string of the authenticated user using Shoplive. For user authentication, enter the authenticated user's security authentication token (JWT) string.
Sample code
val generatedJWT = "eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTA1NzA1dfadsfasfadsfasdfwO"
ShopLive.setAuthToken(generatedJWT)
ShopLive.getAuthToken
Returns the JWT token string for user authentication.
Sample code
ShopLive.getAuthToken()
ShopLive.setPIPRatio
This is the default screen scale when starting PIP screen mode. When you start PIP screen mode after playing for the first time, PIP screen mode starts with the specified screen scale.
enum
ShopLivePIPRatio
RATIO_1X1 | 1 x 1 |
---|---|
RATIO_1X2 | 1 x 2 |
RATIO_2X3 | 2 x 3 |
RATIO_3X4 | 3 x 4 |
RATIO_9X16 | 9 x 16 |
Related guides: Switch to Picture-in-Picture
ShopLive.setKeepAspectOnTabletPortrait
Set the Shoplive screen ratio in tablet portrait mode. true:
Maintain aspect ratio (default)false:
Fullscreen
parameter | explanation |
---|---|
isKeepAspectOnTabletPortrait |
|
Application guide
ShopLive.setKeepPlayVideoOnHeadphoneUnplugged
The video stops when the earphones (or headset) are disconnected.
You can set the video to play continuously or leave it muted upon your needs
To change to silent mode when Bluetooth earphones (or headset) are disconnected, you need to declare BLUETOOTH_CONNECT in AndroidManifest.xml and then grant runtime permission before entering the broadcast, if you want to set it with setKeepPlayVideoOnHeadphoneUnplugged(true, true).
parameter | description |
---|---|
isKeepPlayVideoOnHeadphoneUnplugged |
|
isMute |
|
Application guide
Interruption due to loss of earphone (or headset) connection
ShopLive.setAutoResumeVideoOnCallEnded
When you return to the video after ending the call, the video will continue to play.
However, you can set the video to pause if necessary.
Required permissions:
READ_PHONE_STATE
fun setAutoResumeVideoOnCallEnded(isAutoResumeVideoOnCallEnded: Boolean)
parameter | explanation |
---|---|
isAutoResumeVideoOnCallEnded |
|
Application guide
ShopLive.setShareScheme
When selecting "Share", set the URL or scheme to be passed.
parameter | explanation |
---|---|
shareUrl | share or |
Application guide
ShopLive.setLoadingProgressColor
Set the video loading progress bar color.
field | type | |
---|---|---|
colorInt | ColorInt | Color to set for progress bar |
Application guide
ShopLive.setLoadingAnimation
Set the video loading progress bar as an image animation.
parameter | explanation |
---|---|
animationDrawable | Image Array Resource |
Application guide
ShopLive.setChatViewTypeface
Set the chat font and chat send button font.
To apply the same font to both the chat and the chat send button, call the setChatViewTypeface(typeface) function.
parameter | explanation |
---|---|
typeface | Common font for chat font and chat send button font |
sample code
Application guide
ShopLive.setEnterPipModeOnBackPressed
While watching a video, selecting (tapping) the back button to exit the screen will end the video. However, this option can be used to switch to Picture-in-Picture (PIP) mode and continue watching the video.
parameter | description |
---|---|
isEnterPipModeOnBackPressed |
|
ShopLive.close
Closing the player
ShopLive.setAutoCloseWhenAppDestroyed
You can set it so that the player does not close even if the root activity is terminated.
The reason for using this option is to prevent the broadcast from ending when the root activity is relaunched using the Intent.FLAG_ACTIVITY_NEW_TASK option. It allows for the ShopLive.close function to be called directly to properly terminate the broadcast when the app is appropriately closing.
Default: Automatic termination
If not set, the player will close when the app is closed.
parameter | explanation |
---|---|
isAutoClose |
|
ShopLive.startPictureInPicture
Switch from full screen mode to PIP screen mode.
ShopLive.stopPictureInPicture
Switch PIP screen mode to full screen mode.
Application guide
ShopLive.getStatus
Getting Shoplive player status
enum
Status
situation | explanation |
---|---|
None | no status |
PIP | picture-in-picture mode |
Full | full screen mode |
ShopLive.isShowingPreviewPopup
This is the information provided when successfully entering the Shoplive Preview.
ShopLive.isSuccessCampaignJoin
This is information provided when entry into the broadcast is successful.
ShopLive.sendCommandMessage
Delivers commands and payload to the server.
You can pass commands and payloads in predefined formats. (Alternatively, you can define the command and payload in consultation with Shoplive.)
parameter | explanation |
---|---|
command | predefined |
payload | predefined |
ShopLive.setMuteWhenPlayStart
Set the sound to turn on or mute when you start Shoplive Player.
(Default: Starts Shoplive Player with sound turned on.)
parameter | explanation |
---|---|
isMute | Whether to mute : Start with mute : Start with sound on
|
ShopLive.setAppVersion
Set the app version.
Even if you don't call the API, the app version is read by default and passed to the server.
Please contact your Shoplive representative to use this feature.
parameter | explanation |
---|---|
appVersion | app version |
ShopLive.setVisibleStatusBar
You can hide the StatusBar on the screen.
parameter | type | explanation |
---|---|---|
isVisible | Boolean | Set whether to hide the status bar : Show status bar (default value) : Hide status bar
|
ShopLive.setSystemBarColor
You can change the color of the SystemBar on your screen.
field | type | explanation |
---|---|---|
data | ShopLivePlayerSystemBarColorData | SystemBar color data |
ShopLivePlayerSystemBarColorData
field
type
description
statusBarColor
ColorInt
You can change the StatusBar color.
default
ShopLivePlayerSystemBarColorData.DEFAULT_COLOR
navigationBarColor
ColorInt
You can change the SystemBar color.
default
ShopLivePlayerSystemBarColorData.DEFAULT_COLOR
sample code
ShopLive.setSoundFocusHandling
If a phone call comes in while playing a video or the sound is suppressed due to the use of another app's player, you can receive the event and handle it directly.
parameter | explanation |
---|---|
listener | AudioFocusListener |
ShopLive.showDialogFragment
Used to display the user's DialogFragment on the Shoplive Player screen.
parameter | explanation |
---|---|
dialogFragment | User's DialogFragment |
ShopLive.closeDialogFragment
To close the dialog displayed using ShopLive.showDialogFragment(fragment).
ShopLive.setPlayerScreenCaptureEnabled
You can prevent screenshots of the broadcast screen.
parameter | explanation |
---|---|
isEnabled | true: Activate screen capture function, false: Disable screen capture function |
ShopLive.setMixWithOthers
When external audio is played, you can config the livestream audio.
parameter | explanation |
---|---|
isMixAudio | true: Watch broadcast with external audio, false: Player pauses when external audio is played (default: true) |
ShopLive.setUtmSource
You can track UTM Source. Data can be checked at Data Insights.
parameter | explanation |
---|---|
utmSource | It conveys where the inflow occurred. |
ShopLive.setUtmMedium
You can track UTM Medium. Data can be checked at Data Insights.
parameter | explanation |
---|---|
utmMedium | It conveys how the inflow occurred. Google recommends setting the medium parameter to refer to the marketing method that led to the inflow. (ex. cpc, banner, email, blog, social etc.) |
ShopLive.setUtmCampaign
You can track UTM Campaigns. Data can be checked at Data Insights.
parameter | explanation |
---|---|
utmCampaign | It tells you which advertising campaign the inflow occurred. It can be divided into Campaign Name, Campaign Term, and Campaign Content. |
ShopLive.setUtmContent
You can track UTM Content. Data can be checked at Data Insights.
parameter | explanation |
---|---|
utmContent | It conveys what kind of content the inflow was caused by a posting/advertisement. It is mainly used as a subdivision of campaign parameters. |
ShopLive.addParameter
You can add custom data before launching the player.
parameter | explanation |
---|---|
key | Custom parameter key to apply additionally |
value | Additional custom parameter value to apply |
ShopLive.removeParameter
Before running the player, delete the custom data added with addParameter.
parameter | explanation |
---|---|
key | Parameter key to delete |
ShopLive.setNextActionOnHandleNavigation
Set the next action of Shoplive Player when the user selects a link such as a product, notice, or banner.
enum
ActionType
parameter | explanation |
---|---|
PIP | switch to PIP |
KEEP | keep current status |
CLOSE | close |
ShopLive.setEndpoint
This is used when you need to utilize the Shoplive service from a specific landing page or URL, rather than the Web Landing page of the Shoplive Player. For instance, in cases where the Shoplive Landing page cannot be used due to security reasons, you can create a landing page on a specific domain.
※ The Web Landing page of the Shoplive Player can be implemented after consultation with Shoplive.
parameter | explanation |
---|---|
url | Shoplive Player's Web Landing URL |