- 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
Value | Description |
---|---|
RATIO_1X1 | 1 × 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.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
inAndroidManifest.xml
and then grant runtime permission before entering the broadcast, if you want to set it withsetKeepPlayVideoOnHeadphoneUnplugged(true, true)
.
AndroidManifest.xml
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Parameter name | Type | Description |
---|---|---|
isKeepPlayVideoOnHeadphoneUnplugged | Boolean |
|
isMute | Boolean |
|
Related guides: 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. The required permission is READ_PHONE_STATE
.
fun setAutoResumeVideoOnCallEnded(isAutoResumeVideoOnCallEnded: Boolean)
Parameter name | Type | Description |
---|---|---|
isAutoResumeVideoOnCallEnded | Boolean |
|
Related guides: Interrupt due to call connection
ShopLive.setShareScheme
When selecting the Share, set the URL or scheme to be passed.
fun setShareScheme(shareUrl: String)
Parameter name | Type | Description |
---|---|---|
shareUrl | String | The |
Sample code
val scheme = "shoplive://live" // or "https://shoplive.cloud/live"
ShopLive.setShareScheme(scheme)
Related guides: Share a link of a campaign to broadcast
ShopLive.setLoadingProgressColor
Set the video loading progress bar color.
fun setLoadingProgressColor(@ColorInt colorInt: Int)
Parameter name | Type | Description |
---|---|---|
colorInt | ColorInt | The color to set for progress bar |
ShopLive.setLoadingProgressColor(Color.WHITE)
Related guides: Setting up a progress bar
ShopLive.setLoadingAnimation
Set the video loading progress bar as an image animation.
Parameter name | Type | Description |
---|---|---|
animationDrawablecolorInt | ColorInt | The image array resources |
ShopLive.setLoadingAnimation(R.drawable.progress_animation)
ShopLive.setLoadingAnimation(0)
Related guides: Setting up a progress bar
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.
fun setChatViewTypeface(typeface: Typeface)
Parameter name | Type | Description |
---|---|---|
typeface | Typeface | Common font for chat font and chat send button font |
Sample code
Related guides: Change chat font
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 name | Type | Description |
---|---|---|
isEnterPipModeOnBackPressed | Boolean |
|
Sample code
Close 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.
fun setAutoCloseWhenAppDestroyed(isAutoClose: Boolean)
Parameter name | Type | Description |
---|---|---|
isAutoClose | Boolean |
|
Sample code
ShopLive.startPictureInPicture
Switch from full screen mode to PIP screen mode.
Sample code
ShopLive.stopPictureInPicture
Switch PIP screen mode to full screen mode.
Sample code
ShopLive.getStatus
Retrieve the status of the Shoplive player.
enum
Status
Value | Description |
---|---|
None | no status |
PIP | picture-in-picture mode |
Full | full screen mode |
Sample code
ShopLive.isShowingPreviewPopup
This is the information provided when successfully entering the Shoplive Preview.
Sample code
ShopLive.isSuccessCampaignJoin
This is information provided when entry into the broadcast is successful.
Sample code
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 name | Type | Description |
---|---|---|
command | String | The pre-defined |
payload | Map<String,Any?> | The pre-defined |
Sample code
ShopLive.setMuteWhenPlayStart
Set the sound to turn on or mute when you start Shoplive Player. (Default: Starts Shoplive Player with sound turned on.)
Parameter name | Type | Description |
---|---|---|
isMute | Boolean | Whether to mute:
|
Sample code
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 name | Type | Description |
---|---|---|
appVersion | String | The version of an app. |
Sample code
ShopLive.setVisibleStatusBar
You can hide the StatusBar
on the screen.
Parameter name | Type | Description |
---|---|---|
isVisible | Boolean | Set whether to hide the status bar
|
Sample code
ShopLive.setSystemBarColor
You can change the color of the SystemBar
on your screen.
Parameter name | Type | Description |
---|---|---|
data | ShopLivePlayerSystemBarColorData | SystemBar color data |
ShopLivePlayerSystemBarColorData
Property name | Type | Description |
---|---|---|
statusBarColor | ColorInt | You can change the StatusBar color.
|
navigationBarColor | ColorInt | You can change the SystemBar 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 name | Type | Description |
---|---|---|
listener | OnAudioFocusListener? | AudioFocusListener |
Sample code
ShopLive.showDialogFragment
Used to display the user's DialogFragment
on the Shoplive Player screen.
Parameter name | Type | Description |
---|---|---|
dialogFragment | DialogFragment | User's |
Sample code
ShopLive.closeDialogFragment
To close the dialog displayed using the ShopLive.showDialogFragment(fragment)
.
Sample code
ShopLive.setPlayerScreenCaptureEnabled
You can prevent screenshots of the broadcast screen.
Parameter name | Type | Description |
---|---|---|
isEnabled | Boolean |
|
Sample code
ShopLive.setMixWithOthers
When external audio is played, you can config the livestream audio.
Parameter name | Type | Description |
---|---|---|
isMixAudio | Boolean |
|
Sample code
ShopLive.setUtmSource
You can track UTM Source. Data can be checked at Data Insights.
Parameter name | Type | Description |
---|---|---|
utmSource | String | It conveys where the inflow occurred. |
Sample code
ShopLive.setUtmMedium
You can track UTM Medium. Data can be checked at Data Insights.
Parameter name | Type | Description |
---|---|---|
utmMedium | String | 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.) |
Sample code
ShopLive.setUtmCampaign
You can track UTM Campaigns. Data can be checked at Data Insights.
Parameter name | Type | Description |
---|---|---|
utmCampaign | String | It tells you which advertising campaign the inflow occurred. It can be divided into Campaign Name, Campaign Term, and Campaign Content. |
Sample code
ShopLive.setUtmContent
You can track UTM Content. Data can be checked at Data Insights.
Parameter name | Type | Description |
---|---|---|
utmContent | String | It conveys what kind of content the inflow was caused by a posting/advertisement. It is mainly used as a subdivision of campaign parameters. |
Sample code
ShopLive.addParameter
You can add custom data before launching the player.
Parameter name | Type | Description |
---|---|---|
key | String | Custom parameter key to apply additionally |
value | String | Additional custom parameter value to apply |
Sample code
ShopLive.removeParameter
Before running the player, delete the custom data added with the addParameter
.
Parameter name | Type | Description |
---|---|---|
key | String | Parameter key to delete |
Sample code
ShopLive.setNextActionOnHandleNavigation
Set the next action of Shoplive Player when the user selects a link such as a product, notice, or banner.
enum
ActionType
Value | Description |
---|---|
PIP | switch to PIP |
KEEP | keep current status |
CLOSE | close |
Sample code
Related guides: Controlling the player's next action after link click
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 name | Type | Description |
---|---|---|
url | String | Shoplive Player's Web Landing URL |
Sample code
ShopLive.setResizeMode
Set the aspect ratio of a video. (Default: ShopLiveResizeMode.CENTER_CROP)
fun setResizeMode(resizeMode: ShopLiveResizeMode)