This question is locked. New answers and comments are not allowed.
What file types can the media player run over http? I have so far been able to run wmv files but not h264 encoded mp4 files..
I take a Uri passed to the window and play from that... here is the code as perhaps im doing it wrong?
I take a Uri passed to the window and play from that... here is the code as perhaps im doing it wrong?
public partial class MediaPreview : RadWindow
{
private Uri mediaSource;
public Uri MediaSource
{
get
{
if (this.mediaSource == null)
{
this.mediaSource = new Uri("");
}
return this.mediaSource;
}
set
{
this.mediaSource = value;
}
}
public MediaPreview()
{
this.InitializeComponent();
}
private void OKButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (this.MediaPlayer.IsPlaying)
{
this.MediaPlayer.Stop();
}
this.DialogResult = true;
this.Close();
}
private void CancelButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (this.MediaPlayer.IsPlaying)
{
this.MediaPlayer.Stop();
}
this.DialogResult = false;
this.Close();
}
private void MediaPlayer_Loaded(object sender, RoutedEventArgs e)
{
((RadMediaPlayer)sender).Items.Add(new RadMediaItem() { Source = this.mediaSource });
try
{
((RadMediaPlayer)sender).Play();
}
catch (Exception ex)
{
RadWindow.Alert(Utils.ErrorDialog(string.Format("Playback error: {0}", ex.Message)));
}
}
}