Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gab
social
gab-social
Commits
449dd24b
Commit
449dd24b
authored
Aug 23, 2019
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Video component added aspect ratio for sizing
parent
9b1f1348
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
app/javascript/gabsocial/components/status.js
app/javascript/gabsocial/components/status.js
+1
-0
app/javascript/gabsocial/features/report/components/status_check_box.js
.../gabsocial/features/report/components/status_check_box.js
+1
-0
app/javascript/gabsocial/features/status/components/detailed_status.js
...t/gabsocial/features/status/components/detailed_status.js
+1
-0
app/javascript/gabsocial/features/video/index.js
app/javascript/gabsocial/features/video/index.js
+13
-3
No files found.
app/javascript/gabsocial/components/status.js
View file @
449dd24b
...
...
@@ -344,6 +344,7 @@ class Status extends ImmutablePureComponent {
blurhash
=
{
video
.
get
(
'
blurhash
'
)}
src
=
{
video
.
get
(
'
url
'
)}
alt
=
{
video
.
get
(
'
description
'
)}
aspectRatio
=
{
video
.
getIn
([
'
meta
'
,
'
small
'
,
'
aspect
'
])}
width
=
{
this
.
props
.
cachedMediaWidth
}
height
=
{
110
}
inline
...
...
app/javascript/gabsocial/features/report/components/status_check_box.js
View file @
449dd24b
...
...
@@ -38,6 +38,7 @@ export default class StatusCheckBox extends React.PureComponent {
blurhash
=
{
video
.
get
(
'
blurhash
'
)}
src
=
{
video
.
get
(
'
url
'
)}
alt
=
{
video
.
get
(
'
description
'
)}
aspectRatio
=
{
video
.
getIn
([
'
meta
'
,
'
small
'
,
'
aspect
'
])}
width
=
{
239
}
height
=
{
110
}
inline
...
...
app/javascript/gabsocial/features/status/components/detailed_status.js
View file @
449dd24b
...
...
@@ -111,6 +111,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
blurhash
=
{
video
.
get
(
'
blurhash
'
)}
src
=
{
video
.
get
(
'
url
'
)}
alt
=
{
video
.
get
(
'
description
'
)}
aspectRatio
=
{
video
.
getIn
([
'
meta
'
,
'
small
'
,
'
aspect
'
])}
width
=
{
300
}
height
=
{
150
}
inline
...
...
app/javascript/gabsocial/features/video/index.js
View file @
449dd24b
...
...
@@ -8,6 +8,7 @@ import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/full
import
{
displayMedia
}
from
'
../../initial_state
'
;
import
Icon
from
'
gabsocial/components/icon
'
;
import
{
decode
}
from
'
blurhash
'
;
import
{
isPanoramic
,
isPortrait
,
minimumAspectRatio
,
maximumAspectRatio
}
from
'
../../utils/media_aspect_ratio
'
;
const
messages
=
defineMessages
({
play
:
{
id
:
'
video.play
'
,
defaultMessage
:
'
Play
'
},
...
...
@@ -107,6 +108,7 @@ class Video extends React.PureComponent {
intl
:
PropTypes
.
object
.
isRequired
,
blurhash
:
PropTypes
.
string
,
link
:
PropTypes
.
node
,
aspectRatio
:
PropTypes
.
number
,
};
state
=
{
...
...
@@ -373,7 +375,7 @@ class Video extends React.PureComponent {
}
render
()
{
const
{
preview
,
src
,
inline
,
startTime
,
onOpenVideo
,
onCloseVideo
,
intl
,
alt
,
detailed
,
sensitive
,
link
}
=
this
.
props
;
const
{
preview
,
src
,
inline
,
startTime
,
onOpenVideo
,
onCloseVideo
,
intl
,
alt
,
detailed
,
sensitive
,
link
,
aspectRatio
}
=
this
.
props
;
const
{
containerWidth
,
currentTime
,
duration
,
volume
,
buffer
,
dragging
,
paused
,
fullscreen
,
hovered
,
muted
,
revealed
}
=
this
.
state
;
const
progress
=
(
currentTime
/
duration
)
*
100
;
...
...
@@ -384,8 +386,16 @@ class Video extends React.PureComponent {
let
{
width
,
height
}
=
this
.
props
;
if
(
inline
&&
containerWidth
)
{
width
=
containerWidth
;
height
=
containerWidth
/
(
16
/
9
);
width
=
containerWidth
;
const
minSize
=
containerWidth
/
(
16
/
9
);
if
(
isPanoramic
(
aspectRatio
))
{
height
=
Math
.
max
(
Math
.
floor
(
containerWidth
/
maximumAspectRatio
),
minSize
);
}
else
if
(
isPortrait
(
aspectRatio
))
{
height
=
Math
.
max
(
Math
.
floor
(
containerWidth
/
minimumAspectRatio
),
minSize
);
}
else
{
height
=
Math
.
floor
(
containerWidth
/
aspectRatio
);
}
playerStyle
.
height
=
height
;
}
...
...
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