This is a migrated thread and some comments may be shown as answers.

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

1 Answer 73 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Daniel Brooks
Top achievements
Rank 1
Daniel Brooks asked on 25 Aug 2009, 06:35 PM
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

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 27 Aug 2009, 02:18 PM
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.
Tags
MediaPlayer
Asked by
Daniel Brooks
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or