Giter VIP home page Giter VIP logo

customexoplayer's Introduction

CustomExoPlayer

CustomExoPlayer is a customizable Android library built on top of ExoPlayer from Media3 API, providing additional features and functionalities to enhance media playback in your Android applications using Jetpack Compose.

Features

  • Custom UI Components: Tailor the look and feel of the ExoPlayer UI according to your app's design.
  • Advanced Playback Controls: Implement custom volume controls for a seamless user experience.
  • Show playback progress: Show playback progress to users in center circular progress and in bottom slider.
  • Play video from mp4 link: Play .mp4 media items from their URL.
  • Play video from last paused position: Tailored to start playing the video from last paused position

Getting Started

To integrate ExoPlayer into your Android project, follow these steps:

  1. Add the library to your project dependencies:

     implementation("androidx.media3:media3-exoplayer:1.2.1")
     implementation("androidx.media3:media3-ui:1.2.1")
     implementation("androidx.media3:media3-exoplayer-dash:1.2.1")implementation 'com.github.PriyaSindkar:CustomExoPlayer:1.0.0'
    
  2. Use just one call to build an entire customizable player

VideoPlayer(
                context = LocalContext.current,
                modifier = Modifier
                    .fillMaxSize(),
                videoUrl = videoPlayerUiState.extractedVideoUrl,
                lastPaused = lastPaused,
                returnToHomeScreen = returnToHomeScreen,  // go back
                showSurvey = showSurvey
            )
  1. Build media item from URL
val mediaItem = remember(videoUrl) {
        MediaItem.Builder()
            .setUri(videoUrl)
            .setMimeType(MimeTypes.APPLICATION_MP4)
            .build()
    }

    val player = remember(context) {
        ExoPlayer.Builder(context)
            .build()
    }.apply {
        setMediaItem(mediaItem)
        prepare()
        playWhenReady = true
    }

Work in progress

  • Manage orientation changes while playing the video

References

customexoplayer's People

Contributors

priyashah-novum avatar priyasindkar avatar

Watchers

 avatar

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.