I searched for a while on this subject, but found nothing. I have to upload a certain number of .m4a files to the web page, each of which is inside a separate player. I found and implemented jplayer that claims to handle the format. I decided to use the default flash reserve to avoid lagging incompatibilities. The m4a file example provided in the jplayer examples ( http://www.jplayer.org/audio/m4a/TSP-01-Cro_magnon_man.m4a ) works fine, while I was unable to play any of the files that Eat me.
I ran the file unix command for all files. The jplayer example file returns:
ISO Media, MPEG v4 system, version 2Broken files return one of the following values:
ISO Media, MPEG v4 system, 3GPP ISO Media, MPEG v4 system, version 1 ISO Media, MPEG v4 system, iTunes AAC-LCI am downloading audio files with the following PHP controller code. I need to do this in order to βrewriteβ the URLs and hide the actual file URI.
header('Content-Type: audio/mp4'); header('Content-Disposition: inline; filename=xxxxxxxxxxTrack'.$id.'.m4a'); echo file_get_contents(MVC::siteRoot().'/'.$filename);
(MVC :: siteRoot () returns the physical directory in which the script is stored.) I also tried Content-Type: audio/mp4a-latm again to no avail. I download jplayer with the following code:
$('.jp-jplayer').each(function() { $(this).jPlayer({ ready: function () { console.log($(this).attr('data-src')); $(this).jPlayer("setMedia", { m4a: $(this).attr('data-src') }); $("#insp").jPlayerInspector({jPlayer:$(this)}); }, swfPath: "<?=MVC::httpRoot();?>/gui/swf/Jplayer.swf", supplied: 'm4a', wmode: 'window', solution:"flash", errorAlerts:true, warningAlerts:true, cssSelectorAncestor: '#' + $(this).attr('id').replace('jquery_jplayer','jp_container') }); });
On the DOM side, for each audio file identified by the progressive number $ i, this happens:
<div id="jquery_jplayer_<?=$i?>" class="jp-jplayer" data-src="<?=MVC::httpRoot()?>/get/audio/<?=$traccia['audioid']?>"></div> <div id="jp_container_<?=$i?>" class="jp-audio">[...]
Players seem to load correctly, the DOM rebuilds according to jplayer, but nothing happens when the play button is pressed. There is no error on the network, the file has been delivered correctly, but the contents are not playing and no warnings or errors have been issued. In fact, I only get to listen to the files, download them and open them in QuickTime, since even Chrome will not play them. Safari, on the other hand, will happily download and play files, but not inside the website. Unfortunately, I cannot directly control the contents of the downloaded files, since they come from the iOS / Android application, and for some reason the client requested the .m4a format. Has anyone encountered a similar problem?