Class RadMediaItem
RadMediaItem allows a user to populate RadMediaPlayer with media items. RadMediaItem is identified by the following properties: Source - the Uri of the media file; ImageSource - the Uri of the image file that will represent RadMediaItem in RadMediaPlayer's playlist; Header - Content that is displayed in the Playlist area of RadMediaPlayer.
Inherited Members
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.MediaPlayer.dll
Syntax
[TelerikToolboxCategory("Containers")]
public class RadMediaItem : HeaderedSelector, ISelectable
Constructors
RadMediaItem()
Fields
BufferingTimeProperty
Identifies the BufferingTime Dependency Property.
Declaration
public static readonly DependencyProperty BufferingTimeProperty
Field Value
System.Windows.DependencyProperty
|
CurrentItemChangedEvent
Occurs whenever a chapter is clicked.
Declaration
public static readonly RoutedEvent CurrentItemChangedEvent
Field Value
RoutedEvent
|
DescriptionProperty
Identifies the Description dependency property.
Declaration
public static readonly DependencyProperty DescriptionProperty
Field Value
System.Windows.DependencyProperty
|
ImageSourceProperty
Identifies the ImageSource dependency property.
Declaration
public static readonly DependencyProperty ImageSourceProperty
Field Value
System.Windows.DependencyProperty
|
IsSelectedProperty
Identifies the IsSelected Dependency Property.
Declaration
public static readonly DependencyProperty IsSelectedProperty
Field Value
System.Windows.DependencyProperty
|
IsStreamingSourceProperty
Identifies the IsStreamingSource Property.
Declaration
public static readonly DependencyProperty IsStreamingSourceProperty
Field Value
System.Windows.DependencyProperty
|
PositionProperty
Identifies the Position Dependency Property.
Declaration
public static readonly DependencyProperty PositionProperty
Field Value
System.Windows.DependencyProperty
|
SelectedEvent
Identifies the Selected routed event.
Declaration
public static readonly RoutedEvent SelectedEvent
Field Value
RoutedEvent
|
SourceProperty
Identifies the Source dependency property.
Declaration
public static readonly DependencyProperty SourceProperty
Field Value
System.Windows.DependencyProperty
|
TitleProperty
Identifies the Title dependency property.
Declaration
public static readonly DependencyProperty TitleProperty
Field Value
System.Windows.DependencyProperty
|
UnselectedEvent
Identifies the Unselected routed event.
Declaration
public static readonly RoutedEvent UnselectedEvent
Field Value
RoutedEvent
|
VideoHeightProperty
Identifies the VideoHeight dependency property.
Declaration
public static readonly DependencyProperty VideoHeightProperty
Field Value
System.Windows.DependencyProperty
|
VideoStretchProperty
Identifies the VideoStretch dependency property.
Declaration
public static readonly DependencyProperty VideoStretchProperty
Field Value
System.Windows.DependencyProperty
|
VideoWidthProperty
Identifies the VideoWidth dependency property.
Declaration
public static readonly DependencyProperty VideoWidthProperty
Field Value
System.Windows.DependencyProperty
|
Properties
BufferingTime
The buffering time specifies the advance-load time (buffer) that the media item will need before starts playing. This is a dependency property.
Declaration
public TimeSpan BufferingTime { get; set; }
Property Value
System.TimeSpan
|
Description
Gets or sets the text that will be used as a description of this instance of RadMediaItem into RadMediaPlayer's playlist.
Declaration
public string Description { get; set; }
Property Value
System.String
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv"
Description="Description of movie1"/>
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
mediaItem.Description = "Description of movie1";
radMediaPlayer1.Items.Add(mediaItem);
ImageSource
Gets or sets the source of the image will be used for representing this instance of RadMediaItem into RadMediaPlayer's playlist.
Declaration
public BitmapImage ImageSource { get; set; }
Property Value
System.Windows.Media.Imaging.BitmapImage
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv"
ImageSource="image1.jpg"/>
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
mediaItem.ImageSource = new Uri("image1.jpg", UriKind.RelativeOrAbsolute);
radMediaPlayer1.Items.Add(mediaItem);
IsSelected
Identifies weather this RadMediaItem is currently selected.
Declaration
public bool IsSelected { get; set; }
Property Value
System.Boolean
|
IsStreamingSource
Determines whether RadMediaItems will play media from stream or not.
Declaration
public bool IsStreamingSource { get; set; }
Property Value
System.Boolean
|
Position
Gets or sets the current position in the playing video.
Declaration
public double Position { get; set; }
Property Value
System.Double
|
Source
Gets or sets the video file associated with the media item. Source is of type Uri.
Declaration
public Uri Source { get; set; }
Property Value
System.Uri
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv" />
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
radMediaPlayer1.Items.Add(mediaItem);
Title
Gets or sets the text that will be used as a title of this instance of RadMediaItem into RadMediaPlayer's playlist.
Declaration
public string Title { get; set; }
Property Value
System.String
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv"
Title="Title of movie1"/>
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
mediaItem.Title = "Title of movie1";
radMediaPlayer1.Items.Add(mediaItem);
VideoHeight
Gets or sets the VideoHeight possible Value of the double object.
Declaration
public double VideoHeight { get; set; }
Property Value
System.Double
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv"
VideoWidth="200"
VideoHeight="200" />
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
mediaItem.VideoWidth = 200;
mediaItem.VideoHeight = 200;
radMediaPlayer1.Items.Add(mediaItem);
VideoStretch
Gets or sets the VideoStretch possible Value of the Stretch object.
Declaration
public Stretch VideoStretch { get; set; }
Property Value
System.Windows.Media.Stretch
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv"
VideoStretch="UniformToFill"/>
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
mediaItem.VideoStretch = Stretch.UniformToFill;
radMediaPlayer1.Items.Add(mediaItem);
VideoWidth
Gets or sets the value that will be used to set the Width of the System.Windows.Controls.MediaElement in RadMediaPlayer.
Declaration
public double VideoWidth { get; set; }
Property Value
System.Double
|
Examples
<telerik:RadMediaPlayer
<telerik:RadMediaItem
Source="movie1.wmv"
VideoWidth="200"
VideoHeight="200" />
</telerik:RadMediaPlayer>
RadMediaPlayer radMediaPlayer1 = new RadMediaPlayer();
LayoutRoot.Children.Add(radMediaPlayer1);
RadMediaItem mediaItem = new RadMediaItem();
mediaItem.Source = new Uri("movie1.wmv", UriKind.RelativeOrAbsolute);
mediaItem.VideoWidth = 200;
mediaItem.VideoHeight = 200;
radMediaPlayer1.Items.Add(mediaItem);
Methods
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
System.Windows.DependencyObject
|
IsItemItsOwnContainerOverride(Object)
Determines if the specified item is (or is eligible to be) its own item container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
System.Object
item
|
Returns
System.Boolean
|
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
Overrides
OnSelected(RadRoutedEventArgs)
Called when the RadMediaItem is selected in a RadMediaPlayer.
Declaration
public void OnSelected(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
e
The event data. |
Remarks
This method is called when the IsSelected property changes to true.
OnSelectionChanged(SelectionChangedEventArgs)
Raises the SelectionChanged event.
Declaration
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
System.Windows.Controls.SelectionChangedEventArgs
e
|
Overrides
OnUnselected(RadRoutedEventArgs)
Called when the RadMediaItem is unselected in a RadMediaPlayer.
Declaration
public void OnUnselected(RadRoutedEventArgs e)
Parameters
RadRoutedEventArgs
e
The event data. |
Remarks
This method is called when the IsSelected property changes to true.
Events
StreamAttached
Raised when IsStreamSource is true, to make stream preparations if needed.
Declaration
public event EventHandler StreamAttached
Event Type
System.EventHandler
|
StreamDetached
Raised when IsStreamSource is true, to make stream clean up if needed.
Declaration
public event EventHandler StreamDetached
Event Type
System.EventHandler
|