how can i prevent ofVideoPlayer from auto playing a video clip?
is this the expected behaviour?
stopping or pausing after loading does not work. Is loading happening in a thread?
I am using osx 10.15.4 and oF 0.11.0.
This is definitely a bug and probably left over from when the call was blocking with the QuickTime API.
All the AVFoundation video stuff is asynchronous and means that actions in setup() after the ofVideoPlayer::load() is called don’t always take effect as the video can take a second or two to actually be loaded ( in another thread ). I think there could be a bunch of improvement for video playback relating to this.
We’re tracking this for the next patch release, could you see if the fix described here works for you?
I am not sure about the looping issue.
I do see that at the end of ofVideoPlayer::load the loop state is set to OF_LOOP_NORMAL:
Looking at all the setLoop cools in ofAVFoundationPlayer and ofAVFoundationVideoPlayer it seems like they should be getting set.
I wonder though if you might have to wait for the video to start playing for the calls to work?
I was wondering if you fixed this. I’m having the same, (or a similar) problem. I’m calling video.setLoopState (OF_LOOP_NONE). But it doesn’t seem to have any effect. I’m trying it in setup, and update, and after play etc. The video just keeps playing and playing.
If I replace OF_LOOP_NONE with OF_LOOP_PALINDROME it does indeed play palindrome. So I guess the code is correct.
hey Chris, sorry, i am not a big help here.
I was developing on osx, switched to windows at one point at the project, as I had to deploy to windows anyways. As far as I remember the loop bug did not appear on windows.
I was able to set the loop state, just could not get it via the getLoopState getter. So I kept track of the state in the class that used the video player.