Strict Standards: Declaration of base_page::setOutput() should be compatible with base::setOutput() in /data/premium-dev/application/controllers/base/base_page.php on line 8

Strict Standards: Declaration of base_page::printErrorAndExit() should be compatible with base::printErrorAndExit() in /data/premium-dev/application/controllers/base/base_page.php on line 8
Musicshake API for developers - rtmp

rtmp

Get the MP3 URL for RTMP song streaming for Flash.

Parameters

  • api_key - developer key
  • song_id - the song ID obtained from the songlist method
  • callback (optional) - Callback function name for a JSONP request.

Request Example

http://developers.musicshake.com/api/rtmp?api_key=YOUR_API_KEY&song_id=661

Response Example

{"url":"http:\/\/s208ox97i0l791.cloudfront.net\/audioswap\/490\/948\/8d0cb38f-7e9d-43a0-b47a-06be793f8d34.mp3"}

ActionScript Example

import com.adobe.serialization.json.JSON;
import flash.net.URLLoader;
import flash.events.Event;
import flash.events.IOErrorEvent;

private function loadCategories():void
{
	var requestURL:String = "http://developers-staging.musicshake.com/api/rtmp?api_key=YOUR_API_KEY&song_id=661";
	
	var ul:URLLoader = new URLLoader();
	ul.addEventListener(IOErrorEvent.IO_ERROR, onURLLoaderError);
	ul.addEventListener(Event.COMPLETE, onURLLoaderComplete);
	
	try {
		ul.load(new URLRequest(requestURL));
	} catch (error:SecurityError) {
	}
}

private function onURLLoaderError(error:Error):void
{
}

private function onURLLoaderComplete(event:Event):void
{
	trace(o.url);
}