Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
ESDP_froot.kz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ESDP_froot.kz
ESDP_froot.kz
Commits
93bfa0ca
Commit
93bfa0ca
authored
May 19, 2021
by
Pavel Mishakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
пытаюсь понять почему на сервере не работает getDisplayMedia, плюс некоторые мелкие ошибки исправил
parent
a44401a0
Pipeline
#337
passed with stages
in 2 minutes and 14 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
18 deletions
+40
-18
bigBrother.js
api/app/bigBrother.js
+23
-5
.gitignore
api/public/uploads/.gitignore
+2
-1
.gitignore
api/public/uploads/contentLinks/.gitignore
+2
-0
BigBrother.js
front/src/components/BigBrother/BigBrother.js
+13
-12
No files found.
api/app/bigBrother.js
View file @
93bfa0ca
const
helpers
=
require
(
'./helpers'
);
const
express
=
require
(
'express'
);
const
router
=
express
.
Router
();
const
auth
=
require
(
'./middleware/auth.js'
);
const
upload
=
require
(
'./middleware/upload.js'
);
const
permit
=
require
(
'./middleware/permit.js'
);
const
axios
=
require
(
'axios'
);
const
moment
=
require
(
'moment'
)
const
BigBrother
=
require
(
'./models/BigBrother'
);
const
config
=
require
(
'./config'
);
const
multer
=
require
(
'multer'
)
const
{
nanoid
}
=
require
(
'nanoid'
)
const
storage
=
multer
.
diskStorage
({
destination
:
(
req
,
file
,
cb
)
=>
{
// try {
// fs.opendir("./" + moment().format("DD_MM_YYYY"), (err) => {
// console.log("directory exists")
// })
// } catch {
// console.log(req.body)
// fs.mkdir("./public/" + moment().format("DD_MM_YYYY"), { recursive: true }, (err) => {
// if (err) throw err;
// });
// }
cb
(
null
,
config
.
uploadPath
+
"/contentLinks"
);
},
filename
:(
req
,
file
,
cb
)
=>
{
cb
(
null
,
nanoid
()
+
(
file
.
originalname
!==
"blob"
?
path
.
extname
(
file
.
originalname
)
:
".jpg"
));
}
});
const
upload
=
multer
({
storage
});
router
.
get
(
'/'
,
async
(
req
,
res
)
=>
{
...
...
api/public/uploads/.gitignore
View file @
93bfa0ca
*
!.gitignore
!invoice.jpg
!/contentLinks
\ No newline at end of file
api/public/uploads/contentLinks/.gitignore
0 → 100644
View file @
93bfa0ca
*
!.gitignore
front/src/components/BigBrother/BigBrother.js
View file @
93bfa0ca
...
...
@@ -40,19 +40,19 @@ const BigBrother = () => {
}
function
getUserMedia
(
options
)
{
if
(
navigator
.
mediaDevices
&&
navigator
.
mediaDevices
.
getUserMedia
)
{
//
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
return
navigator
.
mediaDevices
.
getUserMedia
(
options
)
}
if
(
navigator
.
getUserMedia
)
{
return
navigator
.
getUserMedia
(
options
)
}
if
(
navigator
.
webkitGetUserMedia
)
{
return
navigator
.
webkitGetUserMedia
(
options
)
}
if
(
navigator
.
mozGetUserMedia
)
{
return
navigator
.
mozGetUserMedia
(
options
)
}
throw
new
Error
(
'getUserMedia is not defined'
)
//
}
//
if (navigator.getUserMedia) {
//
return navigator.getUserMedia(options)
//
}
//
if (navigator.webkitGetUserMedia) {
//
return navigator.webkitGetUserMedia(options)
//
}
//
if (navigator.mozGetUserMedia) {
//
return navigator.mozGetUserMedia(options)
//
}
//
throw new Error('getUserMedia is not defined')
}
async
function
takeScreenshotStream
()
{
...
...
@@ -92,6 +92,7 @@ const BigBrother = () => {
})
}
catch
(
ex
)
{
errors
.
push
(
ex
)
setLoader
(
false
)
}
}
...
...
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