NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 58 59 60 61 62 … 93 Next »
IVideoPlugin.Deactivate() not called when video stops

 
  • 0 Vote(s) - 0 Average
IVideoPlugin.Deactivate() not called when video stops
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#1
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.
DaveC
Offline

Junior Member

Posts: 40
Threads: 3
Joined: Jan 2005
#2
2006-03-11, 05:34 AM
Hi Snarky ... been away for a bit. See this one's got people stumped Cool

I guess the deactivate is not called when the video ends. I'm not sure why I said that, perhaps assumed. The IMenuTask.Deactivate is invoked by core when IVideo's show/hide says false/true (I always forget which one actually controls the core, they both get called every second). That's likely what I was trying to say.

I've never seen this cause my plug is designed for short-term life on screen, so it really does not care so much about the video ending.

Sounds like your plug is intended to be long running (visible). So if you need to keep track of the video action happening, you may want to check out the IEventNotification inerface. Never used it, but have read it will feed your plug what is going on.
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#3
2006-03-14, 12:12 AM
Hi DaveC,

Maybe people are stumped... or maybe the two of us are the only people in the world developing Video Plugins!!! Smile

Thanks for the tip about IEventNotification. It looks like that might provide what I need (though I think I'll need to know one second before the video actually ends, to ensure that needsToBeHidden is called before the video quits).
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2006-03-14, 12:34 AM
The next version will call IMenuTask.Deactivate when the video finishes.

Quote:or maybe the two of us are the only people in the world developing Video Plugins!!!
There isnt many people doing this. If there were, I'd probably focus more energy on it.
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#5
2006-03-15, 07:53 PM
Excellent. Thanks!
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#6
2006-03-21, 06:48 PM
Snarky Wrote:Maybe people are stumped... or maybe the two of us are the only people in the world developing Video Plugins!!! Smile
I'm doing it Big Grin. The volume plugin uses it.

Oh and btw thanks for ivp.doc DaveC, was very useful.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Video streaming URL and parameters? cncb 1 1,759 2021-10-22, 06:58 PM
Last Post: sub
  Extras device - using hardware video encoder gdogg371 6 3,148 2021-03-09, 12:18 AM
Last Post: gdogg371
  Loading Local Video Files Syler 25 6,338 2021-03-07, 09:20 PM
Last Post: Syler
  Resuming a video imilne 28 14,391 2016-10-30, 09:27 PM
Last Post: mvallevand
  How to tell when video playback has finished in web client? cncb 6 4,200 2015-09-29, 08:07 PM
Last Post: cncb
  VIdeo playback from plugin mvallevand 5 3,421 2015-08-06, 10:43 PM
Last Post: sub
  Inset Video - Stop mvallevand 2 2,054 2013-08-07, 09:57 PM
Last Post: mvallevand
  Video Library Fanart Transparency tieke 7 3,847 2013-01-09, 08:23 AM
Last Post: tieke
  NMT Video Playback - does it receive start/stop events psycik 8 3,356 2012-07-15, 10:01 PM
Last Post: mvallevand
  GetRenderList() always called with "block-extras..." element in renderlist alibert 1 1,593 2012-06-18, 10:24 AM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode