[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting ArtPlayerError: The width and height of the container cannot be 0 #73

Closed
l-u-k-a opened this issue Jun 15, 2020 · 2 comments
Closed

Comments

@l-u-k-a
Copy link
l-u-k-a commented Jun 15, 2020

Expected behaviour

Should render the player

Actual behaviour

Throws error
The width and height of the container cannot be 0

Steps to reproduce

use ` in a React component in a condition like:
(even if wrapping into a container with defined fixed width and height)

function Wrapper() {
  if (someThin) return <div>other thing</div>
  return (
    <ArtplayerComponent
        option={{
            url: editingAsset.asset.attributes.url,
            theme: '#acadee',
            volume: 0.5,
            muted: false,
            autoplay: false,
            setting: true,
        }}
    />
  )
}

Environment

Mac OS Catalina 10.15.5

  • Browser: Google Chrome
  • Version: 83
  • Operating System: Mac OS
  • Version: Catalina 10.15.5

Package versions

  • "react": "^16.13.1",
  • "react-dom": "^16.13.1",

Console errors (if any)

artplayer-react.js:8 Uncaught ArtPlayerError: The width and height of the container cannot be 0

@zhw2590582
Copy link
Owner
zhw2590582 commented Jun 16, 2020

You should specify a fixed size for ArtplayerComponent, for example: demo

Or you can use a percentage: width:100%; height:100%, and then give the parent element of ArtplayerComponent a fixed size

@l-u-k-a
Copy link
Author
l-u-k-a commented Jun 16, 2020

aha, I see, ok thanks

@l-u-k-a l-u-k-a closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants