feat: 简单完成视频播放

This commit is contained in:
guozhigq
2023-06-01 20:14:29 +08:00
parent d2cc94fb6f
commit 9b634ce303
21 changed files with 751 additions and 38 deletions

View File

@ -33,7 +33,9 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:supportsPictureInPicture="true">
android:supportsPictureInPicture="true"
android:resizeableActivity="true"
>
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues

View File

@ -1,6 +0,0 @@
package com.guozhigq.pilipala
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}

View File

@ -0,0 +1,9 @@
package com.guozhigq.pilipala
import io.flutter.embedding.android.FlutterActivity
import com.zezo357.flutter_meedu_media_kit.MeeduPlayerFlutterActivity;
class MainActivity: MeeduPlayerFlutterActivity() {
}

View File

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View File

@ -5,24 +5,41 @@ PODS:
- device_info_plus (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_meedu_media_kit (0.0.1):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- image_gallery_saver (1.5.0):
- Flutter
- media_kit_libs_ios_video (1.0.4):
- Flutter
- media_kit_native_event_loop (1.0.0):
- Flutter
- media_kit_video (0.0.1):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.0.4):
- Flutter
- ReachabilitySwift (5.0.0)
- screen_brightness_ios (0.1.0):
- Flutter
- share_plus (0.0.1):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- url_launcher_ios (0.0.1):
- Flutter
- volume_controller (0.0.1):
- Flutter
- wakelock (0.0.1):
- Flutter
- webview_cookie_manager (0.0.1):
- Flutter
- webview_flutter_wkwebview (0.0.1):
@ -32,12 +49,20 @@ DEPENDENCIES:
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- flutter_meedu_media_kit (from `.symlinks/plugins/flutter_meedu_media_kit/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- volume_controller (from `.symlinks/plugins/volume_controller/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- webview_cookie_manager (from `.symlinks/plugins/webview_cookie_manager/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
@ -53,18 +78,34 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
flutter_meedu_media_kit:
:path: ".symlinks/plugins/flutter_meedu_media_kit/ios"
image_gallery_saver:
:path: ".symlinks/plugins/image_gallery_saver/ios"
media_kit_libs_ios_video:
:path: ".symlinks/plugins/media_kit_libs_ios_video/ios"
media_kit_native_event_loop:
:path: ".symlinks/plugins/media_kit_native_event_loop/ios"
media_kit_video:
:path: ".symlinks/plugins/media_kit_video/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
screen_brightness_ios:
:path: ".symlinks/plugins/screen_brightness_ios/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
volume_controller:
:path: ".symlinks/plugins/volume_controller/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"
webview_cookie_manager:
:path: ".symlinks/plugins/webview_cookie_manager/ios"
webview_flutter_wkwebview:
@ -74,17 +115,25 @@ SPEC CHECKSUMS:
connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_meedu_media_kit: 5059e8719e3fd4a65fe5312b0febc75491e553f9
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_gallery_saver: 259eab68fb271cfd57d599904f7acdc7832e7ef2
media_kit_libs_ios_video: 96259eccffaa309b63a7ee610c2c7786a3b335e5
media_kit_native_event_loop: 9f9eb778d0d806ab9486eff7513f7f90f07d50f8
media_kit_video: c6ae801433b484912087b519b45f1beac97b960b
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
webview_cookie_manager: eaf920722b493bd0f7611b5484771ca53fed03f7
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b
COCOAPODS: 1.12.1

View File

@ -37,7 +37,7 @@ class VideoCardH extends StatelessWidget {
child: InkWell(
onTap: () async {
await Future.delayed(const Duration(milliseconds: 200));
Get.toNamed('/video?aid=$aid',
Get.toNamed('/video?aid=$aid&cid=${videoItem.cid}',
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
},
child: Column(

View File

@ -44,7 +44,7 @@ class VideoCardV extends StatelessWidget {
child: InkWell(
onTap: () async {
await Future.delayed(const Duration(milliseconds: 200));
Get.toNamed('/video?aid=${videoItem.id}',
Get.toNamed('/video?aid=${videoItem.id}&cid=${videoItem.cid}',
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
},
child: Column(

View File

@ -6,6 +6,10 @@ class Api {
// 热门视频
static const String hotList = '/x/web-interface/popular';
// 视频流
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
static const String videoUrl = '/x/player/playurl';
// 视频详情
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
// https://api.bilibili.com/x/web-interface/view/detail 获取视频超详细信息(web端)

View File

@ -59,6 +59,40 @@ class VideoHttp {
}
}
// 视频流
static Future videoUrl(
{int? avid, int? bvid, required int cid, int? qn}) async {
Map<String, dynamic> data = {
'avid': avid,
// 'bvid': bvid,
'cid': cid,
'qn': qn ?? 64,
// 'fnval': 16,
// 'fnver': '',
'fourk': 1,
// 'session': '',
// 'otype': '',
// 'type': '',
// 'platform': '',
// 'high_quality': ''
};
try {
var res = await Request().get(Api.videoUrl, data: data);
if (res.data['code'] == 0) {
// List<HotVideoItemModel> list = [];
// for (var i in res.data['data']['list']) {
// list.add(HotVideoItemModel.fromJson(i));
// }
return {'status': true, 'data': res.data['data']};
} else {
return {'status': false, 'data': []};
}
} catch (err) {
print('🐯:$err');
return {'status': false, 'data': [], 'msg': err};
}
}
// 视频信息 标题、简介
static Future videoIntro({required String aid}) async {
var res = await Request().get(Api.videoIntro, data: {'aid': aid});

View File

@ -1,15 +1,18 @@
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_meedu_media_kit/meedu_player.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:flutter/material.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:pilipala/http/init.dart';
import 'package:pilipala/pages/video/detail/index.dart';
import 'package:pilipala/router/app_pages.dart';
import 'package:pilipala/pages/main/view.dart';
import 'package:pilipala/utils/storage.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
MediaKit.ensureInitialized();
await GStrorage.init();
await Request.setCookie();
runApp(const MyApp());
@ -53,6 +56,7 @@ class MyApp extends StatelessWidget {
getPages: Routes.getPages,
home: const MainApp(),
builder: FlutterSmartDialog.init(),
navigatorObservers: [VideoDetailPage.routeObserver],
);
}),
);

View File

@ -43,6 +43,7 @@ class FavDetailItemData {
// this.season,
// this.ogv,
this.stat,
this.cid,
});
int? id;
@ -62,6 +63,7 @@ class FavDetailItemData {
String? bvId;
String? bvid;
Stat? stat;
int? cid;
FavDetailItemData.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -81,6 +83,7 @@ class FavDetailItemData {
bvId = json['bv_id'];
bvid = json['bvid'];
stat = Stat.fromJson(json['cnt_info']);
cid = json['ugc']['first_cid'];
}
}

View File

@ -43,7 +43,7 @@ class FavVideoCardH extends StatelessWidget {
child: InkWell(
onTap: () async {
await Future.delayed(const Duration(milliseconds: 200));
Get.toNamed('/video?aid=$id',
Get.toNamed('/video?aid=$id&cid=${videoItem.cid}',
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
},
child: Column(

View File

@ -1,5 +1,10 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_meedu_media_kit/meedu_player.dart';
import 'package:get/get.dart';
import 'package:pilipala/http/constants.dart';
import 'package:pilipala/http/video.dart';
import 'package:pilipala/models/video/reply/item.dart';
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
@ -9,7 +14,8 @@ class VideoDetailController extends GetxController {
RxList<String> tabs = <String>['简介', '评论'].obs;
// 视频aid
String aid = Get.parameters['aid']!;
int aid = int.parse(Get.parameters['aid']!);
int cid = int.parse(Get.parameters['cid']!);
// 是否预渲染 骨架屏
bool preRender = false;
@ -30,6 +36,13 @@ class VideoDetailController extends GetxController {
final scaffoldKey = GlobalKey<ScaffoldState>();
MeeduPlayerController meeduPlayerController = MeeduPlayerController(
colorTheme: Theme.of(Get.context!).colorScheme.primary,
pipEnabled: true,
controlsStyle: ControlsStyle.youtube,
enabledButtons: const EnabledButtons(pip: true),
);
@override
void onInit() {
super.onInit();
@ -43,14 +56,16 @@ class VideoDetailController extends GetxController {
}
heroTag = Get.arguments['heroTag'];
}
queryVideoUrl();
}
showReplyReplyPanel() {
PersistentBottomSheetController<void>? ctr = scaffoldKey.currentState?.showBottomSheet<void>((BuildContext context) {
PersistentBottomSheetController<void>? ctr =
scaffoldKey.currentState?.showBottomSheet<void>((BuildContext context) {
return VideoReplyReplyPanel(
oid: oid,
rpid: fRpid,
closePanel: ()=> {
closePanel: () => {
fRpid = 0,
},
firstFloor: firstFloor,
@ -60,4 +75,37 @@ class VideoDetailController extends GetxController {
fRpid = 0;
});
}
playerInit(url) {
meeduPlayerController.setDataSource(
DataSource(
type: DataSourceType.network,
source: url,
httpHeaders: {
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_3_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15',
'referer': HttpString.baseUrl
},
),
autoplay: true,
looping: false
);
}
// Future<void> meeduDispose() async {
// if (meeduPlayerController != null) {
// _playerEventSubs?.cancel();
// await meeduPlayerController!.dispose();
// meeduPlayerController = null;
// // The next line disables the wakelock again.
// // await Wakelock.disable();
// }
// }
// 视频链接
queryVideoUrl() async {
var result = await VideoHttp.videoUrl(cid: cid, avid: aid);
var url = result['data']['durl'].first['url'];
playerInit(url);
}
}

View File

@ -1,4 +1,8 @@
import 'dart:async';
import 'package:extended_image/extended_image.dart';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:flutter_meedu_media_kit/meedu_player.dart';
import 'package:get/get.dart';
import 'package:flutter/material.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart';
@ -7,30 +11,122 @@ import 'package:pilipala/pages/video/detail/controller.dart';
import 'package:pilipala/pages/video/detail/introduction/index.dart';
import 'package:pilipala/pages/video/detail/related/index.dart';
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
import 'package:wakelock/wakelock.dart';
class VideoDetailPage extends StatefulWidget {
const VideoDetailPage({Key? key}) : super(key: key);
@override
State<VideoDetailPage> createState() => _VideoDetailPageState();
static final RouteObserver<PageRoute> routeObserver =
RouteObserver<PageRoute>();
}
class _VideoDetailPageState extends State<VideoDetailPage>
with TickerProviderStateMixin {
with TickerProviderStateMixin, RouteAware {
final VideoDetailController videoDetailController =
Get.put(VideoDetailController(), tag: Get.arguments['heroTag']);
MeeduPlayerController? _meeduPlayerController;
ScrollController _extendNestCtr = ScrollController();
late AnimationController animationController;
// final _meeduPlayerController = MeeduPlayerController(
// pipEnabled: true,
// controlsStyle: ControlsStyle.secondary,
// enabledButtons: const EnabledButtons(pip: true),
// );
StreamSubscription? _playerEventSubs;
bool isPlay = false;
bool isShowCover = true;
double doubleOffset = 0;
@override
void initState() {
super.initState();
_meeduPlayerController = videoDetailController.meeduPlayerController;
_playerEventSubs = _meeduPlayerController!.onPlayerStatusChanged.listen(
(PlayerStatus status) {
if (status == PlayerStatus.playing) {
Wakelock.enable();
print('开始播放了');
isPlay = false;
isShowCover = false;
setState(() {});
} else {
isPlay = true;
setState(() {});
Wakelock.disable();
}
},
);
animationController = AnimationController(
vsync: this, duration: const Duration(milliseconds: 600));
_extendNestCtr.addListener(
() {
print(_extendNestCtr.position.pixels);
double offset = _extendNestCtr.position.pixels;
if (offset > doubleOffset) {
animationController.forward();
} else {
animationController.reverse();
}
doubleOffset = offset;
setState(() {});
},
);
}
Future<void> _meeduDispose() async {
if (_meeduPlayerController != null) {
_playerEventSubs?.cancel();
await _meeduPlayerController!.dispose();
_meeduPlayerController = null;
// The next line disables the wakelock again.
await Wakelock.disable();
}
}
@override
void dispose() {
videoDetailController.meeduPlayerController.dispose();
super.dispose();
}
@override
// 离开当前页面时
void didPushNext() async {
if(!_meeduPlayerController!.pipEnabled){
_meeduPlayerController!.pause();
}
super.didPushNext();
}
@override
// 返回当前页面时
void didPopNext() async {
if (_extendNestCtr.position.pixels == 0) {
await Future.delayed(const Duration(milliseconds: 300));
_meeduPlayerController!.play();
}
super.didPopNext();
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
VideoDetailPage.routeObserver
.subscribe(this, ModalRoute.of(context) as PageRoute);
}
@override
Widget build(BuildContext context) {
final double statusBarHeight = MediaQuery.of(context).padding.top;
final double pinnedHeaderHeight = statusBarHeight +
kToolbarHeight +
MediaQuery.of(context).size.width * 9 / 16;
final videoHeight = MediaQuery.of(context).size.width * 9 / 16;
final double pinnedHeaderHeight =
statusBarHeight + kToolbarHeight + videoHeight;
return DefaultTabController(
initialIndex: videoDetailController.tabInitialIndex,
length: videoDetailController.tabs.length, // tab的数量.
@ -43,20 +139,19 @@ class _VideoDetailPageState extends State<VideoDetailPage>
resizeToAvoidBottomInset: false,
key: videoDetailController.scaffoldKey,
body: ExtendedNestedScrollView(
controller: _extendNestCtr,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
title: const Text("视频详情"),
pinned: true,
automaticallyImplyLeading: false,
pinned: false,
elevation: 0,
scrolledUnderElevation: 0,
forceElevated: innerBoxIsScrolled,
expandedHeight:
MediaQuery.of(context).size.width * 9 / 16,
collapsedHeight:
MediaQuery.of(context).size.width * 9 / 16,
backgroundColor: Colors.black,
expandedHeight: videoHeight,
// collapsedHeight: videoHeight,
backgroundColor: Theme.of(context).colorScheme.background,
flexibleSpace: FlexibleSpaceBar(
background: Padding(
padding: EdgeInsets.only(
@ -65,16 +160,66 @@ class _VideoDetailPageState extends State<VideoDetailPage>
builder: (context, boxConstraints) {
double maxWidth = boxConstraints.maxWidth;
double maxHeight = boxConstraints.maxHeight;
double PR =
MediaQuery.of(context).devicePixelRatio;
return Hero(
// double PR =
// MediaQuery.of(context).devicePixelRatio;
return Stack(
children: [
AspectRatio(
aspectRatio: 16 / 9,
child: MeeduVideoPlayer(
controller: _meeduPlayerController!,
header: (BuildContext context,
MeeduPlayerController
_meeduPlayerController,
Responsive) {
return AppBar(
toolbarHeight: 40,
backgroundColor: Colors.transparent,
primary: false,
elevation: 0,
scrolledUnderElevation: 0,
foregroundColor: Colors.white,
leading: IconButton(
onPressed: () {
Get.back();
},
icon: const Icon(
Icons.arrow_back_ios,
size: 19,
),
),
title: Text(
'视频详情',
style: TextStyle(
color: Colors.white,
fontSize: Theme.of(context)
.textTheme
.titleSmall!
.fontSize),
),
);
},
),
),
Visibility(
visible: isShowCover,
child: Positioned(
top: 0,
left: 0,
right: 0,
child: Hero(
tag: videoDetailController.heroTag,
child: NetworkImgLayer(
type: 'emote',
src: videoDetailController.videoItem['pic'],
src: videoDetailController
.videoItem['pic'],
width: maxWidth,
height: maxHeight,
),
),
),
),
],
);
},
),
@ -84,7 +229,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
];
},
pinnedHeaderSliverHeightBuilder: () {
return pinnedHeaderHeight;
return isPlay
? MediaQuery.of(context).padding.top + 50
: pinnedHeaderHeight;
},
onlyOneScrollInBody: true,
body: Column(
@ -148,6 +295,51 @@ class _VideoDetailPageState extends State<VideoDetailPage>
),
),
),
// 播放完成/暂停播放
Positioned(
top: -MediaQuery.of(context).padding.top +
(doubleOffset / videoHeight) * 50,
left: 0,
right: 0,
child: Opacity(
opacity: doubleOffset / videoHeight,
child: Container(
height: 50 + MediaQuery.of(context).padding.top,
color: Theme.of(context).colorScheme.background,
padding:
EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: AppBar(
primary: false,
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: true,
title: TextButton(
onPressed: () {
_extendNestCtr.animateTo(0,
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut);
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: const [
Icon(Icons.play_arrow_rounded),
Text('继续播放')
],
),
),
actions: [
IconButton(
onPressed: () {},
icon: const Icon(
Icons.share,
size: 20,
)),
const SizedBox(width: 12)
],
),
),
),
),
],
),
),

View File

@ -7,13 +7,33 @@
#include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h>
#include <flutter_meedu_media_kit/flutter_meedu_media_kit_plugin.h>
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
#include <media_kit_video/media_kit_video_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) flutter_meedu_media_kit_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterMeeduMediaKitPlugin");
flutter_meedu_media_kit_plugin_register_with_registrar(flutter_meedu_media_kit_registrar);
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
g_autoptr(FlPluginRegistrar) media_kit_video_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin");
media_kit_video_plugin_register_with_registrar(media_kit_video_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) window_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
window_manager_plugin_register_with_registrar(window_manager_registrar);
}

View File

@ -4,10 +4,16 @@
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
flutter_meedu_media_kit
media_kit_libs_linux
media_kit_video
screen_retriever
url_launcher_linux
window_manager
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
media_kit_native_event_loop
)
set(PLUGIN_BUNDLED_LIBRARIES)

View File

@ -8,17 +8,33 @@ import Foundation
import connectivity_plus
import device_info_plus
import dynamic_color
import flutter_meedu_media_kit
import media_kit_libs_macos_video
import media_kit_video
import path_provider_foundation
import screen_brightness_macos
import screen_retriever
import share_plus
import shared_preferences_foundation
import sqflite
import url_launcher_macos
import wakelock_macos
import window_manager
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
FlutterMeeduMediaKitPlugin.register(with: registry.registrar(forPlugin: "FlutterMeeduMediaKitPlugin"))
MediaKitLibsMacosVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitLibsMacosVideoPlugin"))
MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin"))
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
}

View File

@ -387,6 +387,23 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_meedu:
dependency: transitive
description:
name: flutter_meedu
sha256: "7be568c2df5036cd050358b589f2b3de3318562710f9a64ea364da5fd7eeafe7"
url: "https://pub.dev"
source: hosted
version: "8.3.1"
flutter_meedu_media_kit:
dependency: "direct main"
description:
path: package
ref: feature-custom
resolved-ref: b3dfea3ccf98cc08fc7d2de438eab0d7959c3c02
url: "https://github.com/guozhigq/flutter_meedu_media_kit.git"
source: git
version: "4.2.10+1"
flutter_smart_dialog:
dependency: "direct main"
description:
@ -395,6 +412,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.9.0+6"
flutter_spinkit:
dependency: transitive
description:
name: flutter_spinkit
sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e
url: "https://pub.dev"
source: hosted
version: "5.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -421,6 +446,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.0"
fullscreen_window:
dependency: transitive
description:
name: fullscreen_window
sha256: fe3014f91bff16a82d142ba9d834980b8a84b4bb03347a92588d389ad92bd1d3
url: "https://pub.dev"
source: hosted
version: "1.0.4"
get:
dependency: "direct main"
description:
@ -581,6 +614,78 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.0"
media_kit:
dependency: transitive
description:
name: media_kit
sha256: "67cb78a254a2559f2d4d4a71748817967e3d8a5512071f4e6f63a1a8b8a50ca7"
url: "https://pub.dev"
source: hosted
version: "0.0.9+1"
media_kit_libs_android_video:
dependency: transitive
description:
name: media_kit_libs_android_video
sha256: df98da77eb6ec3473cf627abc68702f9be5a47fd788de7fb4c70863ee82789c5
url: "https://pub.dev"
source: hosted
version: "1.0.5"
media_kit_libs_ios_video:
dependency: transitive
description:
name: media_kit_libs_ios_video
sha256: "28c6ddd5ed43263641293832c8d1fb3f24af81b4eba0b61d6da9bedadbf2e1b1"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
media_kit_libs_linux:
dependency: transitive
description:
name: media_kit_libs_linux
sha256: "21acc71cbae3518b3aeef9023a6a3a3decb579a40153764333814987ccd61040"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
media_kit_libs_macos_video:
dependency: transitive
description:
name: media_kit_libs_macos_video
sha256: c4d3706af5a67bf194d8208eef5cf29ea79e64931ea9bcd50f665b9a438f8416
url: "https://pub.dev"
source: hosted
version: "1.0.5"
media_kit_libs_windows_video:
dependency: transitive
description:
name: media_kit_libs_windows_video
sha256: "99a3a85b185ae012a8e3bd596cf0ca425834477d0bec86207548d6ff7c926254"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
media_kit_native_event_loop:
dependency: transitive
description:
name: media_kit_native_event_loop
sha256: "521125e534603c3f603b93283db3938f557f33ecc383fbd62edd4beb3bf73747"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
media_kit_video:
dependency: transitive
description:
name: media_kit_video
sha256: "89d3c2cdb0f74d1bb597a9c9a7678f656fe538d20620ad1317b7354fd5d1af15"
url: "https://pub.dev"
source: hosted
version: "0.0.12"
meedu:
dependency: transitive
description:
name: meedu
sha256: "2cac0971ea211b1a18e3c4f038369f8ac57401760342da16d9e4e9d043f7de38"
url: "https://pub.dev"
source: hosted
version: "8.0.2"
meta:
dependency: transitive
description:
@ -789,6 +894,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.27.7"
safe_local_storage:
dependency: transitive
description:
name: safe_local_storage
sha256: ede4eb6cb7d88a116b3d3bf1df70790b9e2038bc37cb19112e381217c74d9440
url: "https://pub.dev"
source: hosted
version: "1.0.2"
screen_brightness:
dependency: transitive
description:
name: screen_brightness
sha256: "62fd61a64e68b32b98b840bad7d8b6822bbc40e63c2b569a5f85528484c86b41"
url: "https://pub.dev"
source: hosted
version: "0.2.2"
screen_brightness_android:
dependency: transitive
description:
name: screen_brightness_android
sha256: "3df10961e3a9e968a5e076fe27e7f4741fa8a1d3950bdeb48cf121ed529d0caf"
url: "https://pub.dev"
source: hosted
version: "0.1.0+2"
screen_brightness_ios:
dependency: transitive
description:
name: screen_brightness_ios
sha256: "99adc3ca5490b8294284aad5fcc87f061ad685050e03cf45d3d018fe398fd9a2"
url: "https://pub.dev"
source: hosted
version: "0.1.0"
screen_brightness_macos:
dependency: transitive
description:
name: screen_brightness_macos
sha256: "64b34e7e3f4900d7687c8e8fb514246845a73ecec05ab53483ed025bd4a899fd"
url: "https://pub.dev"
source: hosted
version: "0.1.0+1"
screen_brightness_platform_interface:
dependency: transitive
description:
name: screen_brightness_platform_interface
sha256: b211d07f0c96637a15fb06f6168617e18030d5d74ad03795dd8547a52717c171
url: "https://pub.dev"
source: hosted
version: "0.1.0"
screen_brightness_windows:
dependency: transitive
description:
name: screen_brightness_windows
sha256: "80d90ecdc63fc0823f2ecb1be323471619287937e14210650d7b25ca181abd05"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
screen_retriever:
dependency: transitive
description:
name: screen_retriever
sha256: "4931f226ca158123ccd765325e9fbf360bfed0af9b460a10f960f9bb13d58323"
url: "https://pub.dev"
source: hosted
version: "0.1.6"
share_plus:
dependency: "direct main"
description:
@ -805,6 +974,62 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
shared_preferences:
dependency: transitive
description:
name: shared_preferences
sha256: "16d3fb6b3692ad244a695c0183fca18cf81fd4b821664394a781de42386bf022"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
sha256: "6478c6bbbecfe9aced34c483171e90d7c078f5883558b30ec3163cf18402c749"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: e014107bb79d6d3297196f4f2d0db54b5d1f85b8ea8ff63b8e8b391a02700feb
url: "https://pub.dev"
source: hosted
version: "2.2.2"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
sha256: "9d387433ca65717bbf1be88f4d5bb18f10508917a8fa2fb02e0fd0d7479a9afa"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
sha256: fb5cf25c0235df2d0640ac1b1174f6466bd311f621574997ac59018a6664548d
url: "https://pub.dev"
source: hosted
version: "2.2.0"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
sha256: "74083203a8eae241e0de4a0d597dbedab3b8fef5563f33cf3c12d7e93c655ca5"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
sha256: "5e588e2efef56916a3b229c3bfe81e6a525665a454519ca51dbcc4236a274173"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
shelf:
dependency: transitive
description:
@ -938,6 +1163,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
universal_platform:
dependency: transitive
description:
name: universal_platform
sha256: d315be0f6641898b280ffa34e2ddb14f3d12b1a37882557869646e0cc363d0cc
url: "https://pub.dev"
source: hosted
version: "1.0.0+1"
uri_parser:
dependency: transitive
description:
name: uri_parser
sha256: "6543c9fd86d2862fac55d800a43e67c0dcd1a41677cb69c2f8edfe73bbcf1835"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
url_launcher:
dependency: "direct main"
description:
@ -1026,6 +1267,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.3.3"
volume_controller:
dependency: transitive
description:
name: volume_controller
sha256: "189bdc7a554f476b412e4c8b2f474562b09d74bc458c23667356bce3ca1d48c9"
url: "https://pub.dev"
source: hosted
version: "2.0.7"
wakelock:
dependency: transitive
description:
name: wakelock
sha256: "769ecf42eb2d07128407b50cb93d7c10bd2ee48f0276ef0119db1d25cc2f87db"
url: "https://pub.dev"
source: hosted
version: "0.6.2"
wakelock_macos:
dependency: transitive
description:
name: wakelock_macos
sha256: "047c6be2f88cb6b76d02553bca5a3a3b95323b15d30867eca53a19a0a319d4cd"
url: "https://pub.dev"
source: hosted
version: "0.4.0"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_platform_interface
sha256: "1f4aeb81fb592b863da83d2d0f7b8196067451e4df91046c26b54a403f9de621"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
wakelock_web:
dependency: transitive
description:
name: wakelock_web
sha256: "1b256b811ee3f0834888efddfe03da8d18d0819317f20f6193e2922b41a501b5"
url: "https://pub.dev"
source: hosted
version: "0.4.0"
wakelock_windows:
dependency: transitive
description:
name: wakelock_windows
sha256: "857f77b3fe6ae82dd045455baa626bc4b93cb9bb6c86bf3f27c182167c3a5567"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
watcher:
dependency: transitive
description:
@ -1090,6 +1379,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.4"
window_manager:
dependency: transitive
description:
name: window_manager
sha256: "95096fede562cbb65f30d38b62d819a458f59ba9fe4a317f6cee669710f6676b"
url: "https://pub.dev"
source: hosted
version: "0.3.4"
xdg_directories:
dependency: transitive
description:

View File

@ -73,6 +73,12 @@ dependencies:
# toast
flutter_smart_dialog: ^4.9.0+6
dismissible_page: ^1.0.2
flutter_meedu_media_kit:
# path: /Users/rr/Desktop/code/flutter_meedu_media_kit/package
git:
url: https://github.com/guozhigq/flutter_meedu_media_kit.git
ref: feature-custom
path: package
dev_dependencies:
flutter_test:

View File

@ -8,19 +8,40 @@
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <flutter_meedu_media_kit/flutter_meedu_media_kit_plugin_c_api.h>
#include <fullscreen_window/fullscreen_window_plugin_c_api.h>
#include <media_kit_libs_windows_video/media_kit_libs_windows_video_plugin_c_api.h>
#include <media_kit_video/media_kit_video_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <screen_brightness_windows/screen_brightness_windows_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_manager/window_manager_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
FlutterMeeduMediaKitPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterMeeduMediaKitPluginCApi"));
FullscreenWindowPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FullscreenWindowPluginCApi"));
MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitLibsWindowsVideoPluginCApi"));
MediaKitVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
ScreenBrightnessWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin"));
ScreenRetrieverPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowManagerPlugin"));
}

View File

@ -5,12 +5,20 @@
list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
dynamic_color
flutter_meedu_media_kit
fullscreen_window
media_kit_libs_windows_video
media_kit_video
permission_handler_windows
screen_brightness_windows
screen_retriever
share_plus
url_launcher_windows
window_manager
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
media_kit_native_event_loop
)
set(PLUGIN_BUNDLED_LIBRARIES)