Wondering where "submitted" event is when using v2? Then check this out
At this time our v2 recorder is still considered as "beta" release. As such it is subject to some change and might not have all the little things that you are accustomed in v1.
The "submitted" event is however not one of those missing things.
Well, truth be told, it is missing however this is intentional for v2 and here is why.
v1 of our recorder has helped us gain great insight. You want something:
- easy to use (check),
- easy to deploy (check)
- easy to change (check)
- finishes quickly (check)
To see what is different lets first cover what v1 does with "submitted" event.
It will first start uploading event. Once the uploading event is finished, the processing starts.
Now during this time you were not needed to wait and have your page still open, however your end customers were shown the processing progress bar, waiting for the same to finish.
It is also possible that at some point the processing failed..It had happened for some reason, however regardless, you need to have your customer re-record the video again.
Now instead of doing the same process, our engineers came up with a great idea to verify the video first.
What this does is to actually do the following steps:
- upload the video
- check if we can process it or not
No more need to wait for the processing to complete to see the token or to know how it goes - it tells you right away :)
In the same time you are able to preview the video and close the browser or the page, or direct your customer to something else, while we do the processing without them even knowing of that step - neat :)
I know, you are looking for the code so here it is, just change your "submitted" event to "verified" event (in v2 recorder only).
recorder.on("verified", function () {
alert( 'Video token:' + recorder.get('video') );
});
You can notice that there is no "data" parameter that you would access and need to go through to get your data. Instead we have .get() function.
It is called directly on the variable that you have used to declare the event on (please see the attached sample for more).
With it you can get the very same details and much more.
For example, for video token, you would call
recorder.get('video');
For stream token you would call:
recorder.get('stream');
For key you would call:
recorder.get('key');
Wonder how to get all of the things that you can call? You can always grab the entire object by calling:
recorder.get();
and then inspect it directly to see what there is and how it is named, or contact us and we would be happy to give you more insight into the same :)
We do hope that this helps you and as mentioned above - let us know if you have any questions - we like questions and like helping :)
Attachments:
Please sign in to leave a comment.
Comments
0 comments