openPlayer method
Future<int>
openPlayer(
- FlutterSoundPlayerCallback callback, {
- required Level logLevel,
})
override
Implementation
@override
Future<int> openPlayer(FlutterSoundPlayerCallback callback,
{required Level logLevel}) async {
// openAudioSessionCompleter = new Completer<bool>();
// await invokeMethod( callback, 'initializeMediaPlayer', {'focus': focus.index, 'category': category.index, 'mode': mode.index, 'audioFlags': audioFlags, 'device': device.index, 'withUI': withUI ? 1 : 0 ,},) ;
// return openAudioSessionCompleter.future ;
int slotno = findSession(callback);
if (slotno < _slots.length) {
assert(_slots[slotno] == null);
_slots[slotno] = newPlayerInstance(callback, callbackTable);
} else {
assert(slotno == _slots.length);
_slots.add(newPlayerInstance(callback, callbackTable));
}
return _slots[slotno]!.initializeMediaPlayer();
}