-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
9,646 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/dist | ||
/node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="./css/app.css"> | ||
</head> | ||
<body onload="openNav()"> | ||
<div id="containerDiv" class="container"> | ||
<div id="navPanel" class="nav"> | ||
<div class="menuBtn"> | ||
<span id="closeNavBtn" class="closebtn" onclick="toggleNav()"></span> | ||
</div> | ||
<div class="menuList"> | ||
<!-- <span id="pnt" onclick="loadJS(this.id)">PNT</span> --> | ||
<form action="hideNav()"> | ||
<label for="subjID">Participant</label> | ||
<input type="text" id="subjID" name="subjid" placeholder="0"> | ||
|
||
<label for="sessID">Session</label> | ||
<input type="text" id="sessID" name="sessid" placeholder="0"> | ||
|
||
<label for="assessmentID">Assessment</label> | ||
<select id="assessmentID" name="assessmentType"> | ||
<option value=""></option> | ||
<option value="brokenWindow">Broken Window</option> | ||
<option value="picnicScene">Picnic Scene</option> | ||
<option value="pbj">Making a PBJ</option> | ||
<option value="cinderellaStory">Cinderella Story</option> | ||
</select> | ||
|
||
<button type="button" onclick="getStarted()">Start</button> | ||
<!-- <input type="submit" value="Start"> --> | ||
</form> | ||
</div> | ||
</div> | ||
<div id="contentDiv" class="content"> | ||
<!-- <img id="imageElement" src="./icons/icon-blue.png" alt="" /> --> | ||
<!-- experiments/pnt/assets/pics/ambulance.png --> | ||
<!-- <video id="videoElement" autoplay> | ||
<source src="./experiments/phon/assets/video/airplane264.mp4" type="video/mp4"> | ||
Video loading failed :( | ||
</video> --> | ||
</div> | ||
</div> | ||
<script type="text/javascript" src="./js/lowLag.js"></script> | ||
<script type="text/javascript" src="./core.js"></script> | ||
<!-- <script type="text/javascript" src="./pnt.js"></script> --> | ||
<script type="text/javascript" src="./menu.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
const electron = require('electron') | ||
const Menu = electron.Menu | ||
const app = electron.app | ||
const BrowserWindow = electron.BrowserWindow | ||
const path = require('path') | ||
const url = require('url') | ||
const dialog = electron.dialog //for OS specific dialog windows | ||
const si = require('systeminformation') | ||
const ff = require('./camera/ffmpeg') | ||
const appRootDir = require('app-root-dir').get() //get the path of the application bundle | ||
const ffmpeg = appRootDir+'/ffmpeg/ffmpeg' | ||
const exec = require( 'child_process' ).exec | ||
|
||
// Keep a global reference of the window object, if you don't, the window will | ||
// be closed automatically when the JavaScript object is garbage collected. | ||
let mainWindow | ||
|
||
function createWindow () { | ||
// Create the browser window. | ||
mainWindow = new BrowserWindow({width: 800, height: 600}) | ||
|
||
// and load the index.html of the app. | ||
mainWindow.loadURL(url.format({ | ||
pathname: path.join(__dirname, 'app.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
})) | ||
|
||
// Open the DevTools. | ||
//mainWindow.webContents.openDevTools() | ||
|
||
// Emitted when the window is closed. | ||
mainWindow.on('closed', function () { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
mainWindow = null | ||
}) | ||
} | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', createWindow) | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', function () { | ||
// On OS X it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit() | ||
} | ||
exec('killall ffmpeg') | ||
}) | ||
|
||
app.on('activate', function () { | ||
// On OS X it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (mainWindow === null) { | ||
createWindow() | ||
} | ||
}) | ||
|
||
// In this file you can include the rest of your app's specific main process | ||
// code. You can also put them in separate files and require them here. |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
html, body, video { | ||
height: 100%; | ||
width: 100%; | ||
margin: 0; | ||
} | ||
|
||
video { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Camera Test</title> | ||
<link rel="stylesheet" href="camera.css"> | ||
<script src="cameraPrevOff.js"></script> | ||
</head> | ||
<body> | ||
<video id="camera" autoplay> </video> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Create a new window | ||
navigator.webkitGetUserMedia({video: false}, | ||
function(stream) { | ||
document.getElementById('camera').src = URL.createObjectURL(stream); | ||
}, | ||
function() { | ||
alert('could not connect stream'); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Camera Test</title> | ||
<link rel="stylesheet" href="camera.css"> | ||
<script src="cameraPrevOn.js"></script> | ||
</head> | ||
<body> | ||
<video id="camera" autoplay> </video> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Create a new window | ||
navigator.webkitGetUserMedia({video: true}, | ||
function(stream) { | ||
document.getElementById('camera').src = URL.createObjectURL(stream); | ||
}, | ||
function() { | ||
alert('could not connect stream'); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//ffmpeg idea from SO: | ||
//http://stackoverflow.com/questions/33152533/bundling-precompiled-binary-into-electron-app | ||
const exec = require( 'child_process' ).exec | ||
//var appRootDir = require('app-root-dir').get() //get the path of the application bundle | ||
//var ffmpegpath=appRootDir+'/node_modules/ffmpeg/ffmpeg'; | ||
//var vidname = appRootDir+'/out.mov'; | ||
//var ffmpegArgs = ' -y -thread_queue_size 50 -f avfoundation -framerate 30.00 -i "1" -thread_queue_size 50 -f avfoundation -framerate 30.00 -video_size 1280x720 -i "0":"0" -c:v libx264 -crf 30 -preset ultrafast -filter_complex "[0]scale=iw/8:ih/8 [pip]; [1][pip] overlay=main_w-overlay_w-10:main_h-overlay_h-10" -r 30.00 ' + appRootDir + '/out.m4v' | ||
|
||
var startRec = function(ffmpegpath, ffmpegArgs) { | ||
console.log(ffmpegpath+ffmpegArgs) | ||
const ffmpeg = exec( ffmpegpath+ffmpegArgs); //add whatever switches you need here | ||
ffmpeg.stdout.on( 'data', data => { | ||
console.log( `stdout: ${data}` ); | ||
}); | ||
ffmpeg.stderr.on( 'data', data => { | ||
console.log( `stderr: ${data}` ); | ||
}); | ||
} | ||
|
||
var stopRec = function(){ | ||
exec('killall ffmpeg') | ||
} | ||
|
||
|
||
module.exports = { | ||
startRec: startRec, | ||
stopRec: stopRec, | ||
} |
Oops, something went wrong.