VIDIZMO widgets client API consists of HTML Tags and JavaScript that facilitate VIDIZMO customers to design their own customized application interface using VIDIZMO JS and VIDIZMO Web APIs, which reside on VIDIZMO API Server. The developer simply needs to place HTML tags provided in this document for VIDIZMO widgets and provide input data to the widgets parameters using JavaScript.


All the widgets mentioned below adhere to Context information set before they are used. Therefore to use any of the widgets for a given user, VIDIZMO JS Login API must be used. Its information is provided in sections ahead.


To invoke Widget Library all you have to do is add following script to body of the HTML page by copying/pasting following code

 

<script type="text/javascript" src="http://video.lexcorpinc.com/JavaScript/bundles/widgets.js"></script>


 

This script loads and initiates Widget API for further use. As has been mentioned before, API needs to know which Account or Channel context to use it with and this is communicated by the domain part of Widget URL. As shown above, this script will initialize Widget API for Account available at http://video.lexcorpinc.com domain. After setting up against this Account, Widget API call for listing Channels will display all channels part of this Account. 


Please note that like every Account, all channels have domains of their own. So if the widget is initialized against a channel instead, the Context set would be of the Channel and not Account. Therefore in such case Widget API call for listing Channels will only display one Channel only, the one Widget was initialized against. 


To sum it up, a basic widget setup on a page would look like following.

 

<div class="videos"></div>
<script type="text/javascript" src="http://video.lexcorpinc.com/JavaScript/bundles/widgets.js"></script>
<script type="text/javascript">
    vidizmo.videos.account(".videos");
</script>


 

This widget would bring videos from the Account, http://video.lexcorpinc.com and since no Login is specified before calling Widget API, the videos displayed will only be Anonymous videos.

 

However, in the following example, there’s an additional use of VIDIZMO JS Login API prior to calling Widget API. In such case, the user is authenticated and its Context set, which in turn results in displaying all those videos that are accessible by the logged in user. 

    

<script type="text/javascript" src="http://video.lexcorpinc.com/JavaScript/bundles/widgets.js"></script>
<script type="text/javascript">
    vidizmo.api.login({ email: 'EmailAddress, password: 'Passsword' }, function (response) {
        if (response.status === vidizmo.enumerations.ResultStatus.SUCCESS) {
            // login success
        }
        else {
            // login failed
        }
    });
</script>
<div class="videos"></div>
<script type="text/javascript">
    vidizmo.videos.account(".videos");
</script> 

    

Widgets API available with VIDIZMO today is explained in detail below along with basic setup. These Widgets provide additional events as well as properties that can be set, therefore creating more possibilities than mentioned below. There’s a chart provided at the end of section that describes these events and properties. Also note that almost all the widget will only display 20 videos if ‘count’ property is not set.

 

Note: In all examples given below, a hypothetical account and login id/password are used to demonstrate Widget API and its behavior. These will have to be replaced by actual Account URL and credentials to work. During copying & pasting of widgets mentioned, make sure no special characters are copied in page. If this happens, the Widget would not be able to run properly.


For a complete list of VIDIZMO APIs, click here on VIDIZMO Developer APIs.