Disable MediaPlayer Controls (TogglePlaylist, Stop, Play, Prev/Next)

2 posts, 0 answers
  1. Daniel Brooks
    Daniel Brooks avatar
    3 posts
    Member since:
    Aug 2009

    Posted 25 Aug 2009 Link to this post

    Is there a way to disable the area that holds the controls? (toggle playlist, stop, play, chapter prev/next, volume).  I would like to just have the progress bar (with or without the time count of media). Is this possible?

    Thanks,
    Daniel
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 27 Aug 2009 Link to this post

    Hi Daniel,

    There is no out-of-the-box mechanism to achieve what you are describing. However, one way to do it is to use the VisualTreeHelper and get the panel containing all the playback controls. Then you can iterate through the Children of the panel and disable the desired controls.

    private void DisableControls() 
        // Get the first child in RadMediaPlayer's ControlTemplate. 
        Grid root = VisualTreeHelper.GetChild(radMediaPlayer1, 0) as Grid; 
        // Find the Grid called BottomPart. The 2nd child of BottomPart contains the playback controls. 
        Grid bottomPart = root.FindName("BottomPart"as Grid; 
        Grid videoControls = bottomPart.Children[2] as Grid; 
        // Get all the controls. 
        var controls = videoControls.ChildrenOfType<Control>(); 
        // Disable the controls. 
        foreach (Control control in controls) 
        { 
            control.IsEnabled = false
        } 

    I have attached a sample project for further reference. If you experience additional problems, let us know.

    Best wishes,
    Kiril Stanoev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
Back to Top