目前调通了120全局,准备开始介入播放层,在修bug
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
|
||||
class PlayerService {
|
||||
static final PlayerService _instance = PlayerService._internal();
|
||||
factory PlayerService() => _instance;
|
||||
PlayerService._internal();
|
||||
|
||||
final Player _player = Player();
|
||||
|
||||
void play(String url) {
|
||||
_player.open(Media(url));
|
||||
}
|
||||
|
||||
void pause() => _player.pause();
|
||||
void resume() => _player.play();
|
||||
void stop() => _player.stop();
|
||||
|
||||
void dispose() => _player.dispose();
|
||||
|
||||
// 状态监听...
|
||||
}
|
||||
Reference in New Issue
Block a user