Skip to content

Commit 697264b

Browse files
committed
-v2.0.6 Release
1 parent a484875 commit 697264b

File tree

2 files changed

+99
-69
lines changed

2 files changed

+99
-69
lines changed

README.md

Lines changed: 98 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@
1818

1919
## Overview
2020

21-
MediaPlayer-KMP is a Kotlin Multiplatform (KMP) library that allows you to display and play YouTube videos across Android, iOS, Web, and Desktop platforms using JetBrains Compose Multiplatform. It provides a unified API for video playback that seamlessly integrates into Kotlin's multiplatform ecosystem.
21+
MediaPlayer-KMP is a Kotlin Multiplatform (KMP) library that allows you to display and play YouTube
22+
videos across Android, iOS, Web, and Desktop platforms using JetBrains Compose Multiplatform. It
23+
provides a unified API for video playback that seamlessly integrates into Kotlin's multiplatform
24+
ecosystem.
2225

2326
## Features
2427

25-
- **Platform Agnostic:** Supports Android, iOS, Web, and Desktop platforms through Kotlin Multiplatform.
26-
- **Compose Multiplatform Integration:** Seamlessly integrates with JetBrains Compose Multiplatform UI framework.
28+
- **Platform Agnostic:** Supports Android, iOS, Web, and Desktop platforms through Kotlin
29+
Multiplatform.
30+
- **Compose Multiplatform Integration:** Seamlessly integrates with JetBrains Compose Multiplatform
31+
UI framework.
2732
- **YouTube Video Playback:** Easily load and play YouTube videos with minimal setup.
2833
- **Audio Player Playback:** Easily load and play Audios with minimal setup.
2934
- **Event Handling:** Provides callbacks and event listeners for video playback actions and events.
@@ -32,119 +37,135 @@ MediaPlayer-KMP is a Kotlin Multiplatform (KMP) library that allows you to displ
3237
- **Auth Token:** Authentication Token Implementation.
3338
- **ReelsView Support:** Reels View Support Implementation.
3439

35-
## Future Plans
40+
## Future Plans
41+
3642
- **Desktop Playback Support**.
3743
- **Audio player Customisation Support**.
3844
- **Video and Audio picker for Android, iOS, Web and Desktop.**
3945
- **Local Content Support.**
4046
- **Playback Support.**
4147

42-
4348
## Installation
4449

4550
You can include MediaPlayer-KMP in your project by adding the following dependency:
4651

4752
**Version Catelog**
53+
4854
```
4955
[versions]
50-
mediaPlayerKMP = "2.0.5"
56+
mediaPlayerKMP = "2.0.6"
5157
5258
[libraries]
5359
alert-kmp = { module = "io.github.khubaibkhan4:mediaplayer-kmp", version.ref = "mediaPlayerKMP" }
5460
5561
```
5662

57-
5863
```groovy
59-
implementation("io.github.khubaibkhan4:mediaplayer-kmp:2.0.5")
64+
implementation("io.github.khubaibkhan4:mediaplayer-kmp:2.0.6")
6065
```
6166

62-
6367
## Usage
6468

6569
### YouTube Video Player
66-
For the YouTube Player, you just need to provide the youtube video link. It will automatically detect it & will launch the YouTube Player.
70+
71+
For the YouTube Player, you just need to provide the youtube video link. It will automatically
72+
detect it & will launch the YouTube Player.
73+
6774
```groovy
6875
import io.github.khubaibkhan4.mediaplayer.VideoPlayer
6976
7077
fun main() {
71-
VideoPlayer(modifier = Modifier.fillMaxWidth().height(340.dp),
72-
url ="https://www.youtube.com/watch?v=AD2nEllUMJw", // Automatically Detect the URL, Wether to Play YouTube Video or .mp4 e.g
73-
)
78+
VideoPlayer(modifier = Modifier.fillMaxWidth().height(340.dp),
79+
url = "https://www.youtube.com/watch?v=AD2nEllUMJw", // Automatically Detect the URL, Wether to Play YouTube Video or .mp4 e.g
80+
showControls: Boolean = true,
81+
)
7482
}
7583
```
7684

77-
### Video Player
78-
For the YouTube Player, you just need to provide the youtube video link. It will automatically detect it & will launch the YouTube Player. It almost supports all the video extensions.
85+
### Video Player
86+
87+
For the YouTube Player, you just need to provide the youtube video link. It will automatically
88+
detect it & will launch the YouTube Player. It almost supports all the video extensions.
7989

8090
```groovy
8191
import io.github.khubaibkhan4.mediaplayer.VideoPlayer
8292
8393
fun main() {
84-
VideoPlayer(modifier = Modifier.fillMaxWidth().height(340.dp),
85-
url ="https://freetestdata.com/wp-content/uploads/2022/02/Free_Test_Data_1MB_MP4.mp4", // Automatically Detect the URL, Wether to Play YouTube Video or .mp4 e.g
86-
)
94+
VideoPlayer(modifier = Modifier.fillMaxWidth().height(340.dp),
95+
url = "https://freetestdata.com/wp-content/uploads/2022/02/Free_Test_Data_1MB_MP4.mp4", // Automatically Detect the URL, Wether to Play YouTube Video or .mp4 e.g
96+
showControls: Boolean = true,
97+
)
8798
}
8899
```
89100

90101
## Audio Player Support
91-
Audio Player Support is Implemented. It supports `mp3` `wav` `aac` `ogg` `m4a`. It Supports Play Back, Volume Up, Down and Stability as well.
102+
103+
Audio Player Support is Implemented. It supports `mp3` `wav` `aac` `ogg` `m4a`. It Supports Play
104+
Back, Volume Up, Down and Stability as well.
105+
92106
```groovy
93107
import io.github.khubaibkhan4.mediaplayer.VideoPlayer
94108
95109
fun main() {
96110
MediaPlayer(
97-
modifier = Modifier.fillMaxWidth(),
98-
url = "https://commondatastorage.googleapis.com/codeskulptor-demos/DDR_assets/Kangaroo_MusiQue_-_The_Neverwritten_Role_Playing_Game.mp3",
99-
startTime = Color.Black,
100-
endTime = Color.Black,
101-
volumeIconColor = Color.Black,
102-
playIconColor = Color.Blue,
103-
sliderTrackColor = Color.LightGray,
104-
sliderIndicatorColor = Color.Blue
111+
modifier = Modifier.fillMaxWidth(),
112+
url = "https://commondatastorage.googleapis.com/codeskulptor-demos/DDR_assets/Kangaroo_MusiQue_-_The_Neverwritten_Role_Playing_Game.mp3",
113+
startTime = Color.Black,
114+
endTime = Color.Black,
115+
volumeIconColor = Color.Black,
116+
playIconColor = Color.Blue,
117+
sliderTrackColor = Color.LightGray,
118+
sliderIndicatorColor = Color.Blue,
119+
showControls: Boolean = true,
105120
)
106121
}
107122
```
108123

109124
### Authentication Token Support
110-
Providing the Auth Tokens are pretty simple. You just need to add the headers. You can add the headers with key and value pairs.
125+
126+
Providing the Auth Tokens are pretty simple. You just need to add the headers. You can add the
127+
headers with key and value pairs.
128+
111129
```groovy
112130
MediaPlayer(
113-
modifier = Modifier.fillMaxSize(),
114-
url = "https://example.com/protected-video.mp4",
115-
headers = mapOf(
116-
"Authorization" to "Bearer your_token",
117-
"Custom-Header" to "YourValue"
118-
),
119-
startTime = Color.Red,
120-
endTime = Color.Blue,
121-
autoPlay = true,
122-
volumeIconColor = Color.Green,
123-
playIconColor = Color.Yellow,
124-
sliderTrackColor = Color.Gray,
125-
sliderIndicatorColor = Color.Magenta
131+
modifier = Modifier.fillMaxSize(),
132+
url = "https://example.com/protected-video.mp4",
133+
headers = mapOf(
134+
"Authorization" to "Bearer your_token",
135+
"Custom-Header" to "YourValue"
136+
),
137+
startTime = Color.Red,
138+
endTime = Color.Blue,
139+
autoPlay = true,
140+
volumeIconColor = Color.Green,
141+
playIconColor = Color.Yellow,
142+
sliderTrackColor = Color.Gray,
143+
sliderIndicatorColor = Color.Magenta,
144+
showControls: Boolean = true,
126145
)
127146
128147
129148
```
130149

131150
## Reels View Support
151+
132152
```groovy
133153
@Composable
134154
fun MainScreen() {
135155
val videoUrls = listOf(
136-
"https://www.example.com/video1.mp4",
137-
"https://www.example.com/video2.mp4",
138-
"https://www.example.com/video3.mp4"
156+
"https://www.example.com/video1.mp4",
157+
"https://www.example.com/video2.mp4",
158+
"https://www.example.com/video3.mp4"
139159
)
140160
ReelsView(
141-
videoUrls = videoUrls,
142-
pagerType = PagerType.Vertical, // Choose PagerType.Vertical or PagerType.Horizontal
143-
modifier = Modifier.fillMaxSize(),
144-
autoPlay = true, // Enable auto-play for videos
145-
onInteraction = { page, url ->
146-
println("User interacted with page $page, video URL: $url")
147-
}
161+
videoUrls = videoUrls,
162+
pagerType = PagerType.Vertical, // Choose PagerType.Vertical or PagerType.Horizontal
163+
modifier = Modifier.fillMaxSize(),
164+
autoPlay = true, // Enable auto-play for videos
165+
showControls: Boolean = true,
166+
onInteraction = { page, url ->
167+
println("User interacted with page $page, video URL: $url")
168+
}
148169
)
149170
}
150171
@@ -153,32 +174,33 @@ fun MainScreen() {
153174

154175
## 🤝 Connect with Me
155176

156-
Let's chat about potential projects, job opportunities, or any other collaboration! Feel free to connect with me through the following channels:
177+
Let's chat about potential projects, job opportunities, or any other collaboration! Feel free to
178+
connect with me through the following channels:
157179

158180
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin)](https://www.linkedin.com/in/khubaibkhandev)
159181
[![Twitter](https://img.shields.io/badge/Twitter-Follow-blue?style=for-the-badge&logo=twitter)](https://twitter.com/codespacepro)
160182
[![Email](https://img.shields.io/badge/Email-Drop%20a%20Message-red?style=for-the-badge&logo=gmail)](mailto:18.bscs.803@gmail.com)
161183

162-
## 💰 You can help me by Donating
163-
[![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/khubaibkhan) [![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/18.bscs) [![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/MuhammadKhubaibImtiaz) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/muhammadkhubaibimtiaz)
184+
## 💰 You can help me by Donating
185+
186+
[![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/khubaibkhan) [![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/18.bscs) [![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/MuhammadKhubaibImtiaz) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/muhammadkhubaibimtiaz)
164187

165188
## Screenshots
166-
| ![Screenshot 1](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/1.png) | ![Screenshot 2](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/2.png) | ![Screenshot 3](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/3.png) |
167-
| --- | --- | --- |
168-
![Screenshot 2](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/6.png) | ![Screenshot_20240710_153958](https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/bbda1012-f4a9-46ad-824a-66a710c67c0b)
169189

190+
| ![Screenshot 1](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/1.png) | ![Screenshot 2](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/2.png) | ![Screenshot 3](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/3.png) |
191+
|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
192+
![Screenshot 2](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/6.png) | ![Screenshot_20240710_153958](https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/bbda1012-f4a9-46ad-824a-66a710c67c0b)
170193

171-
| ![Screenshot 1](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/4.png) |
172-
| --- |
173-
| ![Screenshot 2](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/5.png) |
194+
| ![Screenshot 1](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/4.png) |
195+
|---------------------------------------------------------------------------------------------------------------------------------------|
196+
| ![Screenshot 2](https://github.com/KhubaibKhan4/MediaPlayer-KMP/blob/master/assests/screenshots/5.png) |
174197
| ![Screenshot 2024-07-10 153852](https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/1238c26b-8553-459d-b606-7da89459eb04) |
175198
| ![Screenshot 2024-07-10 153944](https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/2bd8bd9e-298c-4488-8348-8f94b6705a66) |
176199

177200
## Demo
178201

179202
https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/657ad29d-5129-4f78-af56-ad354ba0935d
180203

181-
182204
## Desktop Demo
183205

184206
https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/efd68685-2f41-4445-ad76-c183869ab93a
@@ -201,16 +223,24 @@ https://github.com/KhubaibKhan4/MediaPlayer-KMP/assets/98816544/efd68685-2f41-44
201223

202224
[![Forkers repo roster for @KhubaibKhan4/MediaPlayer-KMP](http://reporoster.com/forks/dark/KhubaibKhan4/MediaPlayer-KMP)](https://github.com/KhubaibKhan4/MediaPlayer-KMP/network/members)
203225

226+
## Contribution Guidelines
204227

205-
## Contribution Guidelines
206-
We welcome contributions to the MediaPlayer-KMP Library Project! To contribute, please follow these guidelines:
228+
We welcome contributions to the MediaPlayer-KMP Library Project! To contribute, please follow these
229+
guidelines:
207230

208-
- **Reporting Bugs**: If you encounter a bug, please open an issue and provide detailed information about the bug, including steps to reproduce it.
209-
- **Suggesting Features**: We encourage you to suggest new features or improvements by opening an issue and describing your idea.
210-
- **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.
231+
- **Reporting Bugs**: If you encounter a bug, please open an issue and provide detailed information
232+
about the bug, including steps to reproduce it.
233+
- **Suggesting Features**: We encourage you to suggest new features or improvements by opening an
234+
issue and describing your idea.
235+
- **Submitting Pull Requests**: If you'd like to contribute code, please fork the repository, create
236+
a new branch for your changes, and submit a pull request with a clear description of the changes.
211237

212238
## Support Us:
213-
- We need your support for doing more open source contributions.
239+
240+
- We need your support for doing more open source contributions.
214241

215242
## Code of Conduct
216-
We expect all contributors and users of the Alert-KMP Library Project to adhere to our code of conduct. Please review the [Code of Conduct](CODE_OF_CONDUCT.md) for details on expected behavior and reporting procedures.
243+
244+
We expect all contributors and users of the Alert-KMP Library Project to adhere to our code of
245+
conduct. Please review the [Code of Conduct](CODE_OF_CONDUCT.md) for details on expected behavior
246+
and reporting procedures.

mediaplayer-kmp/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ mavenPublishing {
111111
coordinates(
112112
groupId = "io.github.khubaibkhan4",
113113
artifactId = "mediaplayer-kmp",
114-
version = "2.0.5"
114+
version = "2.0.6"
115115
)
116116

117117
pom {

0 commit comments

Comments
 (0)