Skip to content

Commit a9c3c52

Browse files
committed
Updated pub version
1 parent 9fceda9 commit a9c3c52

File tree

4 files changed

+77
-82
lines changed

4 files changed

+77
-82
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ migrate_working_dir/
2323

2424
# Flutter/Dart/Pub related
2525
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26-
/pubspec.lock
2726
**/doc/api/
2827
.dart_tool/
2928
build/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,10 @@ Fixed bugs, reorganized code and improved documentation.
6767
# 2.0.3
6868

6969
* Bugfixes for Android 14+
70+
71+
# 3.0.0
72+
73+
* Completely Rewritten from scratch with backward compatibility in-mind
74+
* Now supports album arts in both iOS and Android platforms
75+
* Better support for platform native companion playbacks like watchOS, wearOS, CarPlay and Android Auto
76+
* Multiple bugfixes and enhancements from previous versions

README.md

Lines changed: 68 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,110 @@
11
![logo](flutter_radio_player_logo.png)
22

3-
# flutter_radio_player
3+
# Flutter Radio Player
44

55
![Pub Version](https://img.shields.io/pub/v/flutter_radio_player?style=plastic)
66
![Pub Likes](https://img.shields.io/pub/likes/flutter_radio_player)
77
![Pub Points](https://img.shields.io/pub/points/flutter_radio_player)
88
![Pub Popularity](https://img.shields.io/pub/popularity/flutter_radio_player)
99

10-
The only player if you need to play one streaming URL at a time. Flutter Radio Player supports playing a single source
11-
precisely. By default, plugin supports background music playing by default. No additional configurations needed.
12-
Flutter radio player effortlessly integrates with platform native media controls enabling lock screen controling
13-
of the playing media as well <strong>integrates with iOS watchOS, CarPlay and Android's WearOS, Android Auto without any
14-
configuration </strong>
15-
all with the help of Flutter Radio Player's native platform integrations.
10+
**Flutter Radio Player** is the go-to plugin for playing a single streaming URL effortlessly. With support for background music playback right out of the box, it offers seamless integration with platform-native media controls. Whether it's lock screen media controls or deeper integrations like watchOS, CarPlay, WearOS, or Android Auto, Flutter Radio Player handles it all with no extra configuration needed.
1611

1712
## Features
1813

19-
* Supports background playing with zero configurations out of the box
20-
* Integrates with platform native watch interfaces like WatchOs and WearOs
21-
* Integrates well with platform native AutoMotive infotainment system such as Apple CarPlay and Android Auto
22-
* Reactive by default
23-
* Extracts Icy / Meta data from streams (if available)
14+
- **Background Playback**: Plays audio in the background without any configuration.
15+
- **Watch Integration**: Seamlessly integrates with WatchOS and WearOS for native watch control.
16+
- **Automotive Systems**: Supports infotainment systems like Apple CarPlay and Android Auto.
17+
- **Reactive by Default**: Automatically reacts to stream changes.
18+
- **ICY/Metadata Extraction**: Extracts stream metadata if available.
2419

25-
### Getting Started with Flutter Radio Player
20+
## Getting Started
2621

27-
1. Install the player
22+
### 1. Install the Player
2823

2924
```bash
3025
flutter pub add flutter_radio_player
3126
```
3227

33-
2. Import the library
28+
### 2. Import the Library
3429

3530
```dart
3631
import 'package:flutter_radio_player/flutter_radio_player.dart';
3732
```
3833

39-
3. Configuring the player
34+
### 3. Configure the Player
4035

36+
```dart
37+
final _flutterRadioPlayerPlugin = FlutterRadioPlayer(); // Create an instance of the player
38+
_flutterRadioPlayerPlugin.initialize(
39+
[
40+
{"url": "https://s2-webradio.antenne.de/chillout?icy=https"},
41+
{
42+
"title": "SunFM - Sri Lanka",
43+
"artwork": "images/sample-cover.jpg", // Image needs to be bundled with the app
44+
"url": "https://radio.lotustechnologieslk.net:2020/stream/sunfmgarden?icy=https",
45+
},
46+
{"url": "http://stream.riverradio.com:8000/wcvofm.aac"}
47+
],
48+
true, // Auto play on load
49+
);
4150
```
42-
final _flutterRadioPlayerPlugin = FlutterRadioPlayer(); // create an instance of the player
43-
_flutterRadioPlayerPlugin.initialize(
44-
[
45-
{
46-
"url": "https://s2-webradio.antenne.de/chillout?icy=https",
47-
},
48-
{
49-
"title": "SunFM - Sri Lanka",
50-
"artwork": "images/sample-cover.jpg", // needs be bundled with the app
51-
"url":
52-
"https://radio.lotustechnologieslk.net:2020/stream/sunfmgarden?icy=https",
53-
},
54-
{
55-
"url": "http://stream.riverradio.com:8000/wcvofm.aac"
56-
}
57-
],
58-
true, // auto play on load
59-
);
60-
```
6151

62-
once you have the basic player setup you are ready to stream music
52+
Once configured, your player is ready to stream music.
53+
54+
### Manipulating the Player
6355

64-
### Manipulating the player
56+
You can control the player using the following methods:
6557

66-
To manipulate the player, you have below methods available
58+
| Method | Action |
59+
|------------------------|------------------------------------------------------------|
60+
| `play()` | Plays the audio from the current source |
61+
| `pause()` | Pauses the audio |
62+
| `playOrPause()` | Toggles play/pause |
63+
| `changeVolume()` | Adjusts the volume |
64+
| `getVolume()` | Retrieves the current volume |
65+
| `nextSource()` | Skips to the next source in the list (if available) |
66+
| `previousSource()` | Goes to the previous source |
67+
| `jumpToSourceIndex()` | Jumps to a specific index in the sources list |
6768

68-
#### Available methods list
69+
### Available Streams
6970

70-
| Method | Action |
71-
|------------------------|-------------------------------------------------------------|
72-
| play() | Plays the audio item in the queue |
73-
| pause() | Pauses the audio |
74-
| playOrPause() | Toggle the player playback |
75-
| changeVolume() | Change the volume in the player instance |
76-
| getVolume() | Get the current volume |
77-
| nextSource() | Advance to the next audio source in the list (if available) |
78-
| previousSource() | Previous audio source |
79-
| jumpToSourceIndex(int) | Jumps to the provided index from the sources array |
71+
You can also listen to various streams:
8072

81-
#### Available streams list
73+
| Stream | Returns | Description |
74+
|-----------------------------------|-------------------------------------|------------------------------------------------------|
75+
| `getIsPlayingStream()` | `Stream<bool>` | Emits playback status |
76+
| `getNowPlayingStream()` | `Stream<NowPlayingDataChanged>` | Emits metadata such as track name |
77+
| `getDeviceVolumeChangedStream()` | `Stream<double>` | Emits device audio level updates |
8278

83-
| Method | Returns | Action |
84-
|--------------------------------|-------------------------------------|------------------------------------------------------|
85-
| getIsPlayingStream() | stream of boolean | Returns the playback status as stream |
86-
| getNowPlayingStream() | stream NowPlayingDataChanged Object | Return the now playing source ICY or Meta track name |
87-
| getDeviceVolumeChangedStream() | stream of float | Device audio level stepper values |
79+
## Platform Configuration
8880

89-
### Platform Configurations
81+
### iOS
9082

91-
- iOS
92-
For iOS, You have to enable background capabilities like shown in the below image
93-
![xcode image](enabling-xcode-bg-service.png)
83+
To enable background playback, configure background capabilities in Xcode as shown below:
9484

85+
![Xcode Configuration](enabling-xcode-bg-service.png)
9586

96-
- Android
97-
For newer android, add below permissions to play audio in background in `AndroidManifest.xml`. This is already added
98-
to library
99-
```xml
100-
<uses-permission android:name="android.permission.INTERNET" />
101-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
102-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
103-
```
87+
### Android
88+
89+
For Android, ensure the following permissions are added to your `AndroidManifest.xml`:
90+
91+
```xml
92+
<uses-permission android:name="android.permission.INTERNET" />
93+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
94+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
95+
```
10496

105-
**Be sure to check out the [Flutter Radio Player Example](/example) to get an idea of how to use action methods and
106-
streams to create a simple yet powerful player**
97+
> These permissions are already included in the library.
10798
108-
## Support this plugin
99+
**Check out the [Flutter Radio Player Example](/example)** to see how to implement action methods and streams in your player.
109100

110-
Please hit a like to plugin on pub if you used it and love it. put a ⭐️ my
111-
GitHub [repo](https://github.com/Sithira/FlutterRadioPlayer) and show me some ♥️ so i can keep working on this.
101+
## Support the Plugin
112102

113-
and last but not least, ONLY if you think this was worth it and saved you time here is my USDT-TR20 address so you can
114-
buy me a coffee ☕️
103+
If you find this plugin useful, show your support by:
115104

116-
``
117-
TNuTkL1ZJGu2xntmtzHzSiH5YdVqUeAujr
118-
``
105+
- Giving it a ⭐️ on [GitHub](https://github.com/Sithira/FlutterRadioPlayer)
106+
- Leaving a like on Pub
107+
- Showing some ♥️ and buying me a coffee via USDT-TR20 at this address: `TNuTkL1ZJGu2xntmtzHzSiH5YdVqUeAujr`
119108

120-
**ENJOY THE PLUGIN** <br />
121-
Sithira ✌️
109+
**Enjoy the plugin!**
110+
Sithira ✌️

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_radio_player
22
description: "Online Radio Player for Flutter which enable to play streaming URL. Supports Android and iOS as well as WearOs and watchOs"
3-
version: 0.0.1
4-
homepage:
3+
version: 3.0.0
4+
homepage: https://github.com/Sithira/FlutterRadioPlayer
55

66
environment:
77
sdk: '>=3.4.3 <4.0.0'

0 commit comments

Comments
 (0)