This snippet worked in php5.6, but not in php7.
mp3: <script language = "php"> echo "\"" . $MP3FILE . "\"";</script>
The error is: Uncaught SyntaxError: Unexpected token < (I have confirmed that php7 is functioning and processing php files on my server.)
The site is: DNSpanishEnglish.php where it works under php5.6. Here's the whole statement, just for context.
$(document).ready(function(){
$("#jQ_jP").jPlayer( {
ready: function () {
$(this).jPlayer("setMedia", {
mp3: <script language = "php"> echo "\"" . $MP3FILE . "\"";</script>
// Defines the mp3 url
});
startingTime = 45;
//endingTime = $(this).jPlayer("status", "duration");
//myAlert( " endingTime is " + endingTime);
$(this).jPlayer("play", 45); // THIS WORKS!!!!!
//$(this).jPlayer("play").jPlayer("stop").jPlayer("playHead", ).jPlayer.status.currentTime);
//$(this).jPlayer("playHead", {time: 50});
//$(this).jPlayer("play" , { time: 45 }); // works (required for auto-play), but the time args doesnt work.
// $(this).jPlayer("playHeadTime" , { time: 45000 });
$("#jQ_jP").bind($.jPlayer.event.play, function(event) {
// Add a listener to report the time play began
//myAlert("HELLO from jplayer_1" +
//"Play began at time = " +
// event.jPlayer.status.currentTime
//); // OK, this is happening.
//$("#jQ_jP").playHead(50); //doesnt work.
$("#jQ_jP").playHeadTime(45000);
// milliseconds. doesnt work.
});
$("#jQ_jP").playHeadTime(5000); // doesnt work.
} // End of "ready". No semicolon here!
});
});

<script language="php">? Why not<?php? Or even better,<?=.