我正在使用jPlayer在浏览器中播放wav格式的音频文件。音频数据是从服务器端获取的。我正在将音频数据写入响应的输出流。
在浏览器中播放呼叫时,有时我听到相同音频的反射。有时音频质量很低。我正在使用class User extends Model
{
use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships;
protected $casts = [
'options' => 'json',
];
public function roles()
{
return $this->belongsToJson('App\Role', 'options->role_ids');
}
}
class Role extends Model
{
use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships;
public function users()
{
return $this->hasManyJson('App\User', 'options->role_ids');
}
}
。
当我尝试使用音频标签进行相同的操作时,没有任何问题。通话效果很好。
示例:
jPlayer配置
客户端
jplayer Version: 2.5.0
服务器端:
$("#jquery_jplayer_1").jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
wav: "get-call-data"
});
},
swfPath: "plugin-js/jplayer/js",
supplied: "wav",
cssSelectorAncestor: "#jp_container_1",
smoothPlayBar: true,
keyEnabled: true
});
```
此问题不在我的开发环境中。它引发了测试环境。我无法在本地计算机上重新创建。