mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 15:08:18 -07:00
feature: Added LibMDK video player backend (#162)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
6e32018183
commit
da354437e3
53 changed files with 1499 additions and 1006 deletions
|
|
@ -199,7 +199,7 @@ extension ItemBaseModelExtensions on ItemBaseModel? {
|
|||
switch (this) {
|
||||
PhotoAlbumModel album => album.play(context, ref),
|
||||
BookModel book => book.play(context, ref),
|
||||
_ => _default(context, this, ref, startPosition: startPosition),
|
||||
_ => _default(context, this, ref, startPosition: startPosition, showPlaybackOption: showPlaybackOption),
|
||||
};
|
||||
|
||||
Future<void> _default(
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:fladder/models/items/media_streams_model.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
extension PlayerExtensions on Player {
|
||||
Future<void> addSubtitles(List<SubStreamModel> subtitles) async {
|
||||
final separator = Platform.isWindows ? ";" : ":";
|
||||
await (platform as NativePlayer).setProperty(
|
||||
"sub-files",
|
||||
subtitles
|
||||
.mapIndexed((index, e) => "${Platform.isWindows ? e.url : e.url?.replaceFirst(":", "\\:")}@${e.displayTitle}")
|
||||
.join(separator),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import 'package:fladder/models/items/media_streams_model.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
|
||||
extension PlayerExtensions on Player {
|
||||
Future<void> addSubtitles(List<SubStreamModel> subtitles) async {}
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:validators/validators.dart';
|
||||
import 'string_extensions.dart';
|
||||
|
||||
extension SubtitleExtension on SubtitleTrack {
|
||||
String get cleanName {
|
||||
final names = {
|
||||
id,
|
||||
title,
|
||||
};
|
||||
return names
|
||||
.where((element) => element != null)
|
||||
.map((e) {
|
||||
if (e == null) return e;
|
||||
if (isNumeric(e)) return '';
|
||||
if (e == "no") {
|
||||
return "Off";
|
||||
}
|
||||
return e.capitalize();
|
||||
})
|
||||
.where((element) => element != null && element.isNotEmpty)
|
||||
.join(" - ");
|
||||
}
|
||||
}
|
||||
|
||||
extension AudioTrackExtension on AudioTrack {
|
||||
String get cleanName {
|
||||
final names = {
|
||||
id,
|
||||
title,
|
||||
};
|
||||
return names
|
||||
.where((element) => element != null)
|
||||
.map((e) {
|
||||
if (e == null) return e;
|
||||
if (isNumeric(e)) return '';
|
||||
if (e == "no") {
|
||||
return "Off";
|
||||
}
|
||||
return e.capitalize();
|
||||
})
|
||||
.where((element) => element != null && element.isNotEmpty)
|
||||
.join(" - ");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue