1

I just started using Appmethod and I can't seem to figure out how to play a remote audio file using the audio player example they give.

This is what I have tried:

procedure TAudioPlayBackForm.btnPlayClick(Sender: TObject);
begin
  MediaPlayer1.FileName := 'URL HERE';
  MediaPlayer1.Play;
end;
mjn
  • 36,362
  • 28
  • 176
  • 378
austinh
  • 1,061
  • 6
  • 13
  • 34
  • Will the media player even play a remote file? – David Heffernan Jun 18 '14 at 06:24
  • Won't work. Nice if it did, tho. We could do away with all sorts of libraries and crap needed to stream things over the internet! – David Schwartz Jun 18 '14 at 07:27
  • DirectShow on Windows platform can. But I don't know how about on other platforms nor Appmethod in general. – TLama Jun 18 '14 at 08:18
  • @DavidSchwartz Could you point me in the direction on how to stream the file? – austinh Jun 18 '14 at 17:04
  • Sorry, I wouldn't really know where to start. You usually need something running "over there" to respond to a request to download or stream a file "over here" that you want to do something with. It could employ HTTP, FTP, RTSP, or any number of other protocols, including a raw TCP or UDP socket connection. Your question is simply far too vague to suggest anything useful. All I can tell you is that the MediaPlayer most likely uses standard FileOpen or FileCreate (or comparable stream) methods to open the file, and they only work on the local file system. – David Schwartz Jun 19 '14 at 00:05
  • The **Android** platform **MediaPlayer** class will absolutely play resources from a remote source, either loading the audio or streaming it as necessary, according to the resource found at the url. It supports a variety of file formats and streaming protocols, as documented here: http://developer.android.com/guide/appendix/media-formats.html If the FMX TMediaPlayer class doesn't support this then it simply doesn't adequately support the underlying media capabilities of the Android platform and the OP will have to bear the pain of trying to work with the platform API directly. – Deltics Aug 22 '14 at 21:41

0 Answers0