Skip to content

Commit

Permalink
chore: merge 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hvini committed Jun 6, 2024
2 parents eb379a5 + 848302d commit 01c74cc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 39 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_EYE_TRACKER_FRONT }}'
channelId: live
projectId: web-eye-tracker-front
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
# name: Deploy to Firebase Hosting on merge
# 'on':
# push:
# branches:
# - main
# jobs:
# build_and_deploy:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: npm ci && npm run build
# - uses: FirebaseExtended/action-hosting-deploy@v0
# with:
# repoToken: '${{ secrets.GITHUB_TOKEN }}'
# firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_EYE_TRACKER_FRONT }}'
# channelId: live
# projectId: web-eye-tracker-front
# env:
# FIREBASE_CLI_PREVIEWS: hostingchannels
30 changes: 15 additions & 15 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_EYE_TRACKER_FRONT }}'
projectId: web-eye-tracker-front
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
# name: Deploy to Firebase Hosting on PR
# 'on': pull_request
# jobs:
# build_and_preview:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - run: npm ci && npm run build
# - uses: FirebaseExtended/action-hosting-deploy@v0
# with:
# repoToken: '${{ secrets.GITHUB_TOKEN }}'
# firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_EYE_TRACKER_FRONT }}'
# projectId: web-eye-tracker-front
# env:
# FIREBASE_CLI_PREVIEWS: hostingchannels
17 changes: 12 additions & 5 deletions src/views/DoubleCalibrationRecord.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,22 @@
</template>

<script>
export default {
data() {
return {
// camera
webcamfile: null,
recordWebCam: null,
configWebCam: {
audio: false,
video: {
width: 1536,
height: 864,
video: {
width: document.getElementById("video-tag").videoWidth,
height: document.getElementById("video-tag").videoHeight,
},
},
// cablibration
circleIrisPoints: [],
calibPredictionPoints: [],
Expand Down Expand Up @@ -308,13 +310,15 @@ export default {
// canvas related
async startWebCamCapture() {
// Request permission for screen capture
return navigator.mediaDevices
.getUserMedia(this.configWebCam)
.then(async (mediaStreamObj) => {
// Create media recorder object
this.recordWebCam = new MediaRecorder(mediaStreamObj, {
mimeType: "video/webm;",
});
let recordingWebCam = [];
let video = document.getElementById("video-tag");
video.srcObject = mediaStreamObj;
Expand All @@ -325,6 +329,7 @@ export default {
};
// OnStop WebCam Record
const th = this;
this.recordWebCam.onstop = () => {
// Generate blob from the frames
let blob = new Blob(recordingWebCam, { type: "video/webm" });
Expand All @@ -344,18 +349,20 @@ export default {
})
.catch((e) => {
console.error("Error", e);
this.stopRecord();
});
},
async detectFace() {
const lastPrediction = await this.model.estimateFaces({
input: document.getElementById("video-tag"),
});
return lastPrediction
},
stopRecord() {
this.recordWebCam.state != "inactive" ? this.stopWebCamCapture() : null;
},
async stopWebCamCapture() {
await this.recordWebCam.stop();
this.calibFinished = true;
Expand Down

0 comments on commit 01c74cc

Please sign in to comment.