play 0.0.14 play: ^0.0.14 copied to clipboard
a library dart simple for play audio or video any format on cross platform.
Play library #
Fast, Enjoyable & Customizable Play library
Play Library untuk memutar video dan audio cross platform dengan mudah hanya menambah code pada dart, example sudah ada di
Features #
- 🚀 Cross platform: mobile, desktop
- ⚡ Great performance
- ❤️ Simple, powerful, & intuitive API
Demo #
Install Library #
dart pub add play
flutter pub add play
To-Do #
- Cross platform support (Android,iOS,Linux, Windows)
- Easy Play Video and Audio
- Custom View Audio And Video
- Realtime Player Like (call, streaming)
- Custom Encoding & Decoding Audio & Video
Quickstart #
add this in main function
void main() async {
---
await playInitialize();
---
}
Audio Player
Scaffold(
---
Audio(
audioData: AudioData.file(
file: File(path),
),
isAutoStart: false,
audioViewBuilder: (BuildContext context, Widget child, Audio audio, AudioState audioState) {
return child;
}
);
---
)
Video Player
Scaffold(
---
Video(
videoData: VideoData.file(
file: File(path),
),
isAutoStart: false,
videoViewBuilder: (BuildContext context, Widget child, Video video, VideoState videoState) {
return child;
}
);
---
)
Docs #
I use 3 libraries so your document can be seen here
Audio #
Documentation audio
- AudioData
- file
AudioData.file( file: File("./path_to_audio.mp3"), )
- asset
AudioData.asset( asset: "assets/audio/audio.mp3", )
- network
AudioData.network( url: "https://example.com/example.mp3", )
Video #
Documentation video
Scaffold(
child: Video(
videoData: VideoData.file(
file: File(path),
),
isAutoStart: false,
videoViewBuilder: (BuildContext context, Widget child, Video video, VideoState videoState) {
/// custom view
return child;
}
);
)
- videoData
- file
VideoData.file( file: File("./path_to_video.mp4"), )
- asset
VideoData.asset( asset: "assets/videos/video.mp4", )
- network
VideoData.network( url: "https://example.com/example.mp4", )
-
isAutoStart
true
if you want auto play set data to truefalse
if you don't want auto play set data to true
-
videoViewBuilder