Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…player into design
  • Loading branch information
Muhammed-Ramadan512 committed Oct 31, 2023
2 parents a9a93e3 + a589261 commit 275d979
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 79 deletions.
95 changes: 49 additions & 46 deletions lib/src/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,54 +301,57 @@ class _YoYoPlayerState extends State<YoYoPlayer>
height: 40,
width: double.infinity,
// color: Colors.yellow,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 5,
),
topChip(
Text(playbackSpeed.toString() + " x",
style: widget.videoStyle!.qualitystyle),
() {
print("speeed");
setState(() {
m3u8showspeed = !m3u8showspeed;
m3u8show = false;
});
},
),
topChip(
Text(m3u8quality!,
style: widget.videoStyle!.qualitystyle),
() {
// quality function
setState(() {
m3u8show = !m3u8show;
m3u8showspeed = false;
});
},
),
InkWell(
onTap: () => toggleFullScreen(),
child: Container(
margin: EdgeInsets.symmetric(horizontal: 2),
padding:
EdgeInsets.symmetric(horizontal: 3, vertical: 0),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(5)),
child: Icon(
Icons.fullscreen,
color: Colors.white,
size: 33,
child: Directionality(
textDirection: TextDirection.rtl,
child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 5,
),
topChip(
Text(playbackSpeed.toString() + " x",
style: widget.videoStyle!.qualitystyle),
() {
print("speeed");
setState(() {
m3u8showspeed = !m3u8showspeed;
m3u8show = false;
});
},
),
topChip(
Text(m3u8quality!,
style: widget.videoStyle!.qualitystyle),
() {
// quality function
setState(() {
m3u8show = !m3u8show;
m3u8showspeed = false;
});
},
),
InkWell(
onTap: () => toggleFullScreen(),
child: Container(
margin: EdgeInsets.symmetric(horizontal: 2),
padding:
EdgeInsets.symmetric(horizontal: 3, vertical: 0),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(5)),
child: Icon(
Icons.fullscreen,
color: Colors.white,
size: 33,
),
),
),
),
Container(
width: 17,
),
],
Container(
width: 17,
),
],
),
),
),
),
Expand Down
76 changes: 43 additions & 33 deletions lib/src/widget/widget_bottombar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,27 @@ Widget bottomBar({
Column(
children: [
// if (controller!.value.isPlaying)
SmoothVideoProgress(
controller: controller!,
builder: (context, position, duration, child) => Slider(
onChangeStart: (_) => controller.pause(),
onChangeEnd: (_) => controller.play(),
onChanged: (value) => controller
.seekTo(Duration(milliseconds: value.toInt())),
value: position.inMilliseconds.toDouble(),
divisions: duration.inSeconds,
// min: cu,
label: convertDurationToString(
controller.value.position),
Directionality(
textDirection: TextDirection.ltr,
child: SmoothVideoProgress(
controller: controller!,
builder: (context, position, duration, child) =>
Directionality(
textDirection: TextDirection.ltr,
child: Slider(
onChangeStart: (_) => controller.pause(),
onChangeEnd: (_) => controller.play(),
onChanged: (value) => controller.seekTo(
Duration(milliseconds: value.toInt())),
value: position.inMilliseconds.toDouble(),
divisions: duration.inSeconds,
// min: cu,
label: convertDurationToString(
controller.value.position),

max: duration.inMilliseconds.toDouble(),
max: duration.inMilliseconds.toDouble(),
),
),
),
),
// VideoProgressIndicator(
Expand All @@ -72,26 +79,29 @@ Widget bottomBar({
// padding:
// EdgeInsets.only(left: 5.0, right: 5, bottom: 5),
// ),
Padding(
padding: EdgeInsets.only(left: 5.0, right: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
videoSeek!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 17),
),
Text(
videoDuration!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 17),
),
],
Directionality(
textDirection: TextDirection.ltr,
child: Padding(
padding: EdgeInsets.only(left: 5.0, right: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
videoSeek!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 17),
),
Text(
videoDuration!,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 17),
),
],
),
),
),
],
Expand Down

0 comments on commit 275d979

Please sign in to comment.