Skip to content

Commit 18620cf

Browse files
author
Igor Khomenko
committed
added track of orientation changes for Cordova video chat sample
1 parent 592a7cd commit 18620cf

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

samples/cordova/video_chat/platforms/ios/www/index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,24 @@ <h4 class="caller__name">
370370
loadScriptAsync("js/stateBoard.js")
371371
loadScriptAsync("js/app.js")
372372
}
373+
374+
// Listen for orientation changes
375+
//
376+
window.addEventListener('orientationchange', doOnOrientationChange);
377+
function doOnOrientationChange(){
378+
if (window.device.platform === 'iOS') {
379+
cordova.plugins.iosrtc.refreshVideos();
380+
}
381+
}
382+
373383
</script>
374384

375385
<!-- hack for github Pages -->
376386
<script>
377-
console.log("aaaaa");
378387
var host = "quickblox.github.io";
379-
if ((host == window.location.host) && (window.location.protocol != "https:"))
388+
if ((host == window.location.host) && (window.location.protocol != "https:")){
380389
window.location.protocol = "https";
390+
}
381391
</script>
382392
</body>
383393
</html>

samples/cordova/video_chat/www/index.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ <h4 class="caller__name">
357357
}
358358

359359
// Load JavaScript files async
360+
//
360361
var loadScriptAsync = function(path){
361362
var jsScript = document.createElement("script");
362363
jsScript.type = "text/javascript";
@@ -370,14 +371,24 @@ <h4 class="caller__name">
370371
loadScriptAsync("js/stateBoard.js")
371372
loadScriptAsync("js/app.js")
372373
}
374+
375+
// Listen for orientation changes
376+
//
377+
window.addEventListener('orientationchange', doOnOrientationChange);
378+
function doOnOrientationChange(){
379+
if (window.device.platform === 'iOS') {
380+
cordova.plugins.iosrtc.refreshVideos();
381+
}
382+
}
383+
373384
</script>
374385

375386
<!-- hack for github Pages -->
376387
<script>
377-
console.log("aaaaa");
378388
var host = "quickblox.github.io";
379-
if ((host == window.location.host) && (window.location.protocol != "https:"))
389+
if ((host == window.location.host) && (window.location.protocol != "https:")){
380390
window.location.protocol = "https";
391+
}
381392
</script>
382393
</body>
383394
</html>

0 commit comments

Comments
 (0)