0 purchases
bottom navbar player
Bottom NavBar Player #
A Flutter plugin to play audio and video in BottomNavigationBar and bottomSheet with file, web and asset playback capabilities.
Simply play Audio and Video in different input methods in the list or anywhere else.
Android
iOS
Web
Support
SDK 16+
11.0+
Any*
Preview #
Getting Started #
In order to use this package, do import
import 'package:bottom_navbar_player/bottom_navbar_player.dart';
copied to clipboard
First, create an instance of the class:
final bottomNavBarPlayer = BottomNavBarPlayer();
copied to clipboard
Set the player widget for BottomNavigationBar or bottomSheet scaffold:
Scaffold(
bottomSheet: bottomNavBarPlayer.view(),
),
copied to clipboard
Video player
To play the Video from the URL , Asset and File proceed as follows:
MaterialButton(
onPressed: () => bottomNavBarPlayer.play(
/// [url]
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
/// [Assest] 'assets/bee.mp4' ,
/// [File] '/storage/sdcard/Download/bee.mp4' ,
sourceType: SourceType.url,///or [assest] SourceType.asset ,[File] SourceType.file
playerSize: PlayerSize.max, ///or [min] PlayerSize.min
mediaType: MediaType.video,
),
child: const Text('from URL'),
),
copied to clipboard
Audio player
To play the Audio from the URL , Asset and File proceed as follows:
MaterialButton(
onPressed: () => bottomNavBarPlayer.play(
/// [url]
'https://download.samplelib.com/mp3/sample-9s.mp3',
/// [Assest] 'assets/audio.mp3' ,
/// [File] '/storage/sdcard/Download/audio_file.mp3' ,
sourceType: SourceType.url,///or [Assest] SourceType.asset ,[File] SourceType.file
playerSize: PlayerSize.max, ///or [min] PlayerSize.min
mediaType: MediaType.audio
),
child: const Text('from URL'),
)
copied to clipboard
Permissions and configuration #
Android
If you use an internet URL:
<uses-permission android:name="android.permission.INTERNET"/>
copied to clipboard
If you use the File:
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE"/>
<!-- or -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
copied to clipboard
If you wish to connect to non-HTTPS URLS, or if you use a feature that depends on the proxy such as headers, caching or stream audio sources, also add the following attribute to the application element:
<application ... android:usesCleartextTraffic="true">
copied to clipboard
iOS
If you wish to connect to non-HTTPS URLS, or if you use a feature that depends on the proxy such as headers, caching or stream audio sources, add the following to your Info.plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
copied to clipboard
License #
MIT
About #
Built with <3
by Mostafa Efafi
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.