Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45,251 changes: 45,250 additions & 1 deletion quickblox.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions samples/webrtc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ <h4 class="caller__name">

<button class="caller__frames_acts_btn_record j-record" alt="record video">
</button>

<p class="sample_info">
The recording time is 10 minutes maximum.
Check out a <a href="https://github.com/QuickBlox/javascript-media-recorder" target="_blank">recorder</a> if want more.
</p>
</div>

<div class="caller__frames_fl">
Expand Down
23 changes: 18 additions & 5 deletions samples/webrtc/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
};

var recorder = null;
var recorderTimeoutID;

var recorderOpts = {
onstart: function onStartRecord() {
console.log('[QB Recorder] onStartRecording');
$('.j-record').addClass('active');

recorderTimeoutID = setTimeout(function() {
if(recorder) {
recorder.stop();
}
}, 600000); // 10min
},
onstop: function(blob) {
console.log('[QB Recorder] onStopRecording');
$('.j-record').removeClass('active');

var down = confirm('Do you want to download video?');
Expand All @@ -26,6 +31,7 @@
}

recorder = null;
clearTimeout(recorderTimeoutID);
},
onerror: function(error) {
console.error('Recorder error', error);
Expand Down Expand Up @@ -73,7 +79,7 @@
var remoteStreamCounter = 0;

function closeConn(userId) {
if(recorder) {
if(recorder && recorderTimeoutID) {
recorder.stop();
}

Expand Down Expand Up @@ -222,14 +228,20 @@
return [item.name, item.value.trim()];
}));

/** Check internet connection */
if(!window.navigator.onLine) {
alert(CONFIG.MESSAGES['no_internet']);
return false;
}

if(localStorage.getItem('isAuth')) {
$('#already_auth').modal();
return false;
}

$form.addClass('join-wait');

app.helpers.join(data).then(function (user) {
app.helpers.join(data).then(function(user) {
app.caller = user;

QB.chat.connect({
Expand Down Expand Up @@ -329,8 +341,9 @@
if ($btn.hasClass('hangup')) {
if(!_.isEmpty(app.currentSession)) {

if(recorder) {
if(recorder && recorderTimeoutID) {
recorder.stop();

}

app.currentSession.stop({});
Expand Down
14 changes: 12 additions & 2 deletions samples/webrtc/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ b {
}

.caller__ctrl{
height: 100px;
height: 90px;
}

.caller__ctrl_btn {
Expand Down Expand Up @@ -523,6 +523,9 @@ b {
background: #ff2d55;
color: #fff;
}
.caller__ctrl_btn:last-child {
margin-bottom: 0;
}

.caller__name {
margin: 20px 0 0 0;
Expand Down Expand Up @@ -586,7 +589,7 @@ b {
}

.caller__frames_fl {
margin: 30px 0 10px 0;
margin: 15px 0 10px 0;
}

/**
Expand Down Expand Up @@ -684,3 +687,10 @@ b {
font-size: 15px;
line-height: 1.2;
}

.sample_info {
margin: 5px 0 0 0;
font-size: 12px;
line-height: 1.4;
color: #808080;
}