Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cvh-camera
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Simon Döring
cvh-camera
Commits
b732dd1b
Commit
b732dd1b
authored
4 years ago
by
Simon Döring
Browse files
Options
Downloads
Patches
Plain Diff
Add pin parsing from URL for sender (patch from pgerwinski)
parent
e65692a0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sender/camera-sender.html
+25
-17
25 additions, 17 deletions
sender/camera-sender.html
sender/camera-sender.js
+14
-4
14 additions, 4 deletions
sender/camera-sender.js
with
39 additions
and
21 deletions
sender/camera-sender.html
+
25
−
17
View file @
b732dd1b
...
@@ -12,23 +12,31 @@
...
@@ -12,23 +12,31 @@
<div>
<div>
Leave the pin empty if the rooms has none set.
Leave the pin empty if the rooms has none set.
</div>
</div>
<p>
<select
id=
"res-select"
>
<select
id=
"res-select"
>
<option
value=
"lowres"
>
320x240
</option>
<option
value=
"lowres"
>
320x240
</option>
<option
value=
"lowres-16:9"
>
320x180
</option>
<option
value=
"lowres-16:9"
>
320x180
</option>
<option
value=
"stdres"
>
640x480
</option>
<option
value=
"stdres"
selected
>
640x480
</option>
<option
value=
"stdres-16:9"
>
640x360
</option>
<option
value=
"stdres-16:9"
>
640x360
</option>
<option
value=
"hires-4:3"
>
960x720
</option>
<option
value=
"hires-4:3"
>
960x720
</option>
<option
value=
"hires-16:9"
>
1280x720
</option>
<option
value=
"hires-16:9"
>
1280x720
</option>
</select>
</select>
<!--
<input type="password" id="pin-input" placeholder="Room pin" />
<input type="password" id="pin-input" placeholder="Room pin" />
-->
<button
id=
"start"
disabled
>
Start
</button>
<button
id=
"start"
disabled
>
Start
</button>
<button
id=
"stop"
disabled
>
Stop
</button>
<button
id=
"stop"
disabled
>
Stop
</button>
</p>
<p>
<form
id=
"bandwidth-form"
>
<form
id=
"bandwidth-form"
>
<label>
A
bandwidth cap can be set here. 0 or negative means no cap.
</label>
<label>
While the camera is running, a
bandwidth cap can be set here. 0 or negative means no cap.
</label>
<br
/>
<br
/>
<input
type=
"text"
id=
"bandwidth-input"
placeholder=
"New bitrate [in kbit/s]"
/>
<input
type=
"text"
id=
"bandwidth-input"
placeholder=
"New bitrate [in kbit/s]"
/>
<input
type=
"submit"
id=
"bandwidth-submit"
value=
"Change"
disabled
/>
<input
type=
"submit"
id=
"bandwidth-submit"
value=
"Change"
disabled
/>
</form>
</form>
</p>
<div
id=
"preview-container"
></div>
<div
id=
"preview-container"
></div>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
sender/camera-sender.js
+
14
−
4
View file @
b732dd1b
...
@@ -14,13 +14,15 @@ document.addEventListener('DOMContentLoaded', function() {
...
@@ -14,13 +14,15 @@ document.addEventListener('DOMContentLoaded', function() {
var
room
=
1006
;
var
room
=
1006
;
var
slot
=
0
;
var
slot
=
0
;
var
token
=
''
;
var
token
=
''
;
var
pin
=
''
;
var
feedId
=
null
;
var
feedId
=
null
;
parseRoomFromURL
();
parseRoomFromURL
();
parseSlotFromURL
();
parseSlotFromURL
();
parsePinFromURL
();
parseTokenFromURL
();
parseTokenFromURL
();
roomIndicator
.
innerText
=
`
VNC
${
room
-
1000
}
(Room
${
room
}
) - Slot
${
slot
}
- Token:
${
token
||
'
*none*
'
}
`
;
roomIndicator
.
innerText
=
`
Channel
${
room
-
1000
}
, Camera
${
slot
+
1
}
`
;
const
socketNumber
=
room
+
4000
;
const
socketNumber
=
room
+
4000
;
const
socket
=
io
(
'
https://
'
+
window
.
location
.
hostname
,
{
const
socket
=
io
(
'
https://
'
+
window
.
location
.
hostname
,
{
...
@@ -100,13 +102,11 @@ document.addEventListener('DOMContentLoaded', function() {
...
@@ -100,13 +102,11 @@ document.addEventListener('DOMContentLoaded', function() {
startButton
.
onclick
=
function
()
{
startButton
.
onclick
=
function
()
{
var
resSelect
=
document
.
getElementById
(
'
res-select
'
);
var
resSelect
=
document
.
getElementById
(
'
res-select
'
);
var
pinInput
=
document
.
getElementById
(
'
pin-input
'
);
startButton
.
setAttribute
(
'
disabled
'
,
''
);
startButton
.
setAttribute
(
'
disabled
'
,
''
);
resSelect
.
setAttribute
(
'
disabled
'
,
''
);
resSelect
.
setAttribute
(
'
disabled
'
,
''
);
sendResolution
=
resSelect
.
value
;
sendResolution
=
resSelect
.
value
;
Janus
.
log
(
'
sendResolution:
'
,
sendResolution
);
Janus
.
log
(
'
sendResolution:
'
,
sendResolution
);
shareCamera
(
pinInput
.
value
);
shareCamera
(
pin
);
pinInput
.
value
=
''
;
};
};
startButton
.
removeAttribute
(
'
disabled
'
);
startButton
.
removeAttribute
(
'
disabled
'
);
},
},
...
@@ -247,6 +247,16 @@ document.addEventListener('DOMContentLoaded', function() {
...
@@ -247,6 +247,16 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
}
}
function
parsePinFromURL
()
{
var
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
var
pinParam
=
urlParams
.
get
(
'
pin
'
);
if
(
pinParam
!=
null
)
{
pin
=
pinParam
;
}
else
{
console
.
log
(
'
Got no valid pin in URL search params
'
);
}
}
function
parseTokenFromURL
()
{
function
parseTokenFromURL
()
{
var
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
var
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
var
tokenParam
=
urlParams
.
get
(
'
token
'
);
var
tokenParam
=
urlParams
.
get
(
'
token
'
);
...
...
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