Explorar o código

完善了全屏的示例

Caijinglong %!s(int64=6) %!d(string=hai) anos
pai
achega
9c1be358d5
Modificáronse 2 ficheiros con 19 adicións e 4 borrados
  1. 3 2
      TODOLIST.md
  2. 16 2
      example/lib/page/full_screen.dart

+ 3 - 2
TODOLIST.md

@@ -44,6 +44,7 @@
   - [x] 使用选项切换音量的控制是系统音量还是资源音量
   - [x] 允许根据情况禁用各种控制手势
   - [x] 当一个视频是直播视频时,进度条应该隐藏,且无拖动进度相关手势
+  - [ ] 全屏按钮: 利用 Overlay 开发一个全屏的播放界面,不仅仅在 Example 中
 - [x] 根据视频角度自动旋转
 - [x] 保证图片宽高比不失真
 - [x] 允许自定义控制器 UI
@@ -52,6 +53,6 @@
   - [x] 播放相册
   - [x] 播放 asset
   - [ ] 设置选项的使用
-  - [ ] 切换全屏播放的示例代码
-  - [ ] 在列表中(ListView)
+  - [x] 切换全屏播放的示例代码
+  - [x] 在列表中(ListView)
 - [ ] iOS 部分视频无法显示图像的问题: 可能很长时间内都无法解决

+ 16 - 2
example/lib/page/full_screen.dart

@@ -104,8 +104,22 @@ class _FullScreen2State extends State<FullScreen2> {
   Widget buildLandscape() {
     SystemChrome.setEnabledSystemUIOverlays([]);
     return WillPopScope(
-      child: IjkPlayer(
-        mediaController: controller,
+      child: Scaffold(
+        body: Stack(
+          children: <Widget>[
+            IjkPlayer(
+              mediaController: controller,
+            ),
+            Container(
+              height: 44.0,
+              width: 44.0,
+              child: IconButton(
+                icon: Icon(Icons.fullscreen_exit),
+                onPressed: portraitUp,
+              ),
+            ),
+          ],
+        ),
       ),
       onWillPop: () async {
         if (orientation == Orientation.landscape) {