Cloud Video Platform PHP API Introduction
Next 3 Slides may be
skipped if you know
what’s VIMANTRA 
95% of Asian Video Streaming
Suffers from
DON’T SUPPORT MOBILE VIDEO, NOT ENOUGH BANDWIDTH, BUGGY VIDEO PLAYERS
Problem with WebTV
Infrastructure
Its Expensive
- Global Content Delivery networks have high upfront costs
- Video Transco...
VIMANTRA Solves
This Problem

Upload Your
Video to
Vimantra

Vimantra converts for
over 100+ devices and
stores your video...
CLOUD ECOSYSTEM
Integrated
Vimantra is integrated with popular file storage like Google
Drive, Dropbox , Amazon S3 and Box...
WHERE CAN I GET THE API
www.vimantra.com

Login/API -> Vimantra API
WHERE CAN I GET THE API –
DIRECT Links

Documentation

Tar File with PHP SDK
Tar File with PHP SDK and Test
Videos

http:/...
SETUP – Untar and Start
CONFIG FILE

cd sdkvimantra_php_1.0
vi vimantra.config.php
<?php

VIMANTRA KEY
VIMANTRA TOKEN
AWS ...
VIMANTRA KEY & TOKEN

You can get your VIMANTRA Key & Token from VIMANTRA
Content Management Console. Its under Settings->...
API USE CASE

Upload Video to
Vimantra

Generate Embed
Code

Paste Embed Code on
your website.
It works across devices
glo...
VIMANTRA - Instance
All sample code is under subdirectory samples

Instantiate vimantra
…..
if (!class_exists('vimantra'))...
UPLOAD - From Desktop
Sample Code File: vimantra.fileupload.php
……
$data = array("displayname" => "SINTEL Trailer desktop ...
UPLOAD - From AmazonS3
If your S3 file has granted read-only access for
everyone then you don’t have to use the AWS KEY &
...
UPLOAD - From AmazonS3

Sample Code File: vimantra.uploads3private.php
…..

("bucket_permission" => 'private',
"amazon_aws...
UNIQUE ID
Typical Result : You get a unique ID for your video
(

[responsetype] => media/postAction/File-Upload
[status] =...
WHERE IS MY VIDEO ?
Sample Code File: vimantra.findmedia.php
…….

$parentid = "0nApksHymX";
$media = $vim->findMedia($pare...
DIRECT Access Links
VIMANTRA Converts Your Videos for ABR
Result: vimantra.findmedia.php
[contents] => Array
(
[id] => 0nA...
GET EMBED CODE
Sample Code: vimantra.getembedcode.php
….
$mid = "0nApksHymX";
$playerid = "defaultSV";

$embedtype = "trad...
GET EMBED CODE
Result: vimantra.getembedcode.php

Result Embed Code
- traditionalembed

<script id="embedCode" class="embe...
BROADCAST
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>VIMANTRA Traditional Emb...
BROADCAST - PC FLASH
Adaptive Bit Rate

Embed in HTML
Broadcast from your site
Automatic Device Detection
- PC FLASH HDS A...
BROADCAST – iOS .m3u8
Adaptive Bit Rate

Embed in HTML
Broadcast from your site
Automatic Device Detection
- iOS .m3u8 Ada...
BROADCAST – Android

Embed in HTML
Broadcast from your site
Automatic Device Detection
- Android
BROADCAST - Ubuntu FLASH
Adaptive Bit Rate

Embed in HTML
Broadcast from your site
Automatic Device Detection
- Ubuntu FLA...
Upcoming SlideShare
Loading in …5
×

VIMANTRA PHP SDK Introduction

3,117
-1

Published on

VIMANTRA PHP SDK enables you to easily host and stream your videos using VIMANTRA Cloud Video Platform. The PHP SDK enables you to integrate the platform with your website or application. This presentation is for developers who want to get a quick intro to the PHP SDK.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,117
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

VIMANTRA PHP SDK Introduction

  1. 1. Cloud Video Platform PHP API Introduction
  2. 2. Next 3 Slides may be skipped if you know what’s VIMANTRA 
  3. 3. 95% of Asian Video Streaming Suffers from DON’T SUPPORT MOBILE VIDEO, NOT ENOUGH BANDWIDTH, BUGGY VIDEO PLAYERS
  4. 4. Problem with WebTV Infrastructure Its Expensive - Global Content Delivery networks have high upfront costs - Video Transcoding to convert the video for multiple end user devices requires expensive software and hardware infrastructure - Costly and lengthy development cycle to build players which work across devices. - High Capital Costs for video storage. Technically Complex - As viewers become mobile across devices, new video encoding formats have to be handled - Integration with ad exchanges to monetize your content requires complex integration - your player has to be aware of the end users device before it requests an ad
  5. 5. VIMANTRA Solves This Problem Upload Your Video to Vimantra Vimantra converts for over 100+ devices and stores your video. Integrated with CDN with presence in 140+ cities across the world. Vimantra’s Unique Embed Codes and API have automatic device detection and CDN integration. Play the right format from the server nearest to the viewer.
  6. 6. CLOUD ECOSYSTEM Integrated Vimantra is integrated with popular file storage like Google Drive, Dropbox , Amazon S3 and Box.com
  7. 7. WHERE CAN I GET THE API www.vimantra.com Login/API -> Vimantra API
  8. 8. WHERE CAN I GET THE API – DIRECT Links Documentation Tar File with PHP SDK Tar File with PHP SDK and Test Videos http://fpc.vimantra.com/corp/VIMANTRA+PHP+S DK+-+3+Steps+to+Get+You+Started.pdf http://fpc.vimantra.com/corp/sdkvimantra_php_ 1.0_lite.tar http://fpc.vimantra.com/corp/sdkvimantra _php_1.0.tar
  9. 9. SETUP – Untar and Start CONFIG FILE cd sdkvimantra_php_1.0 vi vimantra.config.php <?php VIMANTRA KEY VIMANTRA TOKEN AWS TOKEN AWS SECRET /** * */ // Vimantra access info if (!defined('vimantraAccessKey')) define('vimantraAccessKey',’YOUR-ACCESS-KEY’); if (!defined('vimantraToken')) define('vimantraToken', 'YOUR-API-TOKEN'); if (!defined('AWSKEY')) define('AWSKEY', ‘YOUR-AWS-KEY'); if (!defined('AWSSECRET')) define('AWSSECRET', 'YOUR-AWS-SECRET'); ?> AWS KEY & AWS SECRET are required only if you are uploading videos from AmazonS3
  10. 10. VIMANTRA KEY & TOKEN You can get your VIMANTRA Key & Token from VIMANTRA Content Management Console. Its under Settings->My User Profile.
  11. 11. API USE CASE Upload Video to Vimantra Generate Embed Code Paste Embed Code on your website. It works across devices globally.
  12. 12. VIMANTRA - Instance All sample code is under subdirectory samples Instantiate vimantra ….. if (!class_exists('vimantra')) require_once '../vimantra.php'; require_once '../vimantra.config.php'; // Instantiate the class $vim = new vimantra(vimantraAccessKey, vimantraToken); ……
  13. 13. UPLOAD - From Desktop Sample Code File: vimantra.fileupload.php …… $data = array("displayname" => "SINTEL Trailer desktop video upload", "file_contents" => '@./sintel480p.mp4', "actiontype" => "File-Upload"); $vim->fileUpload($data); $media_upload = echo "Vimantra::fileUpload(): " . print_r($media_upload) . "n"; …. Upload Video File from PC
  14. 14. UPLOAD - From AmazonS3 If your S3 file has granted read-only access for everyone then you don’t have to use the AWS KEY & SECRET Sample Code File: vimantra.uploads3public.php …… $data = array( Upload Video File from AmazonS3 - Public Access "amazon_bucket" => "mybucket", "amazon_directory_name" => "video/video2.mp4", "displayname" => "Public post_" . time(), "actiontype" => "Upload-S3" ); $vim->UploadS3($data); $media_upload = echo "nVimantra::UploadS3(): " . print_r($media_upload) . "n"; ….
  15. 15. UPLOAD - From AmazonS3 Sample Code File: vimantra.uploads3private.php ….. ("bucket_permission" => 'private', "amazon_aws_key" => AWSKEY, "amazon_aws_secretkey" => AWSSECRET, "amazon_bucket" => "myprivatebucket", "amazon_directory_name" => "video/video.mp4", $data = array Upload Video File from AmazonS3 - Private Access "displayname" => "S3 Private Upload post_" . time(), "actiontype" => "Upload-S3"); $media_upload = ….. $vim->UploadS3($data);
  16. 16. UNIQUE ID Typical Result : You get a unique ID for your video ( [responsetype] => media/postAction/File-Upload [status] => OK [session] => Array ( [0] => Array ( [account] => mycompany [ipAddress] => XXX.XXX.XXX.XXX [location] => Array ( [countryCode] => XX [regionCode] => 00 ) Upload Video File [message] => File uploaded successfully. ) ) [Parentmediaid] => 0nApksHymX )
  17. 17. WHERE IS MY VIDEO ? Sample Code File: vimantra.findmedia.php ……. $parentid = "0nApksHymX"; $media = $vim->findMedia($parentid); echo "Vimantra::findMedia(): " . print_r($media) . "n"; ……. Whats happening to my video.
  18. 18. DIRECT Access Links VIMANTRA Converts Your Videos for ABR Result: vimantra.findmedia.php [contents] => Array ( [id] => 0nApksHymX [idtype] => parent [media] => Array ( [parentmediaid] => 0nApksHymX [displayname] => SINTEL Trailer desktop video upload …….. Whats happening to my video. ( [mediatype] => TRAILER [displayname] => SINTEL Trailer desktop video upload ……………………………………..) [Conversions] => Array ( [tnoc] => 1 [conversion] => Array ( [0] => Array ( [conversiontype] => Adaptive Bit Rate [convertedmediaid] => abr_0nApksHymX [conversionstatus] => Ready [convertedon] => 2013-10-04 14:13:42 [hls] => http://hmc.vimantra.com/4/0MlorFc0La/abr/abr_0MlorFc0La.m3u8 [hds] => http://smc.vimantra.com/4/0MlorFc0La/abr/abr_0MlorFc0La.f4m
  19. 19. GET EMBED CODE Sample Code: vimantra.getembedcode.php …. $mid = "0nApksHymX"; $playerid = "defaultSV"; $embedtype = "traditionalembed"; $vim->getEmbedCode($mid, $playerid, $embedtype); $embed_code = print_r(html_entity_decode($embed_code['contents']['embedCode'])) . "n"; ….. Get Embed Code - traditionalembed - autoembed - iframe
  20. 20. GET EMBED CODE Result: vimantra.getembedcode.php Result Embed Code - traditionalembed <script id="embedCode" class="embedCode" type="text/javascript" src="http://prod.vimantra.com/js/player/embedjs.js?traditionalembed=true&playerid=defau ltSV&mid=0nApksHymX&tr="></script><a id="CT_defaultSV_0nApksHymX_1381304907" style="cursor:pointer;float:left;width:640;height:360;" class="player play_arrow" onclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')" ondblclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')"><img alt="" class="player play_arrow" id="SPLASH_defaultSV_0nApksHymX_1381304907" src="http://dmc.vimantra.com/vimantra/4/0nApksHymX/thumb/default_0nApksHymX.png? 1381304907" width="640" height="360" onclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')" ondblclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')"></a>
  21. 21. BROADCAST <html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>VIMANTRA Traditional Embed Code</title> </head><body> Embed in HTML <script id="embedCode" class="embedCode" type="text/javascript" src="http://prod.vimantra.com/js/player/embedjs.js?traditionalembed=true&playerid=defau ltSV&mid=0nApksHymX&tr="></script><a id="CT_defaultSV_0nApksHymX_1381304907" style="cursor:pointer;float:left;width:640;height:360;" class="player play_arrow" onclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')" ondblclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')"><img alt="" class="player play_arrow" id="SPLASH_defaultSV_0nApksHymX_1381304907" src="http://dmc.vimantra.com/vimantra/4/0nApksHymX/thumb/default_0nApksHymX.png? 1381304907" width="640" height="360" onclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')" ondblclick="$vm('CT_defaultSV_0nApksHymX_1381304907' , 'SPLASH_defaultSV_0nApksHymX_1381304907', 'media')"></a> Broadcast from your site Automatic Device Detection </body> </html>
  22. 22. BROADCAST - PC FLASH Adaptive Bit Rate Embed in HTML Broadcast from your site Automatic Device Detection - PC FLASH HDS Adaptive Bit Rate
  23. 23. BROADCAST – iOS .m3u8 Adaptive Bit Rate Embed in HTML Broadcast from your site Automatic Device Detection - iOS .m3u8 Adaptive Bit Rate
  24. 24. BROADCAST – Android Embed in HTML Broadcast from your site Automatic Device Detection - Android
  25. 25. BROADCAST - Ubuntu FLASH Adaptive Bit Rate Embed in HTML Broadcast from your site Automatic Device Detection - Ubuntu FLASH HDS Adaptive Bit Rate
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×