The CDN is easily intergated into you project. Before you start, please read the instructions below.
The primary purpose of our CDN is broadcasting / streaming video on your site and reducing Internet traffic costs.
You should do some very simple steps to start:
Go to CDN control panel:
Settings→Projects→New
Standard HTML5 player example is below:
HTML in the standard player example:
<video controls="controls" width="640" height="480" poster="/cdn.php?path=/test/cinema.jpg&link=1"> <source src="https://mentor.dfcdn.net?v=1&p=311989d4-4799-455e-a645-ca4899527504&f=%2Ftest%2Fx1080.mp4&e=1733202258&s=-120&sig=AzBJrb8V4JCu5ZrO%2BGm1ECZ1ZdejFgqU7lZ%2F7N4QC90%3D&b=60&a=86400" type="video/mp4"> </video>
CDN for Kernel Video Sharing (KVS) is configured very simply.
First of all you need to doproject settings
Then download 2 files:
to FTP of your site /admin/cdn
на FTP вашего сайта
Next, go to the settings in the admin panel of the KVS: add a new server group and a storage server.
Configure the storage server in the following way:
Dragonfly
http://dragonfly.cdn
CDN
SecretKey;ProjectID;PreloadTime;SpeedLimit
(example:5zpoHYdoCqAcxq;311989d4-4799-455e-a645-ca4899527504;30;-120
)
SecretKey - take from project settings
ProjectID - take from project settings
PreloadTime - Video preload time in seconds before hitting the speed limit, if you set a negative value - percentage (example: 30
- this is 30 sec of preloading time or -30
- 30 percent)
SpeedLimit - Limiting video broadcast in kbps, if you set a negative value - percentage (example: 320
- 320 kbps -120
- 120 percent relative to the video bit rate)
FTP
ftp.dfcdn.net
21
/projects/ProjectName/files
, ProjectName take from project settings120
Save the server configuration. Add or migrate new video to the storage server via KVS.
Download PHP-library for working with the CDN dragonfly.php and save it to the root folder of your website
Variables that are used in library functions and their usage.
5zpoHYdoCqAcxq
311989d4-4799-455e-a645-ca4899527504
30
- this is 30 sec of preloading time or -30
- 30 percent320
- 320 kbps -120
- 120 percent relative to the video bit rate600
- 600 seconds or 10 minutes; 60 * 60 * 2
- 2 hours86400
- a day, 1d; 60 * 60 * 24 * 7
- A week, 7d, 1w. For the ease of perceptionout.pdf
- the downloaded file will be named out.pdf false
- empty field and the file will be broadcasted100/10/11.mp4
and receive files: /projects/tube/files/100/10/11.mp4
. Also, this value is an ExtID of an elementIs the most common example of integration and video link creation is below:
<?php require_once 'dragonfly.php'; $file_name = $_GET['path']; $dragonfly = new Dragonfly("//mentor.dfcdn.net", "5zpoHYdoCqAcxq"); $link = $dragonfly->getUrlByExtId("311989d4-4799-455e-a645-ca4899527504", $file_name, 30, -110, 60 * 60 * 2, 0, $download); header('Location: ' . $link ); ?>
Functions of the dragonfly.php library:
getUrlByExtId($projectId, $fileId, $burst, $speedLimit, $secondsTTL, $maxAge, $downloadFn)
- generates a URL with a limited lifetime by filename $fileId (by Path) getUrl($fileId, $burst, $speedLimit, $secondsTTL, $maxAge, $downloadFn)
- generates a URL with a limited lifetime by filename $fileId (by UID) getPermanentUrlByExtId($projectId, $fileId, $burst, $speedLimit, $maxAge, $downloadFn)
- generates permanent URL by the file name $fileId (by Path) getPermanentUrl($fileId, $burst, $speedLimit, $maxAge, $downloadFn)
- generates permanent URL by the file name $fileId (by UID) We have tried to use the advanced functionality in a very convenient form but if you will need extra features, you can always contact us and we will implement it
The letter that you received after signing up has you FTP access credentials.
That is the most convinient way to store your file on the CDN