I've been using OSMF to play MP3 over HTTP, and am trying RTMP. FMS is setup, and the following url works with the FLVPlayback component, "rtmp://myserver.com/vod/mp3:My Test Mp3" but does not work with my OSMF player.
var player = new MediaPlayer();
var loader = new SoundLoader();
theURL = 'rtmp://myserver.com/vod/mp3:My Test Mp3';
var resource = new URLResource( theURL );
resource.mediaType = MediaType.AUDIO;
resource.mimeType = 'audio/mpeg';
var audio = new AudioElement( resource, loader);
player.media = _audio;
It returns "Error opening url rtmp://myserver.com/vod/mp3:My Test Mp3'
I have tried to play an MP3 file from FMS using OSMFPlayer and it works just fine. I am not sure exactly where it goes wrong. But there are a few things you may want to check.
1. The RTMP URL is indeed valid. Can you pass me the actual URL that I can test it using our internal tool. Or you can pass me the MP3 file and I can test it with my FMS environment.
2. You don't need to create sound loader, and set mimeType yourself. You may simply do the following:
Var mediaFactory:MediaFactory = new DefaultMediaFactory();
Var resource = new URLResource(theURL);
Var media:MediaElement = mediaFactory.createMediaElement(resource);
mediaPlayer.media = media;
Senior Computer Scientist
Adobe Systems, Inc.
Thanks, that method of loading the mp3 works, but mediaPlayer.duration returns NaN. mediaPlayer.currentTime works.