Skip to content

Commit

Permalink
Some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
daytime-em committed Jun 27, 2023
1 parent d70201f commit debc7a5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.media3.exoplayer.source.LoadEventInfo
import androidx.media3.exoplayer.source.MediaLoadData
import androidx.media3.exoplayer.source.TrackGroupArray
import com.mux.android.util.weak
import com.mux.stats.sdk.core.util.MuxLogger
import com.mux.stats.sdk.muxstats.bandwidth.BandwidthMetricDispatcher
import java.io.IOException

Expand All @@ -37,6 +38,11 @@ class ExoPlayerBinding : MuxPlayerAdapter.PlayerBinding<ExoPlayer> {
collector.playerWatcher?.stop("player unbound")
listener = null
}

companion object {
private const val TAG = "ExoPlayerBinding"
}

}

@OptIn(UnstableApi::class)
Expand Down Expand Up @@ -76,6 +82,7 @@ private class MuxAnalyticsListener(
format: Format,
decoderReuseEvaluation: DecoderReuseEvaluation?
) {
MuxLogger.d(TAG, "onVideoInputFormatChanged")
collector.renditionChange(
advertisedBitrate = format.averageBitrate,
advertisedFrameRate = format.frameRate,
Expand Down Expand Up @@ -191,5 +198,13 @@ private class MuxAnalyticsListener(
loadEventInfo.responseHeaders
)
}
} // fun onLoadCompleted

companion object {
private const val TAG = "ExoPlayerBinding"
}

init {
MuxLogger.d(TAG, "Listening to ExoPlayer $player")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ internal open class BandwidthMetric(
.getWindow(player.currentWindowIndex, currentTimelineWindow)
} catch (e: Exception) {
// Failed to obtain data, ignore, we will get it on next call
MuxLogger.exception(e, "BandwidthMetric", "Failed to get current timeline")
}
}
val segmentData = BandwidthMetricData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MuxStatsSdkMedia3<P : Player> @JvmOverloads constructor(
playerView = playerView,
customerData = customerData,
customOptions = customOptions ?: CustomOptions(),
logLevel = LogcatLevel.VERBOSE,
logLevel = LogcatLevel.DEBUG,
trackFirstFrame = true,
playerBinding = playerBinding,
device = AndroidDevice(
Expand Down

0 comments on commit debc7a5

Please sign in to comment.