request: event on end behaivor

35 views
Skip to first unread message

Philip Dixon

unread,
Jun 20, 2017, 10:14:21 AM6/20/17
to MPF Users
At the moment it's not possible to end a slide after the video widget is ended. Is it possible to add an event so that when the end is reached we can hook the event and end the slide?

jabdoa

unread,
Jun 20, 2017, 3:43:01 PM6/20/17
to MPF Users
Afaik this is on Quinn's roadmap for the new video player. Dunno if it is already available in dev.


Jan

Quinn Capen

unread,
Jun 20, 2017, 6:55:12 PM6/20/17
to mpf-...@googlegroups.com
I added this feature to mpf 0.33.29 and mpf_mc 0.33.8 (you must update both).  You will Video assets now have the following new settings:

events_when_played
events_when_stopped

Both are lists of events that will be posted when the video is played or stopped.  This mirrors the settings in the sounds. Let me know if you have any problems with the feature.

Quinn
Message has been deleted

Philip Dixon

unread,
Jun 21, 2017, 3:58:44 AM6/21/17
to MPF Users
excellent. Incidentally, as you have added these as events I can use them to duck the music whilst the video plays. Win!

Philip Dixon

unread,
Jun 21, 2017, 1:48:36 PM6/21/17
to MPF Users
Hi Quinn, it's failing the validator:

AssertionError: Your config contains a value for the setting "widgets:video:widgets:video:events_when_stopped", but this is not a valid setting name.

unless I have a typo or misunderstood how it works, here's a typical definition:

skillshot_vid_3:
    widgets:
    - type: video
      video: vid3
      events_when_stopped: remove_slide_skillshot_vid_3
      control_events:
      - event: pre_show_slide
        action: seek
        value: 0.00
      - event: pre_show_slide
        action: play
      z: 1
2017-06-21-18-42-37-mpf-Toshiba-PC.log
2017-06-21-18-42-37-mc-Toshiba-PC.log

Quinn Capen

unread,
Jun 21, 2017, 2:58:57 PM6/21/17
to MPF Users
It currently only works when specified in the video assets section of the config, not in the widget or slide player.  I won't have time until the weekend to extend it to the players.

Quinn

Philip Dixon

unread,
Jun 21, 2017, 3:34:54 PM6/21/17
to MPF Users
Aah i see. That might work for what I'm doing. The problem would come if a video is on more than one slide as you wouldn't know which slidw to remove.
Is the plan to extend this to the slide definition as i have it?
I'm away at a pinball meet for the weekend so i won't be working on this anyway.

Quinn Capen

unread,
Jun 23, 2017, 5:37:13 PM6/23/17
to MPF Users
I'm afraid it is too much work to extend this behavior to the widget_player and slide_player for 0.33 as the work would just be thrown away when these are rewritten for 0.50.  This feature will be available in the slide and widget players in 0.50.  

In the meantime, I suggest if you have the need to use a video in more than one slide, make a copy of the video with a different name and treat them as separate video assets.  While it is a waste of disk space, videos are not loaded in memory (they are streamed from disk) so your other system resources should not be negatively impacted.

Quinn

Philip Dixon

unread,
Jun 24, 2017, 4:54:33 AM6/24/17
to MPF Users
As I say, it's great for what I'm doing. I just wanted to point out a potential pitfall so you don't waste time doing this in 0.50
Reply all
Reply to author
Forward
0 new messages