Giter Site home page Giter Site logo

Comments (2)

sid1605 avatar sid1605 commented on May 29, 2024

it don't work as there isn't any property as Controlls position that i could set as RESIZE_MODE_FILL in horizontal orientation.

from media.

sid1605 avatar sid1605 commented on May 29, 2024

`
@composable
fun XpPlayer() {
val context = LocalContext.current
fun buildCustomDrmSessionManager(): DrmSessionManager {
val userAgent = "1"
val dataSourceFactory = DefaultHttpDataSource.Factory().setUserAgent(userAgent)
.setDefaultRequestProperties(mapOf("X-AxDRM-Message" to ""))
val drmCallback: MediaDrmCallback = HttpMediaDrmCallback("", dataSourceFactory)
val exoMediaDrmProvider: ExoMediaDrm.Provider = FrameworkMediaDrm.DEFAULT_PROVIDER
return DefaultDrmSessionManager.Builder()
.setUuidAndExoMediaDrmProvider(C.WIDEVINE_UUID, exoMediaDrmProvider).build(drmCallback)
}

fun buildDrmMediaItemWithDrmConfig(): MediaItem {
    return MediaItem.fromUri("https://travelxp.s.llnwi.net/watch1/61025c11781ce3c543f5abcd/manifest_v4.mpd")
}

val customDrmSessionManager = buildCustomDrmSessionManager()
val mediaSourceFactory =
    DefaultMediaSourceFactory(context).setDrmSessionManagerProvider { customDrmSessionManager }

val loadControl = DefaultLoadControl.Builder().setBufferDurationsMs(
    10000, 20000, 2000, 10000
).build()

val exoPlayer = remember {
    ExoPlayer.Builder(context, mediaSourceFactory).setLoadControl(loadControl).build().also {
        it.playWhenReady = true
    }.apply {
        setMediaItem(buildDrmMediaItemWithDrmConfig())
        prepare()
    }
}

DisposableEffect(Unit) {
    onDispose {
        exoPlayer.release()
    }
}

AndroidView(modifier = Modifier
    .border(2.dp, Color.Red)
    .width(800.dp).aspectRatio(16/9f),
    factory = {
    PlayerView(context).apply {
        useController = true
        resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FILL
        player = exoPlayer
        setShowBuffering(PlayerView.SHOW_BUFFERING_WHEN_PLAYING)
        hideController()
        layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)
    }
})

}`

this is the code of my player. i put this code in my main activity. when i make player to be full screen then it is okay and then playback speed and audio selection dialog opens inside the player but when i make player with som height and width as in code then these dialogs(playback speed and audio selection) opens outside of the player. these are screen shotls related to this,

Screenshot_20240229_133508

from media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.