-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
34 lines (34 loc) · 961 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<title>Swingbot Licensee SDK Test Page</title>
<script src="./lib/swingbot-licensee-sdk.min.js"></script>
</head>
<body>
<h1>Testing the SDK</h1>
<p>Select a file to upload and press submit to begin upload</p>
<br />
<input type="file" id="videoFile" name="files[]" onChange="handleChange()" />
</body>
<script type="text/javascript">
/**
* When a user chooses a video, this will be called
* and the upload will begin!
*/
function handleChange() {
const file = document.getElementById('videoFile').files[0];
// upload the file..
SwingbotLicenseeSDK.uploadVideo(
file,
'<email-of-user>',
'analyze', // this might be deprecated....will handle in the campaign!
'<campaign-id>',
'<your-api-key>'// API KEY
).then((result, err) => {
if (err) {
console.log(err);
}
console.log(result);
}).catch(err => console.log('error', err));
}
</script>
</html>