私の問題は、オーディオ トラックの再生が停止し、もう一度再生ボタンを押しても、曲が再生されないことです。これは、何も再生されていないことを意味しますが、最初は正常に動作します。
soundManager.url = '{{ asset('bundles/bm/swf/')}}';
soundManager.onload = (function() {
var preview = soundManager.createSound({
id: 'previewer',
url: '{{ path('play_track', { 'id' : track.id}) }}',
type: 'audio/mp3'
});
preview.options.whileplaying = function() {
var current = new Date (this.position),
minutes = current.getMinutes(),
seconds = current.getSeconds();
var current = minutes + ':' + seconds;
$('.editable').html(current);
}
$('.bigPlay').click(function(e){
if($(this).hasClass('playbtn')) {
e.stopPropagation();
$(this).removeClass('playbtn').addClass('pausebtn');
preview.play({
onfinish: function() {
preview.stop();
$('.bigPlay').removeClass('pausebtn').addClass('playbtn');
}
});
return false;
}
if($(this).hasClass('pausebtn')) {
e.stopPropagation();
$('.bigPlay').removeClass('pausebtn').addClass('playbtn');
preview.stop();
return false;
}
});
});
コンソールには次が表示されます。
-- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: true, wav: true -- soundmanager2.js:1110
-- SoundManager 2 V2.97a.20120527 (AS2/Flash 8) + HTML5 audio, normal polling -- soundmanager2.js:1110
soundManager::createMovie(): Trying to load /bundles/bm/swf/soundmanager2_debug.swf soundmanager2.js:1110
soundManager::initMovie(): Waiting for ExternalInterface call from Flash... soundmanager2.js:1112
soundManager::externalInterfaceOK() (~0 ms) soundmanager2.js:1112
soundManager::init() soundmanager2.js:1112
soundManager: Attempting JS to Flash call... soundmanager2.js:1112
(Flash): SM2 SWF V2.97a.20120527 (AS2/Flash 8) soundmanager2.js:1112
(Flash): JS to/from Flash OK soundmanager2.js:1112
Flash security sandbox type: remote soundmanager2.js:1112
(Flash): Enabling polling, 50 ms interval soundmanager2.js:1112
-- SoundManager 2 loaded (OK) -- soundmanager2.js:1110
soundManager::initComplete(): calling soundManager.onload() soundmanager2.js:1110
soundManager.createSound(): previewer (/app_dev.php/track/play/4.mp3) soundmanager2.js:1110
SMSound() merged options: {
id: previewer,
url: /app_dev.php/track/play/4.mp3,
type: audio/mp3,
autoLoad: false,
autoPlay: false,
loops: 1,
multiShot: true,
multiShotEvents: false,
pan: 0,
stream: true,
usePolicyFile: false,
volume: 100
} soundmanager2.js:1112
Loading sound previewer via HTML5 soundmanager2.js:1112
creating HTML5 Audio() element with URL: /app_dev.php/track/play/4.mp3 soundmanager2.js:1112
HTML5::adding event listeners: previewer soundmanager2.js:1112
SMSound.load(): /app_dev.php/track/play/4.mp3 soundmanager2.js:1110
HTML5::load: previewer soundmanager2.js:1112
0 soulshaka-club-69-underground-mix:529
soundManager.onload() complete soundmanager2.js:1110
HTML5::loadstart: previewer soundmanager2.js:1112
SMSound.play(): "previewer" is loading - attempting to play.. soundmanager2.js:1110
SMSound.play(): "previewer" is starting to play soundmanager2.js:1112
setPosition(0): delaying, sound not ready soundmanager2.js:1112
HTML5::play: previewer, /app_dev.php/track/play/4.mp3 soundmanager2.js:1112
HTML5::waiting: previewer soundmanager2.js:1112
HTML5::loadedmetadata: previewer soundmanager2.js:1112
HTML5::loadeddata: previewer soundmanager2.js:1112
SMSound._onload(): "previewer" loaded. soundmanager2.js:1110
HTML5::canplay: previewer, /app_dev.php/track/play/4.mp3 soundmanager2.js:1112
HTML5::playing: previewer soundmanager2.js:1112
HTML5::suspend: previewer soundmanager2.js:1112
HTML5::suspend: previewer soundmanager2.js:1112
HTML5::suspend: previewer soundmanager2.js:1112
HTML5::suspend: previewer soundmanager2.js:1112
HTML5::ended: previewer soundmanager2.js:1112
SMSound._onfinish(): "previewer" soundmanager2.js:1112
SMSound.play(): "previewer" soundmanager2.js:1112
SMSound.play(): "previewer" is starting to play soundmanager2.js:1112
setPosition(0): setting position soundmanager2.js:1112
HTML5::play: previewer, /app_dev.php/track/play/4.mp3 soundmanager2.js:1112
HTML5::playing: previewer soundmanager2.js:1112
setPosition(0): setting position soundmanager2.js:1112
SMSound.play(): "previewer" soundmanager2.js:1112
SMSound.play(): "previewer" is starting to play soundmanager2.js:1112
setPosition(0): setting position soundmanager2.js:1112
どんな助けでも素晴らしいでしょう。