![](https://secure.gravatar.com/avatar/fb363f6aaa9f5fc0696c3b9214d56131?rating=PG&size=50&default=https%3A%2F%2Fcdn.desk.com%2Fassets%2Funknown_user_50-8ad5644bbe6b1bd7454f2ea465f782bd.png)
Problem accessing jwPlayer() within a function
Hello,
I have successfully set up a jwplayer instance, and it is the only one on the page. I can access its properties from an <a onclick> event (for example, <a onclick='jwPlayer().getPosition()'>Report position</a>), but once I call jwPlayer().getPosition() from inside a script or function, I get an 'Uncaught ReferenceError: jwPlayer is not defined'. I am by no means an expert in JS or JQuery, but how could this be a scope issue? I see examples of this working fine on the support pages. I also tried targeting the specific element id: jwPlayer('videoPlayer').getPosition(). I am scratching my head on this one.
Any help is appreciated. Thanks!
Chris Hardwick