Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-029
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-029
2023-029
Commits
db63f5e8
Commit
db63f5e8
authored
May 14, 2023
by
supundileepa00
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : added video recording component
parent
ca4046fa
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1083 additions
and
48 deletions
+1083
-48
Project/Frontend/Web_App/package-lock.json
Project/Frontend/Web_App/package-lock.json
+708
-0
Project/Frontend/Web_App/package.json
Project/Frontend/Web_App/package.json
+2
-0
Project/Frontend/Web_App/src/pages/translate-page.tsx
Project/Frontend/Web_App/src/pages/translate-page.tsx
+137
-45
Project/Frontend/Web_App/yarn.lock
Project/Frontend/Web_App/yarn.lock
+236
-3
No files found.
Project/Frontend/Web_App/package-lock.json
View file @
db63f5e8
This diff is collapsed.
Click to expand it.
Project/Frontend/Web_App/package.json
View file @
db63f5e8
...
...
@@ -68,10 +68,12 @@
"react-lazy-load-image-component"
:
"^1.5.5"
,
"react-map-gl"
:
"^7.0.19"
,
"react-markdown"
:
"^8.0.3"
,
"react-media-recorder"
:
"^1.6.6"
,
"react-organizational-chart"
:
"^2.2.0"
,
"react-quill"
:
"^2.0.0"
,
"react-redux"
:
"^8.0.4"
,
"react-slick"
:
"^0.29.0"
,
"react-webcam"
:
"^7.0.1"
,
"redux"
:
"^4.2.0"
,
"redux-persist"
:
"^6.0.0"
,
"rehype-raw"
:
"^6.1.1"
,
...
...
Project/Frontend/Web_App/src/pages/translate-page.tsx
View file @
db63f5e8
...
...
@@ -10,6 +10,12 @@ import {
CardHeader
,
Divider
,
Grid
,
TextField
,
IconButton
,
Typography
,
InputAdornment
,
Stack
,
Tooltip
,
}
from
'
@mui/material
'
;
// layouts
import
MainLayout
from
'
../layouts/main
'
;
...
...
@@ -22,9 +28,14 @@ import {
AboutTestimonials
,
}
from
'
../sections/slToText
'
;
import
{
Upload
}
from
'
src/components/upload
'
;
import
{
useCallback
,
useState
}
from
'
react
'
;
import
{
useCallback
,
use
Ref
,
use
State
}
from
'
react
'
;
import
UploadIcon
from
'
@mui/icons-material/Upload
'
;
import
EmergencyRecordingIcon
from
'
@mui/icons-material/EmergencyRecording
'
;
import
{
useSnackbar
}
from
'
notistack
'
;
import
useCopyToClipboard
from
'
src/hooks/useCopyToClipboard
'
;
import
Iconify
from
'
src/components/iconify/Iconify
'
;
import
{
useReactMediaRecorder
}
from
'
react-media-recorder
'
;
import
dynamic
from
'
next/dynamic
'
;
// ----------------------------------------------------------------------
...
...
@@ -34,6 +45,7 @@ AboutPage.getLayout = (page: React.ReactElement) => <MainLayout>{page}</MainLayo
export
default
function
AboutPage
()
{
const
[
file
,
setFile
]
=
useState
<
File
|
string
|
null
>
(
null
);
const
[
isUploadFile
,
setIsUploadFile
]
=
useState
<
boolean
|
string
|
null
>
(
true
);
const
handleDropSingleFile
=
useCallback
((
acceptedFiles
:
File
[])
=>
{
const
file
=
acceptedFiles
[
0
];
...
...
@@ -45,32 +57,72 @@ export default function AboutPage() {
);
}
},
[]);
const
checkTranalationTypeForUpload
=
()
=>
{
if
(
isUploadFile
)
{
return
'
contained
'
;
}
else
{
return
'
outlined
'
;
}
};
const
checkTranalationTypeForRecord
=
()
=>
{
if
(
!
isUploadFile
)
{
return
'
contained
'
;
}
else
{
return
'
outlined
'
;
}
};
const
{
enqueueSnackbar
}
=
useSnackbar
();
const
{
copy
}
=
useCopyToClipboard
();
const
[
value
,
setValue
]
=
useState
(
'
ආආආආආආආආආආආආආආආආ
'
);
const
onCopy
=
(
text
:
string
)
=>
{
if
(
text
)
{
enqueueSnackbar
(
'
Copied!
'
);
copy
(
text
);
}
};
const
handleChange
=
(
event
:
React
.
ChangeEvent
<
HTMLTextAreaElement
>
)
=>
{
setValue
(
event
.
target
.
value
);
};
return
(
<>
<
Head
>
<
title
>
Translate SSL to Text
</
title
>
</
Head
>
<
Box
sx=
{
{
flexGrow
:
1
}
}
>
<
ButtonGroup
disableElevation
variant=
"contained"
aria
-
label=
"Disabled elevation buttons"
>
<
Button
variant=
"outlined"
startIcon=
{
<
UploadIcon
/>
}
>
<
Button
variant=
{
checkTranalationTypeForUpload
()
}
startIcon=
{
<
UploadIcon
/>
}
onClick=
{
()
=>
{
setIsUploadFile
(
true
);
}
}
>
Upload
</
Button
>
<
Button
variant=
"contained"
endIcon=
{
<
EmergencyRecordingIcon
/>
}
>
Send
<
Button
variant=
{
checkTranalationTypeForRecord
()
}
endIcon=
{
<
EmergencyRecordingIcon
/>
}
onClick=
{
()
=>
{
setIsUploadFile
(
false
);
}
}
>
Record
</
Button
>
</
ButtonGroup
>
{
isUploadFile
?
(
<
Box
sx=
{
{
flexGrow
:
1
}
}
>
<
Card
>
<
Grid
container
spacing=
{
2
}
sx=
{
{
mt
:
'
3%
'
,
px
:
'
1%
'
,
}
}
>
<
CardHeader
title=
"Upload a video containing Sign Language"
/>
<
Grid
container
spacing=
{
2
}
>
<
Grid
item
xs=
{
12
}
md=
{
6
}
>
<
Card
>
<
CardHeader
title=
"Upload a video containing Sign Language"
/>
<
CardContent
>
<
Upload
file=
{
file
}
...
...
@@ -81,20 +133,60 @@ export default function AboutPage() {
</
Card
>
</
Grid
>
<
Grid
item
xs=
{
12
}
md=
{
6
}
>
<
Card
>
<
CardHeader
title=
"Upload a video containing Sign Language"
/>
<
CardContent
>
<
Upload
file=
{
file
}
onDrop=
{
handleDropSingleFile
}
onDelete=
{
()
=>
setFile
(
null
)
}
<
Card
sx=
{
{
p
:
5
}
}
>
<
Box
display=
"grid"
gridTemplateColumns=
{
{
xs
:
'
repeat(1, 1fr)
'
,
md
:
'
repeat(2, 1fr)
'
}
}
gap=
{
5
}
>
<
Stack
spacing=
{
2
}
>
<
Typography
variant=
"overline"
sx=
{
{
color
:
'
text.secondary
'
}
}
>
on Change
</
Typography
>
<
TextField
fullWidth
value=
{
value
}
onChange=
{
handleChange
}
InputProps=
{
{
endAdornment
:
(
<
InputAdornment
position=
"end"
>
<
Tooltip
title=
"Copy"
>
<
IconButton
onClick=
{
()
=>
onCopy
(
value
)
}
>
<
Iconify
icon=
"eva:copy-fill"
width=
{
24
}
/>
</
IconButton
>
</
Tooltip
>
</
InputAdornment
>
),
}
}
/>
</
CardContent
>
</
Stack
>
</
Box
>
</
Card
>
</
Grid
>
</
Grid
>
</
Card
>
</
Box
>
)
:
(
// Video Capture
// <RecordView />
<
div
>
sdsd
</
div
>
)
}
</>
);
}
const
RecordView
=
()
=>
{
const
{
status
,
startRecording
,
stopRecording
,
mediaBlobUrl
}
=
useReactMediaRecorder
({
video
:
true
,
});
return
(
<
div
>
<
p
>
{
status
}
</
p
>
<
button
onClick=
{
startRecording
}
>
Start Recording
</
button
>
<
button
onClick=
{
stopRecording
}
>
Stop Recording
</
button
>
<
video
src=
{
mediaBlobUrl
}
controls
autoPlay
loop
/>
</
div
>
);
};
Project/Frontend/Web_App/yarn.lock
View file @
db63f5e8
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment