Skip to content

Commit 6e869b7

Browse files
authored
Releases/v1.6.0 (#89)
## Improvements * Add methods to android sdk layer for reporting errors by severity
1 parent e987ee3 commit 6e869b7

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ muxDistribution {
7272
}
7373

7474
dependencies {
75-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1"
75+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2"
7676
implementation 'androidx.annotation:annotation-jvm:1.9.1'
7777

7878
// dynamic version/compileOnly so the player SDKs on top of this can update core independently

library/src/main/java/com/mux/stats/sdk/muxstats/MuxDataSdk.kt

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ import com.mux.stats.sdk.core.MuxSDKViewOrientation
2121
import com.mux.stats.sdk.core.events.EventBus
2222
import com.mux.stats.sdk.core.events.IEvent
2323
import com.mux.stats.sdk.core.events.IEventDispatcher
24+
import com.mux.stats.sdk.core.events.playback.ErrorEvent
25+
import com.mux.stats.sdk.core.events.playback.ErrorEvent.ErrorSeverity
2426
import com.mux.stats.sdk.core.model.*
2527
import com.mux.stats.sdk.core.util.MuxLogger
26-
import com.mux.stats.sdk.muxstats.MuxDataSdk.AndroidDevice
2728
import kotlinx.coroutines.CoroutineScope
2829
import kotlinx.coroutines.Dispatchers
2930
import org.json.JSONObject
@@ -137,6 +138,39 @@ abstract class MuxDataSdk<Player, PlayerView : View> @JvmOverloads protected con
137138
*/
138139
open fun error(exception: MuxErrorException) = muxStats.error(exception)
139140

141+
/**
142+
* Report an error to the dashboard for this view. If the error is recoverable, you can set its
143+
* severity to [ErrorEvent.ErrorSeverity.WARNING]. If it's related to your application logic
144+
* and not playback, you can flag that as well
145+
*
146+
* @param code An error code from your player.
147+
* @param message a message describing the error
148+
* @param errorContext additional context, such as a stack trace, related to this error
149+
*/
150+
open fun error(code: String,
151+
message: String?,
152+
errorContext: String) =
153+
muxStats.error(code, message , errorContext)
154+
155+
/**
156+
* Report an error to the dashboard for this view. If the error is recoverable, you can set its
157+
* severity to [ErrorEvent.ErrorSeverity.WARNING]. If it's related to your application logic
158+
* and not playback, you can flag that as well
159+
*
160+
* @param code An error code from your player.
161+
* @param message a message describing the error
162+
* @param errorContext additional context, such as a stack trace, related to this error
163+
* @param errorSeverity The severity of the error. Errors can be fatal or warnings
164+
* @param isBusinessException True if the error is related to app logic (eg, expired subscription)
165+
*/
166+
167+
open fun error(code: String,
168+
message: String?,
169+
errorContext: String,
170+
errorSeverity: ErrorSeverity,
171+
isBusinessException: Boolean) =
172+
muxStats.error(code, message , errorContext, errorSeverity, isBusinessException)
173+
140174
/**
141175
* Change the player [View] this object observes.
142176
*/

0 commit comments

Comments
 (0)