Change for audioplayer version of kplayer
|
@ -0,0 +1 @@
|
||||||
|
{}
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
BIN
assets/test.webm
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 137 KiB |
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.4 KiB |
|
@ -4,12 +4,12 @@ import 'package:fipy/screens/home.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:kplayer/kplayer.dart';
|
import 'package:kplayer/kplayer.dart';
|
||||||
// import 'package:kplayer_with_audioplayers/kplayer_with_audioplayers.dart' as kp;
|
import 'package:kplayer_with_audioplayers/kplayer_with_audioplayers.dart' as kp;
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
Player.boot();
|
Player.boot();
|
||||||
// kp.Player.boot();
|
kp.Player.boot();
|
||||||
runApp(const FipyApp());
|
runApp(const FipyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// ignore_for_file: avoid_print
|
// ignore_for_file: avoid_print
|
||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:ffmpeg_cli/ffmpeg_cli.dart';
|
|
||||||
import 'package:fipy/globals.dart';
|
import 'package:fipy/globals.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:universal_io/io.dart';
|
import 'package:universal_io/io.dart';
|
||||||
|
@ -13,11 +12,14 @@ import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
||||||
import 'package:fipy/providers/player.dart';
|
import 'package:fipy/providers/player.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
// import 'package:kplayer_with_audioplayers/kplayer_with_audioplayers.dart' as kp;
|
import 'package:audioplayers/audioplayers.dart';
|
||||||
|
import 'package:kplayer_with_audioplayers/kplayer_with_audioplayers.dart' as kp;
|
||||||
|
|
||||||
class HomeProvider with ChangeNotifier {
|
class HomeProvider with ChangeNotifier {
|
||||||
Track? currentTrack;
|
Track? currentTrack;
|
||||||
PlayerController? player;
|
PlayerController? player;
|
||||||
|
AudioPlayer audioPlayer = AudioPlayer();
|
||||||
|
|
||||||
List<Track> trackList = [];
|
List<Track> trackList = [];
|
||||||
int trackNbr = 0;
|
int trackNbr = 0;
|
||||||
int userPageNbr = 3;
|
int userPageNbr = 3;
|
||||||
|
@ -96,13 +98,19 @@ class HomeProvider with ChangeNotifier {
|
||||||
'invidious.snopyta.org',
|
'invidious.snopyta.org',
|
||||||
'invidious.fdn.fr',
|
'invidious.fdn.fr',
|
||||||
];
|
];
|
||||||
// final media = PlayerMedia(
|
|
||||||
// type: PlayerMediaType.network,
|
// audioPlayer.stop();
|
||||||
// resource:
|
// Future.delayed(const Duration(milliseconds: 5));
|
||||||
// "https://${invidiousUrl[0]}/latest_version?id=${track.id}&itag=140&local=true&listen=1");
|
// await audioPlayer.play(DeviceFileSource(
|
||||||
// player = kp.Player(media: media);
|
// "https://${invidiousUrl[1]}/latest_version?id=${track.id}&itag=140&local=true&listen=1"));
|
||||||
player = Player.network(
|
|
||||||
"https://${invidiousUrl[0]}/latest_version?id=${track.id}&itag=140&local=true&listen=1"); // https://${invidiousUrl[0]}/embed/${track.id}?listen=1&raw=1&local=true
|
final media = PlayerMedia(
|
||||||
|
type: PlayerMediaType.network,
|
||||||
|
resource:
|
||||||
|
"https://${invidiousUrl[1]}/latest_version?id=${track.id}&itag=140&local=true&listen=1");
|
||||||
|
player = kp.Player(media: media);
|
||||||
|
// player = Player.network(
|
||||||
|
// "https://${invidiousUrl[0]}/latest_version?id=${track.id}&itag=140&local=true&listen=1"); // https://${invidiousUrl[0]}/embed/${track.id}?listen=1&raw=1&local=true
|
||||||
player!.init();
|
player!.init();
|
||||||
print(player!.media.resource);
|
print(player!.media.resource);
|
||||||
|
|
||||||
|
@ -120,9 +128,13 @@ class HomeProvider with ChangeNotifier {
|
||||||
currentTrack!.duration = player!.duration;
|
currentTrack!.duration = player!.duration;
|
||||||
playerProvider.reload();
|
playerProvider.reload();
|
||||||
}
|
}
|
||||||
if (event.name == 'status' && player!.position == player!.duration) {
|
if (event.name == 'end' &&
|
||||||
|
currentTrack == track &&
|
||||||
|
(currentTrack!.duration!.inSeconds - player!.position.inSeconds <=
|
||||||
|
1)) {
|
||||||
var nextTrack = trackList
|
var nextTrack = trackList
|
||||||
.firstWhere((element) => element.number == track.number + 1);
|
.firstWhere((element) => element.number == track.number + 1);
|
||||||
|
currentTrack = nextTrack;
|
||||||
playTrack(context, nextTrack);
|
playTrack(context, nextTrack);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -208,27 +220,27 @@ class DownloadProvider with ChangeNotifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future convertToMp3(String audioFile) async {
|
// Future convertToMp3(String audioFile) async {
|
||||||
audioFile = 'E:\\Téléchargements/test.webm';
|
// audioFile = 'E:\\Téléchargements/test.webm';
|
||||||
final command = FfmpegCommand(
|
// final command = FfmpegCommand(
|
||||||
inputs: [FfmpegInput.asset(audioFile)],
|
// inputs: [FfmpegInput.asset(audioFile)],
|
||||||
args: [
|
// args: [
|
||||||
// CliArg(name: 'i', value: audioFile),
|
// // CliArg(name: 'i', value: audioFile),
|
||||||
const CliArg(name: 'ab', value: '320'),
|
// const CliArg(name: 'ab', value: '320'),
|
||||||
const CliArg(name: 'ar', value: '44100'),
|
// const CliArg(name: 'ar', value: '44100'),
|
||||||
],
|
// ],
|
||||||
filterGraph: const FilterGraph(
|
// filterGraph: const FilterGraph(
|
||||||
chains: [
|
// chains: [
|
||||||
FilterChain(
|
// FilterChain(
|
||||||
inputs: [],
|
// inputs: [],
|
||||||
filters: [],
|
// filters: [],
|
||||||
outputs: [],
|
// outputs: [],
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
outputFilepath: "E:\\Téléchargements/test.mp3",
|
// outputFilepath: "E:\\Téléchargements/test.mp3",
|
||||||
);
|
// );
|
||||||
|
|
||||||
// Execute command
|
// // Execute command
|
||||||
await Ffmpeg().run(command);
|
// await Ffmpeg().run(command);
|
||||||
}
|
// }
|
||||||
|
|
|
@ -5,6 +5,7 @@ import 'package:fipy/models/track.dart';
|
||||||
import 'package:fipy/providers/home.dart';
|
import 'package:fipy/providers/home.dart';
|
||||||
import 'package:fipy/providers/player.dart';
|
import 'package:fipy/providers/player.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:miniplayer/miniplayer.dart';
|
import 'package:miniplayer/miniplayer.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
|
||||||
|
@ -24,83 +25,74 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
HomeProvider hp = Provider.of<HomeProvider>(context, listen: false);
|
HomeProvider hp = Provider.of<HomeProvider>(context, listen: false);
|
||||||
final MiniplayerController controller = MiniplayerController();
|
final MiniplayerController controller = MiniplayerController();
|
||||||
|
|
||||||
return Stack(
|
return RawKeyboardListener(
|
||||||
children: <Widget>[
|
autofocus: true,
|
||||||
Scaffold(
|
focusNode: FocusNode(),
|
||||||
body: RawScrollbar(
|
onKey: (RawKeyEvent event) {
|
||||||
thumbColor: Colors.grey[600],
|
if (event.runtimeType == RawKeyDownEvent &&
|
||||||
radius: const Radius.circular(20),
|
event.data.logicalKey.keyId == 32) //Enter Key ID from keyboard
|
||||||
thickness: 12,
|
{
|
||||||
// thumbVisibility: true,
|
print('tata');
|
||||||
mainAxisMargin: 70,
|
hp.player?.playing ?? false ? hp.player?.pause() : hp.player?.play();
|
||||||
child: SingleChildScrollView(
|
}
|
||||||
child: Column(
|
},
|
||||||
children: <Widget>[
|
child: Stack(
|
||||||
Container(
|
children: <Widget>[
|
||||||
color: Colors.grey[900],
|
Scaffold(
|
||||||
height: 50,
|
body: RawScrollbar(
|
||||||
child: Row(
|
thumbColor: Colors.grey[600],
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
radius: const Radius.circular(20),
|
||||||
children: [
|
thickness: 12,
|
||||||
DropdownButton(
|
// thumbVisibility: true,
|
||||||
dropdownColor: Colors.grey[900],
|
mainAxisMargin: 70,
|
||||||
value: radio,
|
child: SingleChildScrollView(
|
||||||
style: TextStyle(
|
child: Column(
|
||||||
fontSize: 15, color: Colors.grey[300]),
|
children: <Widget>[
|
||||||
underline: const SizedBox(),
|
Container(
|
||||||
iconSize: 22,
|
color: Colors.grey[900],
|
||||||
onChanged: (String? newRadio) {
|
height: 50,
|
||||||
setState(() {
|
child: Row(
|
||||||
radio = newRadio!;
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
});
|
children: [
|
||||||
},
|
DropdownButton(
|
||||||
items: hp.radioList),
|
dropdownColor: Colors.grey[900],
|
||||||
const SizedBox(width: 50),
|
value: radio,
|
||||||
DropdownButton(
|
style: TextStyle(
|
||||||
dropdownColor: Colors.grey[900],
|
fontSize: 15, color: Colors.grey[300]),
|
||||||
value: hp.userPageNbr.toString(),
|
underline: const SizedBox(),
|
||||||
style: TextStyle(
|
iconSize: 22,
|
||||||
fontSize: 15, color: Colors.grey[300]),
|
onChanged: (String? newRadio) {
|
||||||
underline: const SizedBox(),
|
setState(() {
|
||||||
iconSize: 22,
|
radio = newRadio!;
|
||||||
onChanged: (String? newPageNumber) {
|
});
|
||||||
setState(() {
|
},
|
||||||
hp.userPageNbr = int.parse(newPageNumber!);
|
items: hp.radioList),
|
||||||
});
|
const SizedBox(width: 50),
|
||||||
},
|
DropdownButton(
|
||||||
items: hp.pageList),
|
dropdownColor: Colors.grey[900],
|
||||||
]),
|
value: hp.userPageNbr.toString(),
|
||||||
),
|
style: TextStyle(
|
||||||
FutureBuilder<List<Track>>(
|
fontSize: 15, color: Colors.grey[300]),
|
||||||
future: hp.getTracks(radio),
|
underline: const SizedBox(),
|
||||||
builder: (
|
iconSize: 22,
|
||||||
BuildContext context,
|
onChanged: (String? newPageNumber) {
|
||||||
AsyncSnapshot<List<Track>> snapshot,
|
setState(() {
|
||||||
) {
|
hp.userPageNbr =
|
||||||
print(snapshot.connectionState);
|
int.parse(newPageNumber!);
|
||||||
if (snapshot.connectionState ==
|
});
|
||||||
ConnectionState.waiting) {
|
},
|
||||||
return Stack(children: [
|
items: hp.pageList),
|
||||||
Container(
|
]),
|
||||||
height: 10000,
|
),
|
||||||
width: 10000,
|
FutureBuilder<List<Track>>(
|
||||||
color: const Color(0xFF121212)),
|
future: hp.getTracks(radio),
|
||||||
Center(
|
builder: (
|
||||||
child: Column(children: [
|
BuildContext context,
|
||||||
const SizedBox(height: 20),
|
AsyncSnapshot<List<Track>> snapshot,
|
||||||
SizedBox(
|
) {
|
||||||
height: 30,
|
print(snapshot.connectionState);
|
||||||
width: 30,
|
if (snapshot.connectionState ==
|
||||||
child: CircularProgressIndicator(
|
ConnectionState.waiting) {
|
||||||
color: Colors.amber[100],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else if (snapshot.connectionState ==
|
|
||||||
ConnectionState.done) {
|
|
||||||
if (snapshot.hasError) {
|
|
||||||
return Stack(children: [
|
return Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
height: 10000,
|
height: 10000,
|
||||||
|
@ -109,251 +101,277 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
Center(
|
Center(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Text(
|
SizedBox(
|
||||||
'Error: ' + snapshot.error.toString(),
|
height: 30,
|
||||||
style: TextStyle(color: Colors.grey[500]),
|
width: 30,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: Colors.amber[100],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
} else if (snapshot.hasData) {
|
} else if (snapshot.connectionState ==
|
||||||
return Table(
|
ConnectionState.done) {
|
||||||
columnWidths: {
|
if (snapshot.hasError) {
|
||||||
0: const FlexColumnWidth(4),
|
return Stack(children: [
|
||||||
1: const FlexColumnWidth(2),
|
Container(
|
||||||
2: const FlexColumnWidth(1),
|
height: 10000,
|
||||||
},
|
width: 10000,
|
||||||
defaultVerticalAlignment:
|
color: const Color(0xFF121212)),
|
||||||
TableCellVerticalAlignment.middle,
|
Center(
|
||||||
children: snapshot.data!
|
child: Column(children: [
|
||||||
.map((item) => _buildTableRow(item, context))
|
const SizedBox(height: 20),
|
||||||
.toList()
|
Text(
|
||||||
..insert(
|
'Error: ' + snapshot.error.toString(),
|
||||||
0,
|
style: TextStyle(color: Colors.grey[500]),
|
||||||
_buildTableRow(
|
),
|
||||||
Track(
|
]),
|
||||||
number: -1,
|
|
||||||
title: 'TITRE',
|
|
||||||
artiste: 'ARTISTE',
|
|
||||||
album: 'ALBUM',
|
|
||||||
id: 'URL'),
|
|
||||||
context),
|
|
||||||
),
|
),
|
||||||
);
|
]);
|
||||||
|
} else if (snapshot.hasData) {
|
||||||
|
return Table(
|
||||||
|
columnWidths: {
|
||||||
|
0: const FlexColumnWidth(4),
|
||||||
|
1: const FlexColumnWidth(2),
|
||||||
|
2: const FlexColumnWidth(1),
|
||||||
|
},
|
||||||
|
defaultVerticalAlignment:
|
||||||
|
TableCellVerticalAlignment.middle,
|
||||||
|
children: snapshot.data!
|
||||||
|
.map(
|
||||||
|
(item) => _buildTableRow(item, context))
|
||||||
|
.toList()
|
||||||
|
..insert(
|
||||||
|
0,
|
||||||
|
_buildTableRow(
|
||||||
|
Track(
|
||||||
|
number: -1,
|
||||||
|
title: 'TITRE',
|
||||||
|
artiste: 'ARTISTE',
|
||||||
|
album: 'ALBUM',
|
||||||
|
id: 'URL'),
|
||||||
|
context),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const Text('Empty data');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return const Text('Empty data');
|
return Text('State: ${snapshot.connectionState}');
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return Text('State: ${snapshot.connectionState}');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 70)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
Consumer<PlayerProvider>(builder: (context, playerProvider, _) {
|
|
||||||
TextEditingController trackTitle = TextEditingController();
|
|
||||||
TextEditingController trackArtiste = TextEditingController();
|
|
||||||
trackTitle.text = hp.currentTrack?.title ?? '';
|
|
||||||
trackArtiste.text = hp.currentTrack?.artiste ?? '';
|
|
||||||
return Miniplayer(
|
|
||||||
controller: controller,
|
|
||||||
backgroundColor: Colors.grey[900]!,
|
|
||||||
minHeight: 70,
|
|
||||||
maxHeight: 70,
|
|
||||||
builder: (height, percentage) {
|
|
||||||
return Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
hp.currentTrack?.imageUrl != '' &&
|
|
||||||
hp.currentTrack?.imageUrl != null
|
|
||||||
? Image.network(
|
|
||||||
hp.currentTrack!.imageUrl!,
|
|
||||||
width: 70,
|
|
||||||
)
|
|
||||||
: const SizedBox(width: 70),
|
|
||||||
Expanded(
|
|
||||||
child: Column(children: [
|
|
||||||
SizedBox(
|
|
||||||
height: 20,
|
|
||||||
child: TextField(
|
|
||||||
enabled: false,
|
|
||||||
maxLines: 1,
|
|
||||||
controller: trackTitle,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsets.only(left: 15),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.grey[300],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 20,
|
|
||||||
child: TextField(
|
|
||||||
enabled: false,
|
|
||||||
maxLines: 1,
|
|
||||||
controller: trackArtiste,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsets.only(left: 15),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: Colors.grey[500],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
Column(children: [
|
|
||||||
const Spacer(),
|
|
||||||
Row(children: [
|
|
||||||
const SizedBox(width: 70),
|
|
||||||
Column(children: [
|
|
||||||
IconButton(
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
icon: Icon(Icons.skip_previous,
|
|
||||||
color: Colors.grey[500], size: 32),
|
|
||||||
onPressed: () {
|
|
||||||
if (hp.currentTrack != null &&
|
|
||||||
hp.currentTrack!.number > 1) {
|
|
||||||
hp.currentTrack = hp.trackList.firstWhere(
|
|
||||||
(element) =>
|
|
||||||
element.number ==
|
|
||||||
hp.currentTrack!.number - 1);
|
|
||||||
hp.playTrack(context, hp.currentTrack!);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
const SizedBox(width: 1),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
hp.player?.playing ?? false
|
|
||||||
? hp.player?.pause()
|
|
||||||
: hp.player?.play();
|
|
||||||
playerProvider.reload();
|
|
||||||
},
|
},
|
||||||
child: Icon(
|
),
|
||||||
|
const SizedBox(height: 70)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Consumer<PlayerProvider>(builder: (context, playerProvider, _) {
|
||||||
|
TextEditingController trackTitle = TextEditingController();
|
||||||
|
TextEditingController trackArtiste = TextEditingController();
|
||||||
|
trackTitle.text = hp.currentTrack?.title ?? '';
|
||||||
|
trackArtiste.text = hp.currentTrack?.artiste ?? '';
|
||||||
|
return Miniplayer(
|
||||||
|
controller: controller,
|
||||||
|
backgroundColor: Colors.grey[900]!,
|
||||||
|
minHeight: 70,
|
||||||
|
maxHeight: 70,
|
||||||
|
builder: (height, percentage) {
|
||||||
|
return Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
hp.currentTrack?.imageUrl != '' &&
|
||||||
|
hp.currentTrack?.imageUrl != null
|
||||||
|
? Image.network(
|
||||||
|
hp.currentTrack!.imageUrl!,
|
||||||
|
width: 70,
|
||||||
|
)
|
||||||
|
: const SizedBox(width: 70),
|
||||||
|
Expanded(
|
||||||
|
child: Column(children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
child: TextField(
|
||||||
|
enabled: false,
|
||||||
|
maxLines: 1,
|
||||||
|
controller: trackTitle,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
contentPadding: EdgeInsets.only(left: 15),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: Colors.grey[300],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
child: TextField(
|
||||||
|
enabled: false,
|
||||||
|
maxLines: 1,
|
||||||
|
controller: trackArtiste,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
contentPadding: EdgeInsets.only(left: 15),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
Column(children: [
|
||||||
|
const Spacer(),
|
||||||
|
Row(children: [
|
||||||
|
const SizedBox(width: 70),
|
||||||
|
Column(children: [
|
||||||
|
IconButton(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
icon: Icon(Icons.skip_previous,
|
||||||
|
color: Colors.grey[500], size: 32),
|
||||||
|
onPressed: () {
|
||||||
|
if (hp.currentTrack != null &&
|
||||||
|
hp.currentTrack!.number > 1) {
|
||||||
|
hp.currentTrack = hp.trackList.firstWhere(
|
||||||
|
(element) =>
|
||||||
|
element.number ==
|
||||||
|
hp.currentTrack!.number - 1);
|
||||||
|
hp.playTrack(context, hp.currentTrack!);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
const SizedBox(width: 1),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
hp.player?.playing ?? false
|
hp.player?.playing ?? false
|
||||||
? Icons.pause
|
? hp.player?.pause()
|
||||||
: Icons.play_arrow,
|
: hp.player?.play();
|
||||||
color: Colors.grey[900],
|
// playerProvider.reload();
|
||||||
size: 30),
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
child: Icon(
|
||||||
shape: const CircleBorder(),
|
hp.player?.playing ?? false
|
||||||
padding: const EdgeInsets.all(12),
|
? Icons.pause
|
||||||
primary: Colors.grey[300],
|
: Icons.play_arrow,
|
||||||
onPrimary: Colors.grey[900],
|
color: Colors.grey[900],
|
||||||
),
|
size: 30),
|
||||||
),
|
style: ElevatedButton.styleFrom(
|
||||||
Column(children: [
|
shape: const CircleBorder(),
|
||||||
IconButton(
|
padding: const EdgeInsets.all(12),
|
||||||
padding: const EdgeInsets.all(0),
|
primary: Colors.grey[300],
|
||||||
icon: Icon(Icons.skip_next,
|
onPrimary: Colors.grey[900],
|
||||||
color: Colors.grey[500], size: 32),
|
|
||||||
onPressed: () {
|
|
||||||
if (hp.currentTrack != null &&
|
|
||||||
hp.currentTrack!.number <
|
|
||||||
hp.trackList.last.number) {
|
|
||||||
hp.currentTrack = hp.trackList.firstWhere(
|
|
||||||
(element) =>
|
|
||||||
element.number ==
|
|
||||||
hp.currentTrack!.number + 1);
|
|
||||||
hp.playTrack(context, hp.currentTrack!);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
// const SizedBox(height: 7),
|
|
||||||
]),
|
|
||||||
]),
|
|
||||||
const Spacer(),
|
|
||||||
Row(children: [
|
|
||||||
const SizedBox(width: 70),
|
|
||||||
Text(
|
|
||||||
timeFormat(
|
|
||||||
hp.player?.position ?? const Duration(seconds: 0)),
|
|
||||||
style: TextStyle(color: Colors.grey[500], fontSize: 12),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
SliderTheme(
|
|
||||||
data: const SliderThemeData(
|
|
||||||
thumbShape:
|
|
||||||
RoundSliderThumbShape(enabledThumbRadius: 2),
|
|
||||||
overlayShape:
|
|
||||||
RoundSliderThumbShape(enabledThumbRadius: 5),
|
|
||||||
trackHeight: 2,
|
|
||||||
),
|
|
||||||
child: SizedBox(
|
|
||||||
width: 300,
|
|
||||||
child: Slider(
|
|
||||||
value: double.parse(
|
|
||||||
hp.player?.position.inSeconds.toString() ??
|
|
||||||
'0'),
|
|
||||||
max: double.parse(
|
|
||||||
hp.player?.duration.inSeconds.toString() ??
|
|
||||||
'2000'),
|
|
||||||
onChanged: (double value) {
|
|
||||||
if (hp.player?.position != null) {
|
|
||||||
hp.player!.position =
|
|
||||||
Duration(seconds: value.toInt());
|
|
||||||
playerProvider.reload();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
activeColor: Colors.grey[400],
|
|
||||||
inactiveColor: Colors.grey[700],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Column(children: [
|
||||||
const SizedBox(width: 3),
|
IconButton(
|
||||||
Text(
|
padding: const EdgeInsets.all(0),
|
||||||
timeFormat(
|
icon: Icon(Icons.skip_next,
|
||||||
hp.player?.duration ?? const Duration(seconds: 0)),
|
color: Colors.grey[500], size: 32),
|
||||||
style: TextStyle(color: Colors.grey[500], fontSize: 12),
|
onPressed: () {
|
||||||
),
|
if (hp.currentTrack != null &&
|
||||||
|
hp.currentTrack!.number <
|
||||||
|
hp.trackList.last.number) {
|
||||||
|
hp.currentTrack = hp.trackList.firstWhere(
|
||||||
|
(element) =>
|
||||||
|
element.number ==
|
||||||
|
hp.currentTrack!.number + 1);
|
||||||
|
hp.playTrack(context, hp.currentTrack!);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
// const SizedBox(height: 7),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
const Spacer(),
|
||||||
|
Row(children: [
|
||||||
|
const SizedBox(width: 70),
|
||||||
|
Text(
|
||||||
|
timeFormat(hp.player?.position ??
|
||||||
|
const Duration(seconds: 0)),
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.grey[500], fontSize: 12),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
SliderTheme(
|
||||||
|
data: const SliderThemeData(
|
||||||
|
thumbShape:
|
||||||
|
RoundSliderThumbShape(enabledThumbRadius: 2),
|
||||||
|
overlayShape:
|
||||||
|
RoundSliderThumbShape(enabledThumbRadius: 5),
|
||||||
|
trackHeight: 2,
|
||||||
|
),
|
||||||
|
child: SizedBox(
|
||||||
|
width: 300,
|
||||||
|
child: Slider(
|
||||||
|
value: double.parse(
|
||||||
|
hp.player?.position.inSeconds.toString() ??
|
||||||
|
'0'),
|
||||||
|
max: double.parse(
|
||||||
|
hp.player?.duration.inSeconds.toString() ??
|
||||||
|
'2000'),
|
||||||
|
onChanged: (double value) {
|
||||||
|
if (hp.player?.position != null) {
|
||||||
|
hp.player!.position =
|
||||||
|
Duration(seconds: value.toInt());
|
||||||
|
playerProvider.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
activeColor: Colors.grey[400],
|
||||||
|
inactiveColor: Colors.grey[700],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
Text(
|
||||||
|
timeFormat(hp.player?.duration ??
|
||||||
|
const Duration(seconds: 0)),
|
||||||
|
style:
|
||||||
|
TextStyle(color: Colors.grey[500], fontSize: 12),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
const Spacer(),
|
||||||
]),
|
]),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
]),
|
SliderTheme(
|
||||||
const Spacer(),
|
data: const SliderThemeData(
|
||||||
SliderTheme(
|
thumbShape:
|
||||||
data: const SliderThemeData(
|
RoundSliderThumbShape(enabledThumbRadius: 7),
|
||||||
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 7),
|
overlayShape:
|
||||||
overlayShape:
|
RoundSliderThumbShape(enabledThumbRadius: 8),
|
||||||
RoundSliderThumbShape(enabledThumbRadius: 8),
|
trackHeight: 2.5,
|
||||||
trackHeight: 2.5,
|
),
|
||||||
),
|
child: SizedBox(
|
||||||
child: SizedBox(
|
width: 130,
|
||||||
width: 130,
|
child: Slider(
|
||||||
child: Slider(
|
value: hp.player?.volume ?? 1,
|
||||||
value: hp.player?.volume ?? 1,
|
max: 1,
|
||||||
max: 1,
|
onChanged: (double value) {
|
||||||
onChanged: (double value) {
|
if (hp.player?.volume != null) {
|
||||||
if (hp.player?.volume != null) {
|
hp.player!.volume = value;
|
||||||
hp.player!.volume = value;
|
playerProvider.reload();
|
||||||
playerProvider.reload();
|
}
|
||||||
}
|
},
|
||||||
},
|
activeColor: Colors.grey[400],
|
||||||
activeColor: Colors.grey[400],
|
inactiveColor: Colors.grey[700],
|
||||||
inactiveColor: Colors.grey[700],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 20)
|
||||||
const SizedBox(width: 20)
|
],
|
||||||
],
|
);
|
||||||
);
|
},
|
||||||
},
|
);
|
||||||
);
|
})
|
||||||
})
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\dart_vlc_plugin.dll
|
||||||
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\flutter_windows.dll"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\flutter_windows.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\libvlc.dll"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\libvlc.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\libvlccore.dll"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\libvlccore.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\url_launcher_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\audioplayers_windows_plugin.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\plugins\*"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "C:\Users\poka\dev\fipy\build\windows\runner\Release\plugins\*"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
139
pubspec.lock
|
@ -36,6 +36,48 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.10.0"
|
version: "0.10.0"
|
||||||
|
audioplayers:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0-rc.2"
|
||||||
|
audioplayers_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_android
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0-rc.2"
|
||||||
|
audioplayers_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_darwin
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0-rc.2"
|
||||||
|
audioplayers_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0-rc.2"
|
||||||
|
audioplayers_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_web
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0-rc.2"
|
||||||
|
audioplayers_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0-rc.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -70,7 +112,7 @@ packages:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.16.0"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -112,7 +154,7 @@ packages:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.0"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -120,13 +162,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.1.2"
|
||||||
ffmpeg_cli:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: ffmpeg_cli
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.0"
|
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -204,7 +239,7 @@ packages:
|
||||||
name: js
|
name: js
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.3"
|
version: "0.6.4"
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -247,6 +282,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.12"
|
version: "0.0.12"
|
||||||
|
kplayer_with_audioplayers:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: kplayer_with_audioplayers
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.10"
|
||||||
kplayer_with_dart_vlc:
|
kplayer_with_dart_vlc:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -268,13 +310,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.0.1"
|
||||||
logging:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: logging
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.2"
|
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -288,7 +323,7 @@ packages:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "0.1.4"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -318,7 +353,7 @@ packages:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.1"
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -421,7 +456,7 @@ packages:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.8.2"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -456,7 +491,7 @@ packages:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.8"
|
version: "0.4.9"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -471,62 +506,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.4"
|
||||||
url_launcher:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: url_launcher
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "6.1.0"
|
|
||||||
url_launcher_android:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_android
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "6.0.16"
|
|
||||||
url_launcher_ios:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_ios
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "6.0.15"
|
|
||||||
url_launcher_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_linux
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
url_launcher_macos:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_macos
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
url_launcher_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_platform_interface
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.5"
|
|
||||||
url_launcher_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_web
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.9"
|
|
||||||
url_launcher_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: url_launcher_windows
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "3.0.0"
|
|
||||||
uuid:
|
uuid:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -540,7 +519,7 @@ packages:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.2"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -577,5 +556,5 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.11.0"
|
version: "1.11.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.16.2 <3.0.0"
|
dart: ">=2.17.0-266.5.beta <3.0.0"
|
||||||
flutter: ">=2.10.0"
|
flutter: ">=2.8.1"
|
||||||
|
|
14
pubspec.yaml
|
@ -2,7 +2,7 @@ name: fipy
|
||||||
description: Advanced FIP radio track explorer
|
description: Advanced FIP radio track explorer
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 0.0.1+1
|
version: 0.0.2+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.16.2 <3.0.0"
|
sdk: ">=2.16.2 <3.0.0"
|
||||||
|
@ -15,10 +15,9 @@ dependencies:
|
||||||
# git:
|
# git:
|
||||||
# url: https://git.p2p.legal/poka/youtube_explode.git
|
# url: https://git.p2p.legal/poka/youtube_explode.git
|
||||||
# ref: master
|
# ref: master
|
||||||
url_launcher: ^6.1.0
|
|
||||||
http: ^0.13.4
|
http: ^0.13.4
|
||||||
kplayer: ^0.1.18
|
kplayer: ^0.1.18
|
||||||
# kplayer_with_audioplayers: ^0.0.10
|
kplayer_with_audioplayers: ^0.0.10
|
||||||
miniplayer: #^1.0.1
|
miniplayer: #^1.0.1
|
||||||
git:
|
git:
|
||||||
url: https://git.p2p.legal/poka/flutter_miniplayer.git
|
url: https://git.p2p.legal/poka/flutter_miniplayer.git
|
||||||
|
@ -26,7 +25,8 @@ dependencies:
|
||||||
provider: ^6.0.1
|
provider: ^6.0.1
|
||||||
path_provider: ^2.0.9
|
path_provider: ^2.0.9
|
||||||
universal_io: ^2.0.4
|
universal_io: ^2.0.4
|
||||||
ffmpeg_cli: ^0.1.0
|
# ffmpeg_cli: ^0.1.0
|
||||||
|
# audioplayers: ^1.0.0-rc.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -40,14 +40,14 @@ flutter_icons:
|
||||||
# macos: true
|
# macos: true
|
||||||
windows: true
|
windows: true
|
||||||
web: true
|
web: true
|
||||||
image_path: "assets/logo_aquamarine.jpg"
|
image_path: "assets/logo_green_dark.jpg"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
|
||||||
# To add assets to your application, add an assets section, like this:
|
# To add assets to your application, add an assets section, like this:
|
||||||
assets:
|
# assets:
|
||||||
- assets/test.webm
|
# - assets/test.webm
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
# https://flutter.dev/assets-and-images/#resolution-aware.
|
# https://flutter.dev/assets-and-images/#resolution-aware.
|
||||||
|
|
BIN
web/favicon.png
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
|
@ -1,13 +1,16 @@
|
||||||
|
# Project-level configuration.
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(fipy LANGUAGES CXX)
|
project(fipy LANGUAGES CXX)
|
||||||
|
|
||||||
|
# The name of the executable created for the application. Change this to change
|
||||||
|
# the on-disk name of your application.
|
||||||
set(BINARY_NAME "fipy")
|
set(BINARY_NAME "fipy")
|
||||||
|
|
||||||
|
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||||
|
# versions of CMake.
|
||||||
cmake_policy(SET CMP0063 NEW)
|
cmake_policy(SET CMP0063 NEW)
|
||||||
|
|
||||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
# Define build configuration option.
|
||||||
|
|
||||||
# Configure build options.
|
|
||||||
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
if(IS_MULTICONFIG)
|
if(IS_MULTICONFIG)
|
||||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
|
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
|
||||||
|
@ -20,7 +23,7 @@ else()
|
||||||
"Debug" "Profile" "Release")
|
"Debug" "Profile" "Release")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
# Define settings for the Profile build mode.
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
|
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
||||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
|
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
|
@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
add_definitions(-DUNICODE -D_UNICODE)
|
add_definitions(-DUNICODE -D_UNICODE)
|
||||||
|
|
||||||
# Compilation settings that should be applied to most targets.
|
# Compilation settings that should be applied to most targets.
|
||||||
|
#
|
||||||
|
# Be cautious about adding new options here, as plugins use this function by
|
||||||
|
# default. In most cases, you should add new options to specific targets instead
|
||||||
|
# of modifying this function.
|
||||||
function(APPLY_STANDARD_SETTINGS TARGET)
|
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||||
target_compile_features(${TARGET} PUBLIC cxx_std_17)
|
target_compile_features(${TARGET} PUBLIC cxx_std_17)
|
||||||
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
|
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
|
||||||
|
@ -38,12 +45,11 @@ function(APPLY_STANDARD_SETTINGS TARGET)
|
||||||
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
|
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
|
||||||
|
|
||||||
# Flutter library and tool build rules.
|
# Flutter library and tool build rules.
|
||||||
|
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||||
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
||||||
|
|
||||||
# Application build
|
# Application build; see runner/CMakeLists.txt.
|
||||||
add_subdirectory("runner")
|
add_subdirectory("runner")
|
||||||
|
|
||||||
# Generated plugin build rules, which manage building the plugins and adding
|
# Generated plugin build rules, which manage building the plugins and adding
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# This file controls Flutter-level build steps. It should not be edited.
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
||||||
#include <dart_vlc/dart_vlc_plugin.h>
|
#include <dart_vlc/dart_vlc_plugin.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
||||||
DartVlcPluginRegisterWithRegistrar(
|
DartVlcPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("DartVlcPlugin"));
|
registry->GetRegistrarForPlugin("DartVlcPlugin"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
|
||||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
audioplayers_windows
|
||||||
dart_vlc
|
dart_vlc
|
||||||
url_launcher_windows
|
)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||||
|
@ -15,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||||
endforeach(plugin)
|
endforeach(plugin)
|
||||||
|
|
||||||
|
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||||
|
endforeach(ffi_plugin)
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(runner LANGUAGES CXX)
|
project(runner LANGUAGES CXX)
|
||||||
|
|
||||||
|
# Define the application target. To change its name, change BINARY_NAME in the
|
||||||
|
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
||||||
|
# work.
|
||||||
|
#
|
||||||
|
# Any new source files that you add to the application should be added here.
|
||||||
add_executable(${BINARY_NAME} WIN32
|
add_executable(${BINARY_NAME} WIN32
|
||||||
"flutter_window.cpp"
|
"flutter_window.cpp"
|
||||||
"main.cpp"
|
"main.cpp"
|
||||||
|
@ -10,8 +15,18 @@ add_executable(${BINARY_NAME} WIN32
|
||||||
"Runner.rc"
|
"Runner.rc"
|
||||||
"runner.exe.manifest"
|
"runner.exe.manifest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Apply the standard set of build settings. This can be removed for applications
|
||||||
|
# that need different build settings.
|
||||||
apply_standard_settings(${BINARY_NAME})
|
apply_standard_settings(${BINARY_NAME})
|
||||||
|
|
||||||
|
# Disable Windows macros that collide with C++ standard library functions.
|
||||||
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
|
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
|
||||||
|
|
||||||
|
# Add dependency libraries and include directories. Add any application-specific
|
||||||
|
# dependencies here.
|
||||||
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
|
||||||
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
||||||
|
|
||||||
|
# Run the Flutter tool portions of the build. This must not be removed.
|
||||||
add_dependencies(${BINARY_NAME} flutter_assemble)
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||||
|
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
@ -48,10 +48,10 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) {
|
||||||
int target_length = ::WideCharToMultiByte(
|
int target_length = ::WideCharToMultiByte(
|
||||||
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
||||||
-1, nullptr, 0, nullptr, nullptr);
|
-1, nullptr, 0, nullptr, nullptr);
|
||||||
if (target_length == 0) {
|
|
||||||
return std::string();
|
|
||||||
}
|
|
||||||
std::string utf8_string;
|
std::string utf8_string;
|
||||||
|
if (target_length == 0 || target_length > utf8_string.max_size()) {
|
||||||
|
return utf8_string;
|
||||||
|
}
|
||||||
utf8_string.resize(target_length);
|
utf8_string.resize(target_length);
|
||||||
int converted_length = ::WideCharToMultiByte(
|
int converted_length = ::WideCharToMultiByte(
|
||||||
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
|
||||||
|
|