From 604c359a167cb787f1878d05dcc410fbfac6b157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Tue, 29 Oct 2024 14:34:48 +0100 Subject: [PATCH] Remove some verbosity in the doc --- .../pillarbox/analytics/AnalyticsConfig.kt | 1 - .../analytics/commandersact/CommandersAct.kt | 12 +++---- .../analytics/commandersact/TCMediaEvent.kt | 32 ++++--------------- .../pillarbox/analytics/comscore/ComScore.kt | 4 +-- 4 files changed, 15 insertions(+), 34 deletions(-) diff --git a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/AnalyticsConfig.kt b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/AnalyticsConfig.kt index 0ba59ed5c..84d4fa9e3 100644 --- a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/AnalyticsConfig.kt +++ b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/AnalyticsConfig.kt @@ -20,7 +20,6 @@ import ch.srgssr.pillarbox.analytics.SRGAnalytics.initSRGAnalytics * @property sourceKey The CommandersAct source key. Production apps should use [SOURCE_KEY_SRG_PROD], and apps in development should use * [SOURCE_KEY_SRG_DEBUG]. * @property nonLocalizedApplicationName The non-localized name of the application. By default, the application name defined in the manifest is used. - * You can set it to `null` if the application name is not localized. * @property userConsent The user consent to transmit to ComScore and CommandersAct. * @property comScorePersistentLabels The initial persistent labels for ComScore analytics. * @property commandersActPersistentLabels The initial persistent labels for Commanders Act analytics. diff --git a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/CommandersAct.kt b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/CommandersAct.kt index bb3f27756..d55fa7d86 100644 --- a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/CommandersAct.kt +++ b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/CommandersAct.kt @@ -12,23 +12,23 @@ package ch.srgssr.pillarbox.analytics.commandersact */ interface CommandersAct { /** - * Sends a page view event to Commanders Act. + * Sends a page view event. * - * @param pageView The [CommandersActPageView] object representing the page view to send. + * @param pageView The [CommandersActPageView] to be sent. */ fun sendPageView(pageView: CommandersActPageView) /** - * Sends an event to Commanders Act. + * Sends an event. * - * @param event The [CommandersActEvent] instance to send. + * @param event The [CommandersActEvent] to be sent. */ fun sendEvent(event: CommandersActEvent) /** - * Sends a [TCMediaEvent] to Commanders Act. + * Sends a [TCMediaEvent]. * - * @param event The [TCMediaEvent] to send. + * @param event The [TCMediaEvent] to be sent. */ fun sendTcMediaEvent(event: TCMediaEvent) diff --git a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/TCMediaEvent.kt b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/TCMediaEvent.kt index fde07537b..984e56673 100644 --- a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/TCMediaEvent.kt +++ b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/commandersact/TCMediaEvent.kt @@ -13,20 +13,6 @@ import kotlin.time.DurationUnit /** * Represents a media event to be sent to Commanders Act. This class extends `TCCustomEvent` and adds specific properties for media tracking. - * - * ```kotlin - * val mediaEvent = TCMediaEvent( - * eventType = MediaEventType.PLAY, - * assets = mapOf("key1" to "value1"), - * ) - * mediaEvent.mediaPosition = 15.minutes - * mediaEvent.deviceVolume = 0.5f - * mediaEvent.isSubtitlesOn = true - * // Set other properties as needed - * - * SRGAnalytics.commandersAct.sendTcMediaEvent(mediaEvent) - * ``` - * * @property eventType The type of media event, defined by the Analytics team using the [MediaEventType] enum. * @property assets A map representing additional data associated with the event. * @property sourceId An optional identifier for the source of the event. @@ -37,41 +23,37 @@ class TCMediaEvent( val sourceId: String? = null ) : TCCustomEvent(eventType.toString()) { /** - * Represents the current playback position within the media. + * Represents the current playback position. */ var mediaPosition: Duration = Duration.ZERO /** - * Represents the time shift applied to the data. A value of `null` indicates that no time shift has been applied. + * Represents the time shift applied if it is a live stream, `null` otherwise. */ var timeShift: Duration? = null /** - * Represents the device's volume level as a percentage. The value ranges between 0.0 and 1.0, where 0.0 represents silent and 1.0 represents - * the maximum volume. It may be `null` if the device volume information is unavailable. + * Represents the device's volume level as a percentage. */ var deviceVolume: Float? = null /** - * Indicates whether subtitles are enabled. `true` if subtitles are turned on, `false` otherwise. + * Indicates whether subtitles are enabled. */ var isSubtitlesOn: Boolean = false /** - * Represents the language of the currently selected subtitle track. It may be `null` if no subtitles are selected or if the language information - * is unavailable. + * Represents the language of the currently selected subtitle track. */ var subtitleSelectionLanguage: String? = null /** - * Represents the language of the currently selected audio track. It may be `null` if no audio track is selected or if the language information - * is unavailable. + * Represents the language of the currently selected audio track. */ var audioTrackLanguage: String? = null /** - * Indicates whether the current audio track has an associated audio description. `true` if the audio track includes audio descriptions, and - * `false` otherwise. + * Indicates whether the current audio track has an associated audio description. */ var audioTrackHasAudioDescription: Boolean = false diff --git a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/comscore/ComScore.kt b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/comscore/ComScore.kt index ae38f6872..20f51d6e0 100644 --- a/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/comscore/ComScore.kt +++ b/pillarbox-analytics/src/main/java/ch/srgssr/pillarbox/analytics/comscore/ComScore.kt @@ -13,12 +13,12 @@ interface ComScore { /** * Sends a page view event to ComScore. * - * @param pageView The [ComScorePageView] object containing the data for the page view to be sent. + * @param pageView The [ComScorePageView] to be sent. */ fun sendPageView(pageView: ComScorePageView) /** - * Puts the provided labels. + * Puts the provided labels as persistent data. * * @param labels A map containing the labels. */