filetypes

6 posts, 0 answers
  1. Aziz
    Aziz avatar
    32 posts
    Member since:
    Sep 2011

    Posted 23 Feb 2012 Link to this post

    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)));
                }
            }
        }
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 23 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Aziz
    Aziz avatar
    32 posts
    Member since:
    Sep 2011

    Posted 23 Feb 2012 Link to this post

    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?
  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 24 Feb 2012 Link to this post

    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 >>
  6. Aziz
    Aziz avatar
    32 posts
    Member since:
    Sep 2011

    Posted 24 Feb 2012 Link to this post

    Problem is resolved, stupid Mime type error.

    Because of this the radmediaplayer just gave a 'file not found' error message.
  7. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 27 Feb 2012 Link to this post

    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 >>
Back to Top
DevCraft banner