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

filetypes

5 Answers 52 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Aziz
Top achievements
Rank 1
Aziz asked on 23 Feb 2012, 02:56 PM
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?

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)));
            }
        }
    }

5 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 23 Feb 2012, 03:57 PM
Hello Jacob,

RadMediaPlayer is a wrapper around Silverlight's MediaElement. Therefore, RadMediaPlayer supports the same formats as the MediaElement. Here is a link to the supported media formats, protocols, and log fields by the MediaElement.

Kind regards,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Aziz
Top achievements
Rank 1
answered on 23 Feb 2012, 04:32 PM
ok, so according to this h264 encoded mp4 should play yet it does not appear to work. Can you review the above section of code and let me know if it looks right?
0
Kiril Stanoev
Telerik team
answered on 24 Feb 2012, 10:14 AM
Hi Jacob,

I've tested the code you provided with a local x264 video and everything works as expected. I have doubts that the cause for your issue is the way the video has been encoded. Could you please try and re-encode the video using the Microsoft Expression Encoder and let me know how it goes.

All the best,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Aziz
Top achievements
Rank 1
answered on 24 Feb 2012, 05:32 PM
Problem is resolved, stupid Mime type error.

Because of this the radmediaplayer just gave a 'file not found' error message.
0
Kiril Stanoev
Telerik team
answered on 27 Feb 2012, 02:53 PM
Hi Jacob,

I'm glad you managed to resolve the issue. Contact us as soon as possible if you encounter any further issues.

All the best,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
MediaPlayer
Asked by
Aziz
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Aziz
Top achievements
Rank 1
Share this question
or