Skip to main content
The BeyondWords Android SDK allows you to embed the BeyondWords player directly into your Android applications. The SDK uses the BeyondWords web player under the hood and provides a native Kotlin interface for interacting with the underlying JavaScript API. As a result, most player functionality and properties are shared across the Android SDK and web player. You can compare supported properties in the player properties reference. Before you begin, make sure you have created a project and generated some content.

Installation

Add the JitPack repository

Add the JitPack repository to your root build.gradle file:
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

Add the SDK dependency to your app build.gradle file:
dependencies {
    implementation 'com.github.beyondwords-io:player-android:+'
}

Load content

Add PlayerView to your view hierarchy

You can either add PlayerView to your layout XML:
<io.beyondwords.player.PlayerView
    android:id="@+id/player_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
Or add it programmatically:
val playerView = PlayerView(context)
playerViewParent.addView(playerView)

Load content into the player

playerView.load(PlayerSettings(
    projectId = YOUR_PROJECT_ID,
    contentId = YOUR_CONTENT_ID
))
Replace YOUR_PROJECT_ID with your numeric project ID and YOUR_CONTENT_ID with your content ID. Once your app is running, the player will automatically load the specified content.
Call playerView.release() after the PlayerView has been removed from the view hierarchy. No other methods should be called on the PlayerView after it has been released.

Configuration

The preferred way to configure the player is by going to Distribution → Player → Settings in your project dashboard. However, you can override properties at the app level:
playerView.load(PlayerSettings(
    projectId = YOUR_PROJECT_ID,
    contentId = YOUR_CONTENT_ID,
    playerStyle = "large",
    callToAction = "Listen to this recipe",
    backgroundColor = "yellow"
))

Update properties after loading

You can also update properties after the player has loaded:
playerView.setPlayerStyle("large")
playerView.setBackgroundColor("yellow")
playerView.setPlaybackRate(1.5F)

Example app

The example app demonstrates core player functionality, including how to build a custom player UI. You can explore the source code on GitHub or download a precompiled version from the latest release.

Example app

Explore the example application on GitHub.

Download example app

Download a precompiled version from the latest release.

GitHub repository

Android SDK repository

View the source code, releases, and API documentation on GitHub.