Conversation
|
@bronz3beard I created a draft pull request with your changes for easier review! |
| backgroundVimeo, | ||
| } = this.props; | ||
| useEffect(() => { | ||
| document.body.style.overflow = showModal ? "hidden" : "auto"; |
There was a problem hiding this comment.
This works, but usually you would just use showModal in your render function … or in your case, in what your functional component returns, and there add a class based on whether showModal is true or false.
There was a problem hiding this comment.
A little bit of vanilla JS never hurt anyone right? haha
You are 100% correct a much better approach!
There was a problem hiding this comment.
So i looked into this and actually it is the best way I can think of to manage hiding overflow-y in theatre mode for the body elem.
I left some comments in modal comp.
If there is a better way please show me 😃 I cant think of it.
|
I really liked that you got the custom play button in there. |
| export default class AimeVideoPlayer extends PureComponent { | ||
| static propTypes = { | ||
| url: PropTypes.string.isRequired, | ||
| controlsVimeo: PropTypes.bool, |
There was a problem hiding this comment.
I haven't had a closer look at the video player, I just wanted to suggest we keep all this configuration stuff to a minimum … so, unless we are sure we need it, I wouldn't even add all these props. Especially not the autoplay one, because I hope we will never do it!
I think it also makes things a little complicated to add configurations per player …? Happy to talk about this in a call!
There was a problem hiding this comment.
I haven't had a closer look at the video player, I just wanted to suggest we keep all this configuration stuff to a minimum … so, unless we are sure we need it, I wouldn't even add all these props. Especially not the autoplay one, because I hope we will never do it!
I think it also makes things a little complicated to add configurations per player …? Happy to talk about this in a call!
Hey @rin ,
Yeah this is just getting to know the player right now and figuring out which props are essential, the auto play will be needed so we can have just one click of the play button.
Still looking at if that's the best solution.
Happy to jump on a call and bounce some ideas around 😃
There was a problem hiding this comment.
Hey @rin if you have any suggestions on what to remove I will happily look into it. right now it feels like what we have is what we need but that's just my perspective 😄
|
Just a note to myself that would love to test how to integrate this in the portal soon :) |
kbardi
left a comment
There was a problem hiding this comment.
It looks good, but I left some comments. I'm worry about the modal and using plain javascript to modify a class in the body
|
|
||
| return ( | ||
| <div className={styles[`theme-${theme}`]}> | ||
| {!showModal && ( |
There was a problem hiding this comment.
Also I think we can improve a little bit this jsx to reduce some repetitions and make a smaller file
| useEffect(() => { | ||
| // This is manipulating the parent DOM of the react virtual DOM, so I think its going to be OK for what we need? | ||
| // we would have to hide overflow for the body and app and then make them fill the page and then adjust the react elements to be able to controll overflow-y in css, I think. | ||
| document.body.style.overflowY = |
There was a problem hiding this comment.
not sure if it is a good idea, because for example on website we cannot access easily to the dom when we are in the server side, so it won't work there :(
There was a problem hiding this comment.
I think we can run a check for document, and it is also only available when the vidoe is ready, which should be client side right?
Also it could be done with css and some extra divs but I think thats probably too complex just for hiding body scroll when modal is active.
I am happy to do anything with that we dont need to hide scroll, I'm open to any suggestion. 👍
|
|
||
| *NB: Blueprint will be linked until you run…`yarn unlink “aime-blueprint”`* | ||
|
|
||
| *NB: Blueprint will be linked until you run…`yarn unlink` in your `blueprint` terminal **as well as** `yarn unlink “aime-blueprint”` in your local project (`website` or `portal`)* |
…om/aimementoring/blueprint into feature/video/aimeVideoPlayer-#156
| return ( | ||
| <div className={styles[`theme-${theme}`]}> | ||
| {!showModal && ( | ||
| <div className={styles.playerContainer}> |
There was a problem hiding this comment.
we should add containerClassName here (it's passed as a prop)
| imageUrl === "" ? lightMode : !showModal && imageUrl; | ||
|
|
||
| const backGroundStyle = { | ||
| background: `url(${imageUrl})`, |
There was a problem hiding this comment.
should be url('${imageUrl}')
| AimeVideoPlayer.propTypes = { | ||
| loop: PropTypes.bool, | ||
| mute: PropTypes.bool, | ||
| title: PropTypes.bool, |
| AimeVideoPlayer.defaultProps = { | ||
| loop: false, | ||
| mute: false, | ||
| title: false, |
| .playerContainer { | ||
| width: 100%; | ||
| height: 100%; | ||
| display: flex; |
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| .playerBoarder { |
There was a problem hiding this comment.
we don't need this anymore because our style looks different now
| width: 100%; | ||
| color: #000; | ||
| position: absolute; | ||
| transform: translate(-50%, -3%); |
There was a problem hiding this comment.
if we dont use flex above, we can drop the positioning and transforming here
resolves #156
Currently this is working locally with
YoutTubeandVimeo, partiallyAIME Vids.You can see all props and functions on BP
AimeVideoPlayerI have listed them in the Markdown.I have also added a very basic Modal component just to be used with video component to render a
Theatre-ishmode. this can be used with other things also.Only for
AIMEvideos, for some reasonwithModalonClick event to hide the modal is also overlaying the<video>element I have not been able to figure out why yet.Another interesting thing with
AIMEvideo is if i just add the 1 required propurlthe preview image of the video and the custom play button do not display.I am not 100% sure why not, but this might be outside the realm of ReactPlayer to fix, it might be an aws thing really don't know yet.
I will be reviewing again previous convos around this player to keep working on functionality, but please let me know what is missing here if you notice it.
Any feedback will be greatly appreciated, it is my first attempt adding to Blueprint!!
@rin Couldn't request your review as it is your pr haha so the tag is the request 😄
Note:
YouTubeis as minimal as possible r.e controls branding, they are trying to provide consistent UI, platform, brand recognition, where ever the YT videos are embedded.Volumecontrol was added as standard volume for FF and CHROME where different Chrome was really loud for me now they are both the same.AutoPlayis needed to allow one click play, but thats all it is used for it is set to false by default on load.I think
configsare minimal but thats just me let me know what can be removed.it is possible to add
subtitleswhich look relativly easy to add and can just be passed as strings from aws for example.There are other items that are known to me, but cant think of them right now.
I added the label
component dev readybut i don't really k now what that means?