API - Shortform

    API - Shortform


    Article summary

    Play - Shortform Detail View

    ShopLiveShortform.play(context: Context, requestData: ShopLiveShortformCollectionData? = null)

    Play the Shortform detail view. (Plays the playlist associated with the ShopLiveShortformCollectionData.)

    You can play the related detail view by entering one or more of the field values of ShopLiveShortformCollectionData.

    If ShopLiveShortformCollectionData is null, you can play the entire detail view.

    • ShopLiveShortformCollectionData

      field

      type

      description

      shortsId

      String?

      Shortform unique identifier

      shortsSrn

      String?

      This is the global resource name assigned to Shortform for resource management. It is an internally used value in Shoplive.

      tags

      List?

      Value for related tag search

      tagSearchOperator

      ShopLiveShortformTagSearchOperator?

      Tag search options

      • OR : integrated search

      • AND : cross search

      brands

      List?

      Value for related brand search (searching both title and identifier)

      shuffle

      Boolean?

      Value for random playback (Default: false)

      referrer

      String?

      Value for tracking the path


    Shortform Detail View - Entire

    ShopLiveShortform.play(context)

    Shortform Detail View - Playback after clicking on the list

    ShopLiveShortform.play(context, ShopLiveShortformCollectionData().apply {
        shortsId = "{CLICKED_IN_LIST_SHORTS_ID}"
        shortsSrn = "{CLICKED_IN_LIST_SHORTS_SRN}"
    })

    Shortform Detail View - Playback after clicking on the related tag list

    ShopLiveShortform.play(context, ShopLiveShortformCollectionData().apply {
        shortsId = "{CLICKED_IN_LIST_SHORTS_ID}"
        shortsSrn = "{CLICKED_IN_LIST_SHORTS_SRN}"
        tags = "{CLICKED_IN_LIST_TAGS}"
        tagSearchOperator = "{CLICKED_IN_LIST_TAG_SEARCH_OPERATOR}"
    })

    Shortform Detail View - Playback after clicking on the related brand list

    ShopLiveShortform.play(context, ShopLiveShortformCollectionData().apply {
        shortsId = "{CLICKED_IN_LIST_SHORTS_ID}"
        shortsSrn = "{CLICKED_IN_LIST_SHORTS_SRN}"
        brands = "{CLICKED_IN_LIST_BRANDS}"
    })

    Shortform Detail View - Playback of related tag

    ShopLiveShortform.play(context, ShopLiveShortformCollectionData().apply {
        tags = "{YOUR_TAGS}"
        tagSearchOperator = "{YOUR_SEARCH_OPERATOR}"
    })

    Shortform Detail View - Playback of related brand

    ShopLiveShortform.play(context, ShopLiveShortformCollectionData().apply {
        brands = "{YOUR_BRANDS}"
    })

    Compose detailed intent for short-form content

    ShopLiveShortform.intent(context: Context, requestData: ShopLiveShortformCollectionData? = null)

    Provides an intent to play the Shortform detailed view (playlists associated with ShopLiveShortformCollectionData)

    You can play the related detail view by entering one or more of the field values of ShopLiveShortformCollectionData.

    If ShopLiveShortformCollectionData is null, you can play the entire detail view.

    • ShopLiveShortformCollectionData

      field

      type

      description

      shortsId

      String?

      Shortform unique identifier

      shortsSrn

      String?

      This is the global resource name assigned to Shortform for resource management. It is an internally used value in Shoplive.

      tags

      List?

      Value for related tag search

      tagSearchOperator

      ShopLiveShortformTagSearchOperator?

      Tag search options

      • OR : integrated search

      • AND : cross search

      brands

      List?

      Value for related brand search (searching both title and identifier)

      shuffle

      Boolean?

      Value for random playback (Default: false)

      referrer

      String?

      Value for tracking the path


    Shortform Detail View - Playback after clicking on the list

    val intent = ShopLiveShortform.intent(context, ShopLiveShortformCollectionData().apply {
        shortsId = "{CLICKED_IN_LIST_SHORTS_ID}"
        shortsSrn = "{CLICKED_IN_LIST_SHORTS_SRN}"
    })
    startActivity(intent)

    Shortform Detail View - Playback after clicking on the related tag list

    val intent = ShopLiveShortform.intent(context, ShopLiveShortformCollectionData().apply {
        shortsId = "{CLICKED_IN_LIST_SHORTS_ID}"
        shortsSrn = "{CLICKED_IN_LIST_SHORTS_SRN}"
        tags = "{CLICKED_IN_LIST_TAGS}"
        tagSearchOperator = "{CLICKED_IN_LIST_TAG_SEARCH_OPERATOR}"
    })
    startActivity(intent)

    Shortform Detail View - Playback after clicking on the related brand list

    val intent = ShopLiveShortform.intent(context, ShopLiveShortformCollectionData().apply {
        shortsId = "{CLICKED_IN_LIST_SHORTS_ID}"
        shortsSrn = "{CLICKED_IN_LIST_SHORTS_SRN}"
        brands = "{CLICKED_IN_LIST_BRANDS}"
    })
    startActivity(intent)

    Shortform Detail View - Playback of related tag

    val intent = ShopLiveShortform.intent(context, ShopLiveShortformCollectionData().apply {
        tags = "{YOUR_TAGS}"
        tagSearchOperator = "{YOUR_SEARCH_OPERATOR}"
    })
    startActivity(intent)

    Shortform Detail View - Playback of related brand

    val intent = ShopLiveShortform.intent(context, ShopLiveShortformCollectionData().apply {
        brands = "{YOUR_BRANDS}"
    })
    startActivity(intent)

    Close detail view

    Close Shortform detail view.

    ShopLiveShortform.close()

    Hide Button on Detail View

    Configure whether to show buttons on the Shortform detail view screen.

    • ShopLiveShortfromVisibleFullTypeData

      field

      type

      description

      isLikeButtonVisible

      Boolean

      You can hide the like button. (Default: true)

      isCommentButtonVisible

      Boolean

      You can hide the comment button. (Default: true)

      isShareButtonVisible

      Boolean

      You can hide the share button. (Default: true)

      isBookmarkVisible

      Boolean

      You can hide the bookmark button. (Default: true)

    ShopLiveShortform.setVisibleFullTypeViews(ShopLiveShortformVisibleFullTypeData().apply {
        isLikeButtonVisible = true
        isCommentButtonVisible = true
        isShareButtonVisible = true
        isBookmarkVisible = true
    })

    Play - Shortform Preview

    ShopLiveShortform.showPreview(activity: Activity, data: ShopLiveShortformRelatedData)

    Play the Shortform preview. (Playlist associated with ShopLiveShortformRelatedData)

    You can play the related preview by entering one or more of the field values of ShopLiveShortformRelatedData.

    • ShopLiveShortformRelatedData

      field

      type

      description

      productId

      Long?

      Unique ID of the product, automatically issued upon product registration

      sku

      String?

      Unique SKU information of the product

      name

      String?

      Product name

      url

      String?

      URL of the product's detailed page

      tags

      List?

      Value for related tag search

      tagSearchOperator

      ShopLiveShortformTagSearchOperator?

      Tag search options

      • OR : integrated search

      • AND : cross search

      brands

      List?

      Value for related brand search (searching both title and identifier)

      shuffle

      Boolean

      Value for random playback (Default: false)

      referrer

      String?

      Value for tracking the path

    • ShopLiveShortformPreviewData

      field

      type

      description

      width

      Int?  (px)

      width of shortform preview (Default: 180dp)

      height

      Int? (px)

      height of shortform preview (Default: 180dp)

      marginTop

      Int? (px)

      marginTop of shortform preview (Default: 16dp)

      marginBottom

      Int? (px)

      marginBottom of shortform preview (Default: 16dp)

      marginLeft

      Int? (px)

      marginLeft of shortform preview (Default: 16dp)

      marginRight

      Int? (px)

      marginRight of shortform preview (Default: 16dp)

      radius

      Int? (px)

      radius of shortform preview (Default: 10dp)

      isMuted

      Bool?

      This is used to set the mute option for shortform preview. (Default: false)

      position

      ShopLivePreviewPositionConfig?

      This is used to set the initial display position for shortform preview.
      (Default: ShopLivePreviewPositionConfig.BOTTOM_RIGHT)

      maxCount

      Int?

      You use this to set the number of videos to play in the preview of a shortform.

      useCloseButton

      Boolean?

      This is used to enable or disable the x button in the top left corner of the short-form preview. (Default: true)

      useCustomAction

      Boolean

      This is used when you want to define the click events of the shortform preview manually. (Default: false)

      enableSwipeOut

      Boolean?

      This is used to allow or disallow closing the shortform preview by swiping it off the screen. (Default: true)

      conClickListener

      View.OnClickListener?

      You can receive events triggered when the shortform preview is clicked.

      By setting useCustomAction to true, you can define the behavior and manually handle the preview’s click events.

    Shortform Preview - ProductId Based

    ShopLiveShortform.showPreview(activity: Activity, ShopLiveShortformRelatedData().apply {
        productId = "{PRODUCT_ID}"
    })

    Shortform Preview - SKU Based

    ShopLiveShortform.showPreview(activity: Activity, ShopLiveShortformRelatedData().apply {
        sku = "{PRODUCT_SKU}"
    })

    Shortform Preview - Tag Based

    ShopLiveShortform.showPreview(activity: Activity, ShopLiveShortformRelatedData().apply {
        tags = "{YOUR_TAGS}"
        tagSearchOperator = "{YOUR_SEARCH_OPERATOR}"
    })

    Shortform Preview - Brand Based

    ShopLiveShortform.showPreview(activity: Activity, ShopLiveShortformRelatedData().apply {
        brands = "{YOUR_BRANDS}"
    })

    Shortform Preview Close

    ShopLiveShortform.hidePreview()

    Close the currently running Shortform preview.

    ShopLiveShortform.hidePreview()

    Detailed list of shortform content - composed with a specific shortform ID

    ShopLiveShortform.play(context: Context, shortformIdsData: ShopLiveShortformIdsData, moreSuspendListener: ShopLiveShortformMoreSuspendListener)

    Using a Coroutine, compose a playlist with the shortformId received through the short-form API and play them in order.

    • ShopLiveShortformIdsData

      field

      type

      description

      ids

      List<String>?

      A list of shortform IDs (up to 30 items)

      currentId

      String?

      The item in the list that can currently be focused on

      referrer

      String?

      A value to track the referral path

    • ShopLiveShortformMoreSuspendListener

      function

      return

      description

      onMore

      ShopLiveShortformIdsMoreData?

      A function to compose a paginated list using Coroutines

    • ShopLiveShortformIdsMoreData

      field

      type

      description

      ids

      List<String>?

      A list of shortform IDs (up to 30 items)

      hasMore

      Boolean?

      Pagination availability

    ShopLiveShortform.play(context, ShopLiveShortformIdsData().apply {
        ids = "{YOUR_IDS}"
        currentId = "{YOUR_CURRENT_ID}"
    }, ShopLiveShortformMoreSuspendListener {
        val moreResponse =
            kotlin.runCatching {
                "{YOUR_MORE_API_RESPONSE}"
            }.getOrNull() ?: return@ShopLiveShortformMoreSuspendListener null
        val ids = moreResponse.shortsList?.mapNotNull { it.shortsId } ?: emptyList()
        val hasMore = moreResponse.hasMore
        return@ShopLiveShortformMoreSuspendListener ShopLiveShortformIdsMoreData().apply {
            this.ids = ids
            this.hasMore = hasMore
        }
    })

    ShopLiveShortform.play(context: Context, shortformIdsData: ShopLiveShortformIdsData, moreFutureListener: ShopLiveShortformMoreFutureListener)

    Using a Future, compose a playlist with the shortformId received through the short-form API and play them in order.

    • ShopLiveShortformIdsData

      field

      type

      description

      ids

      List<String>?

      A list of shortform IDs (up to 30 items)

      currentId

      String?

      The item in the list that can currently be focused on

      referrer

      String?

      A value to track the referral path

    • ShopLiveShortformMoreFutureListener

      function

      return

      description

      onMore

      Future<ShopLiveShortformIdsMoreData?>

      A function to compose a paginated list using Futures

    • ShopLiveShortformIdsMoreData

      field

      type

      description

      ids

      List<String>?

      A list of shortform IDs (up to 30 items)

      hasMore

      Boolean?

      Pagination availability

    API - Invoking detailed result values

    ShopLiveShortform.get(context: Context, collectionData: ShopLiveShortformCollectionData? = null, callback: ShopLiveShortformCollectionListener)

    You can check the results of the collection in callback format.

    Application

    You can pre-process data in a reusable RecyclerView

    • ShopLiveShortformCollectionData

      field

      type

      description

      shortsId

      String?

      Shortform unique identifier

      shortsSrn

      String?

      This is the global resource name assigned to Shortform for resource management. It is an internally used value in Shoplive.

      tags

      List?

      Value for related tag search

      tagSearchOperator

      ShopLiveShortformTagSearchOperator?

      Tag search options

      • OR : integrated search

      • AND : cross search

      brands

      List?

      Value for related brand search (searching both title and identifier)

      shuffle

      Boolean?

      Value for random playback (Default: false)

      referrer

      String?

      Value for tracking the path

    • ShopLiveShortformCollectionListener

      function

      description

      onData(response: ShopLiveShortformCollectionResponse)

      When ShopLiveShortform.get is successful, you can receive and handle the response.

      onError(e: Exception)

      When ShopLiveShortform.get fails, you can handle the exception.


    val data = ShopLiveShortformCollectionData()
    ShopLiveShortform.get(context, data, object : ShopLiveShortformCollectionListener {
        // In background thread
        override fun onData(response: ShopLiveShortformCollectionResponse) {
            // Do something
        }
        override fun onError(e: Exception) {
            // Handle error
        }
    })

    Connect API for a hybrid environment

    ShopLiveShortform.connectBridgeInterface(activity: Activity, webView: WebView)

    Connects Web and SDK in a hybrid environment.

    ShopLiveShortform.connectBridgeInterface(activity, webView)

    ShopLiveShortform.receiveBridgeInterface(webView: WebView)

    Exchanges messages between Web and SDK in a hybrid environment.

    ShopLiveShortform.receiveBridgeInterface(webView)

    ShopLiveShortform.updateVisitedHistory(view: WebView?, url: String?, isReload: Boolean)

    You can automatically remove the preview when navigating to a web page.

    webView.webViewClient = object : WebViewClient() {
        ...
        // Required
        override fun doUpdateVisitedHistory(view: WebView?, url: String?, isReload: Boolean) {
            super.doUpdateVisitedHistory(view, url, isReload)
            ShopLiveShortform.updateVisitedHistory(view, url, isReload)
        }
        ...
    }


    What's Next