getNowPlayingStream method
Now playing stream of icy / meta info
Implementation
@override
Stream<NowPlayingDataChanged?> getNowPlayingStream() {
if (_nowPlayingInfo != null) {
return _nowPlayingInfo!;
}
var playerReadyStream = nowPlayingInfoEventChannel
.receiveBroadcastStream()
.asBroadcastStream(onCancel: (sub) {
sub.cancel();
_nowPlayingInfo = null;
});
return playerReadyStream.map<NowPlayingDataChanged>((dynamic event) {
return NowPlayingDataChanged.fromJson(event as String);
});
}