JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.81k stars 1.15k forks source link

VideoPlayer component HLS support #1951

Open fougere-mike opened 2 years ago

fougere-mike commented 2 years ago

The (experimental) VideoPlayer component does not appear to support HLS video playback.

The play(url) call within DesktopVideoPlayer returns true, but there is no video or audio.

Tested with this sample stream: https://multiplatform-f.akamaihd.net/i/multi/will/bunny/big_buck_bunny_,640x360_400,640x360_700,640x360_1000,950x540_1500,.f4v.csmil/master.m3u8

Playing this URL with the VLC desktop application works as expected.

Note: The URL for the mp4 file included with the demo does playback correctly.

System Info:

# Operating System

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

------------------------------------------------------------------------------------------------------------------------------------

# VLC packages

ii  libvlc-bin:amd64                           3.0.9.2-1                             amd64        tools for VLC's base library
ii  libvlc-dev:amd64                           3.0.9.2-1                             amd64        development files for libvlc
ii  libvlc5:amd64                              3.0.9.2-1                             amd64        multimedia player and streamer library
ii  libvlccore-dev:amd64                       3.0.9.2-1                             amd64        development files for libvlccore
ii  libvlccore9:amd64                          3.0.9.2-1                             amd64        base library for VLC and its modules
ii  vlc                                        3.0.9.2-1                             amd64        multimedia player and streamer
ii  vlc-bin                                    3.0.9.2-1                             amd64        binaries from VLC
ii  vlc-data                                   3.0.9.2-1                             all          common data for VLC
ii  vlc-l10n                                   3.0.9.2-1                             all          translations for VLC
ii  vlc-plugin-base:amd64                      3.0.9.2-1                             amd64        multimedia player and streamer (base plugins)
ii  vlc-plugin-notify:amd64                    3.0.9.2-1                             amd64        LibNotify plugin for VLC
ii  vlc-plugin-qt:amd64                        3.0.9.2-1                             amd64        multimedia player and streamer (Qt plugin)
ii  vlc-plugin-samba:amd64                     3.0.9.2-1                             amd64        Samba plugin for VLC
ii  vlc-plugin-skins2:amd64                    3.0.9.2-1                             amd64        multimedia player and streamer (Skins2 plugin)
ii  vlc-plugin-video-output:amd64              3.0.9.2-1                             amd64        multimedia player and streamer (video output plugins)
ii  vlc-plugin-video-splitter:amd64            3.0.9.2-1                             amd64        multimedia player and streamer (video splitter plugins)
ii  vlc-plugin-visualization:amd64             3.0.9.2-1                             amd64        multimedia player and streamer (visualization plugins)
fougere-mike commented 2 years ago

Did you use VideoPlayer in a separate project?

Yes. I used it in a compose multiplatform project.

If so, how did you add VideoPlayer to your build.gradle dependencies?

I copied the VideoPlayer module into the new project, then added it to the "common" module's build.gradle.kts:

kotlin {
    android()
    jvm("desktop") {
        compilations.all {
            kotlinOptions.jvmTarget = "11"
        }
    }
    sourceSets {
        val commonMain by getting {
            dependencies {
                api(compose.runtime)
                api(compose.foundation)
                api(compose.material)

                implementation(project(":VideoPlayer:library"))    // <---------- VideoPlayer component
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
            }
        }
        val androidMain by getting {
            dependencies {
                api("androidx.appcompat:appcompat:1.2.0")
                api("androidx.core:core-ktx:1.3.1")
            }
        }
        val androidTest by getting {
            dependencies {
                implementation("junit:junit:4.13")
            }
        }
        val desktopMain by getting {
            dependencies {
                api(compose.preview)
            }
        }
        val desktopTest by getting
    }
}
okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.