Does anyone have working code for starting and stopping recordings via the html get requests using jquery and authentication admin-digest.
If I have authentication none - then setting Cross-origin resource sharing (CORS) (for HTTP-based streams) on my application appears to allow this to work:
var request = $.ajax({
method: “GET”,
url: “http://localhost:8086/livestreamrecord?app=videochat/definst&streamname=live_v2&action=startRecording”,
success: function (){ console.log(‘worked’) },
error: function( jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); }
});
If I set authentication back to admin-digest on the LiveStreamRecord HTTP Provider then this gives “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied”
var request = $.ajax({
method: “GET”,
url: “http://myuser:mypassword@localhost:8086/livestreamrecord?app=videochat/definst&streamname=live_v2&action=startRecording”,
success: function (){ console.log(‘worked’) },
error: function( jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); }
});
As does this:
var request = $.ajax({
method: “GET”,
username: ‘myuser’,
password: ‘mypassword’,
url: “http://localhost:8086/livestreamrecord?app=videochat/definst&streamname=live_v2&action=startRecording”,
success: function (){ console.log(‘worked’) },
error: function( jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); }
});
And this version gives me a CORS error:
var request = $.ajax({
method: “GET”,
headers: { ‘Authorization’: "Basic " + btoa(“myuser:mypassword”)},
url: “http://localhost:8086/livestreamrecord?app=videochat/definst&streamname=live_v2&action=startRecording”,
success: function (){ console.log(‘worked’) },
error: function( jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); }
});
If I browse to here - http://localhost:8086/livestreamrecord/index.html - then the user name and password let me in - so they are correct.
Does anyone have any ideas?
Thanks in advance
Pip