这里有一个奇怪的,
Soundmanager 在使用 PHP 输出时根本不会播放 MP4。
soundManager.createSound({
id: 'sm2-1001',
url: 'http://mysite.tld/1333092566.mp3', // WORKS
// url: [{type: 'audio/mp3', url: 'http://mysite.tld/outputmp3.php}], // WORKS
// url: 'http://mysite.tld/1333092566.mp4', // WORKS
// url: [{type: 'audio/mp4', url: 'http://mysite.tld/outputmp4.php}], // DOES NOT WORK
autoLoad: false,
autoPlay: true,
});
URL 是正确的,从浏览器转到http://mysite.tld/outputmp4.php - 打开并播放得很好。
使用 smartReadFile.php https://jplayer.googlegroups.com/attach/f308294ddea52f6c/smartReadFile.php?view=1&part=4
使用最新版本的 SM2
来自 SM2 的调试信息:
soundManager.createSound(): sm2-1001 (http://mysite.tld/outputmp4.php)
soundmanager2.js (line 1110)
SMSound() merged options: { id: sm2-1001, url: http://mysite.tld/outputmp4.php, autoLoad: false, autoPlay: true, loops: 1, multiShot: true, multiShotEvents: false, pan: 0, stream: true, usePolicyFile: false, volume: 100, usePeakData: false, useWaveformData: false, useEQData: false, bufferTime: 3 }
soundmanager2.js (line 1112)
SMSound.play(): "sm2-1001" is loading - attempting to play..
soundmanager2.js (line 1110)
SMSound.play(): "sm2-1001" is starting to play
soundmanager2.js (line 1112)
SMSound._onload(): "sm2-1001" loaded.
soundmanager2.js (line 1110)
(Flash): correcting sound sm2-1001 end position (0) to length: 4602
有任何想法吗?请帮忙。谢谢。