1
0
Fork 0
mirror of https://gitlab.com/Shinobi-Systems/ShinobiCE.git synced 2025-03-09 15:40:15 +00:00

Blue Turtle - The Refactoring

This commit is contained in:
Moe 2018-10-24 21:42:47 -07:00
parent 04011678fb
commit b7d08eb500
67 changed files with 11651 additions and 8452 deletions

36
web/libs/js/basic.js Normal file
View file

@ -0,0 +1,36 @@
var tool = {}
tool.getVideoImage = function (path, secs, callback) {
var me = this, video = document.createElement('video');
var backCalled = false
var finish = function(err,data){
if(!backCalled){
backCalled = true
callback(err,data)
clearTimeout(timeout)
}
}
var timeout = setTimeout(function(){
finish(new Error('Failed Getting Snap from Video'))
},5000)
video.onloadedmetadata = function() {
video.play()
this.currentTime = Math.min(Math.max(0, (secs < 0 ? this.duration : 0) + secs), this.duration)
video.pause()
};
video.onseeked = function(e) {
var canvas = document.createElement('canvas')
canvas.height = video.videoHeight
canvas.width = video.videoWidth
var ctx = canvas.getContext('2d')
ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
var base64 = canvas.toDataURL()
finish(null, base64)
delete(ctx)
delete(video)
delete(canvas)
};
video.onerror = function(e) {
finish(e)
};
video.src = path;
}

11
web/libs/js/extra.js Normal file
View file

@ -0,0 +1,11 @@
var browserCheck = {}
browserCheck.forLastPass = function(){
var lastpass = navigator.plugins['LastPass'];
if (lastpass === undefined) {
return false;
}
return true;
}
if(browserCheck.forLastPass){
alert('It appears you are using LastPass. Be aware that LastPass is known to cause issues with the form fields.')
}

File diff suppressed because it is too large Load diff

View file

@ -4192,4 +4192,4 @@
return _moment;
}));
}));

View file

@ -19,7 +19,8 @@ var Poseidon = function () {
uid: options.uid,
ke: options.ke,
id: options.id,
channel: options.channel
channel: options.channel,
errorCallback: options.onError
};
_classCallCheck(this, Poseidon);
@ -28,10 +29,11 @@ var Poseidon = function () {
} else {
this._callback = function (err, msg) {
if (err) {
console.error('Poseidon Error: ' + err);
if(_monitor.errorCallback)_monitor.errorCallback(err)
console.error('Poseidon Error: ' + err,options);
return;
}
console.log('Poseidon Message: ' + msg);
console.log('Poseidon Message: ' + msg,options);
};
}
if (!options.video || !(options.video instanceof HTMLVideoElement)) {
@ -467,7 +469,7 @@ var Poseidon = function () {
}, {
key: '_onSocketDisconnect',
value: function _onSocketDisconnect(event) {
this._callback(null, 'socket disconnect "' + event + '"');
this._callback(true, 'socket disconnect "' + event + '"');
this.stop();
}
}, {
@ -502,6 +504,7 @@ var Poseidon = function () {
}, {
key: '_onSegment',
value: function _onSegment(data) {
if(!this._mediaSource)this_.socket.disconnect()
if (this._sourceBuffer.buffered.length) {
var lag = this._sourceBuffer.buffered.end(0) - this._video.currentTime;
if (lag > 0.5) {
@ -605,4 +608,4 @@ var Poseidon = function () {
//first request codec string to test against browser and then feed first into source
//then request init-segment to feed
//then request media segments until we run into pause, stop, close, error, buffer not ready, etc
//change poster on video element based on current status, error, not ready, etc
//change poster on video element based on current status, error, not ready, etc