trackMediaEvent static method
Future<void>
trackMediaEvent({
- required String tracker,
- required String id,
- required Event event,
- List<
SelfDescribing> ? contexts, - MediaPlayerEntity? player,
- MediaAdEntity? ad,
- MediaAdBreakEntity? adBreak,
Tracks a media player event along with the media entities (e.g., player, session, ad).
Implementation
static Future<void> trackMediaEvent({
required String tracker,
required String id,
required Event event,
List<SelfDescribing>? contexts,
MediaPlayerEntity? player,
MediaAdEntity? ad,
MediaAdBreakEntity? adBreak,
}) async {
await _channel.invokeMethod(event.endpoint(), {
'tracker': tracker,
'mediaTrackingId': id,
'eventData': event.toMap(),
'contexts': contexts?.map((c) => c.toMap()).toList(),
'player': player?.toMap(),
'ad': ad?.toMap(),
'adBreak': adBreak?.toMap(),
});
}