Unfortunately, the MediaStreamSource class is not well documented. Fortunately, Microsoft has made available a set of helper classes, which you can obtain at https://github.com/loarabia/ManagedMediaHelpers. so in the example that I made before is good way to understand it also. Thanks
Hadrich Mohamed
Posts
-
Removing Delay in Playing Mp3 Files in Windows Phone 8 -
Removing Delay in Playing Mp3 Files in Windows Phone 8Many Thnaks for your nice message. So Having set up the projects, you can then declare an Mp3MediaStreamSource object. The sample app fetches a remote MP3 file by using an HttpWebRequest. When we get the data back, we use it to initialize the Mp3MediaStreamSource and set that as the source for a MediaElement object, which is declared in XAML. Thanks.
-
Problem in Windows Phone 8 map controlHi, To show the map, it requires a network connection. and the Network connection is a great problem for Windows Phone Emulator. Try to work with a Windows Phone Device.
-
Removing Delay in Playing Mp3 Files in Windows Phone 8Hi, this is a code sample that can help you : private HttpWebRequest request; private Mp3MediaStreamSource mss; private string mediaFileLocation = @"http://media.ch9.ms/ch9/755d/4f893d13-fa05-4871-9123-3eadd2f0755d/ EightPlatformAnnouncements.mp3"; public MainPage() { InitializeComponent(); Get = (ApplicationBarIconButton)ApplicationBar.Buttons[0]; Play = (ApplicationBarIconButton)ApplicationBar.Buttons[1]; Pause = (ApplicationBarIconButton)ApplicationBar.Buttons[2]; } private void Get_Click(object sender, EventArgs e) { request = WebRequest.CreateHttp(mediaFileLocation); request.AllowReadStreamBuffering = true; request.BeginGetResponse(new AsyncCallback(RequestCallback), null); } private void RequestCallback(IAsyncResult asyncResult) { HttpWebResponse response = request.EndGetResponse(asyncResult) as HttpWebResponse; Stream s = response.GetResponseStream(); mss = new Mp3MediaStreamSource(s, response.ContentLength); Dispatcher.BeginInvoke(() => { mp3Element.SetSource(mss); Play.IsEnabled = true; Get.IsEnabled = false; }); } private void Play_Click(object sender, EventArgs e) { mp3Element.Play(); Play.IsEnabled = false; Pause.IsEnabled = true; } private void Pause_Click(object sender, EventArgs e) { mp3Element.Pause(); Pause.IsEnabled = false; Play.IsEnabled = true; } Thanks
-
Ajax Navigation in Windows Phone 8Hi , Try Using Normal JAVASCRIPT: var ajax = new XMLHttpRequest(); var seconds = new Date().getTime(); // avoid cache problem var additionalParam = "" // if any var URL = "http://www.domainname.com/api/method/"; // your URL var authURL = URL+ additionalParam+'&tmp=' + seconds; ajax.open("GET", authURL + '', false); ajax.send(); if (ajax.readyState == 4 && (ajax.status == 200)) { console.log("ajax.responseText" + ajax.responseText); } Thanks.