ryanheise / audio_session

MIT License
115 stars 81 forks source link

devicesChangedEventStream on IOS ,not work! #143

Open brotherdang opened 2 hours ago

brotherdang commented 2 hours ago

AudioSession.instance.then((session) { session.setActive(true); subscription4DeviceRemoved = session.devicesChangedEventStream.listen((event) async { if (ref.read(seriesProvider(seriesID))?.model?.viewEpisode != episode?.index || episode?.unlock == false) return;

    var devices = await session.getDevices();
    LogUtils.printLog("eventStream 11", "devices.length = ${devices.length}");
    context.showToast("音频设备个数${devices.length}");
brotherdang commented 2 hours ago

when I plug in or remove earphone, I can not get weather it is plug in-or-remove.