diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 74eba1e..dbbb855 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) - id ("kotlin-parcelize") + id("kotlin-parcelize") } android { @@ -23,7 +23,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } @@ -48,7 +48,7 @@ dependencies { implementation(libs.androidx.activity) implementation(libs.androidx.constraintlayout) - //bitmovin + // bitmovin implementation(libs.player) // Testing @@ -57,5 +57,5 @@ dependencies { androidTestImplementation(libs.androidx.espresso.core) // Mux - implementation ("com.mux.stats.sdk.muxstats:muxstatssdkbitmovinplayer_r3_11_1:0.5.1") -} \ No newline at end of file + implementation("com.mux.stats.sdk.muxstats:muxstatssdkbitmovinplayer_r3_11_1:0.5.1") +} diff --git a/app/src/androidTest/java/io/fastpix/bitmovin_data/ExampleInstrumentedTest.kt b/app/src/androidTest/java/io/fastpix/bitmovin_data/ExampleInstrumentedTest.kt index 1903489..d574bb4 100644 --- a/app/src/androidTest/java/io/fastpix/bitmovin_data/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/io/fastpix/bitmovin_data/ExampleInstrumentedTest.kt @@ -1,13 +1,11 @@ package io.fastpix.bitmovin_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. * @@ -21,4 +19,4 @@ class ExampleInstrumentedTest { val appContext = InstrumentationRegistry.getInstrumentation().targetContext assertEquals("io.fastpix.bitmovin_data", appContext.packageName) } -} \ No newline at end of file +} diff --git a/app/src/main/java/io/fastpix/bitmovin_data/MainActivity.kt b/app/src/main/java/io/fastpix/bitmovin_data/MainActivity.kt index b47427e..6a6802b 100644 --- a/app/src/main/java/io/fastpix/bitmovin_data/MainActivity.kt +++ b/app/src/main/java/io/fastpix/bitmovin_data/MainActivity.kt @@ -91,10 +91,10 @@ class MainActivity : AppCompatActivity() { val customerData = com.mux.stats.sdk.core.model.CustomerData( customerPlayerData, customerVideoData, - customerViewData + customerViewData, ) muxStatsSDKBitmovinPlayer = MuxStatsSDKBitmovinPlayer( - this, binding.bitmovinPlayerView, "Player 1", customerData + this, binding.bitmovinPlayerView, "Player 1", customerData, ) val size = Point() windowManager.defaultDisplay.getSize(size) @@ -113,7 +113,6 @@ class MainActivity : AppCompatActivity() { binding.controlsContainer.visibility = View.GONE } - private fun toggleControls() { if (controlsVisible) { hideControls() @@ -128,15 +127,15 @@ class MainActivity : AppCompatActivity() { beaconUrl = "metrix.ninja", videoDetails = VideoDataDetails( UUID.randomUUID().toString(), - videoModel?.id - ) + videoModel?.id, + ), ) bitmovinData = FastPixBitMovinPlayer( this, binding.bitmovinPlayerView, binding.bitmovinPlayerView.player!!, enableLogging = true, - customerData = customerData + customerData = customerData, ) } @@ -163,14 +162,13 @@ class MainActivity : AppCompatActivity() { SourceMetadata( videoId = "android-wizard-Sintel-1763706788214", title = streamTitle, - ) + ), ), ) player.load(source) player.play() setupPlayerListeners() - } catch (e: Exception) { Log.e("BITMOVIN_ERROR", "Failed to initialize player: ${e.message}", e) } @@ -318,7 +316,6 @@ class MainActivity : AppCompatActivity() { } } - private fun switchToEpisode(newIndex: Int) { if (newIndex < 0 || newIndex >= dummyData.size) { Log.e(TAG, "Invalid episode index: $newIndex") @@ -387,7 +384,7 @@ class MainActivity : AppCompatActivity() { R.drawable.ic_pause } else { R.drawable.ic_play_arrow - } + }, ) } @@ -514,4 +511,4 @@ class MainActivity : AppCompatActivity() { binding.bitmovinPlayerView.player = null super.onDestroy() } -} \ No newline at end of file +} diff --git a/app/src/main/java/io/fastpix/bitmovin_data/VideoAdapter.kt b/app/src/main/java/io/fastpix/bitmovin_data/VideoAdapter.kt index 89f3585..5cbe79d 100644 --- a/app/src/main/java/io/fastpix/bitmovin_data/VideoAdapter.kt +++ b/app/src/main/java/io/fastpix/bitmovin_data/VideoAdapter.kt @@ -31,7 +31,7 @@ class VideoAdapter() : val binding = VideoRowBinding.inflate( LayoutInflater.from(parent.context), parent, - false + false, ) return VideoViewHolder(binding) } @@ -42,4 +42,4 @@ class VideoAdapter() : } override fun getItemCount(): Int = videos?.size ?: 0 -} \ No newline at end of file +} diff --git a/app/src/main/java/io/fastpix/bitmovin_data/VideoListScreen.kt b/app/src/main/java/io/fastpix/bitmovin_data/VideoListScreen.kt index a5a32fb..ef3b8e4 100644 --- a/app/src/main/java/io/fastpix/bitmovin_data/VideoListScreen.kt +++ b/app/src/main/java/io/fastpix/bitmovin_data/VideoListScreen.kt @@ -26,4 +26,4 @@ class VideoListScreen : AppCompatActivity() { startActivity(intent) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/io/fastpix/bitmovin_data/VideoPrefs.kt b/app/src/main/java/io/fastpix/bitmovin_data/VideoPrefs.kt index 9ff2027..7583b4d 100644 --- a/app/src/main/java/io/fastpix/bitmovin_data/VideoPrefs.kt +++ b/app/src/main/java/io/fastpix/bitmovin_data/VideoPrefs.kt @@ -3,7 +3,6 @@ package io.fastpix.bitmovin_data import android.os.Parcelable import kotlinx.parcelize.Parcelize - val dummyData = listOf( DummyData( "ca854fd4-a3d0-4525-bd43-80de50887e1a", @@ -20,12 +19,11 @@ val dummyData = listOf( DummyData( "46c09d0c-d97a-44b2-9737-c5e6daf30a41", "https://stream.fastpix.io/46c09d0c-d97a-44b2-9737-c5e6daf30a41.m3u8", - ) + ), ) - @Parcelize data class DummyData( var id: String, var url: String, -) : Parcelable \ No newline at end of file +) : Parcelable diff --git a/app/src/test/java/io/fastpix/bitmovin_data/ExampleUnitTest.kt b/app/src/test/java/io/fastpix/bitmovin_data/ExampleUnitTest.kt index cc95182..f2485ae 100644 --- a/app/src/test/java/io/fastpix/bitmovin_data/ExampleUnitTest.kt +++ b/app/src/test/java/io/fastpix/bitmovin_data/ExampleUnitTest.kt @@ -1,8 +1,7 @@ package io.fastpix.bitmovin_data -import org.junit.Test - import org.junit.Assert.* +import org.junit.Test /** * Example local unit test, which will execute on the development machine (host). @@ -14,4 +13,4 @@ class ExampleUnitTest { fun addition_isCorrect() { assertEquals(4, 2 + 2) } -} \ No newline at end of file +} diff --git a/bitmovin-player-data/build.gradle.kts b/bitmovin-player-data/build.gradle.kts index 7918dd9..e56b6fe 100644 --- a/bitmovin-player-data/build.gradle.kts +++ b/bitmovin-player-data/build.gradle.kts @@ -19,7 +19,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } @@ -38,13 +38,13 @@ dependencies { implementation(libs.material) // FastPix Core - //api(libs.core) + // api(libs.core) - //bitmovin + // bitmovin api(libs.player) // Testing testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) -} \ No newline at end of file +} diff --git a/bitmovin-player-data/src/androidTest/java/io/fastpix/bitmovin_player_data/ExampleInstrumentedTest.kt b/bitmovin-player-data/src/androidTest/java/io/fastpix/bitmovin_player_data/ExampleInstrumentedTest.kt index 8f80d66..edd9e8e 100644 --- a/bitmovin-player-data/src/androidTest/java/io/fastpix/bitmovin_player_data/ExampleInstrumentedTest.kt +++ b/bitmovin-player-data/src/androidTest/java/io/fastpix/bitmovin_player_data/ExampleInstrumentedTest.kt @@ -1,13 +1,11 @@ package io.fastpix.bitmovin_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. * @@ -21,4 +19,4 @@ class ExampleInstrumentedTest { val appContext = InstrumentationRegistry.getInstrumentation().targetContext assertEquals("io.fastpix.bitmovin_player_data.test", appContext.packageName) } -} \ No newline at end of file +} diff --git a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/CustomerData.kt b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/CustomerData.kt index 1889fc3..6f516e9 100644 --- a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/CustomerData.kt +++ b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/CustomerData.kt @@ -9,5 +9,5 @@ data class CustomerData( var workspaceId: String, var videoDetails: VideoDataDetails? = null, var playerDetails: PlayerDataDetails = PlayerDataDetails("bitmovin-player", "3.+"), - var customDataDetails: CustomDataDetails? = null -) \ No newline at end of file + var customDataDetails: CustomDataDetails? = null, +) diff --git a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/FastPixBitMovinPlayer.kt b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/FastPixBitMovinPlayer.kt index e9b73e3..60f0c1a 100644 --- a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/FastPixBitMovinPlayer.kt +++ b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/FastPixBitMovinPlayer.kt @@ -24,7 +24,7 @@ class FastPixBitMovinPlayer( private val playerView: View, private val player: Player, private val enableLogging: Boolean = false, - private val customerData: CustomerData + private val customerData: CustomerData, ) : PlayerListener { private val TAG = "FastPixBitMovinPlayer" private lateinit var fastPixDataSDK: FastPixDataSDK @@ -114,8 +114,6 @@ class FastPixBitMovinPlayer( errorMessage = event.message dispatchError() } - - } private fun initializeFastPixDataSdk() { @@ -127,7 +125,7 @@ class FastPixBitMovinPlayer( videoData = customerData.videoDetails, playerListener = this, enableLogging = enableLogging, - customData = customerData.customDataDetails + customData = customerData.customDataDetails, ) fastPixDataSDK.initialize(sdkConfiguration, context) } @@ -271,7 +269,6 @@ class FastPixBitMovinPlayer( } } - override fun playerHeight(): Int? { val density = context.resources.displayMetrics.density val rawHeight = playerView.measuredHeight @@ -392,4 +389,4 @@ class FastPixBitMovinPlayer( lastSeekPosition = 0.0 errorMessage = null } -} \ No newline at end of file +} diff --git a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/info/BitMovinLibraryInfo.kt b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/info/BitMovinLibraryInfo.kt index 9b21cbc..6fc1a1c 100644 --- a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/info/BitMovinLibraryInfo.kt +++ b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/info/BitMovinLibraryInfo.kt @@ -3,4 +3,4 @@ package io.fastpix.bitmovin_player_data.src.info object BitMovinLibraryInfo { const val SDK_NAME = "bitmovin-fastpix" const val SDK_VERSION = "0.0.1" -} \ No newline at end of file +} diff --git a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/PlayerEvents.kt b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/PlayerEvents.kt index f671740..878f5e1 100644 --- a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/PlayerEvents.kt +++ b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/PlayerEvents.kt @@ -10,5 +10,5 @@ enum class PlayerEvents { SEEKED, ENDED, VARIANT_CHANGED, - ERROR -} \ No newline at end of file + ERROR, +} diff --git a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/Utils.kt b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/Utils.kt index 19dc2f5..11ce11c 100644 --- a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/Utils.kt +++ b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/Utils.kt @@ -22,7 +22,7 @@ object Utils { PlayerEvents.PAUSE, PlayerEvents.VARIANT_CHANGED, PlayerEvents.SEEKING, - PlayerEvents.ERROR + PlayerEvents.ERROR, ), PlayerEvents.PLAYING to setOf( PlayerEvents.BUFFERING, @@ -30,12 +30,12 @@ object Utils { PlayerEvents.ENDED, PlayerEvents.SEEKING, PlayerEvents.VARIANT_CHANGED, - PlayerEvents.ERROR + PlayerEvents.ERROR, ), PlayerEvents.BUFFERING to setOf( PlayerEvents.BUFFERED, PlayerEvents.ERROR, - PlayerEvents.VARIANT_CHANGED + PlayerEvents.VARIANT_CHANGED, ), PlayerEvents.BUFFERED to setOf( PlayerEvents.PAUSE, @@ -43,24 +43,24 @@ object Utils { PlayerEvents.PLAYING, PlayerEvents.ENDED, PlayerEvents.ERROR, - PlayerEvents.VARIANT_CHANGED + PlayerEvents.VARIANT_CHANGED, ), PlayerEvents.PAUSE to setOf( PlayerEvents.SEEKING, PlayerEvents.PLAY, PlayerEvents.ENDED, PlayerEvents.ERROR, - PlayerEvents.VARIANT_CHANGED + PlayerEvents.VARIANT_CHANGED, ), PlayerEvents.SEEKING to setOf( PlayerEvents.SEEKED, PlayerEvents.ENDED, PlayerEvents.ERROR, - PlayerEvents.VARIANT_CHANGED + PlayerEvents.VARIANT_CHANGED, ), PlayerEvents.SEEKED to setOf( PlayerEvents.PLAY, PlayerEvents.ENDED, PlayerEvents.ERROR, PlayerEvents.VARIANT_CHANGED, - PlayerEvents.PLAYING, PlayerEvents.SEEKING + PlayerEvents.PLAYING, PlayerEvents.SEEKING, ), PlayerEvents.ENDED to setOf( PlayerEvents.PLAY, @@ -70,8 +70,7 @@ object Utils { ), PlayerEvents.ERROR to setOf( PlayerEvents.PLAYING, PlayerEvents.PLAY, PlayerEvents.PAUSE, - PlayerEvents.BUFFERED - ) + PlayerEvents.BUFFERED, + ), ) } - diff --git a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/ValidTransitions.kt b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/ValidTransitions.kt index 1826372..77981c2 100644 --- a/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/ValidTransitions.kt +++ b/bitmovin-player-data/src/main/java/io/fastpix/bitmovin_player_data/src/utils/ValidTransitions.kt @@ -1,2 +1 @@ package io.fastpix.bitmovin_player_data.src.utils - diff --git a/bitmovin-player-data/src/test/java/io/fastpix/bitmovin_player_data/ExampleUnitTest.kt b/bitmovin-player-data/src/test/java/io/fastpix/bitmovin_player_data/ExampleUnitTest.kt index eb8d231..c8429d9 100644 --- a/bitmovin-player-data/src/test/java/io/fastpix/bitmovin_player_data/ExampleUnitTest.kt +++ b/bitmovin-player-data/src/test/java/io/fastpix/bitmovin_player_data/ExampleUnitTest.kt @@ -1,8 +1,7 @@ package io.fastpix.bitmovin_player_data -import org.junit.Test - import org.junit.Assert.* +import org.junit.Test /** * Example local unit test, which will execute on the development machine (host). @@ -14,4 +13,4 @@ class ExampleUnitTest { fun addition_isCorrect() { assertEquals(4, 2 + 2) } -} \ No newline at end of file +} diff --git a/build.gradle.kts b/build.gradle.kts index ecf7a23..38d6e78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 -} \ No newline at end of file +}