Skip to content

Commit 7cf5400

Browse files
author
Igor Khomenko
committed
renew Cordova Video chat sample
1 parent 918114f commit 7cf5400

File tree

40 files changed

+772
-608
lines changed

40 files changed

+772
-608
lines changed

samples/cordova/video_chat/config.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
<string>Use microphone for video calling</string>
3131
</config-file>
3232
</platform>
33-
<engine name="android" spec="~6.0.0" />
34-
<engine name="ios" spec="~4.3.0" />
35-
<engine name="browser" spec="~4.1.0" />
3633
<plugin name="cordova-plugin-iosrtc" spec="~3.1.0" />
3734
<plugin name="cordova-plugin-console" spec="~1.0.4" />
3835
<plugin name="cordova-plugin-device" spec="~1.1.3" />
39-
<plugin name="cordova-custom-config" spec="~3.0.14" />
36+
<plugin name="cordova-custom-config" spec="~3.0.14" />
37+
<engine name="ios" spec="~4.3.0" />
38+
<engine name="android" spec="~6.0.0" />
39+
<engine name="browser" spec="~4.1.0" />
4040
</widget>

samples/cordova/video_chat/platforms/android/android.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"parents": {
1010
"/*": [
1111
{
12-
"xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
12+
"xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
1313
"count": 1
1414
},
1515
{
16-
"xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
16+
"xml": "<feature name=\"Whitelist\"><param name=\"android-package\" value=\"org.apache.cordova.whitelist.WhitelistPlugin\" /><param name=\"onload\" value=\"true\" /></feature>",
1717
"count": 1
1818
}
1919
]
@@ -22,20 +22,20 @@
2222
}
2323
},
2424
"installed_plugins": {
25-
"cordova-plugin-whitelist": {
26-
"PACKAGE_NAME": "io.cordova.hellocordova"
27-
},
28-
"cordova-plugin-iosrtc": {
29-
"PACKAGE_NAME": "io.cordova.hellocordova"
25+
"cordova-custom-config": {
26+
"PACKAGE_NAME": "com.quickblox.cordova.video_chat"
3027
},
3128
"cordova-plugin-console": {
32-
"PACKAGE_NAME": "io.cordova.hellocordova"
29+
"PACKAGE_NAME": "com.quickblox.cordova.video_chat"
3330
},
3431
"cordova-plugin-device": {
35-
"PACKAGE_NAME": "io.cordova.hellocordova"
32+
"PACKAGE_NAME": "com.quickblox.cordova.video_chat"
3633
},
37-
"cordova-custom-config": {
38-
"PACKAGE_NAME": "io.cordova.hellocordova"
34+
"cordova-plugin-iosrtc": {
35+
"PACKAGE_NAME": "com.quickblox.cordova.video_chat"
36+
},
37+
"cordova-plugin-whitelist": {
38+
"PACKAGE_NAME": "com.quickblox.cordova.video_chat"
3939
}
4040
},
4141
"dependent_plugins": {},
@@ -50,10 +50,10 @@
5050
}
5151
],
5252
"plugin_metadata": {
53-
"cordova-plugin-whitelist": "1.3.0",
54-
"cordova-plugin-iosrtc": "3.1.0",
53+
"cordova-custom-config": "3.0.14",
5554
"cordova-plugin-console": "1.0.4",
5655
"cordova-plugin-device": "1.1.3",
57-
"cordova-custom-config": "3.0.14"
56+
"cordova-plugin-iosrtc": "3.1.0",
57+
"cordova-plugin-whitelist": "1.3.0"
5858
}
5959
}

samples/cordova/video_chat/platforms/android/assets/www/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
webrtc: {
55
answerTimeInterval: 30,
66
dialingTimeInterval: 5,
7-
disconnectTimeInterval: 30,
7+
disconnectTimeInterval: 35,
88
statsReportTimeInterval: 5
99
}
1010
};

samples/cordova/video_chat/platforms/android/assets/www/cordova_plugins.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ module.exports = [
1212
module.exports.metadata =
1313
// TOP OF METADATA
1414
{
15-
"cordova-plugin-whitelist": "1.3.0",
16-
"cordova-plugin-iosrtc": "3.1.0",
15+
"cordova-custom-config": "3.0.14",
1716
"cordova-plugin-console": "1.0.4",
1817
"cordova-plugin-device": "1.1.3",
19-
"cordova-custom-config": "3.0.14"
18+
"cordova-plugin-iosrtc": "3.1.0",
19+
"cordova-plugin-whitelist": "1.3.0"
2020
};
2121
// BOTTOM OF METADATA
2222
});

samples/cordova/video_chat/platforms/android/assets/www/index.html

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ <h4 class="caller__name">
258258
</g>
259259
</svg>
260260
</button>
261+
262+
<button class="caller__frames_acts_btn_record j-record" alt="record video">
263+
</button>
261264
</div>
262265

263266
<div class="caller__frames_fl">
@@ -333,10 +336,6 @@ <h4 class="caller__name">
333336
</div>
334337
</script>
335338

336-
337-
<!-- Cordova -->
338-
<script type="text/javascript" src="cordova.js"></script>
339-
340339
<!-- SCRIPT -->
341340
<!-- dependencies -->
342341
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
@@ -348,7 +347,6 @@ <h4 class="caller__name">
348347
document.addEventListener('deviceready', onDeviceReady, false);
349348

350349
function onDeviceReady() {
351-
console.log("onDeviceReady RUN");
352350

353351
// Just for iOS devices.
354352
// Read more here https://github.com/eface2face/cordova-plugin-iosrtc
@@ -365,37 +363,28 @@ <h4 class="caller__name">
365363
jsScript.src = path;
366364
document.getElementsByTagName("body")[0].appendChild(jsScript);
367365
}
368-
loadScriptAsync("https://cdnjs.cloudflare.com/ajax/libs/quickblox/2.3.4/quickblox.min.js");
366+
loadScriptAsync("https://cdnjs.cloudflare.com/ajax/libs/quickblox/2.4.0/quickblox.min.js");
369367
loadScriptAsync("config.js")
370368
loadScriptAsync("js/helpers.js")
371369
loadScriptAsync("js/stateBoard.js")
372370
loadScriptAsync("js/app.js")
373371
}
374372

375-
// Listen for orientation changes and scroll events
373+
// Listen for orientation changes
376374
//
377-
window.addEventListener('orientationchange', function(){
378-
refreshVideoViewPosition();
379-
});
380-
window.addEventListener("scroll", function(){
381-
console.log("SCROLL");
382-
refreshVideoViewPosition();
383-
});
384-
//
385-
function refreshVideoViewPosition(){
375+
window.addEventListener('orientationchange', doOnOrientationChange);
376+
function doOnOrientationChange(){
386377
if (window.device.platform === 'iOS') {
387378
cordova.plugins.iosrtc.refreshVideos();
388379
}
389380
}
390-
391381
</script>
392382

393383
<!-- hack for github Pages -->
394384
<script>
395385
var host = "quickblox.github.io";
396-
if ((host == window.location.host) && (window.location.protocol != "https:")){
386+
if ((host == window.location.host) && (window.location.protocol != "https:"))
397387
window.location.protocol = "https";
398-
}
399388
</script>
400389
</body>
401390
</html>

0 commit comments

Comments
 (0)