mirror of
https://github.com/amigan/calls.git
synced 2025-01-31 05:22:37 -05:00
conditional
This commit is contained in:
parent
abd6179e74
commit
c21a0f2021
6 changed files with 18 additions and 8 deletions
1
.github/workflows/build-web.yml
vendored
1
.github/workflows/build-web.yml
vendored
|
@ -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-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
|
||||
- run: flutter --version
|
||||
- run: make removemk
|
||||
- run: flutter pub get
|
||||
- run: make patch
|
||||
# - run: flutter test
|
||||
|
|
5
Makefile
5
Makefile
|
@ -3,8 +3,3 @@ proto:
|
|||
|
||||
patch:
|
||||
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
|
||||
|
|
7
lib/controller/audio_mediakit.dart
Normal file
7
lib/controller/audio_mediakit.dart
Normal file
|
@ -0,0 +1,7 @@
|
|||
import 'package:just_audio_media_kit/just_audio_media_kit.dart';
|
||||
|
||||
class AudioInitializer {
|
||||
void audioInit() {
|
||||
JustAudioMediaKit.ensureInitialized();
|
||||
}
|
||||
}
|
3
lib/controller/audio_none.dart
Normal file
3
lib/controller/audio_none.dart
Normal file
|
@ -0,0 +1,3 @@
|
|||
class AudioInitializer {
|
||||
void audioInit() {}
|
||||
}
|
3
lib/controller/audio_web.dart
Normal file
3
lib/controller/audio_web.dart
Normal file
|
@ -0,0 +1,3 @@
|
|||
class AudioInitializer {
|
||||
void audioInit() {}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter/services.dart';
|
||||
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 'dart:io' show Platform;
|
||||
|
||||
|
@ -39,9 +41,10 @@ class AudioPlayersDriver implements AudioDriver {
|
|||
|
||||
class JustAudioDriver implements AudioDriver {
|
||||
final player = justaudio.AudioPlayer();
|
||||
final initializer = AudioInitializer();
|
||||
|
||||
JustAudioDriver() {
|
||||
JustAudioMediaKit.ensureInitialized();
|
||||
initializer.audioInit();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in a new issue