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

Audio but no Video

1 Answer 89 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Helen
Top achievements
Rank 2
Helen asked on 29 Apr 2009, 08:57 PM
I'm having a weird problem with RadMediaPlayer.

My code is written so that a user can select a video file from the local file system. Then it attempts to play the video thus:

private

FileInfo m_fi;
private string m_fileName;
...

 

OpenFileDialog dlg = new OpenFileDialog();

 

dlg.Filter =

"Media WMV|*.wmv";

 

 

if (dlg.ShowDialog() == true)  
{

 

    m_fi = dlg.File;

    m_fileName = m_fi.Name;   

 

try 
    
 { 
        
 MyPlayer.MediaElement.SetSource(m_fi.OpenRead());
        MyPlayer.MediaElement.Play(); 
    }
    
catch (Exception ex)

    {

MessageBox.Show("Error playing video: " + ex.Message);
    }
}

The video plays, but I only receive the audio. I know that there is a real video there, because I have played it using other code (a video player project from codeplex).

Any suggestions?

BTW, is there some trick to avoid a bunch of extra lines when posting code snippets?

thx

Helen

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 01 May 2009, 01:11 PM
Hi Helen,

Sorry for the delayed reply!

The MediaPlayer needs a list of RadMediaItems to play videos correctly (changing state, displaying descriptions, chapters, etc). Unfortunately the RadMediaItem does not offer a way set the local file as a source.

This task has been logged for a future version of the MediaPlayer but unfortunately currently I cannot offer a solution or workaround.

You can use the "Format Code Block" tool of the editor when posting in the forum (the button looks like an orange paint brush).

Thank you for bringing our attention to this!

All the best,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
MediaPlayer
Asked by
Helen
Top achievements
Rank 2
Answers by
Miroslav
Telerik team
Share this question
or