Skip to content

Commit

Permalink
Add 2 options to place the custom skip button on the main player scre…
Browse files Browse the repository at this point in the history
…en and to adjust its duration. Bump Compose 1.7.0-alpha03, Bump Kotlin 2.0.20
  • Loading branch information
yuroyami committed Aug 30, 2024
1 parent ae21adc commit 9db5704
Show file tree
Hide file tree
Showing 35 changed files with 651 additions and 415 deletions.
8 changes: 4 additions & 4 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ val abiCodes = mapOf(

android {
namespace = "com.yuroyami.syncplay"
compileSdk = 34
compileSdk = 35

signingConfigs {
create("github") {
Expand Down Expand Up @@ -64,11 +64,11 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}

if (!exoOnly) {
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
plugins {
val kotlin = "2.0.0"
val kotlin = "2.0.20"
id("org.jetbrains.kotlin.multiplatform") version kotlin apply false
id("org.jetbrains.kotlin.android") version kotlin apply false
id("org.jetbrains.kotlin.native.cocoapods") version kotlin apply false
kotlin("plugin.serialization") version kotlin apply false

id("org.jetbrains.kotlin.plugin.compose") version kotlin apply false

val agp = "8.5.0"
val agp = "8.5.1"
id("com.android.application") version agp apply false
id("com.android.library") version agp apply false

val compose = "1.6.11" //Last stable: 1.6.10
val compose = "1.7.0-alpha03" //Last stable: 1.6.11
id("org.jetbrains.compose") version compose apply false

id("com.google.devtools.ksp") version "$kotlin-1.0.22" apply false
id("com.google.devtools.ksp") version "$kotlin-1.0.24" apply false
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Gradle
org.gradle.jvmargs=-Xmx3g -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx3g"
org.gradle.parallel = true

#Kotlin
kotlin.code.style=official
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
8 changes: 4 additions & 4 deletions iosApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- MobileVLCKit (3.6.0b11)
- MobileVLCKit (3.6.1b1)
- shared (1.0.0):
- MobileVLCKit (= 3.6.0b11)
- MobileVLCKit (= 3.6.1b1)
- SPLPing
- SPLPing (1.1.8)

Expand All @@ -18,8 +18,8 @@ EXTERNAL SOURCES:
:path: "../shared"

SPEC CHECKSUMS:
MobileVLCKit: d20b1e96a93446d97abd377a1daa230202147619
shared: 3f08c2b6014ffa4228e7523b33b1613baa5b43d7
MobileVLCKit: 2d9c7c373393ae43086aeeff890bf0b1afc15c5c
shared: 50bef45c87cc7d0ce50aaba393a4e757019b60ac
SPLPing: 420837fae1e19bba0a8360e91e7a384f22509663

PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756
Expand Down
22 changes: 11 additions & 11 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
AF7767E45ABA9495FE76EAA2 /* Frameworks */,
E8BE07D417982A5AC61A1319 /* [CP] Embed Pods Frameworks */,
C8723751F12803B87AD3693E /* [CP] Copy Pods Resources */,
99731DE2F7DA9AABD20CBDC3 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -285,38 +285,38 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C8723751F12803B87AD3693E /* [CP] Copy Pods Resources */ = {
99731DE2F7DA9AABD20CBDC3 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E8BE07D417982A5AC61A1319 /* [CP] Embed Pods Frameworks */ = {
C8723751F12803B87AD3693E /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
42 changes: 20 additions & 22 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalKotlinGradlePluginApi::class)

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

Expand All @@ -18,9 +20,8 @@ kotlin {
applyDefaultHierarchyTemplate()

androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
jvmTarget.set(JvmTarget.JVM_17)
}
}

Expand All @@ -37,10 +38,10 @@ kotlin {
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
isStatic = false
isStatic = true
}

pod("MobileVLCKit", "3.6.0b11") //Adds the VLC player engine to iOS
pod("MobileVLCKit", "3.6.1b1") //Adds the VLC player engine to iOS
//pod("MobileVLCKit", "4.0.0a2") //Adds the VLC player engine to iOS
//pod("VLCKit", "4.0.0a4") //a2
pod("SPLPing") //Light-weight Objective-C library to add the ICMP ping functionality
Expand All @@ -59,7 +60,7 @@ kotlin {

commonMain.dependencies {
/* Forcing Kotlin libs to match the compiler */
api("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
api("org.jetbrains.kotlin:kotlin-stdlib:2.0.20")

//Strings internationalization and localization
api("cafe.adriel.lyricist:lyricist:$lyricist")
Expand All @@ -74,18 +75,18 @@ kotlin {
implementation("org.kotlincrypto.hash:sha2:$kotlincrypto")

/* Network client */
val ktor = "2.3.11" //"3.0.0-beta-1"
val ktor = "3.0.0-beta-2"
implementation("io.ktor:ktor-network:$ktor")
//api("io.ktor:ktor-network-tls:$ktor")

/* Android's "Uri" class but rewritten for Kotlin multiplatform */
implementation("com.eygraber:uri-kmp:0.0.18")

/* JSON serializer/deserializer to communicate with Syncplay servers */
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")

/* Explicitly specifying a newer koroutines version */
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC.2")

/* Jetpack Datastore for preferences and settings (accessible in Compose in real-time) */
val datastore = "1.1.1"
Expand All @@ -97,18 +98,19 @@ kotlin {
api(compose.material3)
api(compose.materialIconsExtended)
api(compose.components.resources)
api("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0")

api("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0-dev1771")

/* Helps with color calculations for color preferences */
implementation("com.github.ajalt.colormath:colormath:3.5.0")

/* Compose multiplatform port of Android's lottie-compose. We only need Lottie for
* the day-night toggle button. This basically relies on lottie-compose for Android,
* and on skiko's lottie support (aka Skottie) on the iOS side, and other platforms.*/
implementation("io.github.alexzhirkevich:compottie:1.1.2")
implementation("io.github.alexzhirkevich:compottie:1.1.2") //1.1.2

/* Annotations */
api("androidx.annotation:annotation:1.8.0")
api("androidx.annotation:annotation:1.9.0-alpha02")

}

Expand All @@ -130,14 +132,14 @@ kotlin {
}

/* Activity's compose support with backward compatibility */
api("androidx.activity:activity-compose:1.9.0")
api("androidx.activity:activity-compose:1.9.1")

/* Network and TLS */
implementation("io.netty:netty-all:4.1.110.Final")
api("io.netty:netty-all:4.1.112.Final")
api("org.conscrypt:conscrypt-android:2.5.2") //TLSv1.3 with backward compatibility

/* Video player engine: Media3 (ExoPlayer and its extensions) */
val media3 = "1.4.0-alpha02"
val media3 = "1.4.1"
api("androidx.media3:media3-exoplayer:$media3")
api("androidx.media3:media3-exoplayer-dash:$media3")
api("androidx.media3:media3-exoplayer-hls:$media3")
Expand All @@ -162,12 +164,8 @@ kotlin {
}
}

//compose {
// kotlinCompilerPlugin.set("1.5.9-kt-2.0.0-Beta4")
//}

android {
compileSdk = 34
compileSdk = 35
namespace = "com.yuroyami.syncplay.shared"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
Expand All @@ -178,11 +176,11 @@ android {
minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(8)
jvmToolchain(17)
}

buildFeatures {
Expand Down
2 changes: 1 addition & 1 deletion shared/shared.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pod::Spec.new do |spec|
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '14.0'
spec.dependency 'MobileVLCKit', '3.6.0b11'
spec.dependency 'MobileVLCKit', '3.6.1b1'
spec.dependency 'SPLPing'

if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework')
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ actual fun getDefaultEngine(): String = defaultEngineAndroid
actual fun generateTimestampMillis() = System.currentTimeMillis()

@SuppressLint("DefaultLocale")
actual fun timeStamper(seconds: Long): String {
return if (seconds < 3600) {
String.format("%02d:%02d", (seconds / 60) % 60, seconds % 60)
actual fun timeStamper(seconds: Number): String {
val secs = seconds.toLong()
return if (secs < 3600) {
String.format("%02d:%02d", (secs / 60) % 60, secs % 60)
} else {
String.format("%02d:%02d:%02d", seconds / 3600, (seconds / 60) % 60, seconds % 60)
String.format("%02d:%02d:%02d", secs / 3600, (secs / 60) % 60, secs % 60)
}
}

Expand Down
Loading

0 comments on commit 9db5704

Please sign in to comment.