SureVideo Android Javascript APIs
mrt 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:
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