v1.2.1+55
All checks were successful
Flutter Schmutter / build (push) Successful in 3m42s

- fix deeplink
- add mute button
This commit is contained in:
2025-06-13 15:01:48 +02:00
parent 9655f15927
commit 2a500144f5
7 changed files with 46 additions and 14 deletions

View File

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:f0ckapp/services/api_service.dart';
import 'package:flutter/material.dart';
import 'package:cached_video_player_plus/cached_video_player_plus.dart';
@ -7,6 +8,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:f0ckapp/models/mediaitem_model.dart';
import 'package:f0ckapp/widgets/videooverlay_widget.dart';
import 'package:get/get.dart';
class VideoWidget extends StatefulWidget {
final MediaItem details;
@ -25,6 +27,7 @@ class VideoWidget extends StatefulWidget {
}
class _VideoWidgetState extends State<VideoWidget> {
final ApiService apiService = Get.find<ApiService>();
late CachedVideoPlayerPlusController _controller;
bool _showControls = false;
Timer? _hideControlsTimer;
@ -49,8 +52,7 @@ class _VideoWidgetState extends State<VideoWidget> {
}
_controller.setLooping(true);
//final bool muted = ref.read(mediaProvider).muted;
//_controller.setVolume(muted ? 0.0 : 1.0);
_controller.setVolume(apiService.muted.value ? 0.0 : 1.0);
}
@override
@ -86,11 +88,11 @@ class _VideoWidgetState extends State<VideoWidget> {
@override
Widget build(BuildContext context) {
//final bool muted = ref.watch(mediaProvider).muted;
//if (_controller.value.isInitialized &&
// _controller.value.volume != (muted ? 0.0 : 1.0)) {
// _controller.setVolume(muted ? 0.0 : 1.0);
//}
final bool muted = apiService.muted.value;
if (_controller.value.isInitialized &&
_controller.value.volume != (muted ? 0.0 : 1.0)) {
_controller.setVolume(muted ? 0.0 : 1.0);
}
bool isAudio = widget.details.mime.startsWith('audio');