jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

HTTP "Content-Type" of "text/html" is not supported. Load of media resource failed. #361

Closed chriseugenerodriguez closed 8 years ago

chriseugenerodriguez commented 8 years ago

Hi I have an issue that I updated to version php 7.0 and jplayer stopped working on all my themes. Can you help me out?

http://demo.premiumwd.com/themes/ellion/blog/

lustremedia commented 8 years ago

Should not have anything to do with php. jplayer is jquery client side! Is jquery loaded correctly? Any JS errors?

chriseugenerodriguez commented 8 years ago

right okay than its something client side. Thats the error, yes jquery is loaded and all my scripts are running.

chriseugenerodriguez commented 8 years ago

This is the error which is in title HTTP "Content-Type" of "text/html" is not supported. Load of media resource http://demo.premiumwd.com/adomo/wp-content/uploads/2014/12/Unbreakable-Elephante-Remix.mp3 failed. http://demo.premiumwd.com/themes/ellion/blog/

lustremedia commented 8 years ago

This is not an issue of jPlayer. You have many things messed up, e.g. 'You have included the Google Maps API multiple times on this page. This may cause unexpected errors.' Also there is a 500 internal error. So please clean up your code, and then try again...

lustremedia commented 8 years ago

As it looks, you are sending a GET request when pushing the play button on your player. And this request of course sends 'text/html' as content-type in the response header. It looks like that your button is not escaped properly for just jquery execution.

chriseugenerodriguez commented 8 years ago

Did you even take a look at the code I wrote to execute the function? Google maps isnt even loading on page I gave you so it doesnt have anything to do with it.

jQuery(document).ready(function(){ if(jQuery().jPlayer) { jQuery("#jquery-jplayer-<?php the_ID(); ?>").jPlayer({ ready: function () { jQuery(this).jPlayer("setMedia", { <?php if(in_array('mp3',$formats)) { echo 'mp3: "'.$meta['_audio_mp3_url'][0].'",'."\n"; } ?> <?php if(in_array('m4a',$formats)) { echo 'm4a: "'.$meta['_audio_mp3_url'][0].'",'."\n"; } ?> <?php if(in_array('oga',$formats)) { echo 'oga: "'.$meta['_audio_ogg_url'][0].'",'."\n"; } ?> }); }, swfPath: "<?php echo get_template_directory_uri() ?>/assets/swf", cssSelectorAncestor: "#jp-interface-<?php the_ID(); ?>", supplied: "<?php echo implode(',',$formats); ?>" }); }