Search code examples
javascriptwordpressjwplayerjwplayer7

Uncaught ReferenceError: jwplayer is not defined


I am trying to embed a JW Player 7 on my WordPress site. I have done this on another WP site with no issues and on my old site. I am not sure if this is an issue with the theme I am using or not. The page is http://www.stream.mesquiteweather.net/ I have the path to the js file in the head via a plugin as for some reason when I added it directly to the header.php file for the template it doesn't show up. With the plugin when I view source I can see it is added. I am getting the "Uncaught ReferenceError: jwplayer is not defined" twice in two different places and I am not sure how to resolve it as I am not good with javascript and my searches have come up empty. The actual player is in a separate PHP file which I am calling it into the template for simplicity. Ether way adding it directly to the template or using it in an include, it won't load. I think it has something to do with the template but, I don't use WP often so not familiar with what could be causing it.

I know it has something to do with it not calling the path before loading the script but, I am not sure how to get around that. That is my current thinking. I may be wrong.

Any suggestions?

-Thanks


Solution

  • There has long been an issue with JW Player and MooTools not playing nice together.

    With versions of JW Player earlier than JW 7.4 you could overcome this simply by loading the JW library before MooTools.

    However, with JW7.4+, this solution no longer works.

    Fortunately though MooTools have resolved the issue in the latest version of their library, so probably the best solution would be to update MooTools to v1.6 if possible.

    Here's an example of your page with just the MooTools library updated: http://dev.powered-by-haiku.co.uk/debug/texan78/

    PS: you may also be interested in the "Streamy" component offered as part of my Tatami for Online Video solution in order to elegantly manage your stream availability. Here's an updated page with a Tatami/Streamy embed: http://dev.powered-by-haiku.co.uk/debug/texan78/with-streamy.php

    An example Tatami/Streamy snapshot can be seen here: http://dev.powered-by-haiku.co.uk/solutions/tatami/?share=dhoAJvxfYW