Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions app/src/main/java/io/fastpix/agnoplayerdatasdk/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import com.castlabs.android.player.models.VideoTrackQuality
import io.fastpix.agnoplayerdatasdk.databinding.ActivityMainBinding
import io.fastpix.castlabs_player_data.FastPixBaseCastLabs
import io.fastpix.castlabs_player_data.src.model.CustomerData
import io.fastpix.data.domain.model.PlayerDataDetails
import io.fastpix.data.domain.model.VideoDataDetails
import java.util.Locale
import java.util.UUID
Expand Down Expand Up @@ -82,7 +81,7 @@ class MainActivity : AppCompatActivity() {
val videoDataDetails = VideoDataDetails(
videoId = UUID.randomUUID().toString(),
videoTitle = videoModel?.id.orEmpty(),
videoCDN = "cloudflare"
videoCDN = "cloudflare",
)
val customerData = CustomerData(
workspaceId = "1109888358169935873",
Expand All @@ -93,7 +92,7 @@ class MainActivity : AppCompatActivity() {
playerView = binding.castLabsPlayerView,
playerController = binding.castLabsPlayerView.playerController,
enableLogging = true,
customerData = customerData
customerData = customerData,
)
}

Expand Down Expand Up @@ -142,22 +141,18 @@ class MainActivity : AppCompatActivity() {
}

override fun onVideoSizeChanged(p0: Int, p1: Int, p2: Float) {

}

override fun onSeekRangeChanged(p0: Long, p1: Long) {

}

override fun onPlaybackPositionChanged(p0: Long) {

}

override fun onDisplayChanged(
p0: DisplayInfo?,
p1: Boolean
p1: Boolean,
) {

}

override fun onDurationChanged(p0: Long) {
Expand All @@ -167,21 +162,17 @@ class MainActivity : AppCompatActivity() {
}

override fun onSpeedChanged(p0: Float) {

}

override fun onPlayerModelChanged() {

}

override fun onVideoKeyStatusChanged(p0: List<VideoTrackQuality?>) {

}

override fun onFullyBuffered() {
binding.loadingIndicator.isVisible = false
}

})
}

Expand Down Expand Up @@ -349,7 +340,7 @@ class MainActivity : AppCompatActivity() {
binding.currentTimeText.text = formatTime(currentMs)

if (duration > 0 && binding.seekBar.max > 0) {
val durationMs = duration / 1000.0 // micro → milli
val durationMs = duration / 1000.0 // micro → milli

// -------- Primary progress --------
val playedFraction = currentMs / durationMs
Expand Down Expand Up @@ -428,4 +419,4 @@ class MainActivity : AppCompatActivity() {
stopSeekBarUpdates()
fastPixDataSDK.release()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FastPixBaseCastLabs(
private val playerView: View,
private val playerController: PlayerController,
private val enableLogging: Boolean = false,
private val customerData: CustomerData
private val customerData: CustomerData,
) : PlayerListener, com.castlabs.android.player.PlayerListener {

private val TAG = "FastPixBaseCastLabs"
Expand All @@ -41,7 +41,6 @@ class FastPixBaseCastLabs(
// State machine for valid event transitions
private var currentEventState: PlayerEvents? = null


init {
initializeFastPixSDK()
playerController.addPlayerListener(this)
Expand Down Expand Up @@ -144,7 +143,6 @@ class FastPixBaseCastLabs(
} else {
fastPixDataSDK.dispatchEvent(PlayerEventType.ended)
}

}
}

Expand All @@ -166,7 +164,6 @@ class FastPixBaseCastLabs(
}
}


/**
* Validates if the transition from current state to new state is valid
*/
Expand Down Expand Up @@ -198,7 +195,7 @@ class FastPixBaseCastLabs(
videoData = customerData.videoDetails,
playerListener = this,
enableLogging = enableLogging,
customData = customerData.customDataDetails
customData = customerData.customDataDetails,
)
fastPixDataSDK.initialize(sdkConfiguration, context)
}
Expand Down Expand Up @@ -335,21 +332,17 @@ class FastPixBaseCastLabs(

override fun onDisplayChanged(
p0: DisplayInfo?,
p1: Boolean
p1: Boolean,
) {

}

override fun onDurationChanged(p0: Long) {

}

override fun onSpeedChanged(p0: Float) {

}

override fun onPlayerModelChanged() {

}

override fun onVideoKeyStatusChanged(p0: List<VideoTrackQuality?>) {
Expand All @@ -358,5 +351,4 @@ class FastPixBaseCastLabs(
override fun onFullyBuffered() {
dispatchBufferedEvent()
}

}
}