Skip to content

Commit

Permalink
saving all current assets
Browse files Browse the repository at this point in the history
  • Loading branch information
hanayik committed Feb 15, 2017
1 parent ccb435b commit 49a7d82
Show file tree
Hide file tree
Showing 49 changed files with 9,646 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/dist
/node_modules

48 changes: 48 additions & 0 deletions app.html
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>
65 changes: 65 additions & 0 deletions app.js
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 added assets/beep.wav
Binary file not shown.
Binary file added assets/brokenWindow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_10.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_11.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_12.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_13_page_14.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_15.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_16.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_17.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_18.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_19.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_1_page_2.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_20.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_21.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_22.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_23.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_3.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_4.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_5.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_6.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_7_page_8.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cinderellaImgs/page_9.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pbj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/picnic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions camera/camera.css
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;
}
11 changes: 11 additions & 0 deletions camera/cameraPrevOff.html
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>
9 changes: 9 additions & 0 deletions camera/cameraPrevOff.js
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');
}
);
11 changes: 11 additions & 0 deletions camera/cameraPrevOn.html
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>
9 changes: 9 additions & 0 deletions camera/cameraPrevOn.js
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');
}
);
28 changes: 28 additions & 0 deletions camera/ffmpeg.js
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,
}
Loading

0 comments on commit 49a7d82

Please sign in to comment.