group 'io.flutter.plugins.videoplayer'
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:8.5.0'
    }
}

rootProject.allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

apply plugin: 'com.android.library'

android {
    namespace 'io.flutter.plugins.videoplayer'
    compileSdk 34

    defaultConfig {
        minSdkVersion 19
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        checkAllWarnings true
        warningsAsErrors true
        disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    dependencies {
        def exoplayer_version = "1.4.1"
        implementation "androidx.media3:media3-exoplayer:${exoplayer_version}"
        implementation "androidx.media3:media3-exoplayer-hls:${exoplayer_version}"
        implementation "androidx.media3:media3-exoplayer-dash:${exoplayer_version}"
        implementation "androidx.media3:media3-exoplayer-rtsp:${exoplayer_version}"
        implementation "androidx.media3:media3-exoplayer-smoothstreaming:${exoplayer_version}"
        testImplementation 'junit:junit:4.13.2'
        testImplementation 'androidx.test:core:1.3.0'
        testImplementation 'org.mockito:mockito-inline:5.0.0'
        testImplementation 'org.robolectric:robolectric:4.10.3'
        testImplementation "androidx.media3:media3-test-utils:${exoplayer_version}"
    }

    testOptions {
        unitTests.includeAndroidResources = true
        unitTests.returnDefaultValues = true
        unitTests.all {
            testLogging {
               events "passed", "skipped", "failed", "standardOut", "standardError"
               outputs.upToDateWhen {false}
               showStandardStreams = true
            }
        }
    }
}
