Skip to content

Feature/video/aime video player #156#163

Open
rin wants to merge 21 commits intostagingfrom
feature/video/aimeVideoPlayer-#156
Open

Feature/video/aime video player #156#163
rin wants to merge 21 commits intostagingfrom
feature/video/aimeVideoPlayer-#156

Conversation

@rin
Copy link
Copy Markdown
Contributor

@rin rin commented Jan 27, 2020

resolves #156

Currently this is working locally with YoutTube and Vimeo, partially AIME Vids.
You can see all props and functions on BP AimeVideoPlayer I 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-ish mode. this can be used with other things also.

Only for AIME videos, for some reason withModal onClick 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 AIME video is if i just add the 1 required prop url the 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: YouTube is 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.

Volume control was added as standard volume for FF and CHROME where different Chrome was really loud for me now they are both the same.

AutoPlay is needed to allow one click play, but thats all it is used for it is set to false by default on load.

I think configs are minimal but thats just me let me know what can be removed.

it is possible to add subtitles which 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 ready but i don't really k now what that means?

Screen Shot 2020-02-05 at 2 37 49 pm

@rin
Copy link
Copy Markdown
Contributor Author

rin commented Jan 27, 2020

@bronz3beard I created a draft pull request with your changes for easier review!

Comment thread src/lib/components/AimeVideoPlayer/AimeVideoPlayer.js Outdated
backgroundVimeo,
} = this.props;
useEffect(() => {
document.body.style.overflow = showModal ? "hidden" : "auto";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little bit of vanilla JS never hurt anyone right? haha
You are 100% correct a much better approach!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rin
Copy link
Copy Markdown
Contributor Author

rin commented Jan 27, 2020

I really liked that you got the custom play button in there.
I also think it could be a good idea to have a Modal component, but we should talk about it with @kbardi !

export default class AimeVideoPlayer extends PureComponent {
static propTypes = {
url: PropTypes.string.isRequired,
controlsVimeo: PropTypes.bool,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😃

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😄

@bronz3beard bronz3beard self-assigned this Feb 5, 2020
@bronz3beard bronz3beard added component-dev-ready Component has design and is ready to be coded component-proposed Proposed Component labels Feb 5, 2020
@camposcristian
Copy link
Copy Markdown
Contributor

Just a note to myself that would love to test how to integrate this in the portal soon :)

@camposcristian camposcristian marked this pull request as ready for review February 12, 2020 08:46
Comment thread src/lib/components/AimeVideoPlayer/AimeVideoPlayer.module.scss
Copy link
Copy Markdown
Contributor

@kbardi kbardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/lib/components/AimeVideoPlayer/AimeVideoPlayer.js Outdated
Comment thread src/lib/components/AimeVideoPlayer/AimeVideoPlayer.js Outdated

return (
<div className={styles[`theme-${theme}`]}>
{!showModal && (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think we can improve a little bit this jsx to reduce some repetitions and make a smaller file

Comment thread src/lib/components/AimeVideoPlayer/AimeVideoPlayer.module.scss Outdated
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 =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. 👍

Comment thread src/lib/components/modal/modal.module.scss Outdated
Comment thread README.md

*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`)*
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

@lulen11 lulen11 mentioned this pull request Mar 17, 2020
return (
<div className={styles[`theme-${theme}`]}>
{!showModal && (
<div className={styles.playerContainer}>
Copy link
Copy Markdown
Contributor Author

@rin rin Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add containerClassName here (it's passed as a prop)

imageUrl === "" ? lightMode : !showModal && imageUrl;

const backGroundStyle = {
background: `url(${imageUrl})`,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be url('${imageUrl}')

AimeVideoPlayer.propTypes = {
loop: PropTypes.bool,
mute: PropTypes.bool,
title: PropTypes.bool,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string

AimeVideoPlayer.defaultProps = {
loop: false,
mute: false,
title: false,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title: ''

.playerContainer {
width: 100%;
height: 100%;
display: flex;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

align-items: center;
justify-content: center;

.playerBoarder {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this anymore because our style looks different now

width: 100%;
color: #000;
position: absolute;
transform: translate(-50%, -3%);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we dont use flex above, we can drop the positioning and transforming here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component-dev-ready Component has design and is ready to be coded component-proposed Proposed Component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants