Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Hubs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ar-noc
Hubs
Commits
a0545031
Commit
a0545031
authored
7 years ago
by
Greg Fodor
Browse files
Options
Downloads
Patches
Plain Diff
Stubbed out gear and daydream entry buttons
parent
b81291f2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/react-components/ui-root.js
+38
-11
38 additions, 11 deletions
src/react-components/ui-root.js
with
38 additions
and
11 deletions
src/react-components/ui-root.js
+
38
−
11
View file @
a0545031
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
VR_DEVICE_AVAILABILITY
}
from
"
../utils/vr-caps-detect.js
"
;
const
ENTRY_STEPS
=
{
const
ENTRY_STEPS
=
{
start
:
"
start
"
,
start
:
"
start
"
,
...
@@ -18,11 +19,7 @@ async function hasGrantedMicPermissions() {
...
@@ -18,11 +19,7 @@ async function hasGrantedMicPermissions() {
}
}
function
stopAllTracks
(
mediaStream
)
{
function
stopAllTracks
(
mediaStream
)
{
for
(
const
track
of
mediaStream
.
getAudioTracks
())
{
for
(
const
track
of
mediaStream
.
tracks
)
{
track
.
stop
();
}
for
(
const
track
of
mediaStream
.
getVideoTracks
())
{
track
.
stop
();
track
.
stop
();
}
}
}
}
...
@@ -60,6 +57,30 @@ async function getMediaStream(shareScreen, ...desiredMicRegexes) {
...
@@ -60,6 +57,30 @@ async function getMediaStream(shareScreen, ...desiredMicRegexes) {
return
mediaStream
;
return
mediaStream
;
}
}
const
TwoDEntryButton
=
(
props
)
=>
(
<
button
{...
props
}
>
Enter
on
this
Screen
<
/button
>
);
const
GenericEntryButton
=
(
props
)
=>
(
<
button
{...
props
}
>
Enter
in
VR
<
/button
>
);
const
GearVREntryButton
=
(
props
)
=>
(
<
button
{...
props
}
>
Enter
on
GearVR
<
/button
>
);
const
DaydreamEntryButton
=
(
props
)
=>
(
<
button
{...
props
}
>
Enter
on
Daydream
<
/button
>
);
class
UIRoot
extends
Component
{
class
UIRoot
extends
Component
{
static
propTypes
=
{
static
propTypes
=
{
enterScene
:
PropTypes
.
func
,
enterScene
:
PropTypes
.
func
,
...
@@ -94,6 +115,14 @@ class UIRoot extends Component {
...
@@ -94,6 +115,14 @@ class UIRoot extends Component {
await
this
.
performDirectEntryFlow
(
true
);
await
this
.
performDirectEntryFlow
(
true
);
}
}
enterGearVR
=
async
()
=>
{
console
.
log
(
"
gear
"
);
}
enterDaydream
=
async
()
=>
{
console
.
log
(
"
daydream
"
);
}
getMediaStreamAndEnterScene
=
async
(...
desiredMicRegexes
)
=>
{
getMediaStreamAndEnterScene
=
async
(...
desiredMicRegexes
)
=>
{
const
preStreamAcquisitionTime
=
new
Date
();
const
preStreamAcquisitionTime
=
new
Date
();
const
mediaStream
=
await
getMediaStream
(
this
.
state
.
shareScreen
,
...
desiredMicRegexes
);
const
mediaStream
=
await
getMediaStream
(
this
.
state
.
shareScreen
,
...
desiredMicRegexes
);
...
@@ -124,12 +153,10 @@ class UIRoot extends Component {
...
@@ -124,12 +153,10 @@ class UIRoot extends Component {
const
entryPanel
=
this
.
state
.
entryStep
===
ENTRY_STEPS
.
start
const
entryPanel
=
this
.
state
.
entryStep
===
ENTRY_STEPS
.
start
?
(
?
(
<
div
>
<
div
>
<
button
onClick
=
{
this
.
enter2D
}
>
<
TwoDEntryButton
onClick
=
{
this
.
enter2D
}
/
>
Enter
on
this
Screen
{
this
.
props
.
availableVREntryTypes
.
generic
!==
VR_DEVICE_AVAILABILITY
.
no
&&
<
GenericEntryButton
onClick
=
{
this
.
enterVR
}
/>
}
<
/button
>
{
this
.
props
.
availableVREntryTypes
.
gearvr
!==
VR_DEVICE_AVAILABILITY
.
no
&&
<
GearVREntryButton
onClick
=
{
this
.
enterGearVR
}
/>
}
<
button
onClick
=
{
this
.
enterVR
}
>
{
this
.
props
.
availableVREntryTypes
.
daydream
!==
VR_DEVICE_AVAILABILITY
.
no
&&
<
DaydreamEntryButton
onClick
=
{
this
.
enterDaydream
}
/>
}
Enter
in
VR
<
/button
>
<
/div
>
<
/div
>
)
:
null
;
)
:
null
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment