diff --git a/lib/player/states/player.dart b/lib/player/states/player.dart index 2d61d2d3..83a8b54b 100644 --- a/lib/player/states/player.dart +++ b/lib/player/states/player.dart @@ -301,6 +301,7 @@ class PlayerCubit extends Cubit { } playNext() { + if (state.videos.isNotEmpty || state.offlineVideos.isNotEmpty) { var state = this.state.copyWith(); var listToUpdate = state.videos.isNotEmpty ? state.videos : state.offlineVideos; diff --git a/lib/player/states/video_player.dart b/lib/player/states/video_player.dart index 3f8a3f00..f16a433d 100644 --- a/lib/player/states/video_player.dart +++ b/lib/player/states/video_player.dart @@ -237,13 +237,14 @@ class VideoPlayerCubit extends MediaPlayerCubit { Map resolutions = {}; bool isHls = state.video!.hlsUrl != null; - var formatStream = state.video!.formatStreams[state.video!.formatStreams.length - 1]; + + var formatStream = isHls ? null : state.video!.formatStreams[state.video!.formatStreams.length - 1]; String videoUrl = isHls ? '${state.video!.hlsUrl!}${service.useProxy() ? '?local=true' : ''}' : state.useDash ? '${state.video!.dashUrl}${service.useProxy() ? '?local=true' : ''}' - : formatStream.url; - if (!state.useDash) { + : formatStream?.url ?? ''; + if (!state.useDash && formatStream != null) { state.selectedNonDashTrack = formatStream.resolution; } diff --git a/lib/player/views/components/mini_player_progress.dart b/lib/player/views/components/mini_player_progress.dart index 4a6930e2..d8a30cc8 100644 --- a/lib/player/views/components/mini_player_progress.dart +++ b/lib/player/views/components/mini_player_progress.dart @@ -13,25 +13,27 @@ class MiniPlayerProgress extends StatelessWidget { buildWhen: (previous, current) => previous.position != current.position, builder: (context, _) { var player = context.read(); - return Container( - alignment: Alignment.centerLeft, - width: double.infinity, - height: 2, - decoration: BoxDecoration( - color: colors.secondaryContainer, - borderRadius: BorderRadius.circular(20), - ), - child: AnimatedFractionallySizedBox( - widthFactor: _.position.inMilliseconds / player.duration.inMilliseconds, - heightFactor: 1, - duration: const Duration(milliseconds: 750), - curve: Curves.easeInOutQuad, - child: Container( - decoration: BoxDecoration( - color: colors.primary, - borderRadius: BorderRadius.circular(20), - ), - ))); + return !(player.state.currentlyPlaying?.liveNow ?? false) + ? Container( + alignment: Alignment.centerLeft, + width: double.infinity, + height: 2, + decoration: BoxDecoration( + color: colors.secondaryContainer, + borderRadius: BorderRadius.circular(20), + ), + child: AnimatedFractionallySizedBox( + widthFactor: _.position.inMilliseconds / player.duration.inMilliseconds, + heightFactor: 1, + duration: const Duration(milliseconds: 750), + curve: Curves.easeInOutQuad, + child: Container( + decoration: BoxDecoration( + color: colors.primary, + borderRadius: BorderRadius.circular(20), + ), + ))) + : const SizedBox.shrink(); }, ); } diff --git a/lib/player/views/components/player_controls.dart b/lib/player/views/components/player_controls.dart index 2268d08c..c8075983 100644 --- a/lib/player/views/components/player_controls.dart +++ b/lib/player/views/components/player_controls.dart @@ -86,7 +86,7 @@ class PlayerControls extends StatelessWidget { showOptionMenu(BuildContext context, PlayerControlsState controls, MediaPlayerCubit pc) { var locals = AppLocalizations.of(context)!; - + var player = context.read(); var videoTracks = pc.getVideoTracks(); var audioTracks = pc.getAudioTracks(); var subtitles = pc.getSubtitles(); @@ -149,7 +149,7 @@ class PlayerControls extends StatelessWidget { leading: const Icon(Icons.music_note), title: Text(locals.audio), ), - if (pc.hasDashToggle()) + if (pc.hasDashToggle() && !(player.state.currentlyPlaying?.liveNow ?? false)) ListTile( onTap: () { Navigator.of(context).pop(); @@ -240,7 +240,7 @@ class PlayerControls extends StatelessWidget { } ], ), - Padding( + if(!(player.state.currentlyPlaying?.liveNow ?? false)) Padding( padding: const EdgeInsets.only(top: 0.0, right: 8), child: Row( children: [ diff --git a/pubspec.yaml b/pubspec.yaml index c1ebc095..e5be90c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.14.0+4016 +version: 1.14.1+4017 environment: sdk: '>=3.0.0 <4.0.0'