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
10 changes: 5 additions & 5 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 All @@ -48,7 +48,7 @@ dependencies {
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)

//bitmovin
// bitmovin
implementation(libs.player)

// Testing
Expand All @@ -57,5 +57,5 @@ dependencies {
androidTestImplementation(libs.androidx.espresso.core)

// Mux
implementation ("com.mux.stats.sdk.muxstats:muxstatssdkbitmovinplayer_r3_11_1:0.5.1")
}
implementation("com.mux.stats.sdk.muxstats:muxstatssdkbitmovinplayer_r3_11_1:0.5.1")
}
Original file line number Diff line number Diff line change
@@ -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.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.fastpix.bitmovin_data", appContext.packageName)
}
}
}
19 changes: 8 additions & 11 deletions app/src/main/java/io/fastpix/bitmovin_data/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -113,7 +113,6 @@ class MainActivity : AppCompatActivity() {
binding.controlsContainer.visibility = View.GONE
}


private fun toggleControls() {
if (controlsVisible) {
hideControls()
Expand All @@ -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,
)
}

Expand All @@ -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)
}
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -387,7 +384,7 @@ class MainActivity : AppCompatActivity() {
R.drawable.ic_pause
} else {
R.drawable.ic_play_arrow
}
},
)
}

Expand Down Expand Up @@ -514,4 +511,4 @@ class MainActivity : AppCompatActivity() {
binding.bitmovinPlayerView.player = null
super.onDestroy()
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/io/fastpix/bitmovin_data/VideoAdapter.kt
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 @@ -26,4 +26,4 @@ class VideoListScreen : AppCompatActivity() {
startActivity(intent)
}
}
}
}
6 changes: 2 additions & 4 deletions app/src/main/java/io/fastpix/bitmovin_data/VideoPrefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package io.fastpix.bitmovin_data
import android.os.Parcelable
import kotlinx.parcelize.Parcelize


val dummyData = listOf<DummyData>(
DummyData(
"ca854fd4-a3d0-4525-bd43-80de50887e1a",
Expand All @@ -20,12 +19,11 @@ val dummyData = listOf<DummyData>(
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
) : Parcelable
5 changes: 2 additions & 3 deletions app/src/test/java/io/fastpix/bitmovin_data/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -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).
Expand All @@ -14,4 +13,4 @@ class ExampleUnitTest {
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
}
8 changes: 4 additions & 4 deletions bitmovin-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 All @@ -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)
}
}
Original file line number Diff line number Diff line change
@@ -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.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.fastpix.bitmovin_player_data.test", appContext.packageName)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
var customDataDetails: CustomDataDetails? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -114,8 +114,6 @@ class FastPixBitMovinPlayer(
errorMessage = event.message
dispatchError()
}


}

private fun initializeFastPixDataSdk() {
Expand All @@ -127,7 +125,7 @@ class FastPixBitMovinPlayer(
videoData = customerData.videoDetails,
playerListener = this,
enableLogging = enableLogging,
customData = customerData.customDataDetails
customData = customerData.customDataDetails,
)
fastPixDataSDK.initialize(sdkConfiguration, context)
}
Expand Down Expand Up @@ -271,7 +269,6 @@ class FastPixBitMovinPlayer(
}
}


override fun playerHeight(): Int? {
val density = context.resources.displayMetrics.density
val rawHeight = playerView.measuredHeight
Expand Down Expand Up @@ -392,4 +389,4 @@ class FastPixBitMovinPlayer(
lastSeekPosition = 0.0
errorMessage = null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
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,
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,45 @@ object Utils {
PlayerEvents.PAUSE,
PlayerEvents.VARIANT_CHANGED,
PlayerEvents.SEEKING,
PlayerEvents.ERROR
PlayerEvents.ERROR,
),
PlayerEvents.PLAYING to setOf(
PlayerEvents.BUFFERING,
PlayerEvents.PAUSE,
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,
PlayerEvents.SEEKING,
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,
Expand All @@ -70,8 +70,7 @@ object Utils {
),
PlayerEvents.ERROR to setOf(
PlayerEvents.PLAYING, PlayerEvents.PLAY, PlayerEvents.PAUSE,
PlayerEvents.BUFFERED
)
PlayerEvents.BUFFERED,
),
)
}

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
package io.fastpix.bitmovin_player_data.src.utils

Loading