diff --git a/activities/Record.activity/index.html b/activities/Record.activity/index.html index b263b5647..cd34ad02d 100644 --- a/activities/Record.activity/index.html +++ b/activities/Record.activity/index.html @@ -31,22 +31,9 @@
- - - - - - +
+ +

@@ -55,7 +42,6 @@
- diff --git a/activities/Record.activity/js/activity.js b/activities/Record.activity/js/activity.js index 85a0c271c..9166f7c58 100644 --- a/activities/Record.activity/js/activity.js +++ b/activities/Record.activity/js/activity.js @@ -35,16 +35,33 @@ define(["sugar-web/activity/activity","sugar-web/presence","activity/capture-hel var photoButton = document.getElementById("photo-button"); var audioButton = document.getElementById("audio-button"); var videoButton = document.getElementById("video-button"); + var vidDisplay = document.getElementById("vidDisplay"); + + function handleVideo(stream){ + document.querySelector('#vidDisplay').srcObject = stream; + } + function videoError(e){ + alert("There was some error"); + } photoButton.addEventListener("click", function () { captureHelper.helper.takePicture(); + if(vidDisplay.style.display == "none"){ + vidDisplay.style.display = "block" ; + } }); audioButton.addEventListener("click", function () { + if(vidDisplay.style.display != "none"){ + vidDisplay.style.display = "none" ; + } captureHelper.helper.recordAudio(); }); videoButton.addEventListener("click", function () { + if(vidDisplay.style.display == "none"){ + vidDisplay.style.display = "block" ; + } captureHelper.helper.recordVideo(); }); diff --git a/activities/Record.activity/js/capture-helper.js b/activities/Record.activity/js/capture-helper.js index b1e5dadd6..042985067 100644 --- a/activities/Record.activity/js/capture-helper.js +++ b/activities/Record.activity/js/capture-helper.js @@ -498,7 +498,7 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor quality: 0 }); - + document.querySelector('#vidDisplay').srcObject = mediaStream; recordRTC.startRecording(); var maxTime = 5; t.currentRecording.time = 0; @@ -561,6 +561,7 @@ define(["activity/recordrtc", "sugar-web/activity/activity", "sugar-web/datastor navigator.getUserMedia({video: true}, function (mediaStream) { var recordRTC = RecordRTC(mediaStream, {type: 'video'}); recordRTC.startRecording(); + document.querySelector('#vidDisplay').srcObject = mediaStream; setTimeout(function () { t.timerStart.innerHTML = ""; t.timerEnd.innerHTML = ""; diff --git a/package.json b/package.json old mode 100644 new mode 100755