Adding text overlay on video when toggled from info button in controlbar #8879
Unanswered
faisalkaramat26
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a requirement to add text as an overlay on the video when toggled using an info button in control bar, I have brokendown this requirement to 2 diff task
const infoButton = player.controlBar.addChild( 'button', {}, 18 ); const infoButtonDom = infoButton.el(); infoButtonDom.innerHTML = ReactDOMServer.renderToString( <Info sx={{ width: '20px', height: '20px' }} /> );code is still WIP
let div = document.createElement('div'); player.el().appendChild(div); div.innerHTML = ReactDOMServer.renderToString( <div style={{ display: deviceType === 'desktop' ? 'flex' : 'none', justifyContent: 'center', alignItems: 'center', gap: SpaceXxs, bottom: '5%', position: 'absolute', textAlign: 'center', padding:0 ${SpaceMd}}} ><p style={{ padding:${SpaceXxs} var(--xs, 0.5rem), alignSelf: 'stretch', color: ColorWhite, background: 'red', fontSize: '0.75rem' }} > Text overlay </p> </div> );is this the right way to approach or is there an already built solution that I can use? I looked into making use of textTrackDisplay but it is dealing with certain kinds of text only
Beta Was this translation helpful? Give feedback.
All reactions