MediaEnded not firing

3 posts, 0 answers
  1. John
    John avatar
    8 posts
    Member since:
    Aug 2008

    Posted 16 Apr 2010 Link to this post

    I have what I hope is a simple problem. I'm using the RadMediaPlayer to show a video. When a user gets through the video, I want to record that fact to the database. For whatever reason, my code never fires. Here's my code:

    private void PlayVideo(string url, string title) 
                var item = new RadMediaItem { Source = new Uri(url, UriKind.RelativeOrAbsolute), Title = title }; 
                player.AutoPlay = true
                player.MediaEnded += PlayerMediaEnded; 
                player.CurrentItem = item; 

    void PlayerMediaEnded(object sender, Telerik.Windows.RadRoutedEventArgs e) 
                // record to DB, but this never happens 

    Unfortunately I'm using this in a Azure project, so the debugger spins up the AppFabric and as such it can't be attached to iexplore.exe to investigate. Please help!
  2. Miro Miroslavov
    Miro Miroslavov avatar
    588 posts

    Posted 21 Apr 2010 Link to this post

    Hello John,

    RadMediaPlayer is wrapper around MediaElement, and MediaEnded is raised whenever Silverlight's MediaElement report MediaEnded. You can handle the player.MediaElement.MediaEnded event, but i guess you won't get different result.  I think this could happen because there is something wrong with the encoding of the Video you use. If you can send us example video, we can try to find the problem.

    All the best,
    Miro Miroslavov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. birbilis
    birbilis avatar
    1 posts
    Member since:
    Nov 2010

    Posted 03 Apr 2013 Link to this post


    I think a solution might be to set a MediaMarker at the MediaOpened event (can't set one before that event) and use the MediaElement.NaturalDuration there to specify that the marker is at the end. When you get the MarkerReached event for that specific marker you can stop the mediaelement by code
Back to Top