GithubHelp home page GithubHelp logo

Comments (6)

marcelgruber avatar marcelgruber commented on June 15, 2024

I'm trying to see what I can do with the onResize event, but I haven't yet figured out how to trigger it:

onResize={(e) => {
  // only gets called on initial page load
  console.log('resized')
}}

from stream-react.

third774 avatar third774 commented on June 15, 2024

You can disable the padding-top by passing responsive={false} in on the <Stream /> component. This disables all styling that we apply so you're free to apply whatever styles you'd like!

Lemme know if this resolves the issue you're running into!

from stream-react.

marcelgruber avatar marcelgruber commented on June 15, 2024

Thanks @third774

Just started experimenting with that... Will post an update once I get it.

Is it expected for the onResize event to never fire?

from stream-react.

marcelgruber avatar marcelgruber commented on June 15, 2024

Got the fix for the aspect ratio. Only missing part is vertical centering.

<div
  style={{
    position: 'relative',
    paddingTop: '56.25%',
    maxHeight: 'calc(100vh)',
  }}
>
  <div
    style={{
      position: 'absolute',
      top: '0px',
      left: '0px',
      maxHeight: 'calc(100vh)',
      pointerEvents: 'auto',
      width: '100%',
      height: '100%',
    }}
  >
    <Stream
      responsive={false}
      width="100%"
      height="100%"
      style={{
        width: '100%',
        height: '100%',
        overflow: 'hidden',
      }}
      muted
      streamRef={videoRef}
      controls
      src="5d5bc37ffcf54c9b82e996823bffbb81"
    />
  </div>
</div>

from stream-react.

marcelgruber avatar marcelgruber commented on June 15, 2024

Also, would it be feasible to get a style prop added to the <Stream> component? Else TS builds fail.

from stream-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.