Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluttercommunity/chewie
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: VenusCao/chewie
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 8 commits
  • 2 files changed
  • 1 contributor

Commits on May 20, 2024

  1. Update player_with_controls.dart

    crop
    VenusCao authored May 20, 2024
    Copy the full SHA
    d62e106 View commit details
  2. Update player_with_controls.dart

    fix
    VenusCao authored May 20, 2024
    Copy the full SHA
    e688c5d View commit details
  3. Update player_with_controls.dart

    fix
    VenusCao authored May 20, 2024
    Copy the full SHA
    1e08c31 View commit details
  4. Update player_with_controls.dart

    fix
    VenusCao authored May 20, 2024
    Copy the full SHA
    e1c86f5 View commit details
  5. Update player_with_controls.dart

    fix
    VenusCao authored May 20, 2024
    Copy the full SHA
    3cfe251 View commit details

Commits on Jul 2, 2024

  1. Update utils.dart

    VenusCao authored Jul 2, 2024
    Copy the full SHA
    5845696 View commit details
  2. Update utils.dart

    VenusCao authored Jul 2, 2024
    Copy the full SHA
    208f3f3 View commit details
  3. Update utils.dart

    VenusCao authored Jul 2, 2024
    Copy the full SHA
    34d79be View commit details
Showing with 28 additions and 6 deletions.
  1. +6 −3 lib/src/helpers/utils.dart
  2. +22 −3 lib/src/player_with_controls.dart
9 changes: 6 additions & 3 deletions lib/src/helpers/utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
String formatDuration(Duration position) {
String formatDuration(Duration position,{bool showHours=false}) {
final ms = position.inMilliseconds;

int seconds = ms ~/ 1000;
@@ -25,8 +25,11 @@ String formatDuration(Duration position) {
? '00'
: '0$seconds';

final formattedTime =
var formattedTime =
'${hoursString == '00' ? '' : '$hoursString:'}$minutesString:$secondsString';

if(showHours){
formattedTime =
'$hoursString:$minutesString:$secondsString';
}
return formattedTime;
}
25 changes: 22 additions & 3 deletions lib/src/player_with_controls.dart
Original file line number Diff line number Diff line change
@@ -34,21 +34,40 @@ class PlayerWithControls extends StatelessWidget {
BuildContext context,
) {
return Stack(
children: <Widget>[
children: [
if (chewieController.placeholder != null)
chewieController.placeholder!,

InteractiveViewer(
transformationController: chewieController.transformationController,
maxScale: chewieController.maxScale,
panEnabled: chewieController.zoomAndPan,
scaleEnabled: chewieController.zoomAndPan,
child: Center(
child:
chewieController.aspectRatio==null?
Center(
child: AspectRatio(
aspectRatio: chewieController.aspectRatio ??
chewieController.videoPlayerController.value.aspectRatio,
child: VideoPlayer(chewieController.videoPlayerController),
),
),
):
Center(
child: AspectRatio(
aspectRatio: chewieController.aspectRatio!,
child: FittedBox(
fit: BoxFit.cover,
child: SizedBox(
width: chewieController.videoPlayerController.value.size?.width ?? 0,
height: chewieController.videoPlayerController.value.size?.height ?? 0,
child: AspectRatio(
aspectRatio: chewieController.videoPlayerController.value.aspectRatio,
child: VideoPlayer(chewieController.videoPlayerController),
),
),
),
),
)
),
if (chewieController.overlay != null) chewieController.overlay!,
if (Theme.of(context).platform != TargetPlatform.iOS)