Aller au contenu

SureVideo Android Javascript APIs

Mar 07, 2014 | 42Gears Team

Applies to:
Product SureVideo
Platform Android

SureVideo for Android now comes with built-in set of Javascript APIs. Use these APIs in an HTML file and specify the file as Custom Layout Home Screen.

The APIs are written as window.surevideo.<API_Name>

Following is a comprehensive list of SureVideo APIs:

  • launch(‘file_path’): Launches a media file.

      window.surevideo.launch(‘/mnt/sdcard/samplevideo.mp4’);

  • loopMedia(): Loops the allowed media files once and returns back to SureVideo Home Screen.

      window.surevideo.loopMedia();

  • launchApp(‘packagename‘ , freshlaunch): Launches an application.

      window.surevideo.launchApp(‘com.android.contacts’, true);

  • closeSureVideo(): Closes SureVideo.

      window.surevideo.closeSureVideo()

Sample HTML Home Screen with SureVideo APIs:

custom_homescreen

HTML Code for Sample HTML Home Screen:

<html>
<style type= »text/css »>
.tbview {border-collapse:collapse;border-spacing:0;}
.tbview td{font-family:Arial, sans-serif;font-size:14px;padding:10px 8px;border-style:solid;border-width:1px;}
.tbview th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;}
.tbview .tbview-left{font-size:x-large;background-color:#2980b9;}
.tbview .tbview-one{background-color:#F660AB}
.tbview .tbview-two{font-size:large;background-color:#50EBEC}
</style>
<body>
<table class= »tbview » style= »width: 100%; height: 100%; »>
<tr>
<th rowspan= »2″ class= »tbview-left » onclick = « window.surevideo.launch(‘/mnt/sdcard/movie.mp4’); »>Demo Video</th>
<th class= »tbview-one » onclick = « window.surevideo.launch(‘/mnt/sdcard/a.mp4’); »>Products</th>
<td class=”tbview-five” onclick = « window.surevideo.loopMedia(‘/mnt/sdcard/a.mp4’,4,false); »>Click to loop videos</td>
</tr>
<tr class= »tbview-right »>
<td class= »tbview-two » onclick = « window.surevideo.launch(‘/mnt/sdcard/video.mp4’); »>Testimonials</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>

To know more about SureVideo, click here

To download a trail version, click here

For any other queries, send an email to info@42gears.com

Subscribe for our free newsletter

Thank you! you are successfully subscribed.
newsletter

Exclusive News and Updates on Enterprise Mobility!

* I consent to receive newsletters via email from 42Gears and its Affiliates.
Please agree
* I have reviewed and agreed to 42Gears Privacy Policy and Terms of Use prior to subscribing and understand that I may change my preference or unsubscribe at any time.
Please agree
Please verify captcha
Please enter a valid official email