Teyuto Flutter Player Analytics SDK
Important
If you are using the Teyuto Player, you do not need to integrate this SDK. Analytics tracking is already built into the Teyuto Player.
This SDK provides analytical monitoring for Teyuto with ExoPlayer in Android applications.
Installation
Add the following to your project's build.gradle
:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then, add the dependency to your app's build.gradle
:
dependencies {
implementation 'com.github.teyuto:teyuto-exoplayer-analytics:0.3.6'
}
Usage
The Teyuto ExoPlayer Analytics SDK now supports optional authentication tokens. You can initialize the SDK with or without a token, depending on your requirements.
Initializing with a Token
import com.teyuto.exoplayeranalytics.TeyutoPlayerAnalyticsAdapter
import com.google.android.exoplayer2.ExoPlayer
import com.google.android.exoplayer2.MediaItem
class MainActivity : AppCompatActivity() {
private lateinit var player: ExoPlayer
private lateinit var analytics: TeyutoPlayerAnalyticsAdapter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
player = ExoPlayer.Builder(this).build()
val mediaItem = MediaItem.fromUri("https://example.com/video.mp4")
player.setMediaItem(mediaItem)
analytics = TeyutoPlayerAnalyticsAdapter("channel-public", "user-auth-token")
analytics.init(player, "video-id")
player.prepare()
}
override fun onDestroy() {
super.onDestroy()
analytics.destroy()
player.release()
}
}
Initializing without a Token
If you don't need to use an authentication token, you can initialize the SDK with just the channel:
analytics = TeyutoPlayerAnalyticsAdapter("your-channel-public")
analytics.init(player, "your-video-id-here")