我正忙於一個音樂商店web應用程序,後端使用JAVA,前端使用Angular JS/HTML5/CSS3。 ammm,對於音樂播放我使用Sound Manager Java Script Library,所有的東西都可以和靜態360播放器一起使用,但是當我嘗試在ng-repeat指令中使用聲音管理器時,這不起作用,請提供任何建議?並且是健全的管理者,通過角度js「ng-repeat」創建的live dom元素來工作?Soundmanager 2不能與角度js「ng-repeat」指令一起工作
聲音管理器初始化
// init Sound Manager
soundManager.setup({
// path to directory containing SM2 SWF
url: 'player/'
});
threeSixtyPlayer.config.scaleFont = (navigator.userAgent.match(/msie/i)?false:true);
threeSixtyPlayer.config.showHMSTime = true;
// enable some spectrum stuffs
threeSixtyPlayer.config.useWaveformData = true;
threeSixtyPlayer.config.useEQData = true;
// enable this in SM2 as well, as needed
if (threeSixtyPlayer.config.useWaveformData) {
soundManager.flash9Options.useWaveformData = true;
}
if (threeSixtyPlayer.config.useEQData) {
soundManager.flash9Options.useEQData = true;
}
if (threeSixtyPlayer.config.usePeakData) {
soundManager.flash9Options.usePeakData = true;
}
if (threeSixtyPlayer.config.useWaveformData || threeSixtyPlayer.flash9Options.useEQData || threeSixtyPlayer.flash9Options.usePeakData) {
// even if HTML5 supports MP3, prefer flash so the visualization features can be used.
soundManager.preferFlash = true;
}
角NG重複
<div class="mod-contents">
<div class="questions-block" ng-repeat="question in filtered = (questionList | filter:searchKey | orderBy : predicate : reverse)">
<div class="col-xs-12 col-sm-4 col-md-3 pull-right">
<div class="thumbnail block-black ">
<h3 class="block-title rtl-element">{{ question.description }}<span class="text-muted"> ({{ question.cat_code }}) </span></h3>
<div class="ui360 ui360-vis player-wrapper-md player-md "><a href="pac_test.mp3"></a></div>
</div>
</div>
</div>
</div>
SoundManager只負責處理現有的DOM元素。如果您在SoundManager運行後添加新的DOM元素,那麼它就成爲您的責任。 – idbehold