Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- document.getElementById('submitButton').onclick, function() {
- var form = $('#videoForm');
- $.ajax({
- method: 'get',
- url: 'dashboard/video/upload/payment/submit',
- data: {
- 'length': $length,
- },
- 'ajax': true,
- success: function(data) {
- try {
- data = JSON.parse(data)
- } catch (e) {
- return alert("Error parsing response");
- }
- if (data) {
- $signature = data['signature'];
- $expiration = data['expiration'];
- document.getElementsByTagName("camera")[0].setAttribute("data-signature", $signature);
- document.getElementsByTagName("camera")[0].setAttribute("data-signature-expiration", $expiration);
- myCamera.publish();
- } else {
- return alert("Payment could not be completed");
- }
- },
- error: function(data) {
- // Error from the server (404, 503)
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement