Is it possible to do something when a video "stops" or "ends"?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
snavaro Offline
Member
Posts: 81
Joined: Mar 2012
Reputation: 0
Post: #16
(2012-05-31 20:40)phil65 Wrote:  
(2011-04-05 06:07)igotdvds Wrote:  
wannabegt4 Wrote:What happens when someone isn't watching in fullscreen and presses stop? For instance I'm watching a video and decide to go back and look at the episode list while it's playing in the background.

It will ask them if they want to delete. This is a rough way of getting what I wanted, I wish I could say "If episode is 100% finished or Episode is playing and user presses "stop"" Then prompt to delete. But I cant get that exactly, so I use a hack. Sad

perhaps with
Code:
IntegerGreaterThan(ListItem.PercentPlayed,95)
?

That sounds nice and clean. I like it!
find quote
phil65 Offline
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #17
if i think about it again, than it´s probably not that easy... my idea doesn´t take into account that another item can have focus when ending the video. Same applies to some other solutions here.
stringcomparing videoplayer and listitem episode title would be a work-around. (so set a string/property with the videoplayer episode title on videofullscreen.xml onunload and compare that with the listitem episodetitle. if true, then delete)
i think this can probably be done much better and nicer by a script.
(This post was last modified: 2012-05-31 21:39 by phil65.)
find quote
snavaro Offline
Member
Posts: 81
Joined: Mar 2012
Reputation: 0
Post: #18
(2012-05-31 20:24)Hitcher Wrote:  You should be able to do it this way -

PHP Code:
<onload condition="Container.Content(Episodes) + Window.Previous(FullScreenVideo) + Skin.HasSetting(DeleteEps)">Delete</onload>
<
onload condition="Container.Content(Episodes) + Window.Previous(FullScreenVideo) + Skin.HasSetting(DeleteEps)">SetFocus(50)</onload

Hitcher,

Will this work?:
<onload condition= "Window.Previous(FullScreenVideo) + IntegerGreaterThan(ListItem.PercentPlayed,95)">Delete</onload>
where the Delete button is in DialogVideoInfo (id=2003)
find quote
vikjon0 Offline
---
Posts: 2,500
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #19
(2012-05-31 20:40)phil65 Wrote:  perhaps with
Code:
IntegerGreaterThan(ListItem.PercentPlayed,95)
?

Hm, there seem to some magic in that command.
IntegerGreaterThan(ListItem.PercentPlayed,95) does not work as expected
IntegerGreaterThan(ListItem.PercentPlayed,1) works better but I cant figure it out I need to trace it.

EDIT2:
Nope, I cant het it work. Perhaps it does not work when jumping forward and/or using resume.
(This post was last modified: 2012-05-31 21:29 by vikjon0.)
find quote
phil65 Offline
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #20
since i edited, i´m not sure everyone took notice of this:

(2012-05-31 21:10)phil65 Wrote:  if i think about it again, than it´s probably not that easy... my idea doesn´t take into account that another item can have focus when ending the video. Same applies to some other solutions here.
stringcomparing videoplayer and listitem episode title would be a work-around. (so set a string/property with the videoplayer episode title on videofullscreen.xml onunload and compare that with the listitem episodetitle. if true, then delete)
i think this can probably be done much better and nicer by a script.
(This post was last modified: 2012-05-31 21:39 by phil65.)
find quote
vikjon0 Offline
---
Posts: 2,500
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #21
Ok thanks, perhaps I will have time to dive deeper into the skin-scripting game at a later time.

For the moment I cant get IntegerGreaterThan(ListItem.PercentPlayed,95)
nor
!Player.HasVideo
to work.

The onload triggering as such is working fine.

Passing strings between windows I do in my add-ons but I can see an all nighter to repeat it in another context and have to pass on that Wink

If you mean using a script instead the "delete", that is no problem but still need to figure out the percentage played and get the file name from the videofullscreen.xml
find quote
snavaro Offline
Member
Posts: 81
Joined: Mar 2012
Reputation: 0
Post: #22
(2012-05-31 21:14)vikjon0 Wrote:  
(2012-05-31 20:40)phil65 Wrote:  perhaps with
Code:
IntegerGreaterThan(ListItem.PercentPlayed,95)
?

Hm, there seem to some magic in that command.
IntegerGreaterThan(ListItem.PercentPlayed,95) does not work as expected
IntegerGreaterThan(ListItem.PercentPlayed,1) works better but I cant figure it out I need to trace it.

EDIT2:
Nope, I cant het it work. Perhaps it does not work when jumping forward and/or using resume.

Perhaps the value returned is not an integer? Is there a function NumberGreaterThan()? Or perhaps it requires the $INFO[ListItem.PercentPlayed], 95)
(This post was last modified: 2012-05-31 22:10 by snavaro.)
find quote
vikjon0 Offline
---
Posts: 2,500
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #23
There are some threads discussing percentageplayed not being updated directly/correctly and also some commits. Or I am just getting tired.

This is working and kind of make sense in some use cases. Does not fix the risk of deleting the wrong file though.

Code:
<onload condition="Container.Content(Episodes) + Window.Previous(FullScreenVideo)  + IntegerGreaterThan(ListItem.PlayCount,0) + Skin.HasSetting(DeleteEps)">Delete</onload>
    <onload condition="Container.Content(Episodes) + Window.Previous(FullScreenVideo)  + IntegerGreaterThan(ListItem.PlayCount,0) + Skin.HasSetting(DeleteEps)">SetFocus(50)</onload>
(This post was last modified: 2012-05-31 22:12 by vikjon0.)
find quote
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #24
I would never use Container.Content with an onload condition as its only checked on window load
find quote
vikjon0 Offline
---
Posts: 2,500
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #25
and my test with playcount of course does not work as it is set after onload. I am going to stop now as I need to study a bit before coming up with more bad ideas.
find quote
snavaro Offline
Member
Posts: 81
Joined: Mar 2012
Reputation: 0
Post: #26
(2012-05-31 22:37)Big_Noid Wrote:  I would never use Container.Content with an onload condition as its only checked on window load

I think we are open to suggestions as to how to accomplish our goal. Any recommendations? Neither vicjon or I are skinners.
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,877
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #27
(2012-05-31 22:37)Big_Noid Wrote:  I would never use Container.Content with an onload condition as its only checked on window load

Which is what happens when you stop playing an episode. Wink
find quote
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #28
(2012-05-31 23:07)Hitcher Wrote:  
(2012-05-31 22:37)Big_Noid Wrote:  I would never use Container.Content with an onload condition as its only checked on window load

Which is what happens when you stop playing an episode. Wink

Not very reliable imo, you could quit fullscreen when playing an episode and browse your movies, go to home screen, whatever and when exiting, the container.content is not the same as the videoplayer content.
find quote
vikjon0 Offline
---
Posts: 2,500
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #29
Is it possible the button id 9999 was used because it will make it load last when the values have loaded and not by accident?
While onload is ofc loaded first before I guess the list?

It looks like I can set a string on unload on the previous screen. How to retrieve it I do not know.
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #30
(2012-06-01 06:41)vikjon0 Wrote:  Is it possible the button id 9999 was used because it will make it load last when the values have loaded and not by accident?
While onload is ofc loaded first before I guess the list?

It looks like I can set a string on unload on the previous screen. How to retrieve it I do not know.

nope

and this is a completely slippery slope your on even more so if your deleting files
find quote