1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

feat(mobile): add additional request headers (#10588)

* add additional request headers

* improve interface

* move headers under advanced settings

* refactor

* refactor

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Matej Kramny
2024-06-26 15:31:55 -04:00
committed by GitHub
parent a3c3619811
commit 922430da36
23 changed files with 320 additions and 48 deletions

View File

@ -1,5 +1,6 @@
import 'package:immich_mobile/entities/asset.entity.dart';
import 'package:immich_mobile/entities/store.entity.dart';
import 'package:immich_mobile/services/api.service.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:video_player/video_player.dart';
@ -26,11 +27,9 @@ Future<VideoPlayerController> videoPlayerController(
: '$serverEndpoint/assets/${asset.remoteId}/video/playback';
final url = Uri.parse(videoUrl);
final accessToken = Store.get(StoreKey.accessToken);
controller = VideoPlayerController.networkUrl(
url,
httpHeaders: {"x-immich-user-token": accessToken},
httpHeaders: ApiService.getRequestHeaders(),
videoPlayerOptions: asset.livePhotoVideoId != null
? VideoPlayerOptions(mixWithOthers: true)
: VideoPlayerOptions(mixWithOthers: false),

View File

@ -7,7 +7,7 @@ part of 'video_player_controller_provider.dart';
// **************************************************************************
String _$videoPlayerControllerHash() =>
r'642469a44287188a7c301f5cad3df3e23c84d85c';
r'84b2961cc2aeaf9d03255dbf9b9484619d0c24f5';
/// Copied from Dart SDK
class _SystemHash {