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
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #1
I'd like to prompt the user when a tv show ends or is stopped. Is there a way to create a dialog that appears when "stop" is pressed while a tv show is playing or if the tv show ends?
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #2
Noone has any ideas? Thats odd.
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #3
Well my idea is NO at least not without a python script monitoring playback (maybe). but I really didn't want to say No and then look dumb when someone says yes Tongue
find quote
mcborzu Offline
Skilled Skinner
Posts: 3,381
Joined: Feb 2009
Reputation: 15
Location: dsf
Post: #4
Is there a previous.window() type command, something along those lines? I checked the wiki but I must be phrasing it wrong or it doesnt exist in general. Thought I've seen that type of infolabel before? If yes maybe that would work, being able to show something if previous window was dialogfullscreen?

[Image: widget]

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,289
Joined: Jun 2006
Reputation: 57
Location: Earth
Post: #5
Its
Window.Previous()
and
Window.Next()
but thats not really for stopping I guess maybe a combination of
PHP Code:
Window.Previous(FullScreenVideo) + !Player.HasVideo 
maybe, but its still really hit and miss
find quote
wannabegt4 Offline
Senior Member
Posts: 208
Joined: Dec 2008
Reputation: 1
Location: Wichita, Kansas
Post: #6
Why don't you put a hidden control in fullscreen video xml that sets a custom skin string or setting and have your control in your myvideonav.xml only visible when the string matches or the setting is on. When the user clicks the button in your dialog make it set the skin string/setting back so the control is no longer visible.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #7
Got it:

Ok, so I wanted XBMC to prompt me to delete an episode automatically after watching it, so here's the solution.

A button is SkinSettings:


Code:
<control type="radiobutton" id="2003">
          <width>900</width>
        <height>40</height>
        <font>Simplicity_20</font>
        <label>Enable "Delete" Prompt After Watching TV Episodes</label>
        <textcolor>white</textcolor>
        <focusedcolor>white</focusedcolor>
        <radiowidth>83</radiowidth>
        <radioheight>67</radioheight>
        <textureradiofocus>simplicity/settings-radiobutton-on.png</textureradiofocus>
        <textureradionofocus>simplicity/settings-radiobutton-off.png</textureradionofocus>
        <texturefocus border="0,2,0,2">simplicity/button-focus.png</texturefocus>
        <texturenofocus border="0,2,0,2">simplicity/menuitemnf.png</texturenofocus>
        <onclick>Skin.ToggleSetting(DeleteEps)</onclick>
        <selected>Skin.HasSetting(DeleteEps)</selected>
    </control>


Then I added on to the TVTunes Button in MYVideoNav:

Code:
        <control type="button" id="9999">
            <description>trigger</description>
            <include condition="!Skin.HasSetting(UseTvTunes)">No_TV_Tunes</include>
            <include condition="Skin.HasSetting(UseTvTunes)">Use_TV_Tunes</include>
            <include condition="Window.Previous(FullScreenVideo) + !Skin.HasSetting(DeleteEps)">No_Delete_Eps</include>
            <include condition="Window.Previous(FullScreenVideo) + Skin.HasSetting(DeleteEps)">Delete_Eps</include>
            <texturenofocus>-</texturenofocus>
            <texturefocus>-</texturefocus>
        </control>


Finally the Focus conditions in Includes:

Code:
    <include name="No_Delete_Eps">
        <onfocus>SetFocus(50)</onfocus>
    </include>
    <include name="Delete_Eps">
        <visible>Container.Content(Episodes)</visible>
        <onfocus>Delete</onfocus>
        <onfocus>SetFocus(50)</onfocus>
    </include>
find quote
wannabegt4 Offline
Senior Member
Posts: 208
Joined: Dec 2008
Reputation: 1
Location: Wichita, Kansas
Post: #8
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.
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #9
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
find quote
wannabegt4 Offline
Senior Member
Posts: 208
Joined: Dec 2008
Reputation: 1
Location: Wichita, Kansas
Post: #10
Couldn't you just add the !Player.HasVideo to the condition that Jezz suggested that way it won't come up until stop is pressed. Also, What if the previous window isn't full screen video like I went to the home menu and pressed stop? Would you still get your dialog? Would you still want it to be available throughout the skin? That's the only reason I had thought about using the custom skin setting in the hidden control.

EDIT: You know; I'm probably over complicating things. I'm sure it's fine the way you have it now.
(This post was last modified: 2011-04-05 06:24 by wannabegt4.)
find quote
igotdvds Offline
Skilled Skinner
Posts: 1,616
Joined: Jul 2009
Reputation: 11
Post: #11
wannabegt4 Wrote:Couldn't you just add the !Player.HasVideo to the condition that Jezz suggested that way it won't come up until stop is pressed. Also, What if the previous window isn't full screen video like I went to the home menu and pressed stop? Would you still get your dialog? Would you still want it to be available throughout the skin? That's the only reason I had thought about using the custom skin setting in the hidden control.

EDIT: You know; I'm probably over complicating things. I'm sure it's fine the way you have it now.

I added !Player.HasVideo, thanks for pointing it out. That solved that problem. Good to go now.
find quote
vikjon0 Offline
---
Posts: 2,502
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #12
hello,
I am trying to implement this in confluence.

I am not a skinner, but I have made a few add-on skins and sometimes pretty good with code.

I take it the 9999 button is pre-existing in simplicity? It is not in confluence. I guess that means I have to forget the quick fix?
The tv tunes are loaded in onload.

Is there any way you could explain a bit more detail?
I guess the 9999 button is triggering one of the two actions added to include? Somehow it does not bite and I do not know how to debug a skin.
find quote
Hitcher Online
Skilled Skinner
Posts: 10,821
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #13
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
find quote
phil65 Online
Skilled Skinner
Posts: 4,600
Joined: Mar 2009
Reputation: 63
Location: Cologne, Germany
Post: #14
(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)
?
(This post was last modified: 2012-05-31 20:41 by phil65.)
find quote
vikjon0 Offline
---
Posts: 2,502
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #15
Yes, that is easier to understand. Thank you.
I couldn't get the trigger button to fire regardless of condition.

EDIT: Lost half the words...
However, this is true also if stopping before the end of the video and the adjustment from above does not work. Perhaps it only worked in dharma?

Code:
<onload condition="Container.Content(Episodes) + Window.Previous(FullScreenVideo)  + !Player.HasVideo + Skin.HasSetting(DeleteEps)">Delete</onload>
    <onload condition="Container.Content(Episodes) + Window.Previous(FullScreenVideo)  + !Player.HasVideo + Skin.HasSetting(DeleteEps)">SetFocus(50)</onload>
(This post was last modified: 2012-05-31 20:52 by vikjon0.)
find quote
Post Reply