Skip to content

Remove VLCEventManager and replace processing

Hank Anderson requested to merge Sumou/VLCKit:3.0-fix-event into 3.0

An attempt to remove the VLCEventManager and replace the process. This will increase performance.

An example of improvement

// VLCMediaPlayerDelegate
func mediaPlayerStateChanged(_ aNotification: Notification) {
    guard let mediaPlayer = aNotification.object as? VLCMediaPlayer else { return }
    let currentState: VLCMediaPlayerState = mediaPlayer.state
    print(currentState)
}
  • At the start of playback

before

// print result
VLCMediaPlayerState.buffering = 2

after

// print result
VLCMediaPlayerState.opening = 1
VLCMediaPlayerState.buffering = 2
VLCMediaPlayerState.esAdded = 7
VLCMediaPlayerState.esAdded = 7
VLCMediaPlayerState.playing = 5
VLCMediaPlayerState.buffering = 2
VLCMediaPlayerState.buffering = 2
VLCMediaPlayerState.buffering = 2
VLCMediaPlayerState.buffering = 2
  • 404 At URL playback start

before

// print result
VLCMediaPlayerState.buffering = 2
VLCMediaPlayerState.stopped = 0

after

// print result
VLCMediaPlayerState.opening = 1
VLCMediaPlayerState.buffering = 2
VLCMediaPlayerState.error = 4
VLCMediaPlayerState.stopped = 0

This should fix the #80, #129 (closed), #428 (closed), #459 (closed), #578 (closed) issues.

If this attempt is not suitable, please close this merge request.

best regards.

Edited by Felix Paul Kühne

Merge request reports