YouTube Clone KMP is a sophisticated project developed using Kotlin Multiplatform (KMP), enabling the creation of versatile applications across Android, iOS, Web, and Desktop platforms with shared code. This comprehensive YouTube clone mirrors the functionalities of the official YouTube app, offering a seamless user experience across various devices. A Better Version of Original App (A Big Bold Claim).
- Cross-Platform Compatibility (Android, iOS, Web & Desktop Applications)
- Video Playback
- Sharing Options
- Download Capability
- Playlist Viewing
- Comprehensive Search
- Video Detail
- Trending Videos
- Subscribe Channels
- View Verified Channel Badges
- Quick & Responsive Search for Videos & Channels
- Offline Video Support
- Smooth Interaction
- Responsive UI
- Material Design Components
- Top Videos
- Shorts Videos
- Video Details
- Channel Screen
- Channel Home
- Live Streams
- Community
- Playlists
- Channel Details Screen
- Share Channel, Videos, and Shorts
- Like and Comment Features
- Download Videos
- Relevance Videos
- Subscriptions
- Library
- Shimmer Loading Screen
- Top Categories
- Navigation Rail for Foldable Devices
- Desktop and Web Version Support
- TV and Wear OS Versions
If you wanna contribute, Please make sure to add new features & Then make a PR.Feel free to contribute to the project and stay tuned for more exciting updates!
Do you wanna Convert your thoughts into Physicall & Successfull Project Then I'm here for you. I'm open to work, available for Freelance or Remote Work Opportunities. Feel free to reach me out on Email.
- Kotlin Multiplatform:
1.9.23
- AGP (Android Gradle Plugin):
8.2.2
- Compose:
1.6.2
androidx-appcompat
:1.6.1
androidx-activityCompose
:1.9.0
compose-uitooling
:1.6.6
composeImageLoader
:1.7.1
composeIcons
:1.1.0
- Core Libraries:
12.1.0
- Kotlinx Libraries:
kotlinx-coroutines
:1.8.0
kotlinx-serialization
:1.6.3
kotlinx-datetime
:0.5.0
- Networking:
coilNetwork
:3.0.0-alpha01
ktor
:2.3.9
- Dependency Injection:
koin
:3.5.4
- UI/UX:
compose-uitooling
:1.6.3
composeIcons
:1.1.0
- Media Handling:
media3Ui
:1.3.1
media3ExoplayerDash
:1.3.1
media3Exoplayer
:1.3.1
- Logging:
napier
:2.6.1
- Database/Storage:
sql-delight
:2.0.1
- Web and Networking:
webview-kmp
:1.8.0
- JSON Parsing:
json
:1.6.3
- Build Configurations:
buildConfig
:4.1.1
- Cross-Platform Image Loading:
kamelImage
:0.9.4
- Size Measurement:
size
:0.3.1
- Voyager Navigation:
1.0.0
- Other Utilities:
moko-mvvm
:0.16.1
vlcj
:4.7.0
ffmpegPlatform
:4.1-1.4.4
- JavaFX:
22-ea+16
To use the app, follow these steps:
-
Create YouTube API V3 credentials:
- Navigate to the Google Cloud Console.
- Create a new project or select an existing one.
- Enable the YouTube Data API v3 for your project.
- Generate an API key for your project.
-
Add the credentials to
composeApp/src/kotlin/com/company/app/utils/
:- Open the
Constant.kt
file in your project. - Add the following line:
API_KEY=Your_API_VALUE
, replacingYour_API_VALUE
with the API key generated in step 1.
- Open the
-
Ensure API Key Security:
- Restrict your API key to prevent unauthorized usage.
- Configure API key restrictions based on IP addresses, referrers, or Android app signatures to enhance security.
-
Integrate API Key into the App:
- Use the
BuildConfig.API_KEY
variable in your code to access the API key securely. (Removed for Now, due to some bugs) - Ensure that the API key is not hard-coded or exposed directly in your source code.
- Use the
-
Start Using the App:
- Build and run your app to start utilizing the YouTube Data API functionalities.
- Implement features such as video search, playback, playlists, and more using the API key.
Feel free to reach out if you have any questions or need further assistance!
Let's chat about potential projects, job opportunities, or any other collaboration! Feel free to connect with me through the following channels:
If you find my work helpful, you can support me by
- check your system with KDoctor
- install JDK 17 on your machine
- add
local.properties
file to the project root and set a path to Android SDK there - Make sure to Complete the Installation of Compose Multiplatform Before using this Project.
- Official Setup Guide: ![Official KMP Setup Guide]
To run the application on android device/emulator:
- open project in Android Studio and run imported android run configuration
To build the application bundle:
- run
./gradlew :composeApp:assembleDebug
- find
.apk
file incomposeApp/build/outputs/apk/debug/composeApp-debug.apk
Run the desktop application: ./gradlew :composeApp:run
To run the application on iPhone device/simulator:
- Open
iosApp/iosApp.xcproject
in Xcode and run standard configuration - Or use Kotlin Multiplatform Mobile plugin for Android Studio
Run the browser application: ./gradlew :composeApp:jsBrowserDevelopmentRun
- to create .apk file for the Andorid. We simply need to 'build > Build Bundles > Build APK'.
-
to create Native Distributable for the Desktop Windows, MacOS, Linux. We need to follow the procedure.
-
'First of all following inside the 'build.gradle.kts' ' compose.desktop { application { mainClass = "MainKt"
nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "org.company.app.desktopApp" packageVersion = "1.0.0" description = "YouTube Clone Using Kotlin Multiplatform" copyright = "© 2024 Muhammad Khubaib Imtiaz. All rights reserved." windows { iconFile.set(project.file("src/commonMain/resources/youtube_music.png")) } macOS { iconFile.set(project.file("src/commonMain/resources/youtube_music.png")) } linux { iconFile.set(project.file("src/commonMain/resources/youtube_music.png")) } }
} }'
-
Now simply run the command 'gradle createDistributable or ./gradlew createDistributable'
- for the Js Web App, we simply need to execute the 'gradle jsBrowserWebpack'
We welcome contributions to the YouTube Clone project! To contribute, please follow these guidelines:
- Reporting Bugs: If you encounter a bug, please open an issue and provide detailed information about the bug, including steps to reproduce it.
- Suggesting Features: We encourage you to suggest new features or improvements by opening an issue and describing your idea.
- Submitting Pull Requests: If you'd like to contribute code, please fork the repository, create a new branch for your changes, and submit a pull request with a clear description of the changes.
We expect all contributors and users of the YouTube Clone project to adhere to our code of conduct. Please review the Code of Conduct for details on expected behavior and reporting procedures.
Here's a brief overview of our project roadmap:
- Upcoming Features: We're planning to add support for TV and Wear OS versions in future releases.
- Milestones: We'll be releasing updates regularly to introduce new features and enhancements. Stay tuned for announcements about upcoming releases.
Join our community to connect with other users and contributors:
- Documentation: Find more information and resources in our documentation.
- Forums: Ask questions and discuss ideas in our community forums.
- Chat: Join our community chat on Slack to chat with other users and contributors.
We'd like to thank the following individuals and organizations for their contributions to the YouTube Clone project:
- No Contributor Yet.
Here are some frequently asked questions about the YouTube Clone project:
-
How do I run the application on Android?
- Follow the instructions in the README to set up your development environment and run the app on an Android device or emulator.
-
Can I contribute to the project if I'm new to Kotlin Multiplatform?
- Yes! We welcome contributions from developers of all skill levels. Check out our Contribution Guidelines for more information on how to get started.
To optimize performance in the YouTube Clone project, consider the following tips:
- Lazy Loading: Implement lazy loading for images and videos to reduce initial load times.
- Cache Optimization: Use caching strategies to minimize network requests and improve data loading performance.
- Code Profiling: Profile your code to identify and optimize performance bottlenecks.
- Resource Management: Ensure efficient use of system resources, such as memory and CPU, to improve overall performance.