Chaintech-Network / ComposeMultiplatformMediaPlayer

157 stars 10 forks source link

youtube videos doesn't show #9

Open bkmalkoc opened 1 month ago

bkmalkoc commented 1 month ago

playing youtube videos just shows black screen in VideoPlayerView

ctn-mobile-innovation commented 1 month ago

@bkmalkoc we are adding this functionality! please watch-out here for next update!

bastami82 commented 1 month ago

very useful lib, thanks for all the effort, Do you have any idea how long (roughly) it will take to add YouTube support, please?

ctn-mobile-innovation commented 1 month ago

@bastami82 it's in testing stage, we might publish next week!

ctn-mobile-innovation commented 3 weeks ago

@bastami82 @bkmalkoc It's added in new library version! please checkout

bastami82 commented 2 weeks ago

@ctn-mobile-innovation thanks, for adding Youtube support so quick, however it crashes on iOS : kotlin.native.internal.IrLinkageError: Function 'UIKitView' can not be called: No function found for symbol 'androidx.compose.ui.interop/UIKitView|UIKitView(kotlin.Function0<0:0>;androidx.compose.ui.Modifier;kotlin.Function1<0:0,kotlin.Unit>?;androidx.compose.ui.graphics.Color;kotlin.Function1<0:0,kotlin.Unit>?;kotlin.Function2<0:0,kotlinx.cinterop.CValue<platform.CoreGraphics.CGRect>,kotlin.Unit>?;kotlin.Boolean;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<platform.UIKit.UIView>}[0]'

ctn-mobile-innovation commented 2 weeks ago

@bastami82 Let us check this and get back to you

ctn-mobile-innovation commented 2 weeks ago

@bastami82 Please share which compose and kotlin version you are using

bastami82 commented 2 weeks ago

@bastami82 Please share which compose and kotlin version you are using

compose-plugin = "1.6.11" jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }

kotlin = "2.0.0" kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

using simulator iPhone 15 | iOS 17.5

bastami82 commented 2 weeks ago

@ctn-mobile-innovation also got the same error when used compose-plugin = "1.7.0-alpha03" kotlin = "2.0.20"

ctn-mobile-innovation commented 1 week ago

compose-plugin = "1.6.11" jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } kotlin = "2.0.0" kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } using simulator iPhone 15 | iOS 17.5

@bastami82 we have used same version for demo, demo working fine in your device? or while integrating in your project causing this issue?

bastami82 commented 1 week ago

@ctn-mobile-innovation I was away yesterday, looking into this as you suggested, the Video player works, but when I import the lib in my project, it does not work on iOS , my best guess is maybe some iOS dependencies are missing when import the project, I guess it would be nice if we keep the sample/Demo app separate from the main lib project, so this way demo app will pull player lib same as a real use-case , when I compared the two projects , my project only has 4 chaintech libs as externals whereas yours has a few more specially sdp-ssp-compose-multiplatform-iosarm64:1.0.1 and isosimulatorarm64:1.0.1 and isosx64:1.0.1 , please see this comparison in a screenshot (left is what I have and on the right is your dependencies ) image

ctn-mobile-innovation commented 3 days ago

@bastami82 We have tried creating separate demo too, it's working fine, can you share your .toml and .gradle file?

Configuration used for demo -> kotlin = "2.0.20" compose = "1.6.11"

multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } compose = { id = "org.jetbrains.compose", version.ref = "compose" }

bastami82 commented 9 hours ago

here you are:

[versions]
agp = "8.5.2"
android-compileSdk = "34"
android-minSdk = "24"
android-targetSdk = "34"
androidx-activityCompose = "1.9.2"
compose = "1.6.11"
kotlin = "2.0.20"
ktor = "2.3.12"
landscpapist = "2.3.6"
media-player = "1.0.19"

lifecycleViewModel = "2.8.5"
koin = "3.6.0-alpha3"
koinCompose = "3.6.0-alpha3"
koinComposeMultiplatform = "1.2.0-alpha3"
navigationCompose = "2.8.0-alpha08"
lifecycle-runtime-compose = "2.8.5"
runtimeAndroid = "1.7.1"
serialization = "1.6.3"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
media-player = { module = "network.chaintech:compose-multiplatform-media-player", version.ref = "media-player" }

lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycleViewModel" }
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinCompose" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koinComposeMultiplatform" }
navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization"}

androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle-runtime-compose" }
androidx-runtime-android = { group = "androidx.compose.runtime", name = "runtime-android", version.ref = "runtimeAndroid" }

ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }

landscapist = { group = "com.github.skydoves", name = "landscapist-coil3", version.ref = "landscpapist" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

[bundles]
ktor = [
    "ktor-client-core",
    "ktor-client-content-negotiation",
    "ktor-client-auth",
    "ktor-client-logging",
    "ktor-serialization-kotlinx-json",
]

FYI, I get this error when try to play on ios kotlin.native.internal.IrLinkageError: Function 'UIKitView' can not be called: No function found for symbol 'androidx.compose.ui.interop/UIKitView|UIKitView(kotlin.Function0<0:0>;androidx.compose.ui.Modifier;kotlin.Function1<0:0,kotlin.Unit>?;androidx.compose.ui.graphics.Color;kotlin.Function1<0:0,kotlin.Unit>?;kotlin.Function2<0:0,kotlinx.cinterop.CValue<platform.CoreGraphics.CGRect>,kotlin.Unit>?;kotlin.Boolean;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){0§<platform.UIKit.UIView>}[0]' Which is also shared by other people here https://github.com/Chaintech-Network/ComposeMultiplatformMediaPlayer/issues/20 ,

what I could suggest is, if you can share your working sample app with me, I can compare it and get back to you, Thanks