RadMediaPlayer Play Button

3 posts, 0 answers
  1. C
    C avatar
    7 posts
    Member since:
    Nov 2011

    Posted 14 Dec 2011 Link to this post

    Hi Is it possible to catch the event when the play button is pressed on the RadMediaPlayer ?
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 19 Dec 2011 Link to this post

    Hello C,

    The RadMediaPlayer MediaOpened event occurs as soon as the media stream that has to be played is validated and opened, and the file headers have been read. This is why you can handle this event and then you can attach a handler to the RadMediaPlayer.MediaElement.CurrentStateChanged event. In this handler you can track the MediaElement.CurrentState changes.
    private void RadMediaPlayer_MediaOpened(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        (sender as RadMediaPlayer).MediaElement.CurrentStateChanged += new RoutedEventHandler(MediaElement_CurrentStateChanged);
    }
     
    void MediaElement_CurrentStateChanged(object sender, RoutedEventArgs e)
    {
        var state = (sender as MediaElement).CurrentState;
    }

    I hope this information will help you.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. C
    C avatar
    7 posts
    Member since:
    Nov 2011

    Posted 19 Dec 2011 Link to this post

    Hi ,
    Thanks For Your Reply.
    Thats not really what i was looking for but it may work.
    I have gone another route though so will not be trying to implement it.
    Thanks All the Same
Back to Top