Tag: soundmanager2

如何在soundcloud javascript api中暂停流式传输

我想允许声音文件播放和暂停。 该文档显示了如何播放流文件: $(“#stream”).live(“click”, function(){ SC.stream(“/tracks/{‘track-id’}”, function(sound){ sound.play(); }; 它使用Sound Manager来传输和使用它的一些对象和方法……比如.pause()! 所以这是我认为应该工作的代码: var is_playing=”false”; $(“#stream”).live(“click”, function(){ SC.stream(“/tracks/{‘track-id’}”, function(sound){ if (is_playing===”true”) { sound.pause(); is_playing = “false”; console.log(is_playing); } else if (is_playing === “false”) { sound.play(); is_playing = “true”; console.log(is_playing); } }); 然而,它继续播放轨道而没有停顿。 有任何想法吗? 谢谢。

iPhone上的SoundManager2 – 声音无法在jQuery Load上播放

我正在尝试使用SoundManager2作为iPhone Web App的一部分,在使用jQuery提交表单后播放声音。 播放的特定声音取决于结果,因此生成的页面设置一个变量,用于标识要播放的声音文件。 这一切都在桌面上顺利运行,但在iPhone上运行时,它会失败。 iPhone上的调试控制台显示它正在尝试… 1124: SMSound.play(): “ValidSound” is loading – attempting to play… 1124: SMSound.play(): “ValidSound” is starting to play 1124: setPosition(0): delaying, sound not ready 1124: HTML5::loadstart: ValidSound 1124: HTML5::suspend: ValidSound ……但每次播放都没有声音。 关于可能导致此失败的原因的任何想法? 我已经包含了主页面的代码,以及使用jQuery返回的“响应”页面的示例: 主要 soundManager.setup({ url: ‘sm/swf/’, useHTML5Audio: true, onready: function() { soundManager.createSound({ id: ‘ValidSound’, useHTML5Audio: true, preferFlash: false, url: ‘http://www.example.com/example […]