You can follow and see git hub repository.
Please rate/start and contribute if find it helpful.
import package:
import 'package:az_player_plugin/az_player_plugin.dart' as AZPlayerPlugin;
var file = AZPlayerPlugin.File( 0, "http://dl11.f2m.co/trailer/Crawl.2019.360p.Trailer.Film2Movie_WS.mp4", "title", 0, AZPlayerPlugin.FileStatus.ready, "https://cdn.aparnik.com/static/website/img/logo-persian.png", );
- Add one file:
AZPlayerPlugin.AzPlayerPlugin().addFileToPlayList(file);
- Add multi file:
AZPlayerPlugin.AzPlayerPlugin().addFilesToPlayList([file]);
Note: file/files append together in playlist.
- play :
AZPlayerPlugin.AzPlayerPlugin().play();
or
AZPlayerPlugin.AzPlayerPlugin().AZPlayerPlugin.AzPlayerPlugin().playWithFile(file);
- pause:
AZPlayerPlugin.AzPlayerPlugin().pause();
- get total time of file is playing:
AZPlayerPlugin.AzPlayerPlugin().duration;
- get time left:
AZPlayerPlugin.AzPlayerPlugin().secondsLeft;
- get current time:
AZPlayerPlugin.AzPlayerPlugin().currentTime;
- file is playing?
AZPlayerPlugin.AzPlayerPlugin().isPlaying;
- get player view to attach your custom view:
AZPlayerPlugin.AzPlayerPlugin().getPlayerView(width: 300, height: 100);
or
AZPlayerPlugin.AzPlayerPlugin().getPlayerView();
- stop:
AZPlayerPlugin.AzPlayerPlugin().stop();
- fastForward, current time +15 seconds:
AZPlayerPlugin.AzPlayerPlugin().fastForward();
- fastBackward, current time - 5 seconds:
AZPlayerPlugin.AzPlayerPlugin().fastForward();
- emptyPlayList, command for delete all files in playlist:
AZPlayerPlugin.AzPlayerPlugin().emptyPlayList();
- removeFromPlayList, remove special file from playlist:
AZPlayerPlugin.AzPlayerPlugin().removeFromPlayList(file);
- next track:
AZPlayerPlugin.AzPlayerPlugin().next();
- previous track:
AZPlayerPlugin.AzPlayerPlugin().previous();
- change time to special second:
AZPlayerPlugin.AzPlayerPlugin().changeTime(17);
You must read every one seconds to update your player, like (slider, timer and etc to update time).