A native Android Live TV streaming application built with Kotlin and Jetpack Compose, featuring ExoPlayer (Media3) for HLS/M3U8 video playback.
This application provides a modern, user-friendly interface for streaming live TV channels from a local HTTP server. It features category-based browsing, thumbnail previews, and real-time streaming with professional video playback controls.
- πΊ HLS/M3U8 Video Streaming with ExoPlayer (Media3)
- π¨ Modern UI built entirely with Jetpack Compose
- π Category Filtering (Bangla, English, Hindi, Islamic, Kids, Sports)
- πΌοΈ Channel Grid with thumbnail images
- π₯ Active Users Indicator (simulated real-time updates)
- π Network Security configured for local HTTP server
- π± 16:9 Video Player with adaptive layout
- π― Auto-play first channel on launch
- Language: Kotlin
- UI Framework: Jetpack Compose (Material 3)
- Video Player: ExoPlayer (Media3) with HLS support
- Image Loading: Coil
- HTML Parsing: Jsoup
- Async Operations: Kotlin Coroutines
- Build System: Gradle
| Component | Description |
|---|---|
MainActivity.kt |
Main activity with Compose UI and player lifecycle |
Channel.kt |
Data model for channel information |
ChannelParser.kt |
Utility for parsing HTML channel lists |
| Network Security Config | Allows cleartext HTTP to local server (10.200.13.14) |
- JDK 8+ installed
- Android SDK (API 33+)
- Network access to download dependencies
./gradlew assembleDebugπ¦ Output: app/build/outputs/apk/debug/app-debug.apk
./gradlew assembleReleaseπ¦ Output: app/build/outputs/apk/release/app-release.apk
adb install app/build/outputs/apk/debug/app-debug.apkThe app connects to a local HTTP server:
- Base URL:
http://10.200.13.14/ - Stream Endpoint:
player.php?stream={ID} - Image Path:
assets/images/{CHANNEL_NAME}.png
To change the server, edit ChannelParser.kt:
private const val BASE_URL = "http://YOUR_SERVER_IP/"The app is configured to allow cleartext HTTP traffic to 10.200.13.14:
<!-- res/xml/network_security_config.xml -->
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.200.13.14</domain>
</domain-config>
</network-security-config>- Top Bar: Logo and active users count
- Video Player: 16:9 aspect ratio with player controls
- Category Tabs: Scrollable horizontal tabs
- Channel Grid: 3-column grid with thumbnails
Edit ChannelParser.kt:
fun getSampleChannels(): List<Channel> {
return listOf(
Channel("ID", "Channel Name", "Category", "Image URL"),
// Add more channels...
)
}The parser supports this HTML format:
<li data-type="Sports">
<a onclick="view.location.href='player.php?stream=88'">
<img src="assets/images/A_SPORTS_HD.png">
</a>
</li>Use ChannelParser.parseChannels(html) to extract channel data.
Edit MainActivity.kt:
@Composable
fun LiveTVTheme(content: @Composable () -> Unit) {
MaterialTheme(
colorScheme = lightColorScheme(
primary = Color(0xFF6200EE), // Change colors
secondary = Color(0xFF03DAC5),
background = Color(0xFFF5F5F5)
),
content = content
)
}// ExoPlayer (Media3)
implementation 'androidx.media3:media3-exoplayer:1.0.2'
implementation 'androidx.media3:media3-exoplayer-hls:1.0.2'
implementation 'androidx.media3:media3-ui:1.0.2'
// Jetpack Compose
implementation platform('androidx.compose:compose-bom:2023.01.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.material3:material3'
// Coil for images
implementation 'io.coil-kt:coil-compose:2.2.2'
// HTML parsing
implementation 'org.jsoup:jsoup:1.15.4'- File:
app/keystore.jks - Store Password:
livetv123 - Key Alias:
livetv - Key Password:
livetv123
keytool -genkeypair -v -keystore release.jks -keyalg RSA -keysize 2048 \
-validity 10000 -alias my-keyProblem: Dependencies fail to download
Solution: Ensure internet connectivity. The project uses Maven Central and Google repositories.
Problem: Android SDK not found
Solution: Set ANDROID_HOME environment variable to your SDK location.
Problem: Video doesn't play
Solution:
- Verify server at
10.200.13.14is accessible - Check stream URL format:
http://10.200.13.14/player.php?stream=88 - Ensure network security config is properly configured
Problem: Images not loading
Solution:
- Verify image URLs are correct
- Check server is serving images from
/assets/images/ - Ensure internet permission is granted
This project is provided as-is for educational and development purposes.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues or questions, please open an issue on GitHub.
Built with β€οΈ using Kotlin and Jetpack Compose