Alot of changes
This commit is contained in:
@@ -25,7 +25,7 @@ class AudioWrapper {
|
||||
|
||||
print("AudioWrapper mode: $mode");
|
||||
|
||||
// mode = AudioWrapper_Mode.Mobile;
|
||||
mode = AudioWrapper_Mode.Mobile;
|
||||
}
|
||||
|
||||
justaudio.AudioSource _convertSource_JustAudio(AudioWrapperSource source){
|
||||
@@ -126,11 +126,11 @@ class AudioWrapper {
|
||||
} catch (e) {}
|
||||
_justAudio_AudioPlayer = justaudio.AudioPlayer();
|
||||
} else if (mode == AudioWrapper_Mode.Mobile) {
|
||||
_audioPlayer_AudioPlayer.stop();
|
||||
// _audioPlayer_AudioPlayer.stop();
|
||||
try {
|
||||
_audioPlayer_AudioPlayer.dispose();
|
||||
// _audioPlayer_AudioPlayer.dispose();
|
||||
} catch (e) {}
|
||||
_audioPlayer_AudioPlayer = audioplayers.AudioPlayer();
|
||||
// _audioPlayer_AudioPlayer = audioplayers.AudioPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,12 +142,13 @@ class AudioWrapper {
|
||||
return AudioWrapper_State.NotPlaying;
|
||||
}
|
||||
} else {
|
||||
if (_audioPlayer_AudioPlayer.state == audioplayers.PlayerState.playing){
|
||||
return AudioWrapper_State.Playing;
|
||||
} else {
|
||||
return AudioWrapper_State.NotPlaying;
|
||||
}
|
||||
// if (_audioPlayer_AudioPlayer.state == audioplayers.PlayerState.playing){
|
||||
// return AudioWrapper_State.Playing;
|
||||
// } else {
|
||||
// return AudioWrapper_State.NotPlaying;
|
||||
// }
|
||||
}
|
||||
return AudioWrapper_State.NotPlaying;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
lib/utils/web_workarrounds.dart
Normal file
15
lib/utils/web_workarrounds.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
String WW_AssetSource(String location) {
|
||||
if (kIsWeb) {
|
||||
|
||||
// remove the first character if it is a '/'
|
||||
if (location.startsWith('/')) {
|
||||
location = location.substring(1);
|
||||
}
|
||||
|
||||
return "assets/$location";
|
||||
}
|
||||
return location;
|
||||
}
|
||||
Reference in New Issue
Block a user