Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Thriving in Android Development Using Kotlin

You're reading from   Thriving in Android Development Using Kotlin A project-based guide to using the latest Android features for developing production-grade apps

Arrow left icon
Product type Paperback
Published in Jul 2024
Publisher Packt
ISBN-13 9781837631292
Length 410 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Gema Socorro Rodríguez Gema Socorro Rodríguez
Author Profile Icon Gema Socorro Rodríguez
Gema Socorro Rodríguez
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Part 1:Creating WhatsPackt, a Messaging App FREE CHAPTER
2. Chapter 1: Building the UI for Your Messaging App 3. Chapter 2: Setting Up WhatsPackt’s Messaging Abilities 4. Chapter 3: Backing Up Your WhatsPackt Messages 5. Part 2:Creating Packtagram, a Photo Media App
6. Chapter 4: Building the Packtagram UI 7. Chapter 5: Creating a Photo Editor Using CameraX 8. Chapter 6: Adding Video and Editing Functionality to Packtagram 9. Part 3:Creating Packtflix, a Video Media App
10. Chapter 7: Starting a Video Streaming App and Adding Authentication 11. Chapter 8: Adding Media Playback to Packtflix with ExoPlayer 12. Chapter 9: Extending Video Playback in Your Packtflix App 13. Index 14. Other Books You May Enjoy

Playing video using ExoPlayer

In this section, we’ll harness the full power of ExoPlayer so that we can integrate it into our newly created video playback UI. Let’s learn how we can do this.

Creating PlaybackActivity

We’ll start by creating a new Activity for this functionality called PlaybackActivity:

class PlaybackActivity: ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            PlaybackScreen()
        }
    }
}

This PlaybackActivity activity will show our already created PlaybackScreen() in its content.

We also want our playback UI to be always displayed in landscape mode. To do so, we’ll configure this activity in the AndroidManifest...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime