Sfoglia il codice sorgente

[fix]修改视频播放,修复bug

云天逵 1 anno fa
parent
commit
9b68e0143e

BIN
assets/images/icon_more_contacts.webp


BIN
assets/images/icon_more_contacts_bg.webp


+ 71 - 0
lib/dialog/play_video_dialog.dart

@@ -0,0 +1,71 @@
+import 'package:chewie/chewie.dart';
+import 'package:flutter/Material.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:video_player/video_player.dart';
+import 'package:wechat_assets_picker/wechat_assets_picker.dart';
+import 'package:get/get.dart';
+
+import '../resource/assets.gen.dart';
+ void playVideoDialog(AssetEntity asset) async {
+  try {
+    final mediaUrl = await asset.getMediaUrl();
+    if (mediaUrl == null) return;
+
+    final videoPlayerController =
+    VideoPlayerController.networkUrl(Uri.parse(mediaUrl));
+    await videoPlayerController.initialize();
+
+    final chewieController = ChewieController(
+      videoPlayerController: videoPlayerController,
+      autoPlay: true,
+      looping: true,
+      showOptions: false,
+    );
+    Get.dialog(
+      useSafeArea: false,
+      Dialog(
+        insetPadding: EdgeInsets.zero,
+        backgroundColor: Colors.black,
+        child: SizedBox(
+          width: double.infinity,
+          height: double.infinity,
+          child: Stack(
+            children: [
+              SafeArea(child:   Column(
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: [
+                  GestureDetector(
+                    onTap: () {
+                      Get.back();
+                    },
+                    child:Padding(padding: EdgeInsets.only(left: 16.w,top: 16.h),child:  Assets.images.iconBackArrow.image(
+                      width: 28.w,
+                      height: 28.h,
+                    )),
+                  ),
+                  Expanded(
+                    child: Chewie(controller: chewieController),
+                  ),
+                ],
+              ),),
+              IgnorePointer(
+                child: Assets.images.bgHome.image(
+                  width: 360.w,
+                  fit: BoxFit.cover,
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+      barrierDismissible: true,
+    ).then((_) {
+      videoPlayerController.dispose();
+      chewieController.dispose();
+    });
+    await videoPlayerController.play();
+  } catch (e) {
+    print('Error playing video: $e');
+    Get.snackbar('Error', 'Failed to play video');
+  }
+}

+ 4 - 4
lib/module/analysis/analysis_view.dart

@@ -389,14 +389,14 @@ class AnalysisPage extends BasePage<AnalysisController> {
                   child: controller.selectedAssets.contains(asset.id)
                       ? Center(
                     child: Assets.images.iconSelected.image(
-                      width: 16.w,
-                      height: 16.h,
+                      width: 20.w,
+                      height: 20.h,
                     ),
                   )
                       : Center(
                     child: Assets.images.iconUnselected.image(
-                      width: 16.w,
-                      height: 16.h,
+                      width: 20.w,
+                      height: 20.h,
                     ),
                   ),
                 ),

+ 2 - 39
lib/module/calendar/preview/calendar_preview_controller.dart

@@ -1,5 +1,4 @@
 import 'dart:async';
-import 'dart:io';
 
 import 'package:clean/base/base_controller.dart';
 import 'package:clean/module/calendar/selected_preview/calendar_selected_preview_view.dart';
@@ -7,12 +6,12 @@ import 'package:flutter/Material.dart';
 import 'package:flutter_card_swiper/flutter_card_swiper.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:get/get.dart';
-import 'package:url_launcher/url_launcher.dart';
 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 
 import '../../../data/repositories/user_repository.dart';
 import '../../../dialog/photo_delete_finish_dialog.dart';
 import '../../../dialog/photo_deleting_dialog.dart';
+import '../../../dialog/play_video_dialog.dart';
 import '../../../utils/file_size_calculator_util.dart';
 import '../../../utils/toast_util.dart';
 import '../../image_picker/image_picker_util.dart';
@@ -35,45 +34,9 @@ class CalendarPreviewController extends BaseController
   RxBool animationIsComplete = false.obs;
 
   void playVideo(AssetEntity asset) async {
-    final mediaUrl = await asset.getMediaUrl();
-    if (mediaUrl != null) {
-      final Uri videoUri = Uri.parse(mediaUrl);
-      if (await canLaunchUrl(videoUri)) {
-        await launchUrl(videoUri, mode: LaunchMode.externalApplication);
-      } else {
-        debugPrint("无法打开视频:$mediaUrl");
-      }
-    }
+    playVideoDialog(asset);
   }
 
-  // void playVideo(AssetEntity asset) async {
-  //   final mediaUrl = await asset.getMediaUrl();
-  //   if (mediaUrl != null) {
-  //     late final VideoPlayerController videoPlayerController;
-  //     videoPlayerController =
-  //         VideoPlayerController.networkUrl(Uri.parse(mediaUrl))
-  //           ..initialize().then((_) {
-  //             print('videoPlayerController.value.size ${videoPlayerController.value.reactive}');
-  //             videoPlayerController.play();
-  //             Get.dialog(AlertDialog(
-  //               content: AspectRatio(
-  //                 aspectRatio: videoPlayerController.value.aspectRatio,
-  //                 child: VideoPlayer(videoPlayerController),
-  //               ),
-  //               actions: [
-  //                 TextButton(
-  //                   onPressed: () {
-  //                     videoPlayerController.pause();
-  //                     videoPlayerController.dispose(); // 释放资源
-  //                     Get.back();
-  //                   },
-  //                   child: Text('Close'),
-  //                 )
-  //               ],
-  //             ));
-  //           });
-  //   }
-  // }
 
   @override
   void onInit() {

+ 0 - 1
lib/module/calendar/preview/calendar_preview_view.dart

@@ -53,7 +53,6 @@ class CalendarPreviewPage extends BasePage<CalendarPreviewController> {
               return Column(
                 children: [
                   _titleCard(),
-
                   Spacer(),
                   SizedBox(
                     width: 314.w,

+ 176 - 156
lib/module/contact/all/all_view.dart

@@ -45,84 +45,84 @@ class AllPage extends BasePage<AllController> {
             children: [
               !controller.isEdit.value
                   ? Row(
-                mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                children: [
-                  GestureDetector(
-                    onTap: () {
-                      Get.back();
-                    },
-                    child: Assets.images.iconCommonBack
-                        .image(width: 28.w, height: 28.w),
-                  ),
-                  GestureDetector(
-                    onTap: () {
-                      controller.isEdit.value = true;
-                    },
-                    child: Container(
-                      width: 71.w,
-                      height: 30.h,
-                      decoration: BoxDecoration(
-                        color: "#1F2D3F".color,
-                        borderRadius: BorderRadius.all(
-                          Radius.circular(15.h),
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                      children: [
+                        GestureDetector(
+                          onTap: () {
+                            Get.back();
+                          },
+                          child: Assets.images.iconCommonBack
+                              .image(width: 28.w, height: 28.w),
                         ),
-                      ),
-                      child: Center(
-                        child: Text(
-                          "Select",
-                          style: TextStyle(
-                            color: Colors.white,
-                            fontSize: 14.sp,
+                        GestureDetector(
+                          onTap: () {
+                            controller.isEdit.value = true;
+                          },
+                          child: Container(
+                            width: 71.w,
+                            height: 30.h,
+                            decoration: BoxDecoration(
+                              color: "#1F2D3F".color,
+                              borderRadius: BorderRadius.all(
+                                Radius.circular(15.h),
+                              ),
+                            ),
+                            child: Center(
+                              child: Text(
+                                "Select",
+                                style: TextStyle(
+                                  color: Colors.white,
+                                  fontSize: 14.sp,
+                                ),
+                              ),
+                            ),
                           ),
                         ),
-                      ),
-                    ),
-                  ),
-                ],
-              )
+                      ],
+                    )
                   : Row(
-                mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                children: [
-                  GestureDetector(
-                    onTap: () {
-                      controller.isEdit.value = false;
-                    },
-                    child: Container(
-                      width: 71.w,
-                      height: 30.h,
-                      decoration: BoxDecoration(
-                        color: "#1F2D3F".color,
-                        borderRadius: BorderRadius.all(
-                          Radius.circular(15.h),
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                      children: [
+                        GestureDetector(
+                          onTap: () {
+                            controller.isEdit.value = false;
+                          },
+                          child: Container(
+                            width: 71.w,
+                            height: 30.h,
+                            decoration: BoxDecoration(
+                              color: "#1F2D3F".color,
+                              borderRadius: BorderRadius.all(
+                                Radius.circular(15.h),
+                              ),
+                            ),
+                            child: Center(
+                              child: Text(
+                                "Cancel",
+                                style: TextStyle(
+                                  color: Colors.white,
+                                  fontSize: 14.sp,
+                                ),
+                              ),
+                            ),
+                          ),
                         ),
-                      ),
-                      child: Center(
-                        child: Text(
-                          "Cancel",
-                          style: TextStyle(
-                            color: Colors.white,
-                            fontSize: 14.sp,
+                        GestureDetector(
+                          onTap: () {
+                            controller.toggleSelectAll();
+                          },
+                          child: Text(
+                            controller.isAllSelected.value
+                                ? "Deselect all"
+                                : "Select All",
+                            style: TextStyle(
+                              color: Colors.white.withOpacity(0.65),
+                              fontSize: 14.sp,
+                            ),
                           ),
                         ),
-                      ),
-                    ),
-                  ),
-                  GestureDetector(
-                    onTap: () {
-                      controller.toggleSelectAll();
-                    },
-                    child: Text(
-                      controller.isAllSelected.value
-                          ? "Deselect all"
-                          : "Select All",
-                      style: TextStyle(
-                        color: Colors.white.withOpacity(0.65),
-                        fontSize: 14.sp,
-                      ),
+                      ],
                     ),
-                  ),
-                ],
-              ),
               SizedBox(
                 height: 12.h,
               ),
@@ -147,8 +147,8 @@ class AllPage extends BasePage<AllController> {
                         return ScrollablePositionedList.builder(
                           itemCount: ContactState.initials.length,
                           itemScrollController: controller.itemScrollController,
-                          itemPositionsListener: controller
-                              .itemPositionsListener,
+                          itemPositionsListener:
+                              controller.itemPositionsListener,
                           itemBuilder: (context, index) {
                             String initial = ContactState.initials[index];
                             return Column(
@@ -177,93 +177,115 @@ class AllPage extends BasePage<AllController> {
                                   bool isFirst = index == 0; // 是否是第一个
                                   bool isLast = index ==
                                       (ContactState.groupedContacts[initial]
-                                          ?.length ??
-                                          0) -
+                                                  ?.length ??
+                                              0) -
                                           1; // 是否是最后一个
                                   return Container(
-                                    padding: EdgeInsets.all(10.w),
-                                    width: double.infinity,
-                                    // height: 62.h,
-                                    decoration: BoxDecoration(
-                                      borderRadius: BorderRadius.vertical(
-                                        top: isFirst
-                                            ? Radius.circular(12)
-                                            : Radius.zero, // 第一个设置上圆角
-                                        bottom: isLast
-                                            ? Radius.circular(12)
-                                            : Radius.zero, // 最后一个设置下圆角
+                                      padding: EdgeInsets.only(
+                                        left: 10.w,
+                                        top: 10.h,
+                                        right: 10.w,
                                       ),
-                                      color: Colors.white.withOpacity(0.12),
-                                    ),
-                                    child: Row(
-                                      mainAxisAlignment:
-                                      MainAxisAlignment.spaceBetween,
-                                      children: [
-                                        Column(
-                                          mainAxisAlignment:
-                                          MainAxisAlignment.start,
-                                          crossAxisAlignment:
-                                          CrossAxisAlignment.start,
-                                          children: [
-                                            Text(
-                                              contact.displayName.isEmpty
-                                                  ? 'No contact name'
-                                                  : contact.displayName,
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 14.sp,
-                                                fontWeight: FontWeight.w500,
-                                              ),
-                                            ),
-                                            SizedBox(
-                                              height: 5.h,
-                                            ),
-                                            Text(
-                                              contact.phones.isEmpty
-                                                  ? 'No contact number'
-                                                  : contact.phones.first.number,
-
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 14.sp,
-                                                fontWeight: FontWeight.w500,
-                                              ),
-                                            ),
-                                          ],
+                                      width: double.infinity,
+                                      // height: 62.h,
+                                      decoration: BoxDecoration(
+                                        borderRadius: BorderRadius.vertical(
+                                          top: isFirst
+                                              ? Radius.circular(12)
+                                              : Radius.zero, // 第一个设置上圆角
+                                          bottom: isLast
+                                              ? Radius.circular(12)
+                                              : Radius.zero, // 最后一个设置下圆角
                                         ),
-                                        // 删除按钮
-                                        Visibility(
-                                          visible: controller.isEdit.value,
-                                          child: GestureDetector(
-                                            onTap: () {
-                                              controller.toggleSelectContact(
-                                                  contact);
-                                            },
-                                            child: Container(
-                                              child: controller.selectedContacts
-                                                  .contains(contact.id)
-                                                  ? Center(
-                                                child: Assets
-                                                    .images.iconSelected
-                                                    .image(
-                                                  width: 16.w,
-                                                  height: 16.h,
-                                                ),
-                                              )
-                                                  : Center(
-                                                child: Assets
-                                                    .images.iconUnselected
-                                                    .image(
-                                                  width: 16.w,
-                                                  height: 16.h,
+                                        color: Colors.white.withOpacity(0.12),
+                                      ),
+                                      child: Column(
+                                        children: [
+                                          Row(
+                                            mainAxisAlignment:
+                                                MainAxisAlignment.spaceBetween,
+                                            children: [
+                                              Column(
+                                                mainAxisAlignment:
+                                                    MainAxisAlignment.start,
+                                                crossAxisAlignment:
+                                                    CrossAxisAlignment.start,
+                                                children: [
+                                                  Text(
+                                                    contact.displayName.isEmpty
+                                                        ? 'No contact name'
+                                                        : contact.displayName,
+                                                    style: TextStyle(
+                                                      color: Colors.white,
+                                                      fontSize: 14.sp,
+                                                      fontWeight:
+                                                          FontWeight.w500,
+                                                    ),
+                                                  ),
+                                                  SizedBox(
+                                                    height: 5.h,
+                                                  ),
+                                                  Text(
+                                                    contact.phones.isEmpty
+                                                        ? 'No contact number'
+                                                        : contact.phones.first
+                                                            .number,
+                                                    style: TextStyle(
+                                                      color: Colors.white,
+                                                      fontSize: 14.sp,
+                                                      fontWeight:
+                                                          FontWeight.w500,
+                                                    ),
+                                                  ),
+                                                ],
+                                              ),
+                                              // 删除按钮
+                                              Visibility(
+                                                visible:
+                                                    controller.isEdit.value,
+                                                child: GestureDetector(
+                                                  onTap: () {
+                                                    controller
+                                                        .toggleSelectContact(
+                                                            contact);
+                                                  },
+                                                  child: Container(
+                                                    child: controller
+                                                            .selectedContacts
+                                                            .contains(
+                                                                contact.id)
+                                                        ? Center(
+                                                            child: Assets.images
+                                                                .iconSelected
+                                                                .image(
+                                                              width: 20.w,
+                                                              height: 20.h,
+                                                            ),
+                                                          )
+                                                        : Center(
+                                                            child: Assets.images
+                                                                .iconUnselected
+                                                                .image(
+                                                              width: 20.w,
+                                                              height: 20.h,
+                                                            ),
+                                                          ),
+                                                  ),
                                                 ),
                                               ),
-                                            ),
+                                            ],
                                           ),
-                                        ),
-                                      ],
-                                    ),
-                                  );
+                                          SizedBox(
+                                            height: 10.h,
+                                          ),
+                                          Visibility(
+                                              visible: !isLast,
+                                              child: Container(
+                                                height: 1.h,
+                                                color: "#3E3E47".color,
+                                              )),
+                                        ],
+                                      ));
                                 }),
                                 SizedBox(
                                   height: 12.h,
@@ -281,10 +303,8 @@ class AllPage extends BasePage<AllController> {
                         itemCount: ContactState.initials.length,
                         itemBuilder: (context, index) {
                           return GestureDetector(
-                            onTap: () =>
-                                controller
-                                    .scrollToInitial(
-                                    ContactState.initials[index]),
+                            onTap: () => controller
+                                .scrollToInitial(ContactState.initials[index]),
                             child: Padding(
                               padding: EdgeInsets.symmetric(vertical: 2),
                               child: Text(

+ 4 - 4
lib/module/contact/backup/view.dart

@@ -254,16 +254,16 @@ class ContactBackUpPage extends BasePage<ContactBackUpController> {
                                                         child: Assets
                                                             .images.iconSelected
                                                             .image(
-                                                          width: 16.w,
-                                                          height: 16.h,
+                                                          width: 20.w,
+                                                          height: 20.h,
                                                         ),
                                                       )
                                                     : Center(
                                                         child: Assets.images
                                                             .iconUnselected
                                                             .image(
-                                                          width: 16.w,
-                                                          height: 16.h,
+                                                          width: 20.w,
+                                                          height: 20.h,
                                                         ),
                                                       ),
                                               ),

+ 4 - 4
lib/module/contact/duplicate/view.dart

@@ -330,16 +330,16 @@ class ContactDuplicatePage extends BasePage<ContactDuplicateController> {
                                                 child: Assets
                                                     .images.iconSelected
                                                     .image(
-                                                  width: 16.w,
-                                                  height: 16.h,
+                                                  width: 20.w,
+                                                  height: 20.h,
                                                 ),
                                               )
                                             : Center(
                                                 child: Assets
                                                     .images.iconUnselected
                                                     .image(
-                                                  width: 16.w,
-                                                  height: 16.h,
+                                                  width: 20.w,
+                                                  height: 20.h,
                                                 ),
                                               ),
                                       ),

+ 71 - 57
lib/module/contact/incomplete/view.dart

@@ -185,7 +185,8 @@ class ContactIncompletePage extends BasePage<ContactInCompleteController> {
                                               0) -
                                           1; // 是否是最后一个
                                   return Container(
-                                    padding: EdgeInsets.all(10.w),
+                                    padding: EdgeInsets.only(
+                                        left: 10.w, top: 10.h, right: 10.w),
                                     width: double.infinity,
                                     // height: 62.h,
                                     decoration: BoxDecoration(
@@ -199,77 +200,90 @@ class ContactIncompletePage extends BasePage<ContactInCompleteController> {
                                       ),
                                       color: Colors.white.withValues(alpha: 0.12),
                                     ),
-                                    child: Row(
-                                      mainAxisAlignment:
-                                          MainAxisAlignment.spaceBetween,
+                                    child: Column(
                                       children: [
-                                        Column(
+                                        Row(
                                           mainAxisAlignment:
-                                              MainAxisAlignment.start,
-                                          crossAxisAlignment:
-                                              CrossAxisAlignment.start,
+                                              MainAxisAlignment.spaceBetween,
                                           children: [
-                                            Text(
-                                              contact.displayName.isEmpty
-                                                  ? 'No contact name'
-                                                  : contact.displayName,
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 14.sp,
-                                                fontWeight: FontWeight.w500,
-                                              ),
-                                            ),
-                                            SizedBox(
-                                              height: 5.h,
+                                            Column(
+                                              mainAxisAlignment:
+                                                  MainAxisAlignment.start,
+                                              crossAxisAlignment:
+                                                  CrossAxisAlignment.start,
+                                              children: [
+                                                Text(
+                                                  contact.displayName.isEmpty
+                                                      ? 'No contact name'
+                                                      : contact.displayName,
+                                                  style: TextStyle(
+                                                    color: Colors.white,
+                                                    fontSize: 14.sp,
+                                                    fontWeight: FontWeight.w500,
+                                                  ),
+                                                ),
+                                                SizedBox(
+                                                  height: 5.h,
+                                                ),
+                                                Text(
+                                                  contact.phones.isEmpty
+                                                      ? 'No contact number'
+                                                      : contact.phones.first.number,
+                                                  style: TextStyle(
+                                                    color: Colors.white,
+                                                    fontSize: 14.sp,
+                                                    fontWeight: FontWeight.w500,
+                                                  ),
+                                                ),
+                                              ],
                                             ),
-                                            Text(
-                                              contact.phones.isEmpty
-                                                  ? 'No contact number'
-                                                  : contact.phones.first.number,
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 14.sp,
-                                                fontWeight: FontWeight.w500,
+                                            // 删除按钮
+                                            Visibility(
+                                              visible: controller.isEdit.value,
+                                              child: GestureDetector(
+                                                onTap: () {
+                                                  controller
+                                                      .toggleSelectContact(contact);
+                                                },
+                                                child: Container(
+                                                  child: controller.selectedContacts
+                                                          .contains(contact.id)
+                                                      ? Center(
+                                                          child: Assets
+                                                              .images.iconSelected
+                                                              .image(
+                                                            width: 16.w,
+                                                            height: 16.h,
+                                                          ),
+                                                        )
+                                                      : Center(
+                                                          child: Assets
+                                                              .images.iconUnselected
+                                                              .image(
+                                                            width: 16.w,
+                                                            height: 16.h,
+                                                          ),
+                                                        ),
+                                                ),
                                               ),
                                             ),
                                           ],
                                         ),
-                                        // 删除按钮
+                                        SizedBox(
+                                          height: 10.h,
+                                        ),
                                         Visibility(
-                                          visible: controller.isEdit.value,
-                                          child: GestureDetector(
-                                            onTap: () {
-                                              controller
-                                                  .toggleSelectContact(contact);
-                                            },
+                                            visible: !isLast,
                                             child: Container(
-                                              child: controller.selectedContacts
-                                                      .contains(contact.id)
-                                                  ? Center(
-                                                      child: Assets
-                                                          .images.iconSelected
-                                                          .image(
-                                                        width: 16.w,
-                                                        height: 16.h,
-                                                      ),
-                                                    )
-                                                  : Center(
-                                                      child: Assets
-                                                          .images.iconUnselected
-                                                          .image(
-                                                        width: 16.w,
-                                                        height: 16.h,
-                                                      ),
-                                                    ),
-                                            ),
-                                          ),
-                                        ),
+                                              height: 1.h,
+                                              color: "#3E3E47".color,
+                                            )),
                                       ],
                                     ),
                                   );
                                 }),
                                 SizedBox(
-                                  height: 12.h,
+                                  height: 10.h,
                                 ),
                               ],
                             );

+ 11 - 10
lib/module/more/more_view.dart

@@ -63,6 +63,16 @@ class MorePage extends BaseView<MoreController> {
                     }),
                     SizedBox(height: 14.h),
                     _buildCustomCard(
+                      "Contacts",
+                      Assets.images.iconMoreContactsBg.image(),
+                      Assets.images.iconMoreContacts
+                          .image(height: 72.w, width: 72.w),
+                      onTap: () {
+                        Get.toNamed(RoutePath.contact);
+                      },
+                    ),
+                    SizedBox(height: 14.h),
+                    _buildCustomCard(
                       "Photo Analysis",
                       Assets.images.iconMoreAnalysisBg.image(),
                       Assets.images.iconMoreAnalysis
@@ -90,16 +100,7 @@ class MorePage extends BaseView<MoreController> {
                         Get.toNamed(RoutePath.setting);
                       },
                     ),
-                    SizedBox(height: 25.h),
-                    _buildCustomCard(
-                      "Contacts",
-                      Assets.images.iconMoreSettingsBg.image(),
-                      Assets.images.iconMoreSettings
-                          .image(height: 72.w, width: 72.w),
-                      onTap: () {
-                        Get.toNamed(RoutePath.contact);
-                      },
-                    ),
+
                     SizedBox(height: 25.h),
                   ],
                 ),

+ 3 - 10
lib/module/photo_preview/photo_preview_controller.dart

@@ -23,9 +23,10 @@ import 'package:flutter_card_swiper/flutter_card_swiper.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:get/get.dart';
 import 'package:lottie/lottie.dart';
-import 'package:url_launcher/url_launcher.dart';
+
 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 
+import '../../dialog/play_video_dialog.dart';
 import '../../utils/file_size_calculator_util.dart';
 
 class PhotoPreviewController extends BaseController
@@ -439,15 +440,7 @@ class PhotoPreviewController extends BaseController
   }
 
   void playVideo(AssetEntity asset) async {
-    final mediaUrl = await asset.getMediaUrl();
-    if (mediaUrl != null) {
-      final Uri videoUri = Uri.parse(mediaUrl);
-      if (await canLaunchUrl(videoUri)) {
-        await launchUrl(videoUri, mode: LaunchMode.externalApplication);
-      } else {
-        debugPrint("无法打开视频:$mediaUrl");
-      }
-    }
+    playVideoDialog(asset);
   }
 
   // 将selectedFilesSize转成String类型,然后单位转换,如果超过1MB,则转成MB,超过1GB,则转成GB,否则KB

+ 4 - 4
lib/module/privacy/privacy_view.dart

@@ -622,14 +622,14 @@ class PrivacyPage extends BaseView<PrivacyController> {
                   child: controller.selectedAssets.contains(asset.id)
                       ? Center(
                           child: Assets.images.iconSelected.image(
-                            width: 16.w,
-                            height: 16.h,
+                            width: 20.w,
+                            height: 20.h,
                           ),
                         )
                       : Center(
                           child: Assets.images.iconUnselected.image(
-                            width: 16.w,
-                            height: 16.h,
+                            width: 20.w,
+                            height: 20.h,
                           ),
                         ),
                 ),

+ 3 - 1
pubspec.yaml

@@ -70,7 +70,9 @@ dependencies:
   #权限申请
   permission_handler: ^11.3.1
 
-  url_launcher: ^6.3.1
+#  url_launcher: ^6.3.1
+  chewie: ^1.10.0
+  video_player: ^2.9.2
   #支付
   in_app_purchase: ^3.2.0