Is it possible to do something when a video "stops" or "ends"?
#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!
Reply
#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.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#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)
Reply
#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.
Reply
#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.

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#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
Reply
#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)
Reply
#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>
Reply
#24
I would never use Container.Content with an onload condition as its only checked on window load
Reply
#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.
Reply
#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.
Reply
#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
Reply
#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.
Reply
#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.

Reply
#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
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to do something when a video "stops" or "ends"?0