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)
adConfiguration - optional StorytellerClipsAdConfiguration for per-presentation Clips ads. Full-screen Clips use default-enabled bottom banners and pre-roll eligibility when this configuration is omitted. Set preRollEnabled = false to suppress IMA and the standard zero-index opening ad-as-Clip while preserving later cadence. Set betweenClipsAdProviderOrder to an ordered provider allowlist, or to an empty list to disable standard between-Clip requests. Set a positive frequency and/or a non-negative initialIndex to override the corresponding remote cadence field for this opening; leave either value null to inherit it. See Per-presentation Clips Ad Controls.
For example, this user receives GAM before VAST and no opening pre-roll:
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)
{"slug": "open-player", "page_title": "Open Player", "page_url": "OpenPlayer/", "canonical_url": "/android/OpenPlayer/", "markdown": "# Open Player\n\n## Showcase examples\n\n- [Compose \u2014 opening a category (`ImageActionItem`)](https://github.com/getstoryteller/storyteller-showcase-android/blob/main/compose/app/src/main/java/com/getstoryteller/storytellershowcaseapp/ui/features/home/ImageActionItem.kt#L41)\n\n## Open Stories\n\nThis call opens a Story with a given ID. The call will only open that individual Story.\n\n```kotlin\n fun openStory(activity: Activity, storyId: String? = null, onError: (StorytellerError) -> Unit = {})\n```\n\nParameters:\n\n- `activity` - this is the Activity that will be used to launch the Storyteller Player\n- `storyId` - this is a Story's ID, if it is `null` then `onError` will be called\n- `onError` - this is called when there is an issue with opening a Story (e.g. the requested content is no longer available)\n\n## Open Pages\n\nThis call opens a Page with a given ID. The call will only open that individual Story containing that page.\n\n```kotlin\n fun openPage(activity: Activity, pageId: String? = null, onError: (StorytellerError) -> Unit = {})\n```\n\nParameters:\n\n- `activity` - this is the Activity that will be used to launch the Storyteller Player\n- `pageId` - this is a Page's ID, if it is `null` then `onError` will be called\n- `onError` - this is called when there is an issue with opening a Story (e.g. the requested content is no longer available)\n\n## Open Collection\n\n```kotlin\n fun openCollection(\n activity: Activity,\n configuration: StorytellerClipCollectionConfiguration,\n titleDrawable: Drawable? = null,\n onError: (StorytellerError) -> Unit = {}\n )\n```\n\nParameters:\n\n- `activity` - this is the Activity that will be used to launch the Storyteller Player\n- `configuration` - this is a Clip Collection configuration, see below\n- `titleDrawable` - this is a Drawable that will be used as the title of the Player (optional)\n- `onError` - this is called when there is an issue with opening the Collection (e.g. the requested Collection is not available)\n\n`StorytellerClipCollectionConfiguration` parameters:\n\n- `collectionId` - this is a Clip Collection's ID (required)\n- `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\n- `clipId` - this is a Clip ID to open (optional)\n- `adConfiguration` - optional `StorytellerClipsAdConfiguration` for per-presentation Clips ads. Full-screen Clips use default-enabled bottom banners and pre-roll eligibility when this configuration is omitted. Set `preRollEnabled = false` to suppress IMA and the standard zero-index opening ad-as-Clip while preserving later cadence. Set `betweenClipsAdProviderOrder` to an ordered provider allowlist, or to an empty list to disable standard between-Clip requests. Set a positive `frequency` and/or a non-negative `initialIndex` to override the corresponding remote cadence field for this opening; leave either value `null` to inherit it. See [Per-presentation Clips Ad Controls](Ads.md#per-presentation-clips-ad-controls).\n\nFor example, this user receives GAM before VAST and no opening pre-roll:\n\n```kotlin\nStoryteller.openCollection(\n activity = this,\n configuration = Storyteller.StorytellerClipCollectionConfiguration(\n collectionId = \"yourCollectionId\",\n adConfiguration = Storyteller.StorytellerClipsAdConfiguration(\n bottomBannerEnabled = true,\n preRollEnabled = false,\n betweenClipsAdProviderOrder = listOf(\n Storyteller.StorytellerAdProvider.GAM,\n Storyteller.StorytellerAdProvider.VAST,\n ),\n frequency = 4,\n initialIndex = 1,\n ),\n ),\n)\n```\n\n## Open Category\n\nThis call opens a Story category. If Story ID is not supplied, the first Story in the collection will be opened.\n\n```kotlin\n fun openCategory(\n activity: Activity,\n category: String,\n storyId: String? = null,\n onError: (StorytellerError) -> Unit = {}\n)\n```\n\nParameters:\n\n- `activity` - this is the Activity that will be used to launch the Storyteller Player\n- `category` - this is a Story category\n- `storyId` - this is a Story ID (optional)\n- `onError` - this is called when there is an issue with opening the Category (e.g. the requested Category is not available)\n\n### openStoryByExternalId\n\nThis call opens a Story by external ID.\n\n```kotlin\n fun openStoryByExternalId(\n context: Activity,\n externalId: String? = null,\n onError: (StorytellerError) -> Unit = {}\n )\n```\n\nParameters:\n\n- `activity` - this is the Activity that will be used to launch the Storyteller Player\n- `externalId` - external Id to open a Story\n- `onError` - this is called when there is an issue with opening the Category (e.g. the requested Category is not available)\n\n### openCollectionByExternalId\n\nThis 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.\n\n```kotlin\n fun openCollectionByExternalId(\n activity: Activity,\n collectionId: String,\n externalId: String? = null,\n titleDrawable: Drawable? = null,\n onError: (StorytellerError) -> Unit = {}\n)\n```\n\nParameters:\n\n- `activity` - this is the Activity that will be used to launch the Storyteller Player\n- `collectionId` - this is a Clip Collection's ID\n- `externalId` - this is a Clip's external ID (optional)\n- `titleDrawable` - this is a Drawable that will be used as the title of the Player (optional)\n- `onError` - this is called when there is an issue with opening the Collection (e.g. the requested Collection is not available)\n", "copy_markdown_include_header": false, "base_path": "android", "ai_dir": "ai", "missing_payload_behavior": "empty"}