We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
Integration of HTML5 player using CALLBACK URL
Environment
OnApp CDN
Answer
On the instruction page, we provide a callback URL with both JSON and JSONP approach. The callback URL would return appropriate streaming URLs to be played by different OS/devices: iPhone, web, Android, etc.
You can integrate the JSONP by using the following method:
<script>
function MyCallBack(urls) {
// load the flash / html5 player with one of the urls
}
</script>
<script src="http://video.worldcdn.net/[resource id]/[stream name or filename].jsonp?callback=MyCallBack " />
Outcome:
The outcome of the callback URL looks like the following, however, do not use them as a playing URL in your player as they are the result of the CDN redirection, that means visitors from a different location will get a different result using the callback URL. Always use the callback URL in your script:
MyCallBack({ “rtmp”: “rtmp://324658483.e.384856423.r.worldcdn.net/384856423/mystream”, “rtmpe”: “rtmp://324658483.e.384856423.r.worldcdn.net/384856423/mystream”, “apple”: “http://324658483.e.384856423.r.worldcdn.net/384856423/mystream/playlist.m3u8”, “adobe”: “http://324658483.e.384856423.r.worldcdn.net/384856423/mystream/manifest.f4m”, “rtsp”: “rtsp://324658483.e.384856423.r.worldcdn.net/384856423/mystream”, “silverlight”: “http://324658483.e.384856423.r.worldcdn.net/384856423/mystream/Manifest” });