我只是想添加音频播放器酒吧到我的应用程序。但它会出错,比如:
resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
我尝试了Stackoverflow中发布的所有问题。但我不明白。
这是我的代码:
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
final player = AudioPlayer();
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("data"),
),
body: Center(
child: TextButton(
onPressed: () {
player.setSource(AssetSource("sound/n1.wav"));
},
child: Text("data"),
),
),
),
);
}
}
我试过的资源有哪些:
- Flutter audioplayer错误-单击音频按钮时未播放音频
- Android Studio resetDrmState message on MediaPlayer release and set to null
1条答案
按热度按时间x759pob21#
这对我有帮助: