Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2021-12-17 14:36:02 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b4e15f123bac613532caacc49eaefbe87d2d0ea
3b4e15f1
1 parent
475d4ae5
debugging of video refactoring
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
components/video.js
tests/qrdetector/arcsapp.json
components/video.js
View file @
3b4e15f
...
...
@@ -47,11 +47,11 @@ LiveSource = ARCS.Component.create(
let
shadow
=
document
.
body
;
if
(
_config
.
video
)
{
if
(
!
_config
.
video
)
{
video
.
style
.
display
=
"none"
;
shadow
.
appendChild
(
video
);
}
if
(
_config
.
canvas
)
{
if
(
!
_config
.
canvas
)
{
canvas
.
style
.
display
=
"none"
;
shadow
.
appendChild
(
canvas
);
}
...
...
@@ -65,6 +65,7 @@ LiveSource = ARCS.Component.create(
video
.
onloadedmetadata
=
e
=>
video
.
play
();
/*video.videoWidth=defaultWidth;
video.videoHeight=defaultHeight;*/
console
.
log
(
"video started"
);
self
.
emit
(
"onReady"
);
};
...
...
@@ -79,6 +80,7 @@ LiveSource = ARCS.Component.create(
* @emits onReady
*/
this
.
start
=
function
()
{
console
.
log
(
"call to start"
);
navigator
.
mediaDevices
.
getUserMedia
({
video
:
{
facingMode
:
_config
.
facingMode
,
width
:
defaultWidth
,
height
:
defaultHeight
}})
.
then
(
handleMediaStream
)
.
catch
(
errorMediaStream
);
...
...
@@ -129,8 +131,8 @@ VideoSource = ARCS.Component.create(
let
defaultWidth
=
_config
.
width
||
320
;
let
defaultHeight
=
_config
.
height
||
240
;
if
(
_config
.
video
)
video
=
document
.
querySelector
(
_config
.
video
);
if
(
_config
.
canvas
)
canvas
=
document
.
querySelector
(
_config
.
canvas
);
if
(
!
_config
.
video
)
video
=
document
.
querySelector
(
_config
.
video
);
if
(
!
_config
.
canvas
)
canvas
=
document
.
querySelector
(
_config
.
canvas
);
video
=
video
||
document
.
createElement
(
"video"
);
canvas
=
canvas
||
document
.
createElement
(
"canvas"
);
...
...
tests/qrdetector/arcsapp.json
View file @
3b4e15f
...
...
@@ -3,7 +3,7 @@
"libraries"
:
[
"../components/video.js"
,
"../components/animator.js"
,
"../components/qrcodedetector.js"
],
"components"
:
{
"animator"
:
{
"type"
:
"Animator"
},
"video"
:
{
"type"
:
"LiveSource"
},
"video"
:
{
"type"
:
"LiveSource"
,
"value"
:
{
"video"
:
"#video"
,
"facingMode"
:
"user"
}
},
"detector"
:
{
"type"
:
"QRCodeDetector"
},
"statemachine"
:
{
"type"
:
"StateMachine"
,
...
...
@@ -21,9 +21,7 @@
"controller"
:
"statemachine"
,
"sheets"
:
{
"init"
:
{
"preconnections"
:
[
{
"destination"
:
"video"
,
"slot"
:
"setWidgets"
,
"value"
:
[
"video"
]
}
],
"preconnections"
:
[],
"connections"
:
[
{
"source"
:
"video"
,
"signal"
:
"onReady"
,
"destination"
:
"statemachine"
,
"slot"
:
"next"
}
],
...
...
Please
register
or
login
to post a comment