Skip to content

Commit

Permalink
fix: Set autoPlay as default true (#196)
Browse files Browse the repository at this point in the history
- In this commit bcee6aa, we made `autoPlay` a non-nullable value and set the default to false, but it needs to be true.
- In this commit, we set `autoPlay` as default true.
  • Loading branch information
PruthiviRaj27 committed Jul 12, 2024
1 parent bcee6aa commit b9971a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions player/src/main/java/com/tpstream/player/TpInitParams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import kotlinx.parcelize.Parcelize

@Parcelize
data class TpInitParams (
var autoPlay: Boolean = false,
var autoPlay: Boolean = true,
var accessToken: String? = null,
var videoId: String? = null,
var isDownloadEnabled: Boolean = false,
var startAt: Long = 0L
): Parcelable {

class Builder {
private var autoPlay: Boolean = false
private var autoPlay: Boolean = true
private var accessToken: String? = null
private var videoId: String? = null
private var isDownloadEnabled: Boolean = false
Expand Down
2 changes: 1 addition & 1 deletion player/src/main/java/com/tpstream/player/TpStreamPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal class TpStreamPlayerImpl(val context: Context) : TpStreamPlayer {

override fun load(parameters: TpInitParams, metadata: Map<String, String>?) {
params = parameters
exoPlayer.playWhenReady = parameters.autoPlay?:true
exoPlayer.playWhenReady = parameters.autoPlay
assetRepository.getAsset(parameters, object : NetworkClient.TPResponse<Asset> {
override fun onSuccess(result: Asset) {
asset = result
Expand Down

0 comments on commit b9971a3

Please sign in to comment.