Getting started with Millicast on Android
Dolby Millicast delivers broadcast quality live streaming at sub-second latency, enabling interactivity and fan engagement. Using the THEOplayer Millicast integration, you can play your Millicast streams directly through THEOplayer.
Usage
- Follow our Getting Started guide to set up THEOplayer in your Android app.
- Add the
integration-millicast
dependency to your module'sbuild.gradle
. - Add the
MillicastIntegration
to the player. - Add a
MillicastSource
to your player's source.
Add the integration-millicast
dependency
Add the Millicast integration along with the Millicast SDK
to your module build.gradle
file, as demonstrated below:
dependencies {
// ...
implementation 'com.theoplayer.theoplayer-sdk-android:core:+'
implementation 'com.theoplayer.theoplayer-sdk-android:integration-millicast:+'
implementation "com.millicast:millicast-sdk-android:2.0.0"
// ...
}
Add the Millicast integration to the player
Create and add the MillicastIntegration
to your THEOplayerView
:
val millicastIntegration = MillicastIntegrationFactory.createMillicastIntegration()
theoplayerView.player.addIntegration(millicastIntegration)
Add a MillicastSource
After setting up a THEOplayerView
in your app's activity, set its source to a SourceDescription
containing a MillicastSource
.
You'll need a Millicast account ID and stream name to create a Credential
object and identify your Millicast stream:
import com.millicast.subscribers.Credential
import com.theoplayer.android.api.millicast.MillicastSource
theoplayerView.player.source = SourceDescription.Builder(
MillicastSource(
credential = Credential(
streamName = "multiview",
accountId = "k9Mwad",
apiUrl = "https://director.millicast.com/api/director/subscribe"
)
)
).build()