Skip to content

Commit

Permalink
fix: band-aid fix to disallow linux video fullscreen
Browse files Browse the repository at this point in the history
Ref #1022
  • Loading branch information
Feichtmeier committed Nov 16, 2024
1 parent 6d78c2b commit 1348d48
Show file tree
Hide file tree
Showing 37 changed files with 778 additions and 698 deletions.
7 changes: 7 additions & 0 deletions lib/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ bool allowDiscordRPC = kDebugMode ||
Platform.isMacOS ||
Platform.isWindows ||
bool.tryParse(const String.fromEnvironment('ALLOW_DISCORD_RPC')) == true;

bool get yaruStyled => Platform.isLinux;

bool get appleStyled => Platform.isMacOS || Platform.isIOS;

// TODO(#1022): fix linux video fullscreen
bool get allowVideoFullScreen => !Platform.isLinux;
1 change: 1 addition & 0 deletions lib/common/view/animated_like_icon.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../../app_config.dart';
import 'icons.dart';
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/common/view/audio_autocomplete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:yaru/constants.dart';

import '../../app_config.dart';
import '../../constants.dart';
import '../../extensions/build_context_x.dart';
import '../../extensions/theme_data_x.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/common/view/audio_tile_option_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../extensions/build_context_x.dart';
import '../../l10n/l10n.dart';
import '../../library/library_model.dart';
Expand All @@ -10,7 +11,6 @@ import '../data/audio.dart';
import 'icons.dart';
import 'snackbars.dart';
import 'stream_provider_share_button.dart';
import 'theme.dart';

class AudioTileOptionButton extends StatelessWidget {
const AudioTileOptionButton({
Expand Down
2 changes: 1 addition & 1 deletion lib/common/view/common_widgets.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

import 'theme.dart';
import '../../app_config.dart';

class CommonSwitch extends StatelessWidget {
const CommonSwitch({super.key, required this.value, this.onChanged});
Expand Down
1 change: 1 addition & 0 deletions lib/common/view/country_auto_complete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:podcast_search/podcast_search.dart';

import '../../app_config.dart';
import '../../constants.dart';
import '../../extensions/build_context_x.dart';
import '../../extensions/country_x.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/common/view/drop_down_arrow.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';
import 'theme.dart';

import '../../app_config.dart';

class DropDownArrow extends StatelessWidget {
const DropDownArrow({super.key});
Expand Down
1 change: 1 addition & 0 deletions lib/common/view/header_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app/app_model.dart';
import '../../app_config.dart';
import '../../extensions/build_context_x.dart';
import '../../l10n/l10n.dart';
import '../../library/library_model.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/common/view/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

import 'theme.dart';
import '../../app_config.dart';

class Iconz {
static IconData get image => yaruStyled
Expand Down
1 change: 1 addition & 0 deletions lib/common/view/language_autocomplete.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

import '../../app_config.dart';
import '../../constants.dart';
import '../../extensions/build_context_x.dart';
import '../../extensions/string_x.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/common/view/nav_back_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../library/library_model.dart';
import 'theme.dart';

class NavBackButton extends StatelessWidget {
const NavBackButton({super.key});
Expand Down
1 change: 1 addition & 0 deletions lib/common/view/progress.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../extensions/build_context_x.dart';
import 'theme.dart';

Expand Down
6 changes: 4 additions & 2 deletions lib/common/view/search_button.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import '../../extensions/build_context_x.dart';
import 'icons.dart';
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../extensions/build_context_x.dart';
import 'icons.dart';
import 'theme.dart';

class SearchButton extends StatelessWidget {
Expand Down
5 changes: 4 additions & 1 deletion lib/common/view/search_input.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import '../../extensions/build_context_x.dart';
import 'dart:async';

import 'package:flutter/material.dart';

import '../../app_config.dart';
import '../../extensions/build_context_x.dart';
import 'theme.dart';

class SearchInput extends StatefulWidget {
Expand Down
5 changes: 1 addition & 4 deletions lib/common/view/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../constants.dart';
import 'icons.dart';

Expand Down Expand Up @@ -70,10 +71,6 @@ Color getPlayerBg(Color? surfaceTintColor, Color fallbackColor) {
}
}

bool get yaruStyled => Platform.isLinux;

bool get appleStyled => Platform.isMacOS || Platform.isIOS;

const alphabetColors = {
'A': Colors.red,
'B': Colors.orange,
Expand Down
2 changes: 1 addition & 1 deletion lib/extensions/theme_data_x.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

import '../common/view/theme.dart';
import '../../app_config.dart';

extension ThemeDataX on ThemeData {
bool get isLight => brightness == Brightness.light;
Expand Down
9 changes: 8 additions & 1 deletion lib/player/player_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ class PlayerService {
Media? media = audio!.path != null
? Media('file://${audio!.path!}')
: (audio!.url != null)
? Media(audio!.url!)
? Media(
audio!.url!,
httpHeaders: {
'Accept': '*',
'User-Agent': '$kAppTitle ($kRepoUrl)',
'Content-Language': 'de-DE',
},
)
: null;
if (media == null) return;
_player.open(media).then((_) {
Expand Down
31 changes: 17 additions & 14 deletions lib/player/view/full_height_video_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:watch_it/watch_it.dart';
import 'package:yaru/constants.dart';

import '../../app/connectivity_model.dart';
import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/icons.dart';
import '../../l10n/l10n.dart';
Expand Down Expand Up @@ -58,15 +59,16 @@ class FullHeightVideoPlayer extends StatelessWidget with WatchItMixin {
topButtonBar: [
const Spacer(),
controls,
Tooltip(
message: context.l10n.leaveFullScreen,
child: MaterialFullscreenButton(
icon: Icon(
Iconz.fullScreenExit,
color: baseColor,
if (allowVideoFullScreen)
Tooltip(
message: context.l10n.leaveFullScreen,
child: MaterialFullscreenButton(
icon: Icon(
Iconz.fullScreenExit,
color: baseColor,
),
),
),
),
],
bottomButtonBarMargin: const EdgeInsets.all(20),
bottomButtonBar: [
Expand All @@ -92,15 +94,16 @@ class FullHeightVideoPlayer extends StatelessWidget with WatchItMixin {
topButtonBar: [
const Spacer(),
controls,
Tooltip(
message: context.l10n.fullScreen,
child: MaterialFullscreenButton(
icon: Icon(
Iconz.fullScreen,
color: baseColor,
if (allowVideoFullScreen)
Tooltip(
message: context.l10n.fullScreen,
child: MaterialFullscreenButton(
icon: Icon(
Iconz.fullScreen,
color: baseColor,
),
),
),
),
],
),
child: RepaintBoundary(
Expand Down
2 changes: 1 addition & 1 deletion lib/player/view/player_track.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/custom_track_shape.dart';
import '../../common/view/progress.dart';
import '../../common/view/theme.dart';
import '../../extensions/build_context_x.dart';
import '../../extensions/duration_x.dart';
import '../player_model.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/player/view/seek_button.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';

import '../../app_config.dart';
import '../../common/view/icons.dart';
import '../../common/view/theme.dart';
import '../../extensions/build_context_x.dart';
import '../player_model.dart';

Expand Down
1 change: 1 addition & 0 deletions lib/playlists/view/add_to_playlist_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/common_widgets.dart';
import '../../common/view/global_keys.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/playlists/view/manual_add_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/common_widgets.dart';
import '../../common/view/global_keys.dart';
import '../../common/view/icons.dart';
import '../../common/view/theme.dart';
import '../../constants.dart';
import '../../external_path/external_path_service.dart';
import '../../l10n/l10n.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/podcasts/view/podcast_audio_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/icons.dart';
import '../../common/view/share_button.dart';
Expand All @@ -14,8 +15,8 @@ import '../../extensions/duration_x.dart';
import '../../extensions/int_x.dart';
import '../../l10n/l10n.dart';
import '../../player/player_model.dart';
import 'podcast_tile_play_button.dart';
import 'download_button.dart';
import 'podcast_tile_play_button.dart';

class PodcastAudioTile extends StatelessWidget {
const PodcastAudioTile({
Expand Down
1 change: 1 addition & 0 deletions lib/podcasts/view/podcast_genre_autocomplete.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

import '../../app_config.dart';
import '../../common/data/podcast_genre.dart';
import '../../common/view/theme.dart';
import '../../constants.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/podcasts/view/podcast_tile_play_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:watch_it/watch_it.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/icons.dart';
import '../../common/view/theme.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/radio/view/radio_history_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import 'package:watch_it/watch_it.dart';
import 'package:yaru/constants.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/copy_clipboard_content.dart';
import '../../common/view/icons.dart';
import '../../common/view/mpv_metadata_dialog.dart';
import '../../common/view/snackbars.dart';
import '../../common/view/tapable_text.dart';
import '../../common/view/theme.dart';
import '../../extensions/build_context_x.dart';
import '../../extensions/theme_data_x.dart';
import '../../l10n/l10n.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/radio/view/radio_lib_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:radio_browser_api/radio_browser_api.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/adaptive_container.dart';
import '../../common/view/audio_card.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/radio/view/tag_auto_complete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:radio_browser_api/radio_browser_api.dart' hide State;

import '../../app_config.dart';
import '../../common/view/icons.dart';
import '../../common/view/theme.dart';
import '../../constants.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/search/view/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/rendering.dart';
import 'package:watch_it/watch_it.dart';
import 'package:yaru/theme.dart';

import '../../app_config.dart';
import '../../common/data/audio.dart';
import '../../common/view/adaptive_container.dart';
import '../../common/view/header_bar.dart';
Expand Down
Loading

0 comments on commit 1348d48

Please sign in to comment.