【发布时间】:2014-01-30 01:49:07
【问题描述】:
我正在开发 asp.net 应用程序,我正在从我的视图中调用控制器操作。此视图需要将 mp3 返回到被调用函数。 Actionresult 的类型是什么。被调用的函数返回 mp3 响应。内存中api返回的mp3响应如何保存在内存中并返回查看?
这是我的控制器方法代码:
public ActionResult getrecording()
{
byte[] file = new byte[100]; // Convert.ToByte("https://api.abc.com/api/v2/GetRecording?access_token=dfsdfsdfsdfsdfsdfsdfsdfsfsfdsf");
//return (new FileStreamResult(fileStream, "audio/mpeg"));
////return (new FileContentResult(data, "audio/mpeg"));
}
这是查看代码
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
mp3: "/recording/getrecording"
});
},
swfPath: "../../Content/JPlayer/js",
supplied: "mp3",
wmode: "window",
size: 100,
duration: "#duration"
});
【问题讨论】:
标签: c# asp.net asp.net-mvc