2006-03-02, 10:41 PM
I'm still trying to make a video plugin work properly, and I've noticed one behavior I think is unintended.
According to DaveC in this thread, if a video plugin is running and the video stops, the Deactivate() method of the plugin will be called. I'm finding that's not the case, at least with v0.96.8.
If the plugin is running when a video (in my case a recording) ends, the Deactivate() method will not be called. The next time I watch a video, I find the plugin running as if nothing had happened. Also, if I run the plugin as a MenuTask, the Activate() method will not be called.
This is bad because once the video stops, needsToBeHidden is no longer called, and there's no way for the plugin to deactivate itself.
I assume that what DaveC describes is what's intended to happen, and it would certainly be more convenient for me if it worked that way.
...
Actually, having played with the API for some time, I'd like to suggest one simple improvement that would make a huge difference to me. Currently, GBPVR calls setVideoMode the first time a video is played and every time it is activated as an OSD, to let the plugin know that it's running as a video plugin. However, the same instance of the plugin may later be run as a MenuTask, and there's no straightforward way to know that it's no longer running as a video plugin. (You can put some logic in the Activate, setVideoMode and Deactivate methods, but it's a bit of a mess, especially because of the bug (?) mentioned above.) Besides, it can be useful for a plugin to know whether a video is playing even when it's inactive. (For the time being I'm testing whether needsToBeShown is being called regularly, but this is a bit of a hack.)
So, what I propose is to change setVideoMode() to setVideoMode(bool inVideoMode), and call setVideMode(true) every time a video starts playing, and setVideoMode(false) every time it stops playing.
So, if a video finishes while my video plugin is active, GPVR will call Deactivate() and then setVideoMode(false). That way, if a user runs it as a MenuTask later, it will know when it's activated that it's no longer an OSD, and adapt itself to that fact.
According to DaveC in this thread, if a video plugin is running and the video stops, the Deactivate() method of the plugin will be called. I'm finding that's not the case, at least with v0.96.8.
If the plugin is running when a video (in my case a recording) ends, the Deactivate() method will not be called. The next time I watch a video, I find the plugin running as if nothing had happened. Also, if I run the plugin as a MenuTask, the Activate() method will not be called.
This is bad because once the video stops, needsToBeHidden is no longer called, and there's no way for the plugin to deactivate itself.
I assume that what DaveC describes is what's intended to happen, and it would certainly be more convenient for me if it worked that way.
...
Actually, having played with the API for some time, I'd like to suggest one simple improvement that would make a huge difference to me. Currently, GBPVR calls setVideoMode the first time a video is played and every time it is activated as an OSD, to let the plugin know that it's running as a video plugin. However, the same instance of the plugin may later be run as a MenuTask, and there's no straightforward way to know that it's no longer running as a video plugin. (You can put some logic in the Activate, setVideoMode and Deactivate methods, but it's a bit of a mess, especially because of the bug (?) mentioned above.) Besides, it can be useful for a plugin to know whether a video is playing even when it's inactive. (For the time being I'm testing whether needsToBeShown is being called regularly, but this is a bit of a hack.)
So, what I propose is to change setVideoMode() to setVideoMode(bool inVideoMode), and call setVideMode(true) every time a video starts playing, and setVideoMode(false) every time it stops playing.
So, if a video finishes while my video plugin is active, GPVR will call Deactivate() and then setVideoMode(false). That way, if a user runs it as a MenuTask later, it will know when it's activated that it's no longer an OSD, and adapt itself to that fact.