Uncaught TypeError: Cannot read property 'apply' of undefined
See original GitHub issuewww-widgetapi.js:48 Uncaught TypeError: Cannot read property ‘apply’ of undefined
Gets logged every refresh and play, even worse is sometimes the events don’t bind. Meaning the playerReady and playerStateChanged don’t ever get called. I am unable to see a pattern, but exactly the same code refreshed seems to sometimes result in these events not getting bound. Happens like 10% of the time.
the tags are set up like this:
<ng-youtube-embed
video="videoID"
videoid="videoMainStreamer"
enablejsapi="true"
onready="playerReady"
onstatechange="playerStateChanged">
</ng-youtube-embed>
The JS is this:
$scope.videoID = 'VJawYtS_MlE';
$scope.playerReady = function(event) {
console.log(event);
};
$scope.playerStateChanged = function(event) {
console.log(event);
};
Seems to be a issue of the widgetapi, however this error is avoidable if this module would set up the onYouTubePlayerAPIReady callback in a different way.
Even worse is the events not getting bound sometimes.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot read property 'apply' of undefined · Issue #2359 - GitHub
When I use a regular browser like google chrome everything works as expected, then I used blisk I got an error saying app.js:14868...
Read more >Redux TypeError: Cannot read property 'apply' of undefined
It checks if extension is available, if available call it and if not do nothing which means undefined . createStore method seems to...
Read more >Error message "Cannot read property 'apply' of undefined"
When the UI Action is script is executed, this error is shown in the browser console: Uncaught TypeError: Cannot read property 'apply' of...
Read more >Uncaught TypeError: Cannot read property 'apply' of undefined
When trying to change theme component setting, clicking the green check button produces the following error, changes are not saved (Category icons component ......
Read more >Cannot read property 'apply' of undefined" - Forums - Liferay
RE: Cannot read property 'apply' of undefined" (Answer) ... The hover method takes 2 parameters, one for mouse over and one for mouse...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the problem lies mostly in onYouTubeIframeAPIReady not being called in certain circumstances, I would advise you to implement something like this in your module. To forcefully call the function after the iframe has been loaded.
The pull request from atulingale009 includes very good improvements you should take a look at.
The PR has been merged. Feel free to try the new version out.