Question -
How do I create a live streaming resource on my CDN.net account
Answer -
To create a live streaming resource you can use the following steps.
- After logging into https://hb.cdn.net, navigate to the Dashboard, and click on your package on which you wish to add the Live Streaming resource.
- Click on the "Add New Resource Button".
- Select live streaming from the drop down list, then next.
- Input the cdn hostname, which is the hostname from which you'll be serving the stream, then select either internal or external publishing point. An internal publishing point uses one of our live streaming cdn servers as the publishing point, and an external publishing point is used if you already have a publishing point.
- If you chose internal publishing point then now you'll want to use the next section of resource creation to select which servers you'd like to use as your primary and failover publishing points. Then click "Save Changes."
Once the resource is created Navigate to the resource overview tab, and make a note of the CDN Reference ID. This will be needed to set up the live stream using the following instructions. In your setup replace resource_id with the resource ID from step 5 above.
Video Embed Instructions
Replace "mystream" with the streamname
Our easy video embed script automatically detects the browser type (Desktop or Mobile device) and loads the appropriate player. Currently, this is either Flow Player or the browser’s native HTML5 player. The streaming protocol is also set appropriately.
To use it, enter into your webpage:
<html> <head> <script src="http://video.worldcdn.net/player.js" type="text/javascript"></script> </head> <body> <div id="my-video-player"/> <script type="text/javascript"> CDNPlayer("my-video-player", resource_id, "mystream", {width:640, height:360} ); </script> </body> </html>
Manual Instructions
We support a variety of methods to get the CDN URL to use in your player.
SMIL
http://video.worldcdn.net/resource_id/_definst_/mystream.smil
The SMIL playlist provides an RTMP URL and should be used with Flash-based players only. Longtail Player and Flow Player are compatible with SMIL redirection.
Apple HTTP Live Streaming
http://video.worldcdn.net/resource_id/_definst_/mystream.m3u8
This returns a 302 redirect to a Apple HLS manifest and should be used with Apple HLS-compatible players only.
Adobe HTTP Dynamic Streaming
http://video.worldcdn.net/resource_id/_definst_/mystream.f4m
This returns an Adobe HDS manifest and should be used with Adobe HDS-compatible players only.
Microsoft Smooth Streaming (Silverlight)
http://video.worldcdn.net/resource_id/_definst_/mystream.ism
This returns a 302 redirect to Smooth Streaming manifest and should be used with Smooth Streaming-compatible players only.
Javascript JSONP
http://video.worldcdn.net/resource_id/_definst_/mystream.jsonp?callback=MyCallBack
This returns a JSONP document, embeddable using <script>
An example of a callback with a successful result:
MyCallBack({ “rtmp”: “rtmp://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream”, “rtmpe”: “rtmp://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream”, “apple”: “http://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream/playlist.m3u8”, “adobe”: “http://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream/manifest.f4m”, “rtsp”: “rtsp://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream”, “silverlight”: “http://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream/Manifest” });
An example with an error:
MyCallBack({ “error”: “File not found” });
Javascript JSON
http://video.worldcdn.net/resource_id/_definst_/mystream.json
This returns a JSON document. Cross-origin resource sharing is enabled to allow XMLHttpRequest from any domains.
An example of a callback with a successful result:
An example of a JSON document with a successful result: { “rtmp”: “rtmp://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream”, “rtmpe”: “rtmp://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream”, “apple”: “http://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream/playlist.m3u8”, “adobe”: “http://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream/manifest.f4m”, “rtsp”: “rtsp://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream”, “silverlight”: “http://147285128.e.resource_id.r.worldcdn.net/resource_id/_definst_/mystream/Manifest” }
An example of a callback with a JSON document with an error thrown:
{ “error”: “File not found” }