3

Initial data:

  • windows phone 7.1 application;
  • video streaming (video: MPEG‐4 AVC (part 10) (H.264); audio: MPEG AAC Audio (mp4a));
  • not a smooth streaming;
  • opened in VLC with any problems;
  • all capabilities are included (ID_CAP_MEDIALIB, ID_CAP_MICROPHONE, ID_CAP_NETWORKING and other).

I am using a MediaElement for opening video stream with custom http url:

media.Source = new Uri("streaming url");
media.DownloadProgressChanged += this.media_DownloadProgressChanged;
media.MediaFailed += this.media_MediaFailed;
media.MediaEnded += this.media_MediaEnded;
media.Play();

MediaFailed gives "3100 An error has occurred" error without any additional description.

Seems like listed codecs are supported.

Also I tried this code:

var mediaPlayerLauncher = new MediaPlayerLauncher
{
   Location = MediaLocationType.Install,
   Media = new Uri("streaming url", UriKind.Absolute),
   Controls = MediaPlaybackControls.All,
};
mediaPlayerLauncher.Show(); 

but media player was not able to play video.

What can cause a problem? How to test whether video stream is compatible with Windows Phone?

Thanks in advance.

sashaeve
  • 9,387
  • 10
  • 48
  • 61
  • 1. Check video format. Upload it via zune to the device, and play it on the device. 2. Check if this question might help you http://stackoverflow.com/questions/8201886/h-264-video-play-using-mediastreamsource-meet-with-3100-mediaerror-on-wp7-emul – Alex Sorokoletov Aug 21 '12 at 23:44
  • 1
    3. Check if ID_CAP_MEDIALIB is really included. AppHub detects which caps are used and updates the manifest 4. Maybe you should set metadata before playing: videoStreamAttributes[MediaStreamAttributeKeys.CodecPrivateData] = ""; videoStreamAttributes[MediaStreamAttributeKeys.VideoFourCC] = "H264"; videoStreamAttributes[MediaStreamAttributeKeys.Width] = "WIDTH HERE"; videoStreamAttributes[MediaStreamAttributeKeys.Height] = "HEIGHT HERE"; Details here (use translator) http://social.msdn.microsoft.com/Forums/zh-CN/windowsphonezhchs/thread/1fa21a6f-267a-4930-9826-7247e4bcbc54 – Alex Sorokoletov Aug 21 '12 at 23:45
  • hi there, did you solve this issue – Swift Sharp Dec 04 '13 at 09:42

0 Answers0