Skip to content

Open Player#

Showcase examples#

Open Stories#

This call opens a Story with a given ID. The call will only open that individual Story.

  fun openStory(activity: Activity, storyId: String? = null, onError: (StorytellerError) -> Unit = {})

Parameters:

  • activity - this is the Activity that will be used to launch the Storyteller Player
  • storyId - this is a Story's ID, if it is null then onError will be called
  • onError - this is called when there is an issue with opening a Story (e.g. the requested content is no longer available)

Open Pages#

This call opens a Page with a given ID. The call will only open that individual Story containing that page.

    fun openPage(activity: Activity, pageId: String? = null, onError: (StorytellerError) -> Unit = {})

Parameters:

  • activity - this is the Activity that will be used to launch the Storyteller Player
  • pageId - this is a Page's ID, if it is null then onError will be called
  • onError - this is called when there is an issue with opening a Story (e.g. the requested content is no longer available)

Open Collection#

        fun openCollection(
            activity: Activity,
            configuration: StorytellerClipCollectionConfiguration,
            titleDrawable: Drawable? = null,
            onError: (StorytellerError) -> Unit = {}
        )

Parameters:

  • activity - this is the Activity that will be used to launch the Storyteller Player
  • configuration - this is a Clip Collection configuration, see below
  • titleDrawable - this is a Drawable that will be used as the title of the Player (optional)
  • onError - this is called when there is an issue with opening the Collection (e.g. the requested Collection is not available)

StorytellerClipCollectionConfiguration parameters:

  • collectionId - this is a Clip Collection's ID (required)
  • categoryId - this is a Category ID (optional), if provided, this category will be opened, if the category is not available or not found it will be ignored
  • clipId - this is a Clip ID to open (optional)

Open Category#

This call opens a Story category. If Story ID is not supplied, the first Story in the collection will be opened.

    fun openCategory(
      activity: Activity,
      category: String,
      storyId: String? = null,
      onError: (StorytellerError) -> Unit = {}
)

Parameters:

  • activity - this is the Activity that will be used to launch the Storyteller Player
  • category - this is a Story category
  • storyId - this is a Story ID (optional)
  • onError - this is called when there is an issue with opening the Category (e.g. the requested Category is not available)

openStoryByExternalId#

This call opens a Story by external ID.

  fun openStoryByExternalId(
    context: Activity,
    externalId: String? = null,
    onError: (StorytellerError) -> Unit = {}
  )

Parameters:

  • activity - this is the Activity that will be used to launch the Storyteller Player
  • externalId - external Id to open a Story
  • onError - this is called when there is an issue with opening the Category (e.g. the requested Category is not available)

openCollectionByExternalId#

This call opens a Collection of Clips and shows Clip with external id. If Clip ID is not supplied, the first Clip in the collection will be opened.

    fun openCollectionByExternalId(
    activity: Activity,
    collectionId: String,
    externalId: String? = null,
    titleDrawable: Drawable? = null,
    onError: (StorytellerError) -> Unit = {}
)

Parameters:

  • activity - this is the Activity that will be used to launch the Storyteller Player
  • collectionId - this is a Clip Collection's ID
  • externalId - this is a Clip's external ID (optional)
  • titleDrawable - this is a Drawable that will be used as the title of the Player (optional)
  • onError - this is called when there is an issue with opening the Collection (e.g. the requested Collection is not available)