hyzp_ybqx-Commit182:已经实现播放视频时双击视频界面暂停时,播放按钮跟随变化
This commit is contained in:
@@ -16,6 +16,7 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import '../components/commonFun.dart';
|
||||
import '../services/Storage.dart';
|
||||
import '../my_fijkPanel_fix/my_panel3.dart';
|
||||
|
||||
const _kControlViewTypes = [kControlViewTypeDefault, kControlViewTypeWithout];
|
||||
|
||||
@@ -40,16 +41,20 @@ class SuperPlayerPage extends StatefulWidget {
|
||||
_SuperPlayerPageState createState() => _SuperPlayerPageState();
|
||||
}
|
||||
|
||||
class _SuperPlayerPageState extends State<SuperPlayerPage> with SuperPlayerListener {
|
||||
class _SuperPlayerPageState extends State<SuperPlayerPage>
|
||||
with WidgetsBindingObserver, AutomaticKeepAliveClientMixin {
|
||||
// SuperPlayerController _playerController = SuperPlayerController();
|
||||
|
||||
@override
|
||||
// TODO: implement wantKeepAlive
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
final FijkPlayer _playerController = FijkPlayer();
|
||||
|
||||
String _sdkVersion = 'Unknown';
|
||||
List<String> _logs = [];
|
||||
bool bFullScreen = false;
|
||||
|
||||
String _controlViewType = _kControlViewTypes.first;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
Playing = false;
|
||||
@@ -69,6 +74,9 @@ class _SuperPlayerPageState extends State<SuperPlayerPage> with SuperPlayerListe
|
||||
// });
|
||||
// init();
|
||||
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
|
||||
|
||||
_playerController.setOption(FijkOption.hostCategory, "enable-snapshot", 1);
|
||||
_playerController.setOption(FijkOption.playerCategory, "mediacodec-all-videos", 1);
|
||||
startPlay();
|
||||
@@ -186,10 +194,14 @@ class _SuperPlayerPageState extends State<SuperPlayerPage> with SuperPlayerListe
|
||||
|
||||
PlayerRatioProvide playerRatioProvide;
|
||||
|
||||
FijkPanelWidgetBuilder _fijkPanelWidgetBuilder;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_fijkPanelWidgetBuilder = fijkPanel2Builder3(snapShot: true, player: _playerController);
|
||||
playerRegionProvide = Provider.of<PlayerRegionProvide>(context);
|
||||
playerRatioProvide = Provider.of<PlayerRatioProvide>(context);
|
||||
|
||||
// List<Widget> listData = getDataListControl2();
|
||||
double btnHeight1 = 70; //第一按钮行高度
|
||||
double btnHeight2 = 160; //第二按钮行高度
|
||||
@@ -294,7 +306,8 @@ class _SuperPlayerPageState extends State<SuperPlayerPage> with SuperPlayerListe
|
||||
//设置视频区域背景颜色-OK
|
||||
color: Colors.black,
|
||||
player: _playerController,
|
||||
panelBuilder: fijkPanel2Builder(snapShot: true),
|
||||
// panelBuilder: fijkPanel2Builder(snapShot: true),
|
||||
panelBuilder: _fijkPanelWidgetBuilder,
|
||||
fsFit: FijkFit.fill,
|
||||
// panelBuilder: simplestUI,
|
||||
// panelBuilder: (FijkPlayer player, BuildContext context,
|
||||
|
||||
Reference in New Issue
Block a user