Forward ExoPlaybackException exceptions to the Flutter plugin (#80)
* Forward ExoPlaybackException exceptions to playbackEventStream * Ignore error events in secondary streams
This commit is contained in:
parent
571743a11f
commit
3dfcef6ef1
|
@ -349,6 +349,10 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Met
|
||||||
prepareResult.error(errorCode, errorMsg, null);
|
prepareResult.error(errorCode, errorMsg, null);
|
||||||
prepareResult = null;
|
prepareResult = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (eventSink != null) {
|
||||||
|
eventSink.error(errorCode, errorMsg, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transition(final PlaybackState newState) {
|
private void transition(final PlaybackState newState) {
|
||||||
|
|
|
@ -132,15 +132,15 @@ class AudioPlayer {
|
||||||
isPublic: data[5][1][5])),
|
isPublic: data[5][1][5])),
|
||||||
));
|
));
|
||||||
_eventChannelStreamSubscription =
|
_eventChannelStreamSubscription =
|
||||||
_eventChannelStream.listen(_playbackEventSubject.add);
|
_eventChannelStream.listen(_playbackEventSubject.add, onError: _playbackEventSubject.addError);
|
||||||
_playbackStateSubject
|
_playbackStateSubject
|
||||||
.addStream(playbackEventStream.map((state) => state.state).distinct());
|
.addStream(playbackEventStream.map((state) => state.state).distinct().handleError((err,stack){ /* noop */ }));
|
||||||
_bufferingSubject.addStream(
|
_bufferingSubject.addStream(
|
||||||
playbackEventStream.map((state) => state.buffering).distinct());
|
playbackEventStream.map((state) => state.buffering).distinct().handleError((err,stack){ /* noop */ }));
|
||||||
_bufferedPositionSubject.addStream(
|
_bufferedPositionSubject.addStream(
|
||||||
playbackEventStream.map((state) => state.bufferedPosition).distinct());
|
playbackEventStream.map((state) => state.bufferedPosition).distinct().handleError((err,stack){ /* noop */ }));
|
||||||
_icyMetadataSubject.addStream(
|
_icyMetadataSubject.addStream(
|
||||||
playbackEventStream.map((state) => state.icyMetadata).distinct());
|
playbackEventStream.map((state) => state.icyMetadata).distinct().handleError((err,stack){ /* noop */ }));
|
||||||
_fullPlaybackStateSubject.addStream(Rx.combineLatest3<AudioPlaybackState,
|
_fullPlaybackStateSubject.addStream(Rx.combineLatest3<AudioPlaybackState,
|
||||||
bool, IcyMetadata, FullAudioPlaybackState>(
|
bool, IcyMetadata, FullAudioPlaybackState>(
|
||||||
playbackStateStream,
|
playbackStateStream,
|
||||||
|
|
Loading…
Reference in New Issue