Skip to content

Commit 8f20dba

Browse files
committed
Added current playing video title in video player screen
1 parent 61f8a13 commit 8f20dba

File tree

6 files changed

+27
-32
lines changed

6 files changed

+27
-32
lines changed

.vscode/settings.json

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"Furqan",
88
"hugeicons",
99
"objectbox",
10+
"Oriention",
11+
"Potrait",
1012
"rxdart",
1113
"Uddin"
1214
],

lib/data/services/video/video_player_services.dart

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ final class VideoPlayerService implements VideoPlayerServiceBase {
4141
VideoPlayerReadyState(
4242
vlcPlayerController: vlcPlayerController,
4343
playingVideoPath: videos[videoIndex].path,
44+
currentVideo: videos[videoIndex],
4445
),
4546
);
4647
} catch (e) {

lib/logic/video_player_bloc/video_player_state.dart

+10-8
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ final class VideoPlayerLoadingState extends VideoPlayerState {
2121

2222
/// State when video is ready to play
2323
final class VideoPlayerReadyState extends VideoPlayerState {
24-
const VideoPlayerReadyState(
25-
{required this.vlcPlayerController,
26-
required this.playingVideoPath,
27-
});
24+
const VideoPlayerReadyState({
25+
required this.vlcPlayerController,
26+
required this.playingVideoPath,
27+
required this.currentVideo
28+
});
2829
final VlcPlayerController vlcPlayerController;
2930
final String playingVideoPath;
30-
31-
31+
final VideoModel currentVideo;
3232

3333
@override
34-
List<Object> get props =>
35-
[vlcPlayerController, playingVideoPath, ];
34+
List<Object> get props => [
35+
vlcPlayerController,
36+
playingVideoPath,
37+
];
3638
}
3739

3840
/// Error state when video playback fails

lib/presentation/common/widgets/elegant_video_tile_widget.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ElegantVideoTileWidget extends StatelessWidget {
5252
),
5353
child: Row(
5454
children: [
55-
// Video Thubnail
55+
// Video Thumbnail
5656
Container(
5757
margin: const EdgeInsets.symmetric(horizontal: 16),
5858
padding: const EdgeInsets.all(10),

lib/presentation/pages/players/video/view/video_player.dart

-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ class VideoPlayerPage extends StatelessWidget {
4040
),
4141
);
4242
} else if (state is VideoPlayerReadyState) {
43-
// return PiPSwitcher(
44-
// childWhenDisabled:
45-
// VideoContentWidget(
46-
// videoPlayerReadyState: state,
47-
// ), childWhenEnabled: VideoViewWidget(state: state),
48-
// );
49-
5043
return VideoContentWidget(
5144
videoPlayerReadyState: state,
5245
);

lib/presentation/pages/players/video/widgets/video_player_top_bar_widget.dart

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
// video_player/presentation/pages/video_player_page.dart
2-
31
import 'package:animate_do/animate_do.dart';
42
import 'package:flutter/cupertino.dart';
5-
// import 'package:floating/floating.dart';
63
import 'package:flutter/material.dart';
74
import 'package:flutter/services.dart';
85
import 'package:flutter_bloc/flutter_bloc.dart';
96
import 'package:flutter_hooks/flutter_hooks.dart';
107
import 'package:go_router/go_router.dart';
118
import 'package:hugeicons/hugeicons.dart';
12-
// import 'package:open_player/base/di/injection.dart';
139
import 'package:open_player/logic/Control_visibility/controls_visibility_cubit.dart';
1410
import 'package:open_player/logic/video_player_bloc/video_player_bloc.dart';
1511
import 'package:open_player/presentation/pages/players/video/widgets/video_player_icon_button_widget.dart';
1612
import 'package:velocity_x/velocity_x.dart';
17-
// import '../../../../../data/services/picture_in_picture_service/picture_in_picture_service.dart';
1813
import '../../../../../data/services/favorites_video_hive_service/favorites_video_hive_service.dart';
1914
import '../../../../common/methods/set_orientation_potrait.dart';
2015
import '../../../../common/methods/system_ui_mode.dart';
16+
import '../../../../common/widgets/animated_auto_scroll_text_widget.dart';
2117
import 'video_player_audios_selector_widget.dart';
2218

2319
class VideoPlayerTopBarWidget extends HookWidget {
@@ -58,26 +54,27 @@ class VideoPlayerTopBarWidget extends HookWidget {
5854
},
5955
),
6056

61-
//---------- Video Title
57+
//------------- TITLE ----------------//
6258
Expanded(
63-
child: Text(
64-
"Now Playing",
65-
style: const TextStyle(
66-
color: Colors.white,
67-
fontSize: 18,
68-
fontWeight: FontWeight.w600,
69-
),
70-
textAlign: TextAlign.center,
59+
child: AnimatedAutoScrollTextWidget(
60+
state.currentVideo.title,
61+
style: TextStyle(
62+
fontSize: 18,
63+
color: Colors.white,
64+
shadows: [
65+
Shadow(
66+
blurRadius: 3,
67+
offset: Offset(0, 0),
68+
color: Colors.black38),
69+
]),
7170
),
7271
),
7372

7473
//--------- Favorite/Like Button
75-
7674
IconButton(
7775
iconSize: 28,
7876
color: Colors.white,
7977
onPressed: () async {
80-
8178
//-------- Update the favorite status and retrun it
8279
final favorite = await FavoritesVideoHiveService()
8380
.toggleFavorite(state.playingVideoPath);

0 commit comments

Comments
 (0)