PSDK-1016 Add visual plugins

This commit is contained in:
Николай Коротков
2023-10-26 11:13:16 +03:00
committed by Jura Shikin
parent 913190d8bc
commit 799fde61cf
2 changed files with 17 additions and 2 deletions
+5 -1
View File
@@ -73,6 +73,10 @@ android {
minSdkVersion flutterMinSdkVersion
}
buildFeatures {
viewBinding = true
}
dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.mockito:mockito-core:5.0.0'
@@ -97,7 +101,7 @@ dependencies {
implementation "io.ktor:ktor-client-android:1.6.7"
implementation "io.ktor:ktor-client-serialization:1.6.7"
// for resolve another errors
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'com.android.support.constraint:constraint-layout:2.1.4'
implementation 'androidx.appcompat:appcompat:1.6.1'
}
@@ -10,6 +10,9 @@ import tech.nut.player.model.NutPlayer
import android.view.View
import android.widget.TextView
import android.graphics.Color
import tech.nut.player.plugins.pub.BrightnessVisualPlugin
import tech.nut.player.plugins.pub.ControlPanelVisualPlugin
import tech.nut.player.plugins.pub.VolumeVisualPlugin
interface NutPlayerViewFactoryDelegate {
fun player(playerId: Int): NutPlayer?
@@ -28,7 +31,15 @@ internal class NutPlayerViewFactory(private val delegate: NutPlayerViewFactoryDe
if (player == null) { return NativeView(context, viewId) }
val nutPlayerView = NutPlayerView(context)
nutPlayerView.configure(player)
nutPlayerView.configure(
nutPlayer = player,
visualPlugins =
listOf(
ControlPanelVisualPlugin(),
BrightnessVisualPlugin(),
VolumeVisualPlugin(),
)
)
return PlayerFlutterPlatformView(playerId, nutPlayerView)
}