conditional

This commit is contained in:
Daniel Ponte 2024-08-14 18:26:25 -04:00
parent abd6179e74
commit c21a0f2021
6 changed files with 18 additions and 8 deletions

View file

@ -37,7 +37,6 @@ jobs:
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- run: flutter --version - run: flutter --version
- run: make removemk
- run: flutter pub get - run: flutter pub get
- run: make patch - run: make patch
# - run: flutter test # - run: flutter test

View file

@ -3,8 +3,3 @@ proto:
patch: patch:
dart run patch_package apply dart run patch_package apply
removemk:
# so yucky...
sed -i -e '/media_kit/d' pubspec.yaml lib/controller/play.dart
sed -i -e '/MediaKit/d' pubspec.yaml lib/controller/play.dart

View file

@ -0,0 +1,7 @@
import 'package:just_audio_media_kit/just_audio_media_kit.dart';
class AudioInitializer {
void audioInit() {
JustAudioMediaKit.ensureInitialized();
}
}

View file

@ -0,0 +1,3 @@
class AudioInitializer {
void audioInit() {}
}

View file

@ -0,0 +1,3 @@
class AudioInitializer {
void audioInit() {}
}

View file

@ -1,6 +1,8 @@
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:just_audio/just_audio.dart' as justaudio; import 'package:just_audio/just_audio.dart' as justaudio;
import 'package:just_audio_media_kit/just_audio_media_kit.dart'; import 'audio_none.dart'
if (dart.library.io) 'audio_mediakit.dart'
if (dart.library.html) 'audio_web.dart';
//import 'package:audioplayers/audioplayers.dart' as auplay; //import 'package:audioplayers/audioplayers.dart' as auplay;
//import 'dart:io' show Platform; //import 'dart:io' show Platform;
@ -39,9 +41,10 @@ class AudioPlayersDriver implements AudioDriver {
class JustAudioDriver implements AudioDriver { class JustAudioDriver implements AudioDriver {
final player = justaudio.AudioPlayer(); final player = justaudio.AudioPlayer();
final initializer = AudioInitializer();
JustAudioDriver() { JustAudioDriver() {
JustAudioMediaKit.ensureInitialized(); initializer.audioInit();
} }
@override @override