Seek by clicking on video progress bar (1 Viewer)

osre

Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    As my next contribution I wanted to look into seeking by clicking on the video progress bar.
    As far as I seen it, the progress bar is defined by each skin in MediaStyles.xml (like line 141 und 302 in Titanium).
    I looked a bit through the code, but it looks like that ProgressBar and non of its base classes (Control, FrameworkElemet, UIElement) have a MouseClick or MouseDown/Up event, only MouseEnter/Leave/Move).
    In WPF MouseDown/Up events are implemented in UIElement.
    But somehow I can not even find, how clicking a button is implemented!?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,971
    Germany Germany
    Country flag
    Mouse click is only implemented in buttons using a CommandStencil.
    I recently added very basic touch support and in ApolloOne skin I also stumbled upon missing mouse events.
    So a proper implementation similar to WPF would be very welcome!
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    Ok, I think I start with mouse events then.
    Can I subscribe to events in XAML just like in WPF, or would it look like the commands for buttons?[DOUBLEPOST=1419708160][/DOUBLEPOST]One more question: Should I use the FireEvent() method like used for MouseEnter/Leave in Framework element, or individual events like in WPF.
    Individual events would mean to implement the event bubbling, ... for all of them.
    But the FireEvent has no sender and no original source like in WPF.
    Cloning the RoutedEvents from WPF might get quite a challenge.
     
    Last edited:

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,971
    Germany Germany
    Country flag
    I am not at home till Monday and don't know this special part too well. I hope to be able to help you understanding the differences between WPF and MPF. In general I tried to make MPF and xaml more compatible recently.
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I'll look into WPF RoutingEvents in the meantime. May be I can implement something similar. The MPF FireEvent is a good beginning already. Only the firing of the individual events on every object and some parameters are missing.
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,971
    Germany Germany
    Country flag
    I think there are already some kind of routed events and different strategies. We have triggers that react on Screen.Show event. But I guess the implementation might not be completed yet.
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I have a basic prototype of the event management done.
    Registering events, tunneling bubbeling, class handlers, ... all done.
    Now I'm working on the XAML integration.
    There is already a basic framework for handling events. There is the method
    "static Delegate parser_GetEventHandler(IParserContext context, MethodInfo signature, string value)" in XamlLodaer.cs:101.
    The problem is, that there is no code behind file, like in WPF.
    Where should this method look for the event handler ?
    I thought about an markup extension like "{Command ...}", where you can bind it to the model like:
    XML:
    <Border MouseDown="{EventHandler Source={StaticResource Model},Path=MyMouseDownEventHandler}">...
    Code:
    public void MyMouseDownEventHandler(object source, MouseButtonEventArgs e)
    {
    ...
    }
    Any other Idea?
    Or to which class should an event be bound by default (instead of the code behind class as in WPF)?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,400
    6,971
    Germany Germany
    Country flag
    Thanks for your work (y) I'm trying to catchup the recent changes soon.

    We already have one custom control to capture mouse events: UserInputCapture. We use it only for DVD fullscreen playback, where mouse moves need to be forwared to DVDNavigator DirectShow filter.

    I'd like to keep the same structure, maybe it fits generally
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    766
    386
    Germany Germany
    I looked at it, and find it kind a strange.
    If I understand it correctly, ICommandStencil is more or less a wrapped delegate.
    The UserInputCapture forwards some event like actions (like OnMouseMove) to this stencil if, where it has a specific property for, which is setable from XAML.
    My approach would not need any special programming.
    You simply define an event handler as usual, and assign it in XAML like a property. But since there is no code behind class, I would have done it like an Binding (or like the CommandExtension).
    To do so I would create the EventHandlerExtension, which would be a subclass of CommandBaseMarkupExtension.
    I'll implement it and post a patch, you can then decide if you like it or not.[DOUBLEPOST=1419877757][/DOUBLEPOST]To be honest, my EventHandlerExtension can be replaced by CommandStencilExtension.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    mrmojo666 seek video over lan very slow for big and highbitrates videos General Support 11
    B MP 1.23 First time click TV or Recorded TV fails, 2nd ... it will work General Support 5
    N [Finished] [MP2-781] Enable one-click deletion of grouped TV recordings MediaPortal 2 70
    P Clicking on channel in epg goes nothing General 2
    Rob Hexenmeister Skinning Online Videos question OnlineVideos 2
    A [solved] How to Play All Videos in a List watch/edit Videos 3
    O 1.25.0 Codecs and Video Format for PlayStation 2 Codecs, External Players 0
    g0rsq Info box randomly popping up when watching TV or other video MediaPortal 2 Newcomers Forum 1
    I Video Playback Stuttering General Support 45
    B some videos jerky Television (MyTV frontend and TV-Server) 0
    B MP 2.2.3 Error playing videos from NAS Submit: Bug Reports 2
    T Kurze Tonaussetzter bei Videos und TV Allgemeines Supportforum 1
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    ajs [Proposal] Video embedded cover MediaPortal 1 1
    G [solved] Black Screen on all videos after upgrading to either 1.23 or 1.24 from 1.22 General Support 4
    H random black screen live tv and videos (amended) General Support 0
    404 [solved] Live TV...video and audio freeze General Support 20
    R kein Ton bei TV, Video, Aufnahme, Musik Allgemeines Support- und Diskussionsforum 0
    U [solved] Dynamic Refresh Rate for 23fps video Watch / Listen Media 1
    J Debug OnlineVideos, How To? OnlineVideos 1
    A MP2.2.2, understanding movies/videos/tv and WTV recordings. General 16
    C Problem playing videos created on IPhone X and Samsung S9 General Support 2
    H [solved] Video database genres, sort titles and collection thumbnails Newcomers Forum 12
    M How to Watch my videos from my Media Portal to My TV without TV Tuner Newcomers Forum 1
    cbr954rr Issue BOOTSUWRNQ with online videos? Plugin Development 1
    Similar threads

























    Top Bottom