- Print
API: Option
- Print
setShareScheme
Set the scheme to be passed to the system share popup when Share is selected (tapped). By setting shareDelegate, you can implement a custom share popup instead of the iOS system share popup.
Parameter name | Type | Description |
---|---|---|
scheme | String? | Scheme or URL to share |
shareDelegate | ShopLivePlayerShareDelegate? | ShopLiveShareDelegate |
Sample code
Related guides: Share a link of a campaign to broadcast
ShopLivePlayerShareData
Parameter name | Type | Description |
---|---|---|
campaign | ShopLivePlayerShareCampaign? | Information about current broadcast campaigns |
url | String? | Scheme or URL to share |
ShopLivePlayerShareCampaign
Parameter name | Type | Description |
---|---|---|
campaignKey | String? | The |
title | String? | Current broadcast |
descriptions | String? | Description of the current broadcast |
thumbnail | String? | Thumbnail image of the current broadcast |
setChatViewFont
Set the chat font and chat send button font.
Parameter name | Type | Description |
---|---|---|
inputBoxFont | UIFont | Chat font |
sendButtonFont | UIFont | Chat send button font |
Sample code
Related guides: Change chat font
setLoadingAnimation
Set the video loading progress to image animation.
Parameter name | Type | Description |
---|---|---|
images | UIImage array | An array of |
Sample code
Related guides: Setting up indicators
setInAppPipConfiguration
Set the InAppPip related options. Values set with the setInAppPipConfiguration(config:)
have priority over values set with previously deprecated APIs.
setInAppPipConfiguration(config: ShopLiveInAppPipConfiguration?)
Parameter name | Type | Description |
---|---|---|
pipSize | ShopLiveInAppPipSize |
|
For
pipMaxSize
, it is set to.scaleAspectFill
. For example, ifpipMaxSize
is 100,In landscape mode, it will be width 100, height 100 x (video ratio)
In portrait mode, it will be height 100, width 100 x (video ratio)
Parameter name | Type | Description |
---|---|---|
config | ShopLiveInAppPipConfiguration |
|
In an Objective-C environment, use the
ShopLivePlayerDataObjc
object.
Sample code
getPreviewSize
Retrieve the size of a preview.
getPreviewSize(inAppPipConfiguration: ShopLiveInAppPipConfiguration, videoRatio: CGSize) -> CGSize
Parameter name | Type | Description |
---|---|---|
inAppPipConfiguration | ShopLiveInAppPipConfiguration | ShopLiveInAppPipConfiguration |
videoRatio | CGSize | Video ratio (ex 16 : 9, 9 : 16) |
addSubViewToPreview
Show customView on top of the Shoplive Preview.
Be cautious that while showing customView on top of the Shoplive preview, be sure to set the
ShopLiveInAppPipConfiguration(useCloseButton:false)
.
Sample code
startPictureInPicture
Switch from full screen mode to PIP mode.
Parameter name | Type | Description |
---|---|---|
position | ShopLive.PipPosition | Default position when PIP mode starts |
scale | CGFloat | A value between 0.0 and 1.0 |
Sample code
Size setting sample
Size | PIP screen |
---|---|
0.1 | |
0.4 (default) | |
0.8 |
Related guides: Switching PIP states within an app using the API
stopPictureInPicture
Switch PIP mode to full screen mode.
Sample code
Related guides: Switching PIP states within an app using the API
hookNavigation
When selecting a product or banner, you receive events directly through the custom Callback function set in the parameters (input navigation as a parameter).
Parameter name | Type | Description |
---|---|---|
navigation | URL | Block called when selecting a product or banner
|
Sample code
Related guides: Dispatching events using API functions
KeepWindowStyleOnReturnFromOsPip options
setKeepWindowStyleOnReturnFromOsPip
When using OS PIP, if the Shoplive Player is in a playing state (pip, fullscreen) and you move to the home screen or another app (switching to background state),
causing the video to enter OS PIP, you can choose to either return to the last playing state (pip, fullscreen) or always switch to fullscreen when returning to the app.
Parameter name | Type | Description |
---|---|---|
keep | Bool | Set the player playing state when returning to the app from OS PIP state.
|
Sample code
isKeepWindowStyleOnReturnFromOsPip
Return the currently set value
true
: Switch to the last playing state (pip, fullscreen) (default value)false
: Always switch to fullscreen.
Sample code
ShopLiveCommonUser
Authenticated user of Shoplive. Specify user information to authenticate the user.
public class ShopLiveCommonUser: NSObject {
var userId: String?
var name: String?
var age: Int?
var gender: ShopliveCommonUserGender?
var userScore : Int?
var custom : [String : Any]?
Related guides: Chat as a simple authenticated user
In an Objective-C environment, use the
ShopLiveCommonUserObjc
object.
authToken
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
Related guides: Chat as a secure authenticated user
style
This is the current Shoplive Player style.
Sample code
playerMode
This is the current mode of the Shoplive Player.
enum
PlayerMode
Value | Description |
---|---|
play | Playing video (rehearsal, live, replay) with Player running through play API. |
preview | Preview playing with the player running using the preview API. |
none | Player is not running. |
orientationMode
This is the video aspect ratio information of the broadcast currently being played on the Shoplive Player.
enum
VideoOrientation
Value | Description |
---|---|
portrait | Broadcast in aspect ratio mode. (ratio example - 9:16) |
landscape | Broadcast in landscape ratio mode. (ratio example - 16:9) |
unknown | The mode is unknown, not broadcasting, or the broadcast information has not yet been updated with the SDK. |
playerWindow
The instance of UIWindow
where the Shoplive Player is currently being displayed.
viewController
The instance of the UIViewController
where the Shoplive Player is currently being displayed.
Sample code
Related guides: Using custom system sharing UI
setVisibleStatusBar options
You can hide the app's status bar when Shoplive Player is playing in full screen. In the case of inAppPip, the status bar is automatically displayed.
setVisibleStatusBar
Parameter name | Type | Description |
---|---|---|
isVisible | Bool | Set whether to hide the status bar:
|
Sample code
indicatorColor
Sets the loading indicator color.
Sample code
Related guides: Setting up the indicator yourself
isSuccessCampaignJoin
Check whether broadcast entry was successful.
Related callback:
handleReceivedCommand - ON_SUCCESS_CAMPAIGN_JOIN
Sample code
AutoResumeVideoOnCallEnded options
Set the video to resume playing automatically when you return to the video after ending the call.
setAutoResumeVideoOnCallEnded
Parameter name | Type | Description |
---|---|---|
autoResume | Bool | After call ends, determine whether to autoplay the video:
|
Sample code
Related guides: Interrupt due to call connection
isAutoResumeVideoOnCallEndedInterrupt due to call connection
Returns the currently set value.
true
: Autoplay after call endsfalse
: Video stops after call ends
isAutoResumeVideoOnCallEnded() -> Bool
Sample code
Related guides: Interrupt due to call connection
KeepPlayVideoOnHeadphoneUnplugged options
setKeepPlayVideoOnHeadphoneUnplugged
Indicates whether to keep playing video when the earphones (or headset) are disconnected.
setKeepPlayVideoOnHeadphoneUnplugged(_ keepPlay: Bool)
Parameter name | Type | Description |
---|---|---|
keepPlay | Bool | When earphones (or headset) are disconnected, determines whether to continue to play the video:
|
Sample code
Related guides: Interruption due to loss of earphone (or headset) connection
isKeepPlayVideoOnHeadPhoneUnplugged
Returns the currently set value.
true
: Video continues to playfalse
: Video stops when headphone disconnected
Sample code
Related guides: Interruption due to loss of earphone (or headset) connection
NextActionOnHandleNavigation options
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 | PIP transition |
KEEP | Keep the status |
CLOSE | Terminate |
setNextActionOnHandleNavigation
Parameter name | Type | Description |
---|---|---|
actionType | ActionType | Next action of Shoplive Player when user selects link |
Sample code
getNextActionTypeOnHandleNavigation
Retrieve the current config of the NextActionTypeOnHandleNavigation
.
Sample code
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 | [String:Any]? | The pre-defined |
Sample code
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 |
---|---|---|
mute | Bool | Determine whether to mute : Start with mute : Start with sound on
|
Sample code
setEnabledPictureInPicture
Determines whether app support InAppPip and OSPip (Default : true )
Sample code
// Enable InAppPip and OSPIP
ShopLive.setEnabledPictureInPicture(isEnabled: true)
// Disable InAppPip and OSPIP
ShopLive.setEnabledPictureInPicture(isEnabled: false)
setEnableOSPictureInPicture
Determines whether an app supports the OS’ PIP (Default : true)
@objc static func setEnabledOSPictureInPictureMode(isEnabled: Bool)
Sample code
// InAppPip(Enabled), OSPIP (Disabled)
ShopLive.setEnabledPictureInPicture(isEnabled: true)
ShopLive.setEnabledOSPictureInPicture(isEnabled: false)
// InAppPip, OSPIP both enabled
ShopLive.setEnabledPictureInPicture(isEnabled: true)
ShopLive.setEnabledOSPictureInPicture(isEnabled: true)
// InAppPip, OSPIP both disabled
ShopLive.setEnabledPictureInPicture(isEnabled: false)
ShopLive.setEnabledOSPictureInPicture(isEnabled: true)
setPictureInPicturePadding
Set PIP padding in PIP within the app. (top, left, right, bottom) (Default: top, left, right, bottom all set to 20) If an invalid value is set, it returns false and applies the default value.
Parameter name | Type | Description |
---|---|---|
padding | UIEdgeInsets | Set padding values such as top, left, right, bottom, etc. |
Sample code
Related guides: Setting padding for PIP
setPictureInPictureFloatingOffset
Set the area where PIP can move in the PIP within the app. If an invalid value is set, it returns false
and applies the default value.
Parameter name | Type | Description |
---|---|---|
offset | UIEdgeInsets | Set the offset values for top, left, right, and bottom. |
Sample code
Related guides: Prevent PIP from moving to the edge of the app
setUsingLocalStorage
Set whether to use the local storage save function.
Parameter name | Type | Description |
---|---|---|
use | Bool | Determines whether to use the local storage save function : Use the local storage save function : Disable the local storage save function
|
Sample code
setAppVersion
Set the app version.
Even without calling the API, the version of the app is read by default and passed to the server.
Contact to Shoplive at ask@shoplive.cloud to use this feature.
Parameter name | Type | Description |
---|---|---|
appVersion | String | The version of an app. |
Sample code
setMixWithOthers
You can watch broadcasts with external audio.
Parameter name | Type | Description |
---|---|---|
isMixAudio | Bool |
|
Sample code
useCloseButton
You can activate the close button in Preview and PIP modes.
Parameter name | Type | Description |
---|---|---|
use | Bool |
|
Sample code
addParameter
You can add custom data before launching the player.
Parameter name | Type | Description |
---|---|---|
key | String | A custom parameter key to apply additionally |
value | String | An additional custom parameter value to apply |
Sample code
removeParameter
Before running the player, delete the custom data added by addParameter.
Parameter name | Type | Description |
---|---|---|
key | String | A custom parameter key to delete |
Sample code
setUtmSource
You can log UTM Source. Data can be checked at Data Insights.
Parameter name | Type | Description |
---|---|---|
utmSource | String? | It conveys where the inflow occurred. |
Sample code
setUtmMedium
You can log 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
setUtmCampaign
You can log 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
You can log 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
setResizeMode
You can maintain the aspect ratio of the video. (Default:.CENTER_CROP)