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
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id ("kotlin-parcelize")
id("kotlin-parcelize")
}

android {
Expand All @@ -23,7 +23,7 @@ android {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
Expand Down Expand Up @@ -61,4 +61,4 @@ dependencies {
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.fastpix.agnoplayerdatasdk

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.fastpix.agnoplayerdatasdk", appContext.packageName)
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/io/fastpix/agnoplayerdatasdk/CastLabApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package io.fastpix.agnoplayerdatasdk
import android.app.Application
import com.castlabs.android.PlayerSDK

class CastLabApp: Application() {
class CastLabApp : Application() {

override fun onCreate() {
super.onCreate()
PlayerSDK.init(applicationContext)
}
}
}
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,
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 @@ -31,7 +31,7 @@ class VideoAdapter() :
val binding = VideoRowBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
false,
)
return VideoViewHolder(binding)
}
Expand All @@ -42,4 +42,4 @@ class VideoAdapter() :
}

override fun getItemCount(): Int = videos?.size ?: 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class VideoListScreen : AppCompatActivity() {
startActivity(intent)
}
}
}
}
5 changes: 1 addition & 4 deletions app/src/main/java/io/fastpix/agnoplayerdatasdk/VideoPrefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package io.fastpix.agnoplayerdatasdk
import android.os.Parcelable
import kotlinx.parcelize.Parcelize



val dummyData = listOf<DummyData>(
DummyData(
"Tears of Steel",
Expand All @@ -20,9 +18,8 @@ val dummyData = listOf<DummyData>(
),
)


@Parcelize
data class DummyData(
var id: String,
var url: String,
) : Parcelable
) : Parcelable
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.fastpix.agnoplayerdatasdk

import org.junit.Test

import org.junit.Assert.*
import org.junit.Test

/**
* Example local unit test, which will execute on the development machine (host).
Expand All @@ -14,4 +13,4 @@ class ExampleUnitTest {
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
}
}
4 changes: 2 additions & 2 deletions castLabs-player-data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
Expand Down Expand Up @@ -52,4 +52,4 @@ dependencies {
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.fastpix.castlabs_player_data

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.fastpix.castlabs_player_data.test", appContext.packageName)
}
}
}
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 @@ -87,7 +86,6 @@ class FastPixBaseCastLabs(
dispatchPauseEvent()
dispatchSeekingEvent()
}

}

override fun onVideoSizeChanged(width: Int, height: Int, p2: Float) {
Expand All @@ -112,29 +110,25 @@ 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?>) {

}

override fun onFullyBuffered() {
dispatchBufferedEvent()
}

})
}

Expand Down Expand Up @@ -233,7 +227,6 @@ class FastPixBaseCastLabs(
} else {
fastPixDataSDK.dispatchEvent(PlayerEventType.ended)
}

}
}

Expand All @@ -255,7 +248,6 @@ class FastPixBaseCastLabs(
}
}


/**
* Validates if the transition from current state to new state is valid
*/
Expand Down Expand Up @@ -287,7 +279,7 @@ class FastPixBaseCastLabs(
videoData = customerData.videoDetails,
playerListener = this,
enableLogging = enableLogging,
customData = customerData.customDataDetails
customData = customerData.customDataDetails,
)
fastPixDataSDK.initialize(sdkConfiguration, context)
}
Expand Down Expand Up @@ -467,21 +459,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 @@ -490,5 +478,4 @@ class FastPixBaseCastLabs(
override fun onFullyBuffered() {
dispatchBufferedEvent()
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package io.fastpix.castlabs_player_data.src.info
object CastLabsLibraryInfo {
const val SDK_NAME = "castLabs-fastpix"
const val SDK_VERSION = "0.0.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data class CustomerData(
var videoDetails: VideoDataDetails? = null,
var playerDetails: PlayerDataDetails = PlayerDataDetails(
BuildConfig.LIBRARY_PACKAGE_NAME,
BuildConfig.VERSION_NAME
BuildConfig.VERSION_NAME,
),
var customDataDetails: CustomDataDetails? = null
)
var customDataDetails: CustomDataDetails? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ enum class PlayerEvents {
SEEKED,
ENDED,
VARIANT_CHANGED,
ERROR
}
ERROR,
}
Loading