小编Art*_*Rgr的帖子

调用play()时,Soundcloud流,soundmanager2对象永远不会在Chrome上开始播放

在我的反应应用程序中使用SC.stream,我只是试图从soundcloud API播放一首曲目.这是我的代码:

SC.initialize({
    client_id: '12xxx' // my client ID
  });

//[...]

console.log(this.props.track.trackId); // I get here successfully the trackId from the song I'd like to play

SC.stream('/tracks/'+this.props.track.trackId, function(track){
  track.play();
  console.log(track); // I successfully get the track object here. playState attribute is on 1 
});
Run Code Online (Sandbox Code Playgroud)

不幸的是,曲目从未开始播放.我在控制台中没有错误.

编辑:问题仅在chrome上,它在firefox和safari上完美运行.我现在更加困惑.

编辑2:它似乎与不在Chrome上运行的HTML5播放器相关联:当您在chrome:// plugins /重新启用Flash播放器时,通过选中"始终允许运行",它可以正常工作

javascript soundmanager2 soundcloud reactjs

7
推荐指数
1
解决办法
262
查看次数

标签 统计

javascript ×1

reactjs ×1

soundcloud ×1

soundmanager2 ×1