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

Get an issue using files other than .mp4 (Youtube, streamable) #7

Open
Fred-Macdo opened this issue Jan 22, 2020 · 2 comments
Open

Comments

@Fred-Macdo
Copy link

Whenever I try a video that isn't .mp4 I get an error:

TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)'

But this works for .mp4 videos. Any idea whats going on here?

class Player extends React.Component {
	constructor (props) {
  	super(props)
    this.state = {
      url: "https://www.youtube.com/watch?v=oZrA9nQuEOM",
    	playing: false,
      image: null,
      frames: [], 
      captureInterval: 10000, 
      isLoading: false, 
      result: 0
    }  
`....`
  	  <ReactPlayer 
          ref={player => { this.player = player }}
          url={this.state.url}
          playing={this.state.playing}
          width='320px'
          height='180px'
          config={{ file: { attributes: {
            crossorigin: 'anonymous'
          }}}}
        />
@VIRGO96
Copy link

VIRGO96 commented Mar 13, 2020

@Fred-Macdo Did you find any solution to this?

@ilkkao
Copy link
Owner

ilkkao commented Feb 26, 2023

Sorry for huge delay. Source element must be a native HTML video element. I think e.g. youtube can use something more exotic.

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

3 participants