Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude:
- "**"
errors:
missing_required_param: error
prefer_const_declarations: warning
prefer_const_constructors: warning
import_of_legacy_library_into_null_safe: warning
public_member_api_docs: ignore
language:
strict-casts: true
Expand Down
73 changes: 29 additions & 44 deletions example/lib/screens/cutom_video_controllers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
late PodPlayerController controller;
bool? isVideoPlaying;
final videoTextFieldCtr = TextEditingController(
text:
'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4',
text: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4',
);
final vimeoTextFieldCtr = TextEditingController(
text: '518228118',
Expand Down Expand Up @@ -67,22 +66,18 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
Widget build(BuildContext context) {
///
const sizeH20 = SizedBox(height: 20);
final totalHour = controller.currentVideoPosition.inHours == 0
? '0'
: '${controller.currentVideoPosition.inHours}:';
final totalMinute =
controller.currentVideoPosition.toString().split(':')[1];
final totalSeconds = (controller.currentVideoPosition -
Duration(minutes: controller.currentVideoPosition.inMinutes))
.inSeconds
.toString()
.padLeft(2, '0');
final totalHour =
controller.currentVideoPosition.inHours == 0 ? '0' : '${controller.currentVideoPosition.inHours}:';
final totalMinute = controller.currentVideoPosition.toString().split(':')[1];
final totalSeconds =
(controller.currentVideoPosition - Duration(minutes: controller.currentVideoPosition.inMinutes))
.inSeconds
.toString()
.padLeft(2, '0');

///
const videoTitle = Padding(
padding: kIsWeb
? EdgeInsets.symmetric(vertical: 25, horizontal: 15)
: EdgeInsets.only(left: 15),
padding: kIsWeb ? EdgeInsets.symmetric(vertical: 25, horizontal: 15) : EdgeInsets.only(left: 15),
child: Text(
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
style: TextStyle(
Expand Down Expand Up @@ -149,46 +144,37 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
sizeH20,
_loadVideoFromYoutube(),
sizeH20,
_iconButton('Hide progress bar on overlay hidden',
Icons.hide_source, onPressed: () {
_iconButton('Hide progress bar on overlay hidden', Icons.hide_source, onPressed: () {
setState(() {
alwaysShowProgressBar = false;
});
}),
sizeH20,
_iconButton('Show Overlay', Icons.slideshow_outlined,
onPressed: () {
_iconButton('Show Overlay', Icons.slideshow_outlined, onPressed: () {
controller.showOverlay();
}),
sizeH20,
_iconButton('Hide Overlay', Icons.hide_image,
onPressed: () {
_iconButton('Hide Overlay', Icons.hide_image, onPressed: () {
controller.hideOverlay();
}),
_iconButton('Backward video 5s', Icons.replay_5_rounded,
onPressed: () {
_iconButton('Backward video 5s', Icons.replay_5_rounded, onPressed: () {
controller.doubleTapVideoBackward(5);
}),
sizeH20,
_iconButton('Forward video 5s', Icons.forward_5_rounded,
onPressed: () {
_iconButton('Forward video 5s', Icons.forward_5_rounded, onPressed: () {
controller.doubleTapVideoForward(5);
}),
sizeH20,
_iconButton('Video Jump to 01:00 minute',
Icons.fast_forward_rounded, onPressed: () {
_iconButton('Video Jump to 01:00 minute', Icons.fast_forward_rounded, onPressed: () {
controller.videoSeekTo(const Duration(minutes: 1));
}),
sizeH20,
_iconButton('Enable full screen', Icons.fullscreen,
onPressed: () {
_iconButton('Enable full screen', Icons.fullscreen, onPressed: () {
controller.enableFullScreen();
}),
sizeH20,
_iconButton(
controller.isMute ? 'UnMute video' : 'mute video',
controller.isMute ? Icons.volume_up : Icons.volume_off,
onPressed: () {
_iconButton(controller.isMute ? 'UnMute video' : 'mute video',
controller.isMute ? Icons.volume_up : Icons.volume_off, onPressed: () {
controller.toggleVolume();
}),
sizeH20,
Expand Down Expand Up @@ -217,16 +203,19 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
backgroundColor: Colors.black,
onPressed: () => controller.togglePlayPause(),
child: isVideoPlaying == null
? const SizedBox(
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
backgroundColor: Colors.black,
color: Colors.white,
color: Theme.of(context).colorScheme.primary,
strokeWidth: 1,
),
)
: Icon(!isVideoPlaying! ? Icons.play_arrow : Icons.pause),
: Icon(
!isVideoPlaying! ? Icons.play_arrow : Icons.pause,
color: Theme.of(context).colorScheme.primary,
),
),
);
}
Expand Down Expand Up @@ -267,8 +256,7 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
if (!mounted) return;
ScaffoldMessenger.of(context).hideCurrentSnackBar();
} catch (e) {
snackBar(
"Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e");
snackBar("Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e");
}
},
child: const Text('Load Video'),
Expand Down Expand Up @@ -313,8 +301,7 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
if (!mounted) return;
ScaffoldMessenger.of(context).hideCurrentSnackBar();
} catch (e) {
snackBar(
"Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e");
snackBar("Unable to load,${kIsWeb ? 'Please enable CORS in web' : ''} \n$e");
}
},
child: const Text('Load Video'),
Expand Down Expand Up @@ -372,12 +359,10 @@ class _CustomVideoControllsState extends State<CustomVideoControlls> {
);
}

ElevatedButton _iconButton(String text, IconData icon,
{void Function()? onPressed}) {
ElevatedButton _iconButton(String text, IconData icon, {void Function()? onPressed}) {
return ElevatedButton.icon(
onPressed: onPressed ?? () {},
style: ElevatedButton.styleFrom(
fixedSize: const Size.fromWidth(double.maxFinite)),
style: ElevatedButton.styleFrom(fixedSize: const Size.fromWidth(double.maxFinite)),
icon: Icon(icon),
label: Text(text));
}
Expand Down
1 change: 1 addition & 0 deletions example/lib/screens/from_youtube.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class _PlayVideoFromVimeoIdState extends State<PlayVideoFromYoutube> {
shrinkWrap: true,
children: [
PodVideoPlayer(
podProgressBarConfig: const PodProgressBarConfig(),
controller: controller,
videoThumbnail: const DecorationImage(
image: NetworkImage(
Expand Down
2 changes: 1 addition & 1 deletion example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.11'
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
35 changes: 9 additions & 26 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,52 +1,35 @@
PODS:
- FlutterMacOS (1.0.0)
- media_kit_libs_macos_video (1.0.4):
- FlutterMacOS
- media_kit_native_event_loop (1.0.0):
- FlutterMacOS
- media_kit_video (0.0.1):
- FlutterMacOS
- package_info_plus (0.0.1):
- FlutterMacOS
- screen_brightness_macos (0.1.0):
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS
- wakelock_plus (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- media_kit_libs_macos_video (from `Flutter/ephemeral/.symlinks/plugins/media_kit_libs_macos_video/macos`)
- media_kit_native_event_loop (from `Flutter/ephemeral/.symlinks/plugins/media_kit_native_event_loop/macos`)
- media_kit_video (from `Flutter/ephemeral/.symlinks/plugins/media_kit_video/macos`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- screen_brightness_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos`)
- video_player_avfoundation (from `Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin`)
- wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
media_kit_libs_macos_video:
:path: Flutter/ephemeral/.symlinks/plugins/media_kit_libs_macos_video/macos
media_kit_native_event_loop:
:path: Flutter/ephemeral/.symlinks/plugins/media_kit_native_event_loop/macos
media_kit_video:
:path: Flutter/ephemeral/.symlinks/plugins/media_kit_video/macos
package_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
screen_brightness_macos:
:path: Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos
video_player_avfoundation:
:path: Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin
wakelock_plus:
:path: Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
media_kit_libs_macos_video: b3e2bbec2eef97c285f2b1baa7963c67c753fb82
media_kit_native_event_loop: 81fd5b45192b72f8b5b69eaf5b540f45777eb8d5
media_kit_video: c75b07f14d59706c775778e4dd47dd027de8d1e5
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda
wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269
package_info_plus: a8a591e70e87ce97ce5d21b2594f69cea9e0312f
video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b
wakelock_plus: 21ddc249ac4b8d018838dbdabd65c5976c308497

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

COCOAPODS: 1.11.2
COCOAPODS: 1.16.2
Loading