Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changelog and basic documentation for SSAI tracking #76

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Added
- `ConvivaAnalyticsIntegration.ssai` namespace to enable server side ad tracking
rolandkakonyi marked this conversation as resolved.
Show resolved Hide resolved

### Fixed
- Potential exception when determining the IMA SDK version on ad start
Expand Down
45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ For more information about permissions and collected network types please look a

The following example create a ConvivaAnalyticsIntegration object and attaches at Bitmovin Native SDK to it

#### Basic Conviva Reporting
### Basic Conviva Reporting

```java
// Create your ConvivaConfig object
Expand All @@ -83,14 +83,14 @@ Source source = Source.create(sourceConfig);
bitmovinPlayer.load(source);
```

#### Optional Configuration Parameters
### Optional Configuration Parameters
```java
convivaConfig.setGatewayUrl("YOUR_DEBUG_GATEWAY_URL");
convivaConfig.setDebugLoggingEnabled(true);

```

#### Content Metadata handling
### Content Metadata handling

If you want to override some content metadata attributes or track additional custom or standard tags you can do so by adding the following:

Expand All @@ -116,15 +116,15 @@ convivaAnalyticsIntegration.updateContentMetadata(metadata);

Those values will be cleaned up after the session is closed.

#### Consecutive playback
### Consecutive playback

If you want to use the same player instance for multiple playback, just load a new source with player.load(…). The integration will close the active session.

```java
player.load(…);
```

#### Background handling
### Background handling

If your app stops playback when entering background conviva suggests to end the active session. Since the integration can't know if your app supports background playback this can't be done automatically.

Expand All @@ -133,7 +133,40 @@ A session can be ended using following method call:
`convivaAnalyticsIntegration.endSession()`
Since the `BitmovinPlayer` automatically pauses the video if no background playback is configured the session creation after the app is in foreground again is handled automatically.

#### Clean up
### Server Side Ad Tracking

In order to track server side ads you can use the functions provided in `ConvivaAnalyticsIntegration.getSsai()`. The following example shows basic server side ad tracking:
```java
SsaiApi ssai = convivaAnalyticsIntegration.getSsai();

ssai.reportAdBreakStarted();

SsaiApi.AdInfo adInfo = new SsaiApi.AdInfo();
adInfo.setPosition(AdPosition.PREROLL);
adInfo.setTitle("My ad title");
adInfo.setDuration(30);
ssai.reportAdStarted(adInfo);

...

ssai.reportAdFinished();
ssai.reportAdBreakFinished();
```

In addition to the metadata provided in the `AdInfo` object at ad start, the following metadata will be auto collected from the main content metadata:
- ConvivaSdkConstants.STREAM_URL
- ConvivaSdkConstants.ASSET_NAME
- ConvivaSdkConstants.IS_LIVE
- ConvivaSdkConstants.DEFAULT_RESOURCE
- ConvivaSdkConstants.ENCODED_FRAMERATE
- ConvivaSdkConstants.VIEWER_ID
- ConvivaSdkConstants.PLAYER_NAME
- streamType
- integrationVersion
rolandkakonyi marked this conversation as resolved.
Show resolved Hide resolved

Metadata in the `AdInfo` overwrites all auto collected metadata.

### Clean up

At end of app instance lifecycle, the convivaAnalyticsIntegration should be released:

Expand Down