Skip to content

Commit 7fb7d42

Browse files
authored
Merge pull request #5 from FastPix/docs/Updates-ReadMe
Updates ReadMe For Analytics
2 parents 5196aec + 88a1e30 commit 7fb7d42

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,61 @@ class MainActivity : AppCompatActivity() {
230230

231231
---
232232

233+
## Analytics (FastPix Data Core SDK)
234+
235+
The FastPix Android Data Core SDK provides analytics for FastPix playback on Android. It is **not** a standalone video player. Instead, it integrates with your player and automatically captures playback analytics, including:
236+
237+
- Playback lifecycle events (play, pause, ready, complete, errors)
238+
- Buffering behavior and seek patterns
239+
- Engagement signals and session-level playback usage
240+
241+
The SDK sends collected analytics to your FastPix workspace, where you can monitor them in near real time through the FastPix dashboard. The integration is lightweight and does not interrupt or degrade playback.
242+
243+
### What it is for
244+
245+
Use analytics when you want to:
246+
- Measure viewer engagement and completion trends
247+
- Detect buffering and quality-of-experience issues
248+
- Correlate playback behavior with video metadata (for example, title and ID,etc)
249+
- Monitor player health and failures in production
250+
251+
### How to use it
252+
253+
Configure analytics using `AnalyticsConfig` and pass it to `FastPixPlayer.Builder`.
254+
255+
```kotlin
256+
import io.fastpix.data.domain.model.VideoDataDetails
257+
import io.fastpix.media3.analytics.AnalyticsConfig
258+
import io.fastpix.media3.core.FastPixPlayer
259+
260+
val videoDataDetails = VideoDataDetails("video-123", "Launch Demo")
261+
262+
val analyticsConfig = AnalyticsConfig.Builder(
263+
playerView = binding.playerView, // Required
264+
workSpaceId = "your-workspace-id" // Required
265+
)
266+
.setVideoDataDetails(videoDataDetails) // Optional metadata
267+
.setEnabled(true) // default is true
268+
.build()
269+
270+
val fastPixPlayer = FastPixPlayer.Builder(this)
271+
.setAutoplay(true)
272+
.setLoop(false)
273+
.setAnalyticsConfig(analyticsConfig)
274+
.build()
275+
276+
binding.playerView.player = fastPixPlayer
277+
```
278+
279+
### Notes
280+
281+
- `playerView` and `workSpaceId` are mandatory.
282+
- `videoDataDetails`, `playerDataDetails`, and `customDataDetails` are optional and can be added based on your use case.
283+
- If analytics setup fails at runtime, playback continues. Analytics is fail-safe by design.
284+
- Current analytics APIs are optimized for Java-first Android integration. Kotlin ergonomics and customization options will improve in future releases.
285+
286+
---
287+
233288
## Seek Preview (Spritesheet thumbnails)
234289

235290
Seek preview lets you show **thumbnail previews while the user scrubs** your seek bar. When enabled, the SDK automatically attempts to resolve the default FastPix spritesheet URL from the currently loaded stream URL:

0 commit comments

Comments
 (0)