Skip to content

Conversation

@codinronan
Copy link

@codinronan codinronan commented May 5, 2017

Basically, for change detection reasons my app needs access to these state changes so that I don't have to use setInterval. I need to be able to implement the OnPush change detection strategy, which is extremely hard when a setInterval is needed to detect changes to these objects.

The following events are added to IAudioTrack and implemented in both classes:

  onLoaded: Subject<IAudioTrack>;
  onPlaying: Subject<IAudioTrack>;
  onStop: Subject<IAudioTrack>;
  onPause: Subject<IAudioTrack>;
  onFinished: Subject<IAudioTrack>;
  onProgressChange: Subject<IAudioTrack>;
  onError: Subject<IAudioTrackError>;

...

export interface IAudioTrackError {
  track: IAudioTrack,
  error: ErrorEvent,
}

This also incorporates #115 so you'll see the same set of changes.

@arielfaur let me know what you think. I'm not convinced this is the best implementation but it is the most obvious.

@proustibat
Copy link

@codinronan thanks for reviewing my intents. This is exactly what I wanted.
@arielfaur let us know if theses changes are ok for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants