Basic API Integration Strategy

The heavy lifting for using video on your website is being done by VIXY and its platform.

Integrating the VIXY services for this use-case is split in two main activities: retrieving the data from VIXY (4a) and wrapping it in a own endpoint for consumption by the GUI and integrating the VIXY player (4b)

1a. Integrating the API

The data returned by VIXY will probably not be ready for consumption by your own GUI. So a basic wrapper will have to be created in your own endpoint. The sequence for showing VIXY data in your own GUI would look like (how to do the requests is handled in (5)):

1b. Integrating the player

VIXY provides its clients with a branded HTML5/Javascript player to start streaming as quickly as possible. The embedding strategy is as follows:

2. Technical

Here I will cover the technicals on how to make the various requests and its parameters. For the sake of simplicity I will assume we are using the client libraries provided by VIXY, useful code examples using the libraries can be generated in the test console. When using the test console it is recommended to install the Chrome plugin XML tree, since it will show the result in XML. 

The service endpoint is:


The interactive test console:


Downloading the client libraries:


2a. Starting a session

Before we start, there are two types of sessions. 
  1. Admin sessions, these are used for administering the catalog and its features. Session tokens of this type should NOT be returned to the GUI and are meant for use by the trusted publisher backend. 
  2. User sessions, these sessions are used to create viewing sessions to secure playback. These can safely be returned to the GUI.

Starting a session through the test console is done as follows: 

Or by using the following (generated) PHP snippet.

<?php

require_once('lib/KalturaClient.php');

$config = new KalturaConfiguration();

$config->serviceUrl = 'https://platform.vixyvideo.com/';

$client = new KalturaClient($config);

$secret = 'Admin secret provided by VIXY';

$userId = 'admin@example.com';3.1 - Basic API Integration Strategy - image 3

$type = KalturaSessionType::ADMIN;

$partnerId = 666;

$expiry = 500;

$privileges = null;

$result = $client->session->start($secret, $userId, $type, $partnerId, $expiry, $privileges);

2b. Listing Media

When you have obtained a valid admin session by following 5a, you are able to query the VIXY api for the media list. You are able to test this using the test console as follows: 

Or by using the following (generated) PHP Snippet.

<?php

require_once('lib/KalturaClient.php');

$config = new KalturaConfiguration();

$config->serviceUrl = 'https://platform.vixyvideo.com/';

$client = new KalturaClient($config);

$filter = null;

$pager = new KalturaFilterPager();

$pager->pageSize = 500;

$pager->pageIndex = 1;

$result = $client->media->listAction($filter, $pager);

Please note that the pageSize parameter is capped at 500. So if the total catalog exceeds 500, multiple requests will need to be done to the VIXY API. If there are less, the full catalog can be retrieved in one request for caching locally. 


2c. Listing Categories

Categories are listed using the categories.list() call like so:

Or by using the following (generated) PHP Snippet:

<?php

require_once('lib/KalturaClient.php');

$config = new KalturaConfiguration();

$config->serviceUrl = 'https://platform.vixyvideo.com/';

$client = new KalturaClient($config);

$filter = null;

$pager = null;

$result = $client->category->listAction($filter, $pager);

 

2d. Filtering Media

Filtering the media.list call based on category Id, retrieved by the results in 5c:

Or by using the following (generated) PHP Snippet:

<?php

require_once('lib/KalturaClient.php');

$config = new KalturaConfiguration();

$config->serviceUrl = 'https://platform.vixyvideo.com/';

$client = new KalturaClient($config);

$filter = new KalturaMediaEntryFilter();

$filter->categoriesIdsMatchAnd = 1;

$pager = new KalturaFilterPager();

$result = $client->media->listAction($filter, $pager);

3. Rendering the player

There are two ways to embed a VIXY video player:

A. Dynamic Embed. This requires you to include and process the VIXY player libraries. This might be problematic for some environments so we also offer:

B. Iframe embed. This just requires you to embed the <iframe> in the source. The source url for the iframe can also be used in app webviews if needed. 


The dynamic embed looks like:

<script src="https://platform.vixyvideo.com/p/493/sp/49300/embedIframeJs/uiconf_id/23453902/partner_id/493"></script>

<div style="padding-bottom: 56.25%; position: relative;"><div id="kaltura_player_1584526241" style="position:absolute; width:100%; height:100%"><a href="https://www.vixyvideo.com/video-platform">Video Platform</a>

</div></div>

<script>

kWidget.embed({

"targetId": "kaltura_player_1584526241",

"wid": "_493",

"uiconf_id": 23453902,

"flashvars": {},

"cache_st": 1584526241,

"entry_id": "0_5ov2h5i2"

});

</script>

4. Documentation

Entry guide:

Full documentation:

 
FAQ
Q: Why doesn’t media.list not show all entries like the OVP interface does?
A1. When using media.list using a user type session, only your own media are shown. Start an admin type session to show all media.

A2. The entry is not “ready” or filtered out by other filters. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us