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

onUnstarted is not a function when importing from "react-player/youtube" #993

Closed
FBosler opened this issue Aug 20, 2020 · 0 comments
Closed

Comments

@FBosler
Copy link

FBosler commented Aug 20, 2020

Be sure to search for your issue before opening a new one.

Current Behavior

Error
image

Unhandled Runtime Error
TypeError: onUnstarted is not a function

Call Stack
eval
node_modules/react-player/lib/players/YouTube.js (135:0)
O.q.P
https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl7A8A6y/www-widgetapi.js (296:267)
Z.q.I
https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl7A8A6y/www-widgetapi.js (569:67)
Z.q.aa
https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl7A8A6y/www-widgetapi.js (593:291)
Qe.i
https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl7A8A6y/www-widgetapi.js (368:272)
Ce.g
https://s.ytimg.com/yts/jsbin/www-widgetapi-vfl7A8A6y/www-widgetapi.js (352:28)

Expected Behavior

Should work as with direct import from react-player or react-player/lazy

Steps to Reproduce

import ReactPlayer from 'react-player/youtube';

export default ({ url }) => {
    return (
        <div style={{ position: 'relative', paddingTop: '56.25%' }}>
            <ReactPlayer
                style={{ position: 'absolute', top: 0, left: 0, paddingRight: '2px' }} // to fight strange black border
                className="react-player"
                url={url}
                controls={true}
                width="100%"
                height="100%"
            />
        </div>
    );
};

Environment

  • URL attempting to play: https://youtu.be/CoxcEzSAlpQ
  • Browser: Chrome (Version 84.0.4147.125 (Official Build) (64-bit))
  • Operating system: MacOS Catalina

Other Information

Love the player!

Webmaster1116 added a commit to Webmaster1116/video-player that referenced this issue May 20, 2021
Passing through the player directly meant `key` couldn’t be used for the clever config merging
Fixes cookpete/react-player#993
webmiraclepro added a commit to webmiraclepro/video-player that referenced this issue Sep 9, 2022
Passing through the player directly meant `key` couldn’t be used for the clever config merging
Fixes cookpete/react-player#993
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

1 participant