Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions lib/models/syncing/transcode_download_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@

/// Device profile for download transcoding.
/// Uses HTTP protocol instead of HLS so the server returns a complete file URL.
DeviceProfile get deviceProfile => DeviceProfile(
DeviceProfile get deviceProfile => ref.read(argumentsStateProvider).leanBackMode

Check failure on line 57 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Undefined name 'argumentsStateProvider'. (undefined_identifier) See https://dart.dev/diagnostic/undefined_identifier or https://dart.dev/lints/undefined_identifier

Check failure on line 57 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Undefined name 'ref'. (undefined_identifier) See https://dart.dev/diagnostic/undefined_identifier or https://dart.dev/lints/undefined_identifier

Check failure on line 57 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Undefined class 'DeviceProfile'. (undefined_class) See https://dart.dev/diagnostic/undefined_class or https://dart.dev/lints/undefined_class
? DeviceProfile(
maxStreamingBitrate: maxBitrate.bitRate,
maxStaticBitrate: maxBitrate.bitRate,
directPlayProfiles: const [
Expand All @@ -76,9 +77,33 @@
SubtitleProfile(format: 'vtt', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'ass', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'ssa', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'pgssub', method: SubtitleDeliveryMethod.$external),
],
);

Check failure on line 81 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Expected to find ':'. (expected_token) See https://dart.dev/diagnostic/expected_token or https://dart.dev/lints/expected_token

Check failure on line 81 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Expected an identifier. (missing_identifier) See https://dart.dev/diagnostic/missing_identifier or https://dart.dev/lints/missing_identifier
: DeviceProfile(

Check notice on line 82 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

The variable name 'DeviceProfile' isn't a lowerCamelCase identifier. (non_constant_identifier_names) See https://dart.dev/diagnostic/non_constant_identifier_names or https://dart.dev/lints/non_constant_identifier_names

Check notice on line 82 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

The method 'DeviceProfile' should have a return type but doesn't. (always_declare_return_types) See https://dart.dev/diagnostic/always_declare_return_types or https://dart.dev/lints/always_declare_return_types

Check notice on line 82 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference

Check failure on line 82 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Expected a class member. (expected_class_member) See https://dart.dev/diagnostic/expected_class_member or https://dart.dev/lints/expected_class_member
maxStreamingBitrate: maxBitrate.bitRate,

Check notice on line 83 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference

Check failure on line 83 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

The instance member 'maxBitrate' can't be accessed in an initializer. (implicit_this_reference_in_initializer) See https://dart.dev/diagnostic/implicit_this_reference_in_initializer or https://dart.dev/lints/implicit_this_reference_in_initializer

Check failure on line 83 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

The default value of an optional parameter must be constant. (non_constant_default_value) See https://dart.dev/diagnostic/non_constant_default_value or https://dart.dev/lints/non_constant_default_value

Check failure on line 83 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Using a colon as the separator before a default value is no longer supported. (obsolete_colon_for_default_value) See https://dart.dev/diagnostic/obsolete_colon_for_default_value or https://dart.dev/lints/obsolete_colon_for_default_value

Check failure on line 83 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Named parameters must be enclosed in curly braces ('{' and '}'). (named_parameter_outside_group) See https://dart.dev/diagnostic/named_parameter_outside_group or https://dart.dev/lints/named_parameter_outside_group
maxStaticBitrate: maxBitrate.bitRate,

Check notice on line 84 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference
directPlayProfiles: const [

Check notice on line 85 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference
DirectPlayProfile(type: DlnaProfileType.video),
DirectPlayProfile(type: DlnaProfileType.audio),
],
transcodingProfiles: [

Check notice on line 89 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference
TranscodingProfile(
audioCodec: audioCodec.name.toLowerCase(),
container: container.name.toLowerCase(),
maxAudioChannels: '2',
protocol: MediaStreamProtocol.http,
type: DlnaProfileType.video,
videoCodec: videoCodec.name.toLowerCase(),
),
],
containerProfiles: const [],

Check notice on line 99 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference
subtitleProfiles: const [

Check notice on line 100 in lib/models/syncing/transcode_download_model.dart

View workflow job for this annotation

GitHub Actions / Linting & Formatting

Missing type annotation. (strict_top_level_inference) See https://dart.dev/diagnostic/strict_top_level_inference or https://dart.dev/lints/strict_top_level_inference
SubtitleProfile(format: 'vtt', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'ass', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'ssa', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'pgssub', method: SubtitleDeliveryMethod.$external),
],
);

String label(BuildContext context) {
if (!enabled) {
Expand Down
30 changes: 30 additions & 0 deletions lib/profiles/default_profile.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import 'package:flutter/foundation.dart';

import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand All @@ -12,6 +12,36 @@

DeviceProfile defaultProfile(PlayerOptions player) => kIsWeb
? webProfile
: ref.read(argumentsStateProvider).leanBackMode
? const DeviceProfile(
maxStreamingBitrate: 120000000,
maxStaticBitrate: 120000000,
musicStreamingTranscodingBitrate: 384000,
directPlayProfiles: [
DirectPlayProfile(
type: DlnaProfileType.video,
),
DirectPlayProfile(
type: DlnaProfileType.audio,
)
],
transcodingProfiles: [
TranscodingProfile(
audioCodec: 'aac,mp3,mp2',
container: 'ts',
maxAudioChannels: '2',
protocol: MediaStreamProtocol.hls,
type: DlnaProfileType.video,
videoCodec: 'h264',
),
],
containerProfiles: [],
subtitleProfiles: [
SubtitleProfile(format: 'vtt', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'ass', method: SubtitleDeliveryMethod.$external),
SubtitleProfile(format: 'ssa', method: SubtitleDeliveryMethod.$external),
],
)
: const DeviceProfile(
maxStreamingBitrate: 120000000,
maxStaticBitrate: 120000000,
Expand Down
Loading