Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Maintenance on Tuesday 15.4. at 14:00. ETA 60 - 90 minutes.
Show more breadcrumbs
Nicolas Pope
ftl
Commits
5d13cc32
Commit
5d13cc32
authored
5 years ago
by
Sami Spets
Browse files
Options
Downloads
Patches
Plain Diff
minor tweaks to thumbnail
parent
b11d52df
No related branches found
No related tags found
No related merge requests found
Pipeline
#14712
passed
5 years ago
Stage: all
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
web-service/client/src/Streams.js
+6
-1
6 additions, 1 deletion
web-service/client/src/Streams.js
web-service/client/src/Thumbnail.js
+5
-12
5 additions, 12 deletions
web-service/client/src/Thumbnail.js
web-service/client/src/seeds.js
+0
-21
0 additions, 21 deletions
web-service/client/src/seeds.js
with
11 additions
and
34 deletions
web-service/client/src/Streams.js
+
6
−
1
View file @
5d13cc32
...
...
@@ -22,6 +22,10 @@ const Streams = ({clearCookies}) => {
* setInterval() fetch every 1 second
*/
const
renderThumbnails
=
()
=>
{
const
returnVal
=
thumbnails
.
map
(
i
=>
<
Thumbnail
thumbnail
=
{
i
}
/>
)
return
returnVal
}
return
(
...
...
@@ -30,7 +34,8 @@ const Streams = ({clearCookies}) => {
<
h2
>
Namibia
here
we
come
!<
/h2
>
<
button
onClick
=
{
clearCookies
}
>
Logout
<
/button
>
<
br
/>
<
Thumbnail
thumbnail
=
{
thumbnails
[
0
]}
/
>
{
console
.
log
(
"
THUMBNAILIT ON
"
,
thumbnails
)}
{
renderThumbnails
()}
<
/div
>
)
}
...
...
This diff is collapsed.
Click to expand it.
web-service/client/src/Thumbnail.js
+
5
−
12
View file @
5d13cc32
...
...
@@ -10,19 +10,11 @@ class Thumbnail extends Component {
this
.
renderThumbnails
()
}
fetchThumbnails
=
async
()
=>
{
const
jsonThumbnails
=
await
fetch
(
'
http://localhost:8080/streams/
'
)
const
realThumbnails
=
await
jsonThumbnails
.
json
();
console
.
log
(
'
REAL THUMBNAILS
'
,
realThumbnails
)
return
realThumbnails
;
}
renderThumbnails
=
async
()
=>
{
let
returnVal
=
"
err
"
;
console
.
log
(
this
.
props
)
const
thumbs
=
await
this
.
fetchThumbnails
()
console
.
log
(
'
PROPS
'
,
this
.
props
)
const
thumbs
=
this
.
props
.
thumbnail
console
.
log
(
thumbs
);
const
encodedURI
=
encodeURIComponent
(
thumbs
[
0
]
)
const
encodedURI
=
encodeURIComponent
(
thumbs
)
console
.
log
(
'
ENCODED
'
,
encodedURI
)
try
{
const
someData
=
await
fetch
(
`http://localhost:8080/stream/rgb?uri=
${
encodedURI
}
`
)
...
...
@@ -37,6 +29,7 @@ class Thumbnail extends Component {
this
.
setState
({
imgSrc
:
objectURL
});
}
catch
(
err
){
console
.
log
(
'
Kurwavaara:
'
,
err
);
this
.
setState
({
imgSrc
:
'
Error while loading the picture
'
})
}
}
render
(){
...
...
@@ -45,7 +38,7 @@ class Thumbnail extends Component {
<
div
>
{
console
.
log
(
'
SRC
'
,
this
.
state
.
imgSrc
)}
<
img
src
=
{
val
}
width
=
'
500px
'
><
/img
>
<
button
onClick
=
{()
=>
this
.
renderThumbnails
()}
>
<
/button
>
<
button
onClick
=
{()
=>
{
this
.
renderThumbnails
()}
}
>
Refresh
<
/button
>
<
/div
>
)
}
...
...
This diff is collapsed.
Click to expand it.
web-service/client/src/seeds.js
deleted
100644 → 0
+
0
−
21
View file @
b11d52df
const
testData
=
{
thumbnail
:
[
{
name
:
'
source1
'
,
video
:
'
https://images.unsplash.com/photo-1558981285-6f0c94958bb6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80
'
,
viewers
:
9
},
{
name
:
'
source2
'
,
video
:
'
https://images.unsplash.com/photo-1558981420-c532902e58b4?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1477&q=80
'
,
viewers
:
9
},
{
name
:
'
source3
'
,
video
:
'
https://images.unsplash.com/photo-1558981285-6f0c94958bb6?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80
'
,
viewers
:
9
}
]
}
export
default
testData
;
\ No newline at end of file
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