我正在使用 YouTube API ,并且使用了youtube_player_flutter
软件包。现在,我想在用户导航到其他屏幕后以点子形式显示/播放视频。
我尝试使用easy_pip
程序包,但即使重新运行应用程序并清除抖动后,它仍然显示异常。
我的代码如下:
BlocProvider(
create: (BuildContext context) => _detailBloc,
child: Scaffold(
body:PIPStack(
backgroundWidget: Center(
child: RaisedButton(
onPressed: () {
setState(() {
isEnabled = !isEnabled;
});
},
child: Text("Click here to enable PIP"),
),
),
pipWidget: YoutubePlayer(
controller: _controller,
),
pipEnabled: true,
pipExpandedContent: BlocBuilder(
cubit: _detailBloc,
builder: _buildScaffoldContent,
),
onClosed: () {
setState(() {
isEnabled = !isEnabled;
});
}, ),
),
在这方面请帮我,或者提出一些建议,使视频一直播放直到用户退出为止(或者可能类似于YouTube)。