MediaPlayer.Pause does not work, IsPlaying always true, only in built game
Summary
I found that MediaPlayer.Pause
does not work properly in the built game on Windows.
- IsPlaying stays true
- Sometimes playback starts again out of nowhere
- Sometimes the time keeps increasing.
This happens already with the demo scene.
Minimal project and steps to reproduce
You can use the demo VLCMinimalPlayback from the plugin.
- Add a log statement in VLCMinimalPlayback.Update:
Debug.Log($"time: {_mediaPlayer.Time}, isPlaying: {_mediaPlayer.IsPlaying}");
- Build and run the demo scene VLCMinimalPlayback
- Toggle play/pause
- Check the log, IsPlaying is always true
What is the current bug behavior?
- IsPlaying stays true
- in my other app, time still increases and playback suddenly starts again. When this unlucky state has been reached then it usually crashes on MediaPlayer.Dispose.
- Overall, MediaPlayer.Pause is unreliable at the moment
What is the expected correct behavior?
after calling Pause()
- IsPlaying should be false
- time should not increase further
- playback should not start without calling Play()
Does it work on other plaforms? Does it work with the official VLC apps?
- it seems to work in the Unity editor. IsPlaying is set to false correctly
Relevant logs and/or screenshots
Excerpt from VLCMinimalPlayback
time: 3438, isPlaying: True
time: 3452, isPlaying: True
time: 3469, isPlaying: True
time: 3485, isPlaying: True
time: 3502, isPlaying: True
[VLC] Toggling Play Pause !
time: 3524, isPlaying: True
time: 3534, isPlaying: True
time: 3542, isPlaying: True
time: 3542, isPlaying: True
time: 3542, isPlaying: True
time: 3542, isPlaying: True
[...]
Environment
- OS: Windows 11
- LibVLC version and architecture: 4.0.0-dev-24970-ga03de829e1
- LibVLCSharp version: LibVLCSharp version: 4.0.0.0
- VLC Unity plugin version: 0.1.8
- Scripting backend used: Mono
Edited by Andreas