feat(story element): support brightcove#220
Merged
ReenaSingh07 merged 19 commits intomasterfrom Jun 14, 2023
Merged
Conversation
ags1773
reviewed
May 4, 2023
Comment on lines
+12
to
+13
| const [showVideo, handleVideoDisplay] = useState(false); | ||
| const [isLibraryLoaded, handleLibrary] = useState(false); |
Contributor
There was a problem hiding this comment.
handleVideoDisplay, handleLibrary are confusing variables names, pls rename to something descriptive
Comment on lines
+18
to
+24
| if (!loaderPromise && !isLibraryLoaded) { | ||
| return (loaderPromise = import(/* webpackChunkName: "qtc-react-brightcove" */ "@brightcove/react-player-loader") | ||
| .then((module) => { | ||
| BrightcovePlayerLoader = module.default; | ||
| window.BrightcovePlayerLoader = BrightcovePlayerLoader; | ||
| handleLibrary(true); | ||
| }) |
Contributor
There was a problem hiding this comment.
Pls simplify the library loading logic, can BrightcovePlayerLoader, loaderPromise and isLibraryLoaded be combined?
Comment on lines
+108
to
+112
| const StoryElementBrightcove = (props) => { | ||
| return <WithLazy margin="0px">{() => <CustomElementBrightcove {...props} />}</WithLazy>; | ||
| }; | ||
|
|
||
| export default StoryElementBrightcove; |
Contributor
There was a problem hiding this comment.
can give more descriptive names
StoryElementBrightcoveis a lazy wrapped brightcove component so can call itlazyBrightcoveor somethingCustomElementBrightcoveis the main component, I think it should be calledBrightcoveElement
Comment on lines
+53
to
+54
| myPlayer.muted(true); | ||
| myPlayer.play(); |
Contributor
There was a problem hiding this comment.
Can we discuss this behaviour with the team?
| } else if (!loadIframeOnClick && isLibraryLoaded) { | ||
| return <div className="brightcove-wrapper">{brightcoveIframe()}</div>; | ||
| } else { | ||
| return <></>; |
ags1773
reviewed
May 9, 2023
| return <WithLazy margin="0px">{() => <BrightcoveElement {...props} />}</WithLazy>; | ||
| }; | ||
|
|
||
| export default LazyBrightcove; |
Contributor
There was a problem hiding this comment.
rename to StoryElementBrightcove
ags1773
approved these changes
May 9, 2023
Athira001
approved these changes
Jun 14, 2023
nandap4790
approved these changes
Jun 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/quintype/page-builder/issues/2349
Dependencies https://github.com/quintype/itsman/issues/10510
Type of change
Checklist: