Audio/video stream recording forums
|
| Attention Visitor: |
You may have to register or log in before you can post:
|
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Akamai CDN: Getting RTMP URL From XML FileAkamai CDN: Getting RTMP URL From XML File
Where I work, my company uses Akamai as the CDN for all properties. Initially our company used non-RTMP downloadable URL from Akamai, but, later after some struggling (in May 2008 or so) I was able to figure out how to extract RTMP from Akamai's XML File. Akamai Provides two URLs for each File:
#1 is self-explanatory, when you visit that URL, you get the RAW FLV File. so, I will talk on #2. #2. Streaming URL: When you try visiting the streaming URL. It returns an XML File like below: Code:
<FLVPlayerConfig>
<serverName>cp49576.edgefcs.net</serverName>
<fallbackServerName>cp49576.edgefcs.net</fallbackServerName>
<appName>ondemand</appName>
<streamName>
flash/streamfile/.uid.ManyRzefr9384ec84.anti
</streamName>
<isLive>false</isLive>
<bufferTime>2</bufferTime>
</FLVPlayerConfig>
Code:
rtmp://[serverName]/[appName]/[streamName] Code:
rtmp://cp49576.edgefcs.net/ondemand/flash/streamfile/.uid.ManyRzefr9384ec84.anti I usually use PHP DomDocument and DomXPath to get the RTMP URL. The code would be simple and straight-forward like below: Code:
$dom = new DomDocument($akamaiURL);
$xpath = new DomXPath($dom);
$rtmpURL = 'rtmp://'.$xpath->query('/FLVPlayerConfig/serverName')->item(0)->nodeValue .'/'. $xpath->query('/FLVPlayerConfig/appName')->item(0)->nodeValue . '/' . $xpath->query('/FLVPlayerConfig/streamName')->item(0)->nodeValue;
Please Note that: In this article, I didn't cover the Akamai URL that requires Authentication Token, which is a separate issue. |
| Tags: akamai, akamai cdn, cdn, edgeboss, edgeboss net, edgefcs, edgefcs net, file, get, get rtmp url, getting, rtmp, url, xml, xml file |
| Thread Tools | |
| Display Modes | |
|
|