Browse Source

Merge 9f45fad4ed into 9f2036de9d

pull/14/merge
Muhammad Sohail 7 years ago committed by GitHub
parent
commit
767b5a6474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 94
      .gitignore
  2. 2
      css/comm.css
  3. 7
      dploy.yaml
  4. 0
      img/vidbg.png
  5. 7
      index.html
  6. 4
      js/comm.js
  7. 21
      js/config.js

94
.gitignore vendored

@ -1,48 +1,48 @@ @@ -1,48 +1,48 @@
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
/nbproject/private/

2
css/comm.css

@ -229,7 +229,7 @@ @@ -229,7 +229,7 @@
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(../img/vidbg.png) no-repeat;
background: url(/img/vidbg.png) no-repeat;
background-size: cover;
}

7
dploy.yaml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
server_name:
host: "166.62.28.113"
user: "met10fojqw7e"
pass: "Nowshera123!@#"
path:
local: "/"
remote: "/public_html"

0
img/vidbg.PNG → img/vidbg.png

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

7
index.html

@ -54,13 +54,20 @@ @@ -54,13 +54,20 @@
var linkInput = document.querySelector("#roomLink");
createBtn.onclick = function(){
var check = appRoot.includes("Video-Call-App");
new Promise(function(resolve, reject){
var room = Math.random().toString(36).slice(2).substring(0, 15);
return room ? resolve(room) : reject(new Error("Could not create room"));
}).then(function(room){
if(check){
var roomLink =appRoot+"comm.html?room="+room;
linkInput.innerHTML = '<a href="'+roomLink+'" target="_blank">Enter Room</a>';
}
else{
var roomLink =appRoot+"Video-Call-App/comm.html?room="+room;
linkInput.innerHTML = '<a href="'+roomLink+'" target="_blank">Enter Room</a>';
}
}).catch(function(err){
linkInput.innerHTML = err;
});

4
js/comm.js

@ -570,7 +570,7 @@ function startCall(isCaller){ @@ -570,7 +570,7 @@ function startCall(isCaller){
//When remote stream becomes available
myPC.ontrack = function(e){
document.getElementById("peerVid").src = window.URL.createObjectURL(e.streams[0]);
document.getElementById("peerVid").src = window.HTMLMediaElement.srcObject(e.streams[0]);
};
@ -635,7 +635,7 @@ function setLocalMedia(streamConstraints, isCaller){ @@ -635,7 +635,7 @@ function setLocalMedia(streamConstraints, isCaller){
navigator.mediaDevices.getUserMedia(
streamConstraints
).then(function(myStream){
document.getElementById("myVid").src = window.URL.createObjectURL(myStream);
document.getElementById("myVid").src = window.HTMLMediaElement.srcObject(myStream);
myPC.addStream(myStream);//add my stream to RTCPeerConnection

21
js/config.js

@ -5,10 +5,21 @@ @@ -5,10 +5,21 @@
'use strict';
const appRoot = setAppRoot('video-call-app', 'video-call-app');
var app = getRootWebSitePath();
const appRoot = setAppRoot(app,app);
const spinnerClass = 'fa fa-spinner faa-spin animated';
function getRootWebSitePath()
{
var _location = document.location.toString();
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
var applicationName = _location.substring(0, applicationNameIndex) + '/';
var webFolderIndex = _location.indexOf('/', _location.indexOf(applicationName) + applicationName.length);
var webFolderFullPath = _location.substring(0, webFolderIndex);
return webFolderFullPath;
}
function setAppRoot(devFolderName, prodFolderName){
var hostname = window.location.hostname;
@ -17,16 +28,16 @@ function setAppRoot(devFolderName, prodFolderName){ @@ -17,16 +28,16 @@ function setAppRoot(devFolderName, prodFolderName){
* This will work for both http, https with or without www
* @type String
*/
//attach trailing slash to both foldernames
var devFolder = devFolderName ? devFolderName+"/" : "";
var prodFolder = prodFolderName ? prodFolderName+"/" : "";
if((hostname.search("localhost") !== -1) || (hostname.search("192.168.") !== -1) || (hostname.search("127.0.0.") !== -1)){
return window.location.origin+"/"+devFolder;
return devFolder;
}
else{
return window.location.origin+"/"+prodFolder;
return prodFolder + "/";
}
}
Loading…
Cancel
Save