-
-
Notifications
You must be signed in to change notification settings - Fork 78
feat: Add tizen support #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
popdollar
wants to merge
13
commits into
DonutWare:develop
Choose a base branch
from
popdollar:feat/add-tizen-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d2eabe2
feat: added basic changes to make tizen launch
popdollar 4a7c8ca
feat: made videos play
popdollar a6b9a0f
feat: subtitles and audiotracks in a working state
popdollar 4647e0d
feat: video overlay now works with tizen
popdollar 040b5cb
feat: created tizen transcode profile
popdollar c4124e0
fix: small fixes to ui not behaving correctly with tizen
popdollar 86a37d1
fix: fixed bug where videoplayer would crash when loading next video
popdollar f0cb9d2
fix: added a fix to scaling of tizen video_widget
popdollar d89912e
chore: made a readme for tizen
popdollar d8e7737
fix: have tizen sync use correct folder structure
popdollar cf8c104
Merge branch 'develop' into feat/add-tizen-support
popdollar 6dca081
fix: simpler scaling of tizen video player
popdollar c89b572
fix: more specific device profile for Tizen to better handle transcoding
popdollar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.5.2.0 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tizen", "tizen", "{A388AB0E-F47B-31FD-1F3C-3AE867F75632}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runner", "tizen\Runner.csproj", "{11CBC428-FFDB-ECCF-FBBF-1DB39BFFB147}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {11CBC428-FFDB-ECCF-FBBF-1DB39BFFB147}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {11CBC428-FFDB-ECCF-FBBF-1DB39BFFB147}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {11CBC428-FFDB-ECCF-FBBF-1DB39BFFB147}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {11CBC428-FFDB-ECCF-FBBF-1DB39BFFB147}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(NestedProjects) = preSolution | ||
| {11CBC428-FFDB-ECCF-FBBF-1DB39BFFB147} = {A388AB0E-F47B-31FD-1F3C-3AE867F75632} | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {38085DC2-CEE5-4C57-8CBF-1D53D4E7A0F4} | ||
| EndGlobalSection | ||
| EndGlobal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import 'dart:convert'; | ||
| import 'dart:io'; | ||
| import 'dart:ui'; | ||
| import 'dart:ffi' as ffi; | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter/material.dart'; | ||
|
|
@@ -46,8 +47,11 @@ | |
| import 'package:fladder/util/window_helper.dart'; | ||
| import 'package:fladder/widgets/media_query_scaler.dart'; | ||
|
|
||
| import 'package:flutter_tizen/flutter_tizen.dart'; | ||
| import 'package:sqlite3/open.dart' as sqlite3_open; | ||
|
|
||
| bool get _isDesktop { | ||
| if (kIsWeb) return false; | ||
| if (kIsWeb || isTizen) return false; | ||
| return [ | ||
| TargetPlatform.windows, | ||
| TargetPlatform.linux, | ||
|
|
@@ -63,6 +67,12 @@ | |
| } | ||
|
|
||
| void main(List<String> args) async { | ||
| if (isTizen) { | ||
| sqlite3_open.open.overrideFor(sqlite3_open.OperatingSystem.linux, () { | ||
| return ffi.DynamicLibrary.open('/usr/share/dotnet.tizen/lib/libsqlite3.so'); | ||
| }); | ||
| } | ||
|
|
||
| WidgetsFlutterBinding.ensureInitialized(); | ||
| final crashProvider = CrashLogNotifier(); | ||
|
|
||
|
|
@@ -297,12 +307,32 @@ | |
| final scrollBehaviour = const MaterialScrollBehavior(); | ||
| return DynamicColorBuilder( | ||
| builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) { | ||
| final lightTheme = themeColor == null | ||
| final rawLightTheme = themeColor == null | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this change? |
||
| ? FladderTheme.theme(lightDynamic ?? FladderTheme.defaultScheme(Brightness.light), schemeVariant) | ||
| : FladderTheme.theme(themeColor.schemeLight, schemeVariant); | ||
| final darkTheme = (themeColor == null | ||
| final rawDarkTheme = (themeColor == null | ||
| ? FladderTheme.theme(darkDynamic ?? FladderTheme.defaultScheme(Brightness.dark), schemeVariant) | ||
| : FladderTheme.theme(themeColor.schemeDark, schemeVariant)); | ||
| final lightTheme = !isTizen | ||
| ? rawLightTheme | ||
| : rawLightTheme.copyWith( | ||
| pageTransitionsTheme: PageTransitionsTheme( | ||
| builders: { | ||
| ...rawLightTheme.pageTransitionsTheme.builders, | ||
| TargetPlatform.linux: const FadeUpwardsPageTransitionsBuilder(), | ||
| }, | ||
| ), | ||
| ); | ||
| final darkTheme = !isTizen | ||
| ? rawDarkTheme | ||
| : rawDarkTheme.copyWith( | ||
| pageTransitionsTheme: PageTransitionsTheme( | ||
| builders: { | ||
| ...rawDarkTheme.pageTransitionsTheme.builders, | ||
| TargetPlatform.linux: const FadeUpwardsPageTransitionsBuilder(), | ||
| }, | ||
| ), | ||
| ); | ||
| final amoledOverwrite = amoledBlack ? Colors.black : null; | ||
| return ThemesData( | ||
| light: lightTheme, | ||
|
|
@@ -359,4 +389,4 @@ | |
| } | ||
| } | ||
|
|
||
| final currentTitleProvider = StateProvider<String>((ref) => "Fladder"); | ||
| final currentTitleProvider = StateProvider<String>((ref) => "Fladder"); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import 'dart:convert'; | ||
| import 'dart:io'; | ||
|
|
||
| import 'package:drift/native.dart'; | ||
| import 'package:drift/drift.dart'; | ||
| import 'package:drift_flutter/drift_flutter.dart'; | ||
| import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
|
@@ -17,6 +18,8 @@ import 'package:fladder/models/items/trick_play_model.dart'; | |
| import 'package:fladder/models/syncing/sync_item.dart'; | ||
| import 'package:fladder/providers/user_provider.dart'; | ||
|
|
||
| import 'package:flutter_tizen/flutter_tizen.dart'; | ||
| import 'package:sqlite3/sqlite3.dart'; | ||
| part 'database_item.g.dart'; | ||
|
|
||
| const _databseName = 'syncedDatabase'; | ||
|
|
@@ -194,6 +197,14 @@ class AppDatabase extends _$AppDatabase { | |
| } | ||
|
|
||
| static QueryExecutor _openConnection() { | ||
| if (isTizen) { | ||
| return _openConnectionTizen(); | ||
| } else { | ||
| return _openConnectionDefault(); | ||
| } | ||
| } | ||
|
|
||
| static QueryExecutor _openConnectionDefault() { | ||
| return driftDatabase( | ||
| name: _databseName, | ||
| native: const DriftNativeOptions( | ||
|
|
@@ -205,4 +216,15 @@ class AppDatabase extends _$AppDatabase { | |
| ), | ||
| ); | ||
| } | ||
|
|
||
| static LazyDatabase _openConnectionTizen() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason we need to open the database this way for tizen? Are downloads even supported for on samsung tv's? |
||
| return LazyDatabase(() async { | ||
| final dir = await getApplicationSupportDirectory(); | ||
| final file = File(p.join(dir.path, '$_databseName.sqlite')); | ||
|
|
||
| return NativeDatabase.opened( | ||
| sqlite3.open(file.path), | ||
| ); | ||
| }); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,54 @@ | ||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter_tizen/flutter_tizen.dart'; | ||
|
|
||
| import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
|
||
| import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart'; | ||
| import 'package:fladder/models/settings/video_player_settings.dart'; | ||
| import 'package:fladder/profiles/tizen_profile.dart'; | ||
| import 'package:fladder/profiles/web_profile.dart'; | ||
| import 'package:fladder/providers/video_player_provider.dart'; | ||
|
|
||
| final videoProfileProvider = StateProvider.autoDispose<DeviceProfile>((ref) => | ||
| defaultProfile(ref.read(videoPlayerProvider.select((value) => value.backend)) ?? PlayerOptions.platformDefaults)); | ||
|
|
||
| DeviceProfile defaultProfile(PlayerOptions player) => kIsWeb | ||
| ? webProfile | ||
| : 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), | ||
| SubtitleProfile(format: 'pgssub', method: SubtitleDeliveryMethod.$external), | ||
| ], | ||
| ); | ||
| DeviceProfile defaultProfile(PlayerOptions player) { | ||
| if (kIsWeb) { | ||
| return webProfile; | ||
| } | ||
|
|
||
| if (isTizen) { | ||
| return tizenProfile; | ||
| } | ||
|
|
||
| return 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), | ||
| SubtitleProfile(format: 'pgssub', method: SubtitleDeliveryMethod.$external), | ||
| ], | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic like this should be moved to a new file. So we can create a "stub" file like mentioned previously for the other platforms that implements the functions/boolean with nothing attached.
That also includes the following imports.
import 'dart:ffi' as ffi;import 'package:flutter_tizen/flutter_tizen.dart';import 'package:sqlite3/open.dart' as sqlite3_open;While only the ffi is not supported on some platforms best to not use it at all by default if possible.